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

How to tell the parser it's not a string but a 'path'

Subject: How to tell the parser it's not a string but a 'path' to a node?
From: Jacobus Reyneke <jacobusreyneke@xxxxxxxxx>
Date: Tue, 16 Mar 2010 23:52:43 +0200
 How to tell the parser it's not a string but a 'path'
Good day,

I've just spent 5 hours on this and still can't find a solution.

I have an element called glossary. It contains a link to a different
part of the XML file. If I select the path from it, Saxon assumes that
I'm now working with a string value, but I'm not. How to I tell it not
to treat it as a string but to get the value of the node that the
'string' is pointing to?

----This doesn't work ----
(it outputs the path and not the value of the node where the path is pointing )

   </xsl:template>  <xsl:template match="glossary">
      <xsl:variable name="location" select="'/gset/d/'"/>
      <xsl:variable name="path" select="."/> <!-- Test data contains
gset/goal/description -->
      <xsl:variable name="fullpath" select="concat($location,$path)"/>
..
            <xsl:value-of select="$fullpath"/>
..
    </xsl:template>

----If I "hard code" the value, it works:----
(now I ignore the variables and hardcode a sample path)

   </xsl:template>  <xsl:template match="glossary">
      <xsl:variable name="location" select="'/gset/d/'"/>
      <xsl:variable name="path" select="."/>
      <xsl:variable name="fullpath" select="concat($location,$path)"/>
..
            <xsl:value-of select="/gset/d/gset/goal/description"/>
..
    </xsl:template>

I'm off to bed to cry myself to sleep!

Kind regards,
Jacobus

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.