Hi there,
I have a little application in VB 6. Iam trying to create a XML file and assign the DTD to validate this xml file.
My code is this:
Private Sub cmdCreateXMLFile_Click()
Dim xml As MSXML2.DOMDocument
Dim root As IXMLDOMNode
Dim tmpNode As IXMLDOMNode
Dim tmpAttr As IXMLDOMAttribute
Dim tmpProcessingInstruction As IXMLDOMProcessingInstruction
Set xml = New MSXML2.DOMDocument
Set tmpProcessingInstruction = xml.createProcessingInstruction("xml", "version=""1.0"" encoding=""UTF-8"""
Set root = xml.createNode(NODE_ELEMENT, "rootNode", ""
xml.insertBefore tmpProcessingInstruction, xml.childNodes.Item(0)
Set tmpNode = xml.createNode(NODE_ELEMENT, "Node01", ""
tmpNode.appendChild xml.createTextNode("2800101"
root.appendChild tmpNode
............
............
End Sub
Here no problem, but I need to add this line :
<!DOCTYPE rootNode SYSTEM "mydtdfile.dtd"> to the DOM tree. I have been read about this and I found that some properties referent to the Doctype are read only.
I want to create a XML file like this:
This file is created with a VB application, then it will be read by other VB application, so this application will validate the XML file with the mydtdfile.dtd. You must assume that the second application have the DTD file to validate the XML file.
Someone can help me? or have other suggestion?
What about Schemas and VB?
Thanks in advance,
JCarlos Silva
jcarlos@intelimedic.com
________________________________
Juan Carlos Silva
Software Developer
I have a little application in VB 6. Iam trying to create a XML file and assign the DTD to validate this xml file.
My code is this:
Private Sub cmdCreateXMLFile_Click()
Dim xml As MSXML2.DOMDocument
Dim root As IXMLDOMNode
Dim tmpNode As IXMLDOMNode
Dim tmpAttr As IXMLDOMAttribute
Dim tmpProcessingInstruction As IXMLDOMProcessingInstruction
Set xml = New MSXML2.DOMDocument
Set tmpProcessingInstruction = xml.createProcessingInstruction("xml", "version=""1.0"" encoding=""UTF-8"""
Set root = xml.createNode(NODE_ELEMENT, "rootNode", ""
xml.insertBefore tmpProcessingInstruction, xml.childNodes.Item(0)
Set tmpNode = xml.createNode(NODE_ELEMENT, "Node01", ""
tmpNode.appendChild xml.createTextNode("2800101"
root.appendChild tmpNode
............
............
End Sub
Here no problem, but I need to add this line :
<!DOCTYPE rootNode SYSTEM "mydtdfile.dtd"> to the DOM tree. I have been read about this and I found that some properties referent to the Doctype are read only.
I want to create a XML file like this:
Code:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE Replica SYSTEM "mydtdfile.dtd">
<rootNode>
..
..
..
</rootNode>
This file is created with a VB application, then it will be read by other VB application, so this application will validate the XML file with the mydtdfile.dtd. You must assume that the second application have the DTD file to validate the XML file.
Someone can help me? or have other suggestion?
What about Schemas and VB?
Thanks in advance,
JCarlos Silva
jcarlos@intelimedic.com
________________________________
Juan Carlos Silva
Software Developer