Using XML in Property Elements

Although property values are mostly text or resources that you reference, they can also be straight XML. In that case, you just set the parseType attribute of the property to "Literal" .

For example, I'm using my own XML elements, such as <BirthCity> and <BirthCountry> in the <Creator> property here, and giving them their own namespace: ns :

Listing ch18_09.rdf
 <?xml version="1.0" ?> <rdf:RDF     xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"     xmlns:dc="http://www.purl.org/DC/"  xmlns:ns="http://www.starpowder.com/namespace/">  <rdf:Description about="http://www.starpowder.com/planets.html">  <dc:Creator parseType="Literal">   <ns:FirstName>Nicolas</nm:FirstName>   <ns:LastName>Copernicus</nm:LastName>   <ns:Birth>1473</nm:Birth>   <ns:Death>1543</nm:Death>   <ns:BirthCity>Torun</nm:BirthCity>   <ns:BirthCountry>Poland</nm:BirthCountry>   </dc:Creator>  </rdf:Description> </rdf:RDF> 


Real World XML
Real World XML (2nd Edition)
ISBN: 0735712867
EAN: 2147483647
Year: 2005
Pages: 440
Authors: Steve Holzner

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net