OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.

 


Help: OASIS Mailing Lists Help | MarkMail Help

 


 

   RE: simple XPath question

[ Lists Home | Date Index | Thread Index ]
  • From: "clark.evans@softwareag-usa.com" <cce@clarkevans.com>
  • To: xml-dev@lists.xml.org
  • Date: Wed, 25 Oct 2000 15:12:33 -0400 (EDT)

Richard Lanyon wrote: 
> [H]ow do I refer to the default namespace within an XPath expression? 



      select="namespace::node()[local-name(.)='']" 




For example, if you are given: 

      <?xml version="1.0"?> 
      <test xmlns="hello" /> 

Processed by: 

      <?xml version="1.0"?> 
      <xsl:stylesheet xmlns:xsl=" http://www.w3.org/1999/XSL/Transform
<http://www.w3.org/1999/XSL/Transform> " 
                      xmlns:h="hello" version="1.0"> 
        <xsl:template match="h:test"> 
          <xsl:value-of select="namespace::node()[local-name(.)='']" /> 
        </xsl:template> 
      </xsl:stylesheet> 

The output produced should be: 

      <?xml version="1.0" encoding="UTF-16"?>hello 

Both SAXON and the Microsoft XSLT processor perform 
this operation wonderfully.  XT, and Oracle's 
processor report "namespace axis not implemented". 
Sabaloton and Xalan produce just the XML declaration 
and fail to show any error.  
  
Kind Regards, 

Clark Evans 






 

News | XML in Industry | Calendar | XML Registry
Marketplace | Resources | MyXML.org | Sponsors | Privacy Statement

Copyright 2001 XML.org. This site is hosted by OASIS