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

Re: Working with 2 namespaces

Subject: Re: Working with 2 namespaces
From: Andreas Schlegel <schlegel@xxxxxxxxxxxxxxxxxxx>
Date: Mon, 25 Mar 2002 12:14:28 +0100
andreas schlegel
Thanks for your help. It works now.

-- Andreas


Peter Davis wrote:

> On Sunday 24 March 2002 13:21, Andreas Schlegel wrote:
> > I have a "<xsl:for-each select="/test/common/fields/*">" loop.
> > For every item in this loop I would refer to an item in another
> > namespace ("<xsl:value-of select="/test/common/labels/."/>.
> > Both items have the same name but are in different namespaces.
> > My problem is: how to get the name of the current item and use it to get
> > the corresponding item in the other namespace ("/test/common/labels/")?
>
> Can you please post some sample input and output?  There are a dozen possible
> answers, but it is impossible to tell what you really mean.
>
> Either way, though, the answer will likely end up using <xsl:key> and key(),
> so you might investigate those.  Also investigate the local-name() function,
> which will give you the name of an element not including its namespace
> prefix.  If I'm interpreting your question right, you could do this:
>
> <xsl:key name="label" match="/test/common/labels/*" use="local-name(.)"/>
> ...
> <xsl:for-each select="/test/common/fields/*">
>   <xsl:value-of select="key('label', local-name(.))"/>
> </xsl:for-each>
>
> --
> Peter Davis
> Valerie: Aww, Tom, you're going maudlin on me ...
> Tom:     I reserve the right to wax maudlin as I wane eloquent ...
>                 -- Tom Chapin
>
>  XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list




 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


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.