[xstream-user] Custom Doctype Validation

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

[xstream-user] Custom Doctype Validation

Szilard Varga

Hi,

 

I want to validate an xml file regardless of what the doctype in that xml file is, and I want to use my own dtd.

 

BufferedReader reader = new BufferedReader(new InputStreamReader(in));

MyClass myObject = (MyClass) xStream.fromXML(reader);

 

When the .fromXML method is called xStream is searching for the dtd file specified in <!DOCTYPE element. What I want to do is to ignore the dtd path from that element and use a default one from my code.

 

Is there possible to ignore the Doctype element from the xml file, and set a default one (a path to a dtd file from am configuration file)?

 

Thank you.