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

RE: Parse a variable which contains a tree-fragment

Subject: RE: Parse a variable which contains a tree-fragment
From: "Andreas L. Delmelle" <a_l.delmelle@xxxxxxxxxx>
Date: Thu, 22 Jan 2004 00:01:44 +0100
parse a variable
> -----Original Message-----
> From: Gerald Fingerlos
>  
> I have a variable $result which contains the following
> value/tree-fragment:
>  
> <root>
>     <output>
>         <instance class-name="User" src-dn="\XY\EMA\G2 F2">
>             <attr attr-name="manager">
>                 <value type="dn">\xy\EMA\test1\G1 F1</value>
>             </attr>
>         </instance>
>         <instance class-name="User" src-dn="\XY\EMA\G1 F1">
>         </instance>
>     </output>
> </root>
>  
> What I want to do is to select the src-dn if there is _no_ "attr
> attr-name='manager'"
> In this case, the result should be "\XY\EMA\G1 F1"
>  
> I tried it with the following stylesheet:
>  
> <xsl:choose>
>     <xsl:when test="$result//attr[@attr-name]='manager'"/>
>     <xsl:otherwise>
>     <add-attr attr-name="manager">
>         <value>
>             <xsl:value-of select="="$result//@src-dn"/>
>         </value>
>     </add-attr>
>     </xsl:otherwise>
> </xsl:choose>
>  
> But obviously this doesnt work because the value-of select chooses the
> first available one.
> Can anyone give me a hint how this could be corrected?
>  

Not only that, I'm curious as to where the add-attr comes from...
(do you mean 'xsl:attribute'?)

A bit of context would be helpful in any case.

Cheers,

Andreas


 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.