- From: Pete Johnston <Pete.Johnston@eduserv.org.uk>
- Date: Tue, 13 Jun 2006 11:09:25 +0100
- To: "Fabien Gandon" <Fabien.Gandon@sophia.inria.fr>, "public-rdf-in-xhtml task force" <public-rdf-in-xhtml-tf@w3.org>
Hi Fabien, > I quickly scanned the archives of the list and could not find > an answer to the following question so I take the risk of > asking it again. > > We are using RDFa and GRDDL in SweetWiki [1]: a wiki here > persistence is in XHTML+RDFa and navigation is done through > SPARQL queries on the RDF extracted from the pages by a GRDDL > stylesheet. > > The current stylesheet is domain dependent in the sense that > it includes the namespaces of the OWL Lite schemas used in the wiki. > > Before releasing the stylesheet I wanted to make it > schema-independent. > Unfortunately I got stuck by the fact that: > 1 - RDFa uses standard xmlns attributes to declare its namespaces [2]; > 2 - In XPath "There are no attribute nodes corresponding to > attributes that declare namespaces" [3] > > Therefore, unless I missed a point, in XSLT I can easily > extract property and class QName from XHTML+RDFa and get > their ns prefix an local name, but there seems to be no way > of accessing the ns declaration (i.e. the URI associated to > the prefix) and therefore no way of being independent from > the ns used in the RDFa. XPath 1.0 does have "Namespace Nodes" though http://www.w3.org/TR/xpath#namespace-nodes Given a QName as attribute value, I think you can probably get from QName to XML Namespace Name that way, using something like <xsl:variable name="prefix" select="substring-before(.,':')"/> <xsl:value-of select="../namespace::*[local-name()=$prefix]"/> The "../" is needed because the Namespace Nodes are associated with the Element Node, rather than the Attribute Node. (I haven't tried this on RDF/A but I've used variants of it in other contexts.) > Did I miss something? > Is there an RDFa syntax for RDFa ns declaration? e.g. > <link rel="xmlns:dc" href="http://purl.org/dc/elements/1.1/" /> (don't scream; I know it's ugly.) Pete --- Pete Johnston Technical Researcher, Eduserv Foundation Web: http://www.eduserv.org.uk/foundation/ Email: pete.johnston@eduserv.org.uk Tel: +44 (0)1225 474323
Received on Tuesday, 13 June 2006 10:09:35 UTC