Im parsing XML documents with java. Every document has root tag (it is a string) and a number of tags with text(unknown number) for example(check code in codebox). <AnyStrYouwant>
tags have a string of characters in its body.
<anyRoot>
<AnyStrYouwant1>anyTextYouWant1</AnyStrYouwant1>
<AnyStrYouwant2>anyTextYouWant2</AnyStrYouwant2>
...
</anyRoot>
How programically(in java) chek if some file suits this structure. I can parse XML, I know that there is DTD(for example) that can check XML file with known format (tag names and content). What shall I use in this case?
PS: some people advice me to use XSD. But if I want to validate elements I need to know root element name. I dont know root element name (every file has own root element).