Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


Nodes with the same name in one XML doc

From: engwar <engwar1@-----.--->
To: NULL
Date: 11/5/2007 9:26:00 PM

How do you created a DTD that will allow for node with the same name
at different places in the XML document?

Here's my XML

<parentNode>
	<someNode>
		<myNode/>
	</someNode>
</parentNode>
<parentNode>
	<someOtherNode>
		<myNode/>
	</someNode>
</parentNode>

Here's my dtd

<!ELEMENT parentNode (someNode|someOtherNode)
	<!ELEMENT someNode (myNode)>
		<!ELEMENT myNode (#PCDATA)>
	<!ELEMENT someOtherNode (myNode)>
		<!ELEMENT myNode (#PCDATA)>

The problem is that if both of these nodes can have a myNode child
node then the application I'm using to validate my XML (Oxygen XML
editor) says that my Element type "myNode" must not be declared more
than once.

I'm new to XML so this is probably easy. Is my dtd really incorrect
here?

Thanks.



transparent
Print
Mail
Like It
Disclaimer
.

These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on www.altova.com/list/index.html. Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.

.
.

transparent

transparent