Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

DOM Question: Adding DocumentType to a DOM structure

Status
Not open for further replies.

CubeE101

Programmer
Joined
Nov 19, 2002
Messages
1,492
Location
US
When creating a DOM file programmatically...

such as with VB...

how do you add these 2 lines to the top of the XML file when you save it to a .XML file from memory...

<?xml version="1.0" ?>
<!DOCTYPE MyDTD SYSTEM 'MyDTD.dtd'>


...???

When I export the structure, It looks like this...
Code:
<TEST>
  <OBJ ID=" 0">
    <Name>Object1</Name>
  </OBJ>
  <OBJ ID=" 1">
    <Name>Object2</Name>
  </OBJ>
  <OBJ ID=" 2">
    <Name>Object3</Name>
  </OBJ>
</TEST>

How can you make it look like this?
Code:
[b]<?xml version="1.0" ?>
<!DOCTYPE MyDTD SYSTEM 'MyDTD.dtd'>[/b]
<TEST>
  <OBJ ID=" 0">
    <Name>Object1</Name>
  </OBJ>
  <OBJ ID=" 1">
    <Name>Object2</Name>
  </OBJ>
  <OBJ ID=" 2">
    <Name>Object3</Name>
  </OBJ>
</TEST>

In the DOMDocument Object, there is a doctype property...
And there is a IXMLDOMDocumentType class, but I don't know how (or if you need to) use them...???

Thanks in advance,
Josh

Have Fun, Be Young... Code BASIC
-Josh
cubee101.gif


PROGRAMMER: (n) Red-eyed, mumbling mammal capable of conversing with inanimate objects.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top