[XML-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: XSL and Namespace Question
Future XSL questions are best directed to xsl-list@m... Here's some helpful hints... | <NavigationElement xlink:href="index.xml" xlink:title="Overview" | xml-href="true"/> | | I don't get the href value using <xsl:value-of select="@href"/>. For the first one, you need to qualify href with xlink:href... <?xml version="1.0"?> <NavigationElement xmlns:xlink="urn:xlink" xlink:href="index.xml" xlink:title="Overview" xml-href="true"/> <?xml version="1.0"?> <xsl:stylesheet xmlns:xlink="urn:xlink" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> <xsl:template match="/NavigationElement"> Href = <xsl:value-of select="@xlink:href"/> </xsl:template> </xsl:stylesheet> | <Meta xmlns="meta.dtd"> | <Title> | title | </Title> | </Meta> | | <xsl:value-of select="Meta/Title"/>, works only if i remove the xmlns | declaration. For the second one, you're hitting a limitation of XPath 1.0 regarding default namespaces. You must explicitly associate a prefix with the namespace uri "meta.dtd" and then use that prefix to find Meta/Title as meta:Meta/meta:Title as in: <Meta xmlns="meta.dtd"> <Title>title</Title> </Meta> <?xml version="1.0"?> <xsl:stylesheet xmlns:M="meta.dtd" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> <xsl:template match="/"> Title = <xsl:value-of select="M:Meta/M:Title"/> </xsl:template> </xsl:stylesheet> ______________________________________________________________ Steve Muench, Lead XML Evangelist & Consulting Product Manager Business Components for Java & XSQL Servlet Development Teams Oracle Rep to the W3C XSL Working Group *************************************************************************** This is xml-dev, the mailing list for XML developers. To unsubscribe, mailto:majordomo@x...&BODY=unsubscribe%20xml-dev List archives are available at http://xml.org/archives/xml-dev/ ***************************************************************************
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|