Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Verifying the XML structure
Message
From
03/01/2006 14:33:43
 
 
To
All
General information
Forum:
ASP.NET
Category:
XML
Title:
Verifying the XML structure
Miscellaneous
Thread ID:
01082781
Message ID:
01082781
Views:
58
On a specific XML file I have to deal with, I need to add an element to a specific node branch. The XML structure looks like this:
<Root>
  <Item1>Value</Item1>
  <Item2>Value</Item2>
  <DocAttachment>
    <AttachmentType>PI</AttachmentType> 
    <AttachmentMemo>Print Image</AttachmentMemo> 
    <AttachmentFileType>Text</AttachmentFileType> 
    <AttachmentFileName>report80col.txt</AttachmentFileName> 
    <EmbeddedAttachmentType>SGVsb..Base64..G8sIHRoaXM</EmbeddedAttachmentType> 
  </DocAttachment>
  <DocAttachment>
    <AttachmentType>EN</AttachmentType> 
    <AttachmentMemo>Estimator Notes</AttachmentMemo> 
    <AttachmentFileType>Text</AttachmentFileType> 
    <AttachmentFileName>estnotes.txt</AttachmentFileName> 
    <EmbeddedAttachmentType>SGVsb..Base64..G8sIHRoaXM</EmbeddedAttachmentType> 
  </DocAttachment>
</Root>
The element I need to add is the embeded attachment. This should be an element that is created under Root/DocAttachment/Content. On the version I have right now, I already did it. Basically, in order to reference a unique node, I added an additional branch under the Root for all attachments and added another branch to identify each attachment. So, in the first version I did, I have this specific node Root/Attachment/Report/DocAttachment/Content. As each attachment can be qualified with a fully node syntax, it is easy for me to add the element at the specific location I want in the XML.

But, in the original XML that I obtained, I cannot do that as there is no way for me to fully qualify the node I need to add the element under as first of all, there isn't an element that is the header of all attachments and there isn't a unique element that defines each attachment. So, my question is, assuming such XML file, how someone could be able to add a specific element under a specific attachment if it is not fully qualified? To me, this looks like a bad XML structure. Is it?
Michel Fournier
Level Extreme Inc.
Designer, architect, owner of the Level Extreme Platform
Subscribe to the site at https://www.levelextreme.com/Home/DataEntry?Activator=55&NoStore=303
Subscription benefits https://www.levelextreme.com/Home/ViewPage?Activator=7&ID=52
Next
Reply
Map
View

Click here to load this message in the networking platform