Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


[xsl] back again: child nodes in variable

From: Aniceto L&oacute;pez <aniceto@------------->
To:
Date: 6/4/2002 8:04:00 AM
Hi everybody
"<xsl:text disable-output-escaping="yes">&#38;nbsp;</xsl:text>" boy is back
again
but don't worry about this topic so-discussed in the past, today the "thing"
is
another one:

this is part of the xml file:

<mercados>
	<mercado id="MERCADO" descripcion="CONTINUO">
		<subyacentes/>
	</mercado>
	<mercado id="M3" descripcion="MEFF RENTA VARIABLE">
		<subyacentes>
			<subyacente id="20" descripcion="IBEX  MINI"/>
			<subyacente id="21" descripcion="IBEX  PLUS"/>
		</subyacentes>
	</mercado>
	<mercado id="MERCADO2" descripcion="CONTINUO2">
		<subyacentes/>
	</mercado>
	<mercado id="G1" descripcion="EUREX">
		<subyacentes>
			<subyacente id="10" descripcion="Fut EURO SCHATZ"/>
			<subyacente id="20" descripcion="Fut EURO BOBL"/>
		</subyacentes>
	</mercado>
</mercados>

first I need to put in a variable the "mercado" nodes getting rid of
the ones with no "subyacentes", maybe something like:

<xsl:variable name="conhijos"
select="mercados[child::*[descendant::*[descendant::node()]]]"></xsl:variabl
e>

just for having
  <mercado id="M3" descripcion="MEFF RENTA VARIABLE">
  	<subyacentes>
  		<subyacente id="20" descripcion="IBEX  MINI"/>
  		<subyacente id="21" descripcion="IBEX  PLUS"/>
  	</subyacentes>
  </mercado>
  <mercado id="G1" descripcion="EUREX">
  	<subyacentes>
  		<subyacente id="10" descripcion="Fut EURO SCHATZ"/>
  		<subyacente id="20" descripcion="Fut EURO BOBL"/>
  	</subyacentes>
  </mercado>
inside $conhijos variable then do something like:

  <xsl:for-each select="$conhijos/mercado/subyacentes/subyacente">
    <xsl:value-of select="@descripcion"/>
  </xsl:for-each>

when needed

I've read something about at
http://www.dpawson.co.uk/xsl/sect2/N8090.html#d60e447
but I cant get it working. Can someone point what is worng?
thanks in advance

Aniceto Lopez





 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


transparent
Print
Mail
Digg
delicious
Disclaimer
.

These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on www.altova.com/list/index.html. Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.

.
.

transparent

transparent