Hi,
how can I read the xml with a different order of complex elements?
I have schema:
<xsd:element name="sheet">
<xsd:complexType>
<xsd:all> <- this is a key element of the problem
<xsd:element type="xsd:string" name="name"/>
<xsd:element type="xsd:string" name="salesman"/>
<xsd:element type="xsd:string" name="customer"/>
</xsd:all>
</xsd:complexType>
</xsd:element>
and in XML files:
<sheet>
<name>Value</name>
<salesman>Value</salesman>
<customer>Value</customer>
</sheet>
and sometimes:
<sheet>
<name>Value</name>
<customer>Value</customer>
<salesman>Value</salesman>
</sheet>
0
Comments
I suggest to use a transform in order to fix up the element order before feeding the document to the XMLport. I don't think XMLport can handle it otherwise.
Of course you could also use the .NET Classes (System.Xml) right away to parse the xml file. You can use XPath do access the nodes directly in the order you need.
You can find some examples in the Codeunit 7701"ADCS Communication" if youre not sure how to use the Codeunit / Classes.
Have your stylesheet.xsl look like this:
Cheers
edit: there's a rogue semi colon appearing after the URL in the XML namespace. You won't need that.