By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,028 Members | 1,869 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,028 IT Pros & Developers. It's quick & easy.

Finding the correct location for inserting node (Repost)

P: n/a

Say for example I have this simple XSD:

<xs:schema xmlns:xs=""
xmlns="" elementFormDefault="qualified">
<xs:element name="purchaseOrder" type="PurchaseOrderType"/>
<xs:element name="comment" type="xs:string"/>

<xs:complexType name="PurchaseOrderType">
<xs:element name="shipTo" type="xs:string"/>
<xs:element name="billTo" type="xs:string"/>
<xs:element name="comment" type="xs:string" minOccurs="0"/>
<xs:element name="itemId" type="xs:string"/>
<xs:attribute name="orderDate" type="xs:date"/>

Now for example I have the an XML instance of the above XSD but without the
"comment" node, however at a future date someone may need to insert the
comment node. If I don't follow the XSD I can simply append the comment node
in the purchaseOrder node, but that will be wrong because it has to be in
sequence which is after the billTo and before itemId.

How can I correctly find the location of the insert node? This problem is
worsen with the fact that there are several XSDs that I need to handle so
somehow I need to be able to do this in a generic way.


Victor Hadianto
Nov 12 '05 #1
Share this question for a faster answer!
Share on Google+

This discussion thread is closed

Replies have been disabled for this discussion.