[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: XPath references using exsl:node-set() stop workin

Subject: Re: XPath references using exsl:node-set() stop working when default name-space defined.
From: Florent Georges <lists@xxxxxxxxxxxx>
Date: Tue, 28 Aug 2007 10:46:29 +0200 (CEST)
Re:  XPath references using exsl:node-set() stop workin
  Hi

  You can bind the same namespace URI as the default namespace to an
explicit prefix, and use this prefix within your XPath expression.  To
be even clearer you can use an internal namespace if appropriate:

    <xsl:stylesheet ... xmlns:impl=".../this.xsl">

      [...]

      <xsl:variable name="args">
        <impl:local-pub-id>
          <xsl:value-of select="@pub-id"/>
        </impl:local-pub-id>
        <impl:local-doc-type>
          <xsl:value-of select="@type"/>
        </impl:local-doc-type>
        <impl:element-num>
          <xsl:value-of select="@element"/>
        </impl:element-num>
      </xsl:variable>
 
      <xsl:value-of select="
          exsl:node-set($args)/impl:local-pub-id"/>

  Regards,

--drkm


--- Matt Poff <matt.poff@xxxxxxxxxxxxxxx> a icrit :

> Previously working references to nodes stored inside a variable and 
> referenced using the exsl:node-set() function are no longer working 
> properly since I defined a default name-space for my document.
> 
> I'm using XSLT 1.0 and the syntax is as below:
> 
>    <xsl:template name="document" match="document">
>         ...
> 
>         <xsl:variable name="args">
>             <local-pub-id><xsl:value-of select="./@pub-id"
> /></local-pub-id>
>             <local-doc-type><xsl:value-of select="./@type" 
> /></local-doc-type>
>             <element-num><xsl:value-of select="./@element"
> /></element-num>
>         </xsl:variable>
> 
>         <xsl:value-of select="exsl:node-set($args)/local-pub-id" />
>         ...
>    </xsl:template>
> 
> 
> It works fine when I take out the default name-space declaration but
> I 
> need to keep that in. I *can* reference the nodes in the variable
> using 
> the form:
> 
>     <xsl:value-of select="exsl:node-set($args)[1]" />
> 
> But this is also less than desirable. Do I need to put namespace 
> declarations in the variable node or similar? Using the libxml2
> processor.
> 
> 
> Hope you can help,
> 
> Matt
> 
> 





      _____________________________________________________________________________ 
Ne gardez plus qu'une seule adresse mail ! Copiez vos mails vers Yahoo! Mail 

Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.