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

Re: problem with Xpath in Variable filled by choose

Subject: Re: problem with Xpath in Variable filled by choose
From: Jon Gorman <jonathan.gorman@xxxxxxxxx>
Date: Wed, 16 Nov 2005 12:26:27 -0600
xsl xpath with var
On 11/16/05, Dietmar Klotz <dklotz@xxxxxxxxxxx> wrote:
> I am not sure if i understand the concept fully. If I follow your advice my
> output of: <xsl:copy-of select="$CategoryPointer"/>
>
> Is than this:
>                 <news
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
>                     <HeadlineColor>#ff0000</HeadlineColor>
>                     <TeaserColor>#00ff00</TeaserColor>
>                     <TeaserColorSub>#0000ff</TeaserColorSub>
>                 </news>
>
> But if I do:
> <xsl:copy-of select="$CategoryPointer/HeadlineColor"/>

Looks like a namespace problem to me, but I'm battling a headcold so I
could be a bit flaky. Assuming you declare the namespace in the xslt
stylesheet element the xpath you are looking for is something like
this:

 <xsl:copy-of select="$CategoryPointer/xsI:HeadlineColor"/>

The reason the other xpath till "grabbed" those in the variable
setting is because you're doing the name()=$catagory I would suspect.

Notice this still wouldn't get you

#ff0000 but something like:

<HeadlineColor>#ff0000</HeadlineColor> or

<HeadlineColor
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">#ff0000</HeadlineColor>

There's quite a bit about namespaces in the faq.

If I'm wrong I'm sure someone will correct me.

Jon Gorman

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.