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

RE: How to use xpath in this xml file...

Subject: RE: How to use xpath in this xml file...
From: "Kenny Akridge" <kenny@xxxxxxxxxxxxxxxxx>
Date: Wed, 17 Mar 2004 09:35:46 -0500
xslt like
I changed your XML a bit to show differentials:

<PENSIONES>
	<NOMBRE>28509599H</NOMBRE>
	<numCol>1</numCol>
	<Volver>0</Volver>
	<CIF>P4100000A</CIF>
	<RAZONSOCIAL>DIPUTACION PROVINCIAL DE SEVILLA</RAZONSOCIAL>
	<TOTAL_APORT_EMP>4.640,55</TOTAL_APORT_EMP>
	<TOTAL_APORT_TRAB>1.969,44</TOTAL_APORT_TRAB>
	<accion>listadoPensiones</accion>
	<desde>1</desde>
	<DETALLE_PENSION>
		<ANNO>1997</ANNO>
		<MES>4</MES>
		<APORT_EMP>1.514,55</APORT_EMP>
		<APORT_TRAB>0</APORT_TRAB>
	</DETALLE_PENSION>
	<DETALLE_PENSION>
		<ANNO>1998</ANNO>
		<MES>5</MES>
		<APORT_EMP>42,07</APORT_EMP>
		<APORT_TRAB>8,41</APORT_TRAB>
	</DETALLE_PENSION>
	<DETALLE_PENSION>
		<ANNO>1998</ANNO>
		<MES>6</MES>
		<APORT_EMP>42,07</APORT_EMP>
		<APORT_TRAB>8,41</APORT_TRAB>
	</DETALLE_PENSION>
	<DETALLE_PENSION>
		<ANNO>1999</ANNO>
		<MES>7</MES>
		<APORT_EMP>42,07</APORT_EMP>
		<APORT_TRAB>8,41</APORT_TRAB>
	</DETALLE_PENSION>
	<DETALLE_PENSION>
		<ANNO>1998</ANNO>
		<MES>8</MES>
		<APORT_EMP>42,07</APORT_EMP>
		<APORT_TRAB>8,41</APORT_TRAB>
	</DETALLE_PENSION>
	<DETALLE_PENSION>
		<ANNO>1998</ANNO>
		<MES>9</MES>
		<APORT_EMP>42,07</APORT_EMP>
		<APORT_TRAB>8,41</APORT_TRAB>
	</DETALLE_PENSION>
	<hasta>70</hasta>
	<registros>71</registros>
</PENSIONES>

Used this simple xslt:

<?xml version="1.0"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="/">
	<xsl:for-each select="//ANNO">
		
		<xsl:value-of select="."/> = = <xsl:value-of
select="preceding::ANNO"/> :: <xsl:value-of select=". = preceding::ANNO"/>
		<br/>
		
	</xsl:for-each>
</xsl:template>
</xsl:stylesheet>

Gives this output:


-----Original Message-----
From: owner-xsl-list@xxxxxxxxxxxxxxxxxxxxxx
[mailto:owner-xsl-list@xxxxxxxxxxxxxxxxxxxxxx] On Behalf Of BECAPORTAL2
becario desarrollo
Sent: Wednesday, March 17, 2004 8:47 AM
To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
Subject:  How to use xpath in this xml file...

Hi everybody,

I have a xml file like this:

<PENSIONES>
	<NOMBRE>28509599H</NOMBRE>
	<numCol>1</numCol>
	<Volver>0</Volver>
	<CIF>P4100000A</CIF>
	<RAZONSOCIAL>DIPUTACION PROVINCIAL DE SEVILLA</RAZONSOCIAL>
	<TOTAL_APORT_EMP>4.640,55</TOTAL_APORT_EMP>
	<TOTAL_APORT_TRAB>1.969,44</TOTAL_APORT_TRAB>
	<accion>listadoPensiones</accion>
	<desde>1</desde>
	<DETALLE_PENSION>
		<ANNO>1998</ANNO>
		<MES>4</MES>
		<APORT_EMP>1.514,55</APORT_EMP>
		<APORT_TRAB>0</APORT_TRAB>
	</DETALLE_PENSION>
	<DETALLE_PENSION>
		<ANNO>1998</ANNO>
		<MES>5</MES>
		<APORT_EMP>42,07</APORT_EMP>
		<APORT_TRAB>8,41</APORT_TRAB>
	</DETALLE_PENSION>
	<DETALLE_PENSION>
		<ANNO>1998</ANNO>
		<MES>6</MES>
		<APORT_EMP>42,07</APORT_EMP>
		<APORT_TRAB>8,41</APORT_TRAB>
	</DETALLE_PENSION>
	<DETALLE_PENSION>
		<ANNO>1998</ANNO>
		<MES>7</MES>
		<APORT_EMP>42,07</APORT_EMP>
		<APORT_TRAB>8,41</APORT_TRAB>
	</DETALLE_PENSION>
	<DETALLE_PENSION>
		<ANNO>1998</ANNO>
		<MES>8</MES>
		<APORT_EMP>42,07</APORT_EMP>
		<APORT_TRAB>8,41</APORT_TRAB>
	</DETALLE_PENSION>
	<DETALLE_PENSION>
		<ANNO>1998</ANNO>
		<MES>9</MES>
		<APORT_EMP>42,07</APORT_EMP>
		<APORT_TRAB>8,41</APORT_TRAB>
	</DETALLE_PENSION>
	<hasta>70</hasta>
	<registros>71</registros>
</PENSIONES>

 When i select value of "ANNO" with xsl, i would like compare with last
value of ANNO. I have trying with precedence,ancestor,position(), but i have
failled. Which xpath sentence will be good in this case?

Thanks in advance and Greetings from Spain


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



 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.