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

Namespace and XSL Variables

Subject: Namespace and XSL Variables
From: <Trish@xxxxxxxxxxxxxx>
Date: Tue, 12 Sep 2006 10:15:13 -0400
xsl variables

I have an xml stream that is formed from three different xml sources
(Source1, Source2, Source3) and then folded into a single xml stream.
The single xml stream has this structure:

     <Source2 xmlns:"http://www.somenonexistenturl.com">
          <Results selected="123">
               <Path cp="123">blah blah blah</Path>
               <Path cp="124">la dee da</Path>
               <Path cp="125">ha</Path>

I'm using xsl to create a web page. I pull data from the three 'Source'
elements randomly throughout the stylesheet:

<xsl:stylesheet version="1.0"
<xsl:output method="html" indent="no" />
<xsl:template match="/">
     <xsl:variable name="varResultsId"
select="//x:Source2/x:Results/@x:selected" />
     <xsl:for-each select="//x:Source2/x:Results/x:Path">
               <xsl:when test="$varResultsId = @cp">
                    do one thing
                    do something else

While I can get the data within the loop with no problem, I cannot seem
to get the xsl:variable to work with the namespace prefixes. Can you
tell me what I'm doing wrong?

Second question: Is there anyway to access the data in Source2 from the
Document node without using "//"?


Current Thread


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.
First Name
Last Name
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.