Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


Struggling to debug XSL..Help appreciated

From: Az <az.yasin@-----.--->
To: 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


transparent
Print
Mail
Like It
Disclaimer
.

These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on www.altova.com/list/index.html. Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.

.
.

transparent

transparent