Domanda

I am trying to find a recursive DTD and an XML data file that is valid with that. Are the existing validators able to validate a recursive DTD? I want to be able to execute XQueries after to that XML file.

È stato utile?

Soluzione

If by "recursive DTD" you mean a DTD which includes at least one element that can occur as its own descendant, then examples include the HTML DTD (div, ul, ol, and li are all recursive in this sense; so is span), TEI, DocBook, JATS, and any number of other DTDs. Yes, any validating XML parser is able to validate against such DTDs.

If you need a simple example for testing, you can use this DTD and document:

<!DOCTYPE e [
<!ELEMENT e (#PCDATA | e)* >
]>
<e>
This is a test document. 
In it, the <e>e</e> element is allowed
to test <e>within <e>itself</e></e>.
</e>

If by "recursive DTD" you mean something else, then ... what do you mean?

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top