O'Reilly logo

Real World XML by Steven Holzner

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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> ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required