jo_rocks 2 Posted April 15, 2012 Report Share Posted April 15, 2012 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! 1 Quote Link to post Share on other sites
Ingolme 1,019 Posted April 15, 2012 Report Share Posted April 15, 2012 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)> 1 Quote Link to post Share on other sites
jo_rocks 2 Posted April 15, 2012 Author Report Share Posted April 15, 2012 Thanks a lot Foxy Mod. It worked!!! Quote Link to post Share on other sites
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.