Altova Mailing List Archives>Archive Index >microsoft.public.xsl Archive Home >Recent entries [Thread Prev] >Thread Next - Re: Struggling to debug XSL..Help appreciated Struggling to debug XSL..Help appreciatedTo: NULL Date: 8/19/2009 4:46:00 AM Hi
Hoping someone can help !
See below XML in
<?xml version="1.0" encoding="windows-1252" ?>
<SalesOrders Language="05" Language2="EN" CssStyle="" DecFormat="1"
DateFormat="01" Role="01" Version="6.0.050" OperatorPrimaryRole="">
<TransmissionHeader>
<TransmissionReference>T90806AAAM</TransmissionReference>
</TransmissionHeader>
<Order>
<CustomerPoNumber>0137545504-TEST</CustomerPoNumber>
<SalesOrder>516108</SalesOrder>
<OrderActionType>A</OrderActionType>
</Order>
</SalesOrders>
I need to use the XML In to create a new XML as per the following
output, (using the Sales Order Number Value from XML IN):
<?xml version="1.0" encoding="Windows-1252"?>
<Query xmlns:xsd="http://www.w3.org/2001/XMLSchema-instance"
xsd:noNamespaceSchemaLocation="SORQOD.XSD">
<Option>
<DocumentType>O</DocumentType>
</Option>
<Filter>
<SalesOrder FilterType="A" FilterValue="516108"/>
</Filter>
</Query>
This is my XSL (bare in mind this is all new learning for me !!)
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
version="1.0">
<xsl:template match="/">
<Query xmlns:xsd="http://www.w3.org/2001/XMLSchema-instance"
xsd:noNamespaceSchemaLocation="SORQOD.XSD">
<Option>
<DocumentType>O</DocumentType>
</Option>
<xsl:apply-templates select="Order"/>
</Query>
</xsl:template>
<xsl:template match="Order">
<Filter>
<xsl:element name="SalesOrder">
<xsl:attribute name="FilterType">A</xsl:attribute>
<xsl:attribute name="FilterValue"><xsl:copy-of select="SalesOrder"/
></xsl:attribute>
</xsl:element>
</Filter>
</xsl:template>
</xsl:stylesheet>
I keep getting invalidation error : The element 'template' in
namespace "http://www.w3.org/1999/XSL/Transform" has invalid child
element 'Query'.
Any help on this would be appreciated.
Regards
Az
| ||||||
| Company | Legal | Press | Partners | Careers | Sitemap | Contact Us | Altova Blog | Mobile | Full Site | |||
|
