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

RE: Next node name

Subject: RE: Next node name
From: "Casadome, Francisco Javier" <Francisco.Casadome@xxxxxxxxxxxxxx>
Date: Wed, 3 Apr 2002 13:41:02 +0200
xsl next node
Hi all,

I have an xml like this (actually is a TMX):

<tu>
    <tuv>
        <seg>Use <ut>{\cs6\f1\cf6\lang1024
</ut>&lt;b&gt;<ut>}</ut>Set<ut>{\cs6\f1\cf6\lang1024
</ut>&lt;/b&gt;<ut>}</ut> when you want to assign an object reference</seg>
    </tuv>
</tu>

with a lot of "tu".

I want to replace all the formatted text (the word "Set" in the example
above) and the format nodes by a string, lets say "(%TERM%)".
The result would be:

<tu>
    <tuv>
        <seg>Use (%TERM%) when you want to assign an object reference</seg>
    </tuv>
</tu>

I use this template to walk through the nodes inside "seg" nodes (note that
it's not working right now):

<xsl:template match="seg">
  <xsl:for-each select="node()">
   <xsl:choose>
    <xsl:when test="not(name()) and not(following-sibling::*[1][name()])">
      <xsl:value-of select="."/>
    </xsl:when>
    <xsl:otherwise>
<!--     <xsl:text>(%TERM%)</xsl:text>-->
    </xsl:otherwise>
   </xsl:choose>
  </xsl:for-each>
</xsl:template>

What I do is: when the node has no name, it means we are in a text node, so
there's nothing to do with it unless it's between two nodes with name (the
"ut" nodes), then is when I have to replace.
For the nodes with name (the "ut" nodes) I just do nothing so they are
removed.

What I need to know is how to reference the next and previous node names to
check if they are "ut" nodes.

Thanks in advance,
Frank.

 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.