Hi Everyone,
I'm trying to write an application in VB6 to export some XML using MS XML DOM version 2. I'm trying to get output the following line but I am having some trouble...
<!DOCTYPE NMLoader SYSTEM "standardX05.dtd">
within the structure...
<?xml version="1.0"?>
<!DOCTYPE NMLoader SYSTEM "standardX05.dtd">
<NMLoader>
<ele1>1</ele1>
<ele2>2</ele2>
</NMloader>
I've tried using the createCDataSection Method but it puts "[" around the tag and only appears to work within the <NMLoader> tags anyway, not at the start of the document. I've tried using the createTextNode method too but to no avail.
The nature of this post stems from a problem I've had trying to write the !DOCTYPE element when creating XML files "on the fly". This is because the DOCTYPE element is apparently read only. A few posts on the net mention that the only way to get around this problem is to first loadXML and then append the necessary DOCTYPE element.
I have attempted to load in the XML using the loadXML method. But I can't seem to append a DOCTYPE, I'm stuck again.
There's an IXMLDOMDocumentType object that I believe to be the DOCTYPE object that I need, I'm just struggling to see how and where I can append it.
The first question really is: Is this the way to be solving this problem? And if not, what is the best method of overcoming it? Installing a later version of ms xml?
The second question is: If this is the way to solve the problem, could you please post some code to help me out! I'm really struggling!
Many Thanks
Ynyr
I'm trying to write an application in VB6 to export some XML using MS XML DOM version 2. I'm trying to get output the following line but I am having some trouble...
<!DOCTYPE NMLoader SYSTEM "standardX05.dtd">
within the structure...
<?xml version="1.0"?>
<!DOCTYPE NMLoader SYSTEM "standardX05.dtd">
<NMLoader>
<ele1>1</ele1>
<ele2>2</ele2>
</NMloader>
I've tried using the createCDataSection Method but it puts "[" around the tag and only appears to work within the <NMLoader> tags anyway, not at the start of the document. I've tried using the createTextNode method too but to no avail.
The nature of this post stems from a problem I've had trying to write the !DOCTYPE element when creating XML files "on the fly". This is because the DOCTYPE element is apparently read only. A few posts on the net mention that the only way to get around this problem is to first loadXML and then append the necessary DOCTYPE element.
I have attempted to load in the XML using the loadXML method. But I can't seem to append a DOCTYPE, I'm stuck again.
There's an IXMLDOMDocumentType object that I believe to be the DOCTYPE object that I need, I'm just struggling to see how and where I can append it.
The first question really is: Is this the way to be solving this problem? And if not, what is the best method of overcoming it? Installing a later version of ms xml?
The second question is: If this is the way to solve the problem, could you please post some code to help me out! I'm really struggling!
Many Thanks
Ynyr