Author: andreas
Date: Tue Oct 30 14:51:39 2007
New Revision: 590480
URL: http://svn.apache.org/viewvc?rev=590480&view=rev
Log:
Adding ID attribute to Person class
Modified:
lenya/sandbox/modules/person/java/src/org/apache/lenya/modules/person/Person.java
Modified: lenya/sandbox/modules/person/java/src/org/apache/lenya/modules/person/Person.java
URL: http://svn.apache.org/viewvc/lenya/sandbox/modules/person/java/src/org/apache/lenya/modules/person/Person.java?rev=590480&r1=590479&r2=590480&view=diff
==============================================================================
--- lenya/sandbox/modules/person/java/src/org/apache/lenya/modules/person/Person.java (original)
+++ lenya/sandbox/modules/person/java/src/org/apache/lenya/modules/person/Person.java Tue Oct 30 14:51:39 2007
@@ -42,6 +42,7 @@
private Document document;
private Map knownPersons;
+ private String id;
private String title;
private String givenName;
private String familyName;
@@ -101,6 +102,8 @@
Element rdf = xml.getDocumentElement();
Element person = helper.getFirstChild(rdf, "Person");
+
+ this.id = person.getAttributeNS(RDF_NAMESPACE, "ID");
Element title = helper.getFirstChild(person, "title");
this.title = DocumentHelper.getSimpleElementText(title);
@@ -145,6 +148,7 @@
NamespaceHelper helper = new NamespaceHelper(FOAF_NAMESPACE, FOAF_PREFIX, xml);
Element person = helper.createElement("Person");
+ person.setAttributeNS(RDF_NAMESPACE, "rdf:ID", this.id);
xml.getDocumentElement().appendChild(person);
Element title = helper.createElement("title", this.title);
lmpx.com only provides a reader for public news (NNTP) servers. It is not
affiliated with the servers or forums shown here and is not responsible for
the content of articles, which is written by their respective authors.