Subject: RE: [xsl] Malformed (??) XML and XML 2 SQL XSLT transformation From: cknell@xxxxxxxxxx Date: Fri, 14 Nov 2003 09:58:19 -0500 |
<?xml version="1.0" encoding="UTF-8" ?> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <xsl:output method="text" indent="no" encoding="UTF-8" /> <xsl:strip-space elements="*" />
<xsl:template match="/"><xsl:apply-templates mode="columns"/><xsl:apply-templates mode="values"/></xsl:template> <xsl:template match="Orders" mode="columns">INSERT INTO orders(<xsl:for-each select="Customer/Template/Fields">"<xsl:value-of select="@FieldName" />"<xsl:if test="position() != last()">,</xsl:if></xsl:for-each>)</xsl:template> <xsl:template match="Orders" mode="values"> values(<xsl:for-each select="Customer/Template/Fields">"<xsl:value-of select="FieldValue" />"<xsl:if test="position() != last()">,</xsl:if></xsl:for-each>);</xsl:template>
-- Charles Knell cknell@xxxxxxxxxx - email
-----Original Message----- From: Guillaume LECERF <guillaume.lecerf@xxxxxxxxxxxxxx> Sent: Fri, 14 Nov 2003 14:42:01 +0100 To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx Subject: [xsl] Malformed (??) XML and XML 2 SQL XSLT transformation
<?xml version="1.0" encoding="iso8859-1" ?> <Orders> <Customer cust-id="C6272"> <Template Template-id="T37141"> <Fields FieldName="User Login ID"> <FieldValue>roger.moore</FieldValue> </Fields> <Fields FieldName="External Client ID"> <FieldValue>105</FieldValue> </Fields> <Fields FieldName="Job Docket"> <FieldValue>P377609</FieldValue> </Fields> <Fields FieldName="Order Date"> <FieldValue>10/14/2003</FieldValue> </Fields> <Fields FieldName="Order"> <FieldValue>O1084281</FieldValue> </Fields> <Fields FieldName="User Login ID"> <FieldValue>bernard</FieldValue> </Fields> <Fields FieldName="External Client ID"> <FieldValue>104</FieldValue> </Fields> <Fields FieldName="Job Docket"> <FieldValue>P377610</FieldValue> </Fields> <Fields FieldName="Order Date"> <FieldValue>10/16/2003</FieldValue> </Fields> <Fields FieldName="Order"> <FieldValue>O1084283</FieldValue> </Fields> </Template> </Customer> </Orders>
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
[xsl] Re: Generating a 2 column tab, Dimitre Novatchev | Thread | RE: [xsl] Malformed (??) XML and XM, Guillaume LECERF |
RE: [xsl] XHTML Output, Craig Kattner | Date | RE: [xsl] Malformed (??) XML and XM, Guillaume LECERF |
Month |