Ver Mensaje Individual
  #1 (permalink)  
Antiguo 15/04/2008, 13:05
Matt-CodeGlide
 
Fecha de Ingreso: abril-2008
Mensajes: 11
Antigüedad: 16 años, 1 mes
Puntos: 0
XML - XSL Add Number line in Attributes problem

hi, i wanna to add the number of the line in my tree...

I wish to do that with attributes as __line=" "




I guess I need an accountant but not how to do it:

<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" >

<xsl:template match="//*">
<xsl:copy>
<xsl:attribute name="__line">
<!--COUNT -->
</xsl:attribute>
<xsl:apply-templates/>
</xsl:copy>
</xsl:template>
</xsl:stylesheet>



<inventory __line="1">
<book year="2000" __line="2">
<title __line="3">Snow Crash</title>
<author __line="4">Neal Stephenson</author>
<publisher __line="5">Spectra</publisher>
<isbn __line="6">0553380958</isbn>
<price __line="7">14.95</price>
</book>

<book year="2005" __line="8">
<title __line="9">Burning Tower</title>
<author __line="10">Larry Niven</author>
<author __line="11">Jerry Pournelle</author>
<publisher __line="12">Pocket</publisher>
<isbn __line="13">0743416910</isbn>
<price __line="14">5.99</price>
</book>

<book year="1995" __line="14">
<title __line="16">Zodiac</title>
<author __line="17">Neal Stephenson</author>
<publisher __line="18">Spectra</publisher>
<isbn __line="19">0553573862</isbn>
<price __line="20">7.50</price>
</book>

<!-- more books... -->
</inventory>



Thx and if any can send my the result to [email protected]

Bye