Suppose I have two XML files.
First XML File:
<?xml version="1.0"?>
<AccessRequest xml:lang="en-US">
<AccessLicenseNumber>Your_License</AccessLicenseNumber>
<UserId>Your_ID</UserId>
<Password>Your_Password</Password>
</AccessRequest>
Second XML File:
<?xml version="1.0"?>
<RatingServiceSelectionRequest xml:lang="en-US">
<CustomerContext>Rating and Service</CustomerContext>
</RatingServiceSelectionRequest>
Now, when I merge them two, i want the output like this:
<?xml version="1.0"?>
<AccessRequest xml:lang="en-US">
<AccessLicenseNumber>Your_License</AccessLicenseNumber>
<UserId>Your_ID</UserId>
<Password>Your_Password</Password>
</AccessRequest>
<?xml version="1.0"?>
<RatingServiceSelectionRequest xml:lang="en-US">
<CustomerContext>Rating and Service</CustomerContext>
</RatingServiceSelectionRequest>
When I am merging these two files using the usual methods found on google, the version number etc are being eaten up and RatingServiceSelectionRequest node ends up being part of AccessRequest node, which is clearly not what I want.
How do I approach this in C#.Net?
Note: The reason I want it like that is because this API I'm using is requesting it like that, so no two ways about it I guess.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…