|
[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
> -----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
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|

Cart








