|
Subject: Re: [xsl] Output flat file results 2 nodes at a time? From: Abel Braaksma <abel.online@xxxxxxxxx> Date: Wed, 09 May 2007 15:56:41 +0200 |
Cheers, Abel
<xsl:template match="/shipment" >
<xsl:apply-templates select="header" />
<xsl:apply-templates select="detail" />
<xsl:apply-templates select="detail/containers/box" />
</xsl:template> <xsl:template match="header">
<xsl:text>REC1*</xsl:text>
<xsl:value-of select="shipmentId"/>
<xsl:text>
</xsl:text>
</xsl:template> <xsl:template match="po" >
<xsl:text>*</xsl:text>
<xsl:value-of select="."/>
<xsl:if test="position() mod 2 = 0 or position() = last()">
<xsl:text>
</xsl:text>
</xsl:if>
</xsl:template>
I need to take the following XML document (a shipping delivery) and output as a fixed length file. The fixed length file has expected repetitions within it, as follows: 1) The first output record -- REC1 -- is the shipping header. 2) The second output line(s) -- REC2 --are the purchase order(s). Each line of text will contain least one and up to two purchase orders. 3) The final output line(s) --REC3 -- are the containers. Each line of text will contain at least one and up to four containers.
| Current Thread |
|---|
|
| <- Previous | Index | Next -> |
|---|---|---|
| Re: [xsl] Output flat file results , David Carlisle | Thread | Re: [xsl] Output flat file results , David Carlisle |
| RE: [xsl] simple xslt function erro, Michael Kay | Date | RE: [xsl] Is PI a real node?, Michael Kay |
| Month |