Mailing list ARC-DEV: Archives

RDFa parser and namespace prefixes

From: Stephane Corlosquet 
Subject: RDFa parser and namespace prefixes
Date: Tue, 24 Feb 2009 17:06:03 -0500


Hi,

Parsing an RDFa snippet containing a list of prefixes like the following:
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" dir="ltr"
  xmlns:dc="http://purl.org/dc/elements/1.1/"
  xmlns:dcterms="http://purl.org/dc/terms/"
  xmlns:foaf="http://xmlns.com/foaf/0.1/">

will not keep the prefixes as defined originally and will output 
something like

<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
  xmlns:ns0="http://purl.org/dc/elements/1.1/"
  xmlns:ns1="http://www.w3.org/1999/xhtml/vocab#"
  xmlns:ns2="http://purl.org/dc/terms/">

  <rdf:Description rdf:about="http://site.com/page.html">
    <ns0:title>my blog entry 1</ns0:title>
    <ns2:created xml:lang="en">2009-02-24T10:25:28-05:00</ns2:created>
  </rdf:Description>
</rdf:RDF>

Is there a way to work around this and keep the prefixes defined in the 
original HTML document?

regards,
Stéphane.