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

Re: from one node get the next node value with the sam

Subject: Re: from one node get the next node value with the same name
From: Josh Canfield <joshcanfield@xxxxxxxxx>
Date: Wed, 25 Aug 2004 19:54:07 -0700
xsl get next node
The problem is with the context when you use the following-sibling
axis. Your current node is a masterinformaciones/sn_masterinformacion
node, which has no following-siblings. If you want to select the 1st
and 2nd composicioninformacion/sn_composicioninformacion nodes, then
depending on your actual requirements you may be able to get away with
something like this:

<xsl:value-of
select="composicioninformacion/sn_composicioninformacion[1]/metadatosinformac
ion_texto"
disable-output-escaping="yes"/>
   (<xsl:value-of
select="composicioninformacion/sn_composicioninformacion[2]/metadatosinformac
ion_texto"
disable-output-escaping="yes"/>)

You may want to be more explicit in your test attribute that you are
knowingly comparing to the text value of the first
sn_composicioninformacion nodes child composicioninformacion_cc node:

 <xsl:when
test="composicioninformacion/sn_composicioninformacion[1]/composicioninformac
ion_cc='titulo'">

since there are multiple such child nodes of composicioninformacion.

Phew... Those element names are pretty unwieldy...

Oh right, I'm supposed to say something about
disable-output-escaping... it's not needed in any of the code you have
provided, and it's generally not a recommended feature, unless you
really think that you need it.

Josh

On Thu, 26 Aug 2004 03:49:26 +0200, Dionisio Ruiz de Zarate
<dionisio@xxxxxxxxxxxxx> wrote:
> hello i have the next xml file and from one node i want to load the next
> node with the same name.
>
> but it doesn't show me the next node value.
>
> the xml file is:
> <?xml version="1.0" encoding="ISO-8859-1" standalone="yes"?>
> <sn_servicioproyecto>
> <masterinformaciones>
> <sn_masterinformacion>
> <composicioninformacion>
> <sn_composicioninformacion>
>
<composicioninformacion_aliasnvolucion><![CDATA[titulo]]></composicioninform
> acion_cc>
> <metadatosinformacion_texto><![CDATA[Negorta (Zuhatza) -
> 2004]]></metadatosinformacion_texto>
> </sn_composicioninformacion>
> <sn_composicioninformacion>
>
<composicioninformacion_aliasnvolucion><![CDATA[titulo_secundario]]></compos
> icioninformacion_cc>
> <metadatosinformacion_texto><![CDATA[AIARAKO V. JARDUNALDI
> HISTORIKOAK]]></metadatosinformacion_texto>
> </sn_composicioninformacion>
> </composicioninformacion>
> </sn_masterinformacion>
> </masterinformaciones>
> </sn_servicioproyecto>
>
> i want to load, to show this:
>
> a.. Negorta (Zuhatza) - 2004 (AIARAKO V. JARDUNALDI HISTORIKOAK)
>
> for this i have the next xslt file:
>
> <?xml version="1.0" encoding="ISO-8859-1"?>
> <xsl:stylesheet version="1.0"
> xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
> <xsl:output method="html" version="1.0" encoding="ISO-8859-1" indent="yes"
> omit-xml-declaration="yes"/>
> <xsl:strip-space elements="*"/>
> <xsl:template match="/sn_servicioproyecto">
> Hauexek dira dituzun <xsl:value-of
> select="sn_servicioproyectodetalles/servicioproyectodetalle_titulo"
> disable-output-escaping="yes"/><br/>
> <ul>
> <xsl:for-each select="masterinformaciones/sn_masterinformacion">
> <xsl:choose>
> <xsl:when
>
test="composicioninformacion/sn_composicioninformacion/composicioninformacio
> n_cc='titulo'">
> <li><xsl:value-of
>
select="composicioninformacion/sn_composicioninformacion/metadatosinformacio
> n_texto" disable-output-escaping="yes"/> (<xsl:value-of
>
select="normalize-space(following-sibling::composicioninformacion/sn_composi
> cioninformacion/metadatosinformacion_texto)"
> disable-output-escaping="yes"/>)</li>
> </xsl:when>
> </xsl:choose>
> </xsl:for-each>
> </ul>
> </xsl:template>
> </xsl:stylesheet>
>
> can you help me please?

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.