macchisp
06-06-2006, 09:01 PM
Hey all,
I was wondering if anyone can help me out with having one XML file that goes through an XSL stylesheet that outputs two XHTML pages.
Let me give you the test code that I've been working with:
staff.xml
<staff>
<is>
<cd>
<first>John</first>
<last>Doe</last>
<room>178</room>
<email>doejx@domain.com</email>
</cd>
</is>
<ts>
<cd>
<first>Jane</first>
<last>Doe</last>
<room>278</room>
<email>doe2jx@domain.com</email>
</cd>
</ts>
</staff>
staff.xsl
<table border="0" cellpadding="5" cellspacing="5">
<xsl:for-each select="staff/is/cd">
<tr>
<td>
<xsl:attribute name="align">left</xsl:attribute>
<strong><xsl:value-of select="last" />,
<xsl:value-of select="first" /></strong><br />
Room Number: <xsl:value-of select="room" /><br />
E-mail: <a><xsl:attribute name="href">mailto:<xsl:value-of email" />
</xsl:attribute>
<xsl:value-of select="email" />
</a>
</td>
</tr>
</xsl:for-each>
</table>
Right now I understand the XSL above will only select the <is> and display it. What I would like to do is have the <ts> tag go to one html file and the <is> go to another html file.
Please ask questions if I did not make it clear.
Thanks for all the help.
I was wondering if anyone can help me out with having one XML file that goes through an XSL stylesheet that outputs two XHTML pages.
Let me give you the test code that I've been working with:
staff.xml
<staff>
<is>
<cd>
<first>John</first>
<last>Doe</last>
<room>178</room>
<email>doejx@domain.com</email>
</cd>
</is>
<ts>
<cd>
<first>Jane</first>
<last>Doe</last>
<room>278</room>
<email>doe2jx@domain.com</email>
</cd>
</ts>
</staff>
staff.xsl
<table border="0" cellpadding="5" cellspacing="5">
<xsl:for-each select="staff/is/cd">
<tr>
<td>
<xsl:attribute name="align">left</xsl:attribute>
<strong><xsl:value-of select="last" />,
<xsl:value-of select="first" /></strong><br />
Room Number: <xsl:value-of select="room" /><br />
E-mail: <a><xsl:attribute name="href">mailto:<xsl:value-of email" />
</xsl:attribute>
<xsl:value-of select="email" />
</a>
</td>
</tr>
</xsl:for-each>
</table>
Right now I understand the XSL above will only select the <is> and display it. What I would like to do is have the <ts> tag go to one html file and the <is> go to another html file.
Please ask questions if I did not make it clear.
Thanks for all the help.