S
srujana
Hi
I am validating an xml document against schema .
when i am passing the xml file location as an input to the parse method
String XmlDocumentUrl="E:/books.xml";
parser.parse(XmlDocumentUrl);
it is working fine.
but how can i do that if i need to pass a xml document content instead
of the file location.
String XmlDocumentUrl="E:/books.xml";
InputSource inputSource = new InputSource(new
ByteArrayInputStream(XmlDocumentUrl.getBytes()));
parser.parse(inputSource);
The error is Cannot find the declaration of element 'Books'
'Books' is my root element.
Any help is greatly appreciated.
Thanks.
I am validating an xml document against schema .
when i am passing the xml file location as an input to the parse method
String XmlDocumentUrl="E:/books.xml";
parser.parse(XmlDocumentUrl);
it is working fine.
but how can i do that if i need to pass a xml document content instead
of the file location.
String XmlDocumentUrl="E:/books.xml";
InputSource inputSource = new InputSource(new
ByteArrayInputStream(XmlDocumentUrl.getBytes()));
parser.parse(inputSource);
The error is Cannot find the declaration of element 'Books'
'Books' is my root element.
Any help is greatly appreciated.
Thanks.