XML.com: XML From the Inside Out

XML.comWebServices.XML.comO'Reilly Networkoreilly.com
  Articles | Weblogs | Newsletter | Safari Bookshelf
advertisement

Article:
 Trickledown Namespaces?
Subject: use (or not) of the namespace axis
Date: 2004-07-01 03:49:18
From: David Carlisle

Unfortunately, assuming you really do want to use namespaces to locate the two different title elements -- well, it just isn't possible. The reason: again, while you've declared the namespaces, they aren't actually in use in the source tree (by any element, not just the two titles). So there's nothing namespace-related with which to distinguish the two title elements.



This isn't really true, the namespace declarations are in scope and are visible from the title elements, so the original stylesheet
would work as desired if changed to say



<xsl:value-of
select="string(//*/*/title[namespace::fa])"/>


FB:
<xsl:value-of
select="string(//*/*/title[namespace::fb])"/>


That is, instead of looking for fa:title look for a title in no-namespace that has a namespace binding for "fa" in scope.




Previous Message Previous Message   Next Message Next Message

Sponsored By:


Contact Us | Our Mission | Privacy Policy | Advertise With Us | | Submissions Guidelines
Copyright © 2008 O'Reilly Media, Inc. | (707) 827-7000 / (800) 998-9938