Subject: Re: [xsl] Match values? (sorry so big) From: Joerg Heinicke <joerg.heinicke@xxxxxx> Date: Mon, 23 Sep 2002 22:02:38 +0200 |
> I thought my original explanation was a little confusing (ok very > confusing). > I got things working as I wanted after changing the xml file tags and > adding attributes. > Here is what I ended up with, what other approach would you have taken? > > Also is it more efficient to declare billto as a string and pass as a > parameter and declare > the document in the apply-templates select, like below. Or to declare > billto as a document > initially and pass the node set as the parameter. > > Thanks, > Rich
========================= mergeXML.xsl =============================== <?xml version="1.0"?> <xsl:stylesheet version="2.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <xsl:output method="html"/>
<xsl:template match="/invoice-xml-files"> <xsl:variable name="TA-Parties" select="document(@bill-to)/TRANSACTION_PARTIES/TRANSACTION_PARTY"/>
<html> <head> <title> This is driving me out of my mind!!!! </title> </head> <body> <xsl:apply-templates select="document(@invoice-header)/INVOICES/INVOICE"> <xsl:with-param name="TA-Parties" select="$TA-Parties"/> </xsl:apply-templates> </body> </html> </xsl:template>
<xsl:template match="INVOICES/INVOICE"> <xsl:param name="TA-Parties"/> <hr/> <h3>INVOICE HEADER RECORD</h3> <xsl:apply-templates select="$TA-Parties[@account=current()/@account and type='BILL_TO']"/> <xsl:apply-templates/> </xsl:template>
<!-- Invoice header templates go here -->
<xsl:template match="TRANSACTION_PARTY"> <xsl:text>Bill To:</xsl:text><br/> <xsl:value-of select="NAME"/><br/> <xsl:value-of select="ADDRESS1"/><br/> <xsl:value-of select="ADDRESS2"/><br/> <xsl:value-of select="CITY"/> <xsl:text>, </xsl:text> <xsl:value-of select="STATE"/> <xsl:text> </xsl:text> <xsl:value-of select="ZIPCODE"/><br/> </xsl:template>
</xsl:stylesheet>
========================== mergeXML.xsl ==========
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
Re: [xsl] Match values? (sorry so b, RShonk | Thread | [xsl] Urgent Help Needed in XSLT, Kong, Yan |
[xsl] How to do for-each on nodeset, SoumenS | Date | RE: [xsl] Can you apply a template , Wendell Piez |
Month |