A
alfienorks
I'm new to XML document creation with Java and I've got to admit I'm
struggling.
I need to generate an XML file structure in Java (no content - just the
structure) based on an array of parameters as follows:
XMLNodesArray[] = { '/a/b/c', '/a/b/d', '/z/y/x', '/z/y/a' };
and what I need is an (string) output of:
<root>
<a>
<b>
<c></c>
<d></d>
</b>
</a>
<z>
<y>
<x></x>
<a></a>
</y>
</z>
</root>
Firstly is there a quick way of converting these slash delimited tokens
into XML
Alternatively is there a Java-XML-Document-Creation-101 guide anywhere
that might tell me how to navigate a growing XML tree and insert
missing tokens as I trawl through the XMLNodesArray?
Any thoughts - or guidance on XML document generation coding?
many thanks,
Al
struggling.
I need to generate an XML file structure in Java (no content - just the
structure) based on an array of parameters as follows:
XMLNodesArray[] = { '/a/b/c', '/a/b/d', '/z/y/x', '/z/y/a' };
and what I need is an (string) output of:
<root>
<a>
<b>
<c></c>
<d></d>
</b>
</a>
<z>
<y>
<x></x>
<a></a>
</y>
</z>
</root>
Firstly is there a quick way of converting these slash delimited tokens
into XML
Alternatively is there a Java-XML-Document-Creation-101 guide anywhere
that might tell me how to navigate a growing XML tree and insert
missing tokens as I trawl through the XMLNodesArray?
Any thoughts - or guidance on XML document generation coding?
many thanks,
Al