Hi,

I want to insert an element in an existing XML file. Since the XML file is attached to a DTD, I have to insert the element at the correct position. The problem is that most elements are optional, so I'm not sure that they will be present in the XML file. How can I insert the new element at the correct position?

example, say that the DTD has the following declaration:
<!ELEMENT alphabet (a?,b?,c?,d?,....,x?,y?,z?)>

I have the following XML:
<alphabet>
   <a/>
   <d/>
   <x/>
</alphabet>

I want to insert the <f /> element, how can I accomplish this when I don't know which elements are present in the XML file ?

regards,
Maarten

Reply via email to