Is there a way to define the SchemaLocation using the java SimpleXML library?
i followed the API spec here by manually trying to add it as a namespace from http://simple.sourceforge.net/download/stream/doc/javadoc/
Using:
@NamespaceList({
@Namespace(reference="http://hello/stock", prefix="stk"),
@Namespace(reference="http://hello/basket", prefix="bsk"),
@Namespace(reference="http://hello/location", prefix="loc"),
@Namespace(reference="http://hello/common", prefix="cmn"),
@Namespace(reference="schemaLocation:http://hello/stock stock-v1.xsd", prefix="xsi"),
})
public class Response{
//
}
but whenever i try parsing an XML file that will get converted into this POJO class, it says it cannot find the SchemaLocation?
Error below:
org.simpleframework.xml.core.AttributeException: Attribute 'schemaLocation' does not have a match in class com.hello.model.Response at line 1
the xml i am trying to parse is this:
<Stock
xmlns:stk="hello/stock"
xmlns:bsk="hello/basket"
xmlns:loc="hello/location"
xmlns:cmn="hello/common"
xsi:schemaLocation="hello/stock stock-v1.xsd"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
uri="http://hello/stock/"
version="1"
id=""
brand="ford">
..xml data here
</Stock>
Thanks