You are viewing a plain text version of this content. The canonical link for it is here.
Posted to c-users@xerces.apache.org by Tristan Mehamli <tr...@tcelectronic.com> on 2005/06/10 12:17:55 UTC

XML Generation with a DOM tree

Hi,
I want to create a DOM tree in order to generate an XML file with 
DOMWriter.

This is the an example of the document I want to generate:
<?xml version="1.0" Encoding="UTF-8" ?>
<!-- A comment-->
 <root xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:noNamespaceSchemaLocation="myschema.xsd">
    <tag1>
      <tag2>its value</tag2>
      <tag3 atName="value" atName="value"></tag3>
      <tag4>
        <tag5>
          <tag6>its value</tag6>
        </tag5>
      </tag4>
    </tag1>
</root>

Can someone give me an example of code to generate a DOM tree that 
describes this document?

Is there a way to generate a DOM tree from an XML schema and just fill 
its nodes?

Thanks for all answers.

-- 
Tristan Mehamli
Software Engineer
TC Electronic A/S