I’m having trouble finding out the schema location from the XML using the xstream.
<order xmlns="http://www.mycompany.com/xml/myproject"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="test.xsd">
For validation of the XML, with the schema, I’m using the javax :
Validator validator = schema.newValidator();
validator.validate(source);
For now I’ve hardcoded the schema name as “test.xsd”, but I hope that is just a temporary fix.
XStream isn’t namespace-aware by default, though I think you can enable that. You should be able to find details on the website. To just get access to the namespace, though, you can treat it like any other attribute: