Subject: RE: [xsl] Newbie question on Recusrion using XLST 1.0 Part 2 From: "Aron Bock" <aronbock@xxxxxxxxxxx> Date: Mon, 02 May 2005 01:56:43 +0000 |
<xsl:template match="/"> <xsl:for-each select="company/division"> <xsl:sort select="@DID"/>
<xsl:value-of select="@DID"/> <xsl:text>
</xsl:text>
<xsl:for-each select="employees/employee"> <xsl:sort select="ENAME"/>
<company> <division DID="Sal"> <employees> <employee EID="EMP001"> <ENAME>Joe Blow</ENAME> <OFFICE>1.2.27</OFFICE> <BIRTHDATE>1963-08-01</BIRTHDATE> <SALARY>28790</SALARY> </employee> <employee EID="EMP002"> <ENAME>John Doe</ENAME> <OFFICE>1.2.2</OFFICE> <BIRTHDATE>1970-08-01</BIRTHDATE> <SALARY>29855</SALARY> </employee> </employees> </division> <division DID="SOF"> <employees> <employee EID="EMM001"> <ENAME>Mark Smith</ENAME> <OFFICE>1.2.27</OFFICE> <BIRTHDATE>1966-08-01</BIRTHDATE> <SALARY>35000</SALARY> </employee> <employee EID="EMM002"> <ENAME>John Doe</ENAME> <OFFICE>1.2.2</OFFICE> <BIRTHDATE>1977-08-01</BIRTHDATE> <SALARY>40000</SALARY> </employee> </employees> </division> </company>
I'm having using a recursive routine (see below) to display the following elements and attributes: 1) The employee EID attribute such as 'EMP001', followed by 2) The element text of ENAME, such as 'Joe Blow', 3) The element text of OFFICE, such as '1.2.27' 4) The output must be formatted such that the employees of each division are grouped together.
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
[xsl] Newbie question on Recusrion , Marco Mastrocinque | Thread | [xsl] Newbie question on Recusrion , Marco Mastrocinque |
[xsl] Newbie question on Recusrion , Marco Mastrocinque | Date | [xsl] Newbie question on Recusrion , Marco Mastrocinque |
Month |