Jump to content

jo_rocks

Recommended Posts

Hi all, I have the follow problem, I have an xml file that have this, this xml file can't be changed:

<root>		  <title>Hello</title>			<content>				  <title>Weekend</title>			</content></root>

I must have a DTD that must validate the xml, now the problem is that I have two nodes with the same name title, this is my proposal, but it doesn't pass the validation, because I can't declare the same name more than once:

<!ELEMENT root (title, content)><!ELEMENT title (#PCDATA)><!ELEMENT content (title)><!ELEMENT title (#PCDATA)>

This is a school project, and I am obligated to use a dtd to validate an xml. Thanks all!

Link to comment
Share on other sites

You don't need to define the same element twice. If you want an element to contain itself, I think this works:

<!ELEMENT title (title|#PCDATA)>

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...