Can someone help me parse a XML string using SAX parser and then validate the same against the XSD defined'

I have the program that works when I pass the input xml and xsd as arguments but my requirement involves passing a input string containing the target XML and the XSD as arguments

I am getting the below error when parsing the XML string using DocumentBuilder

[Fatal Error] BlendedProfile.xsd:2:6: The processing instruction target matching "[xX][mM][lL]" is not allowed.
The error is The processing instruction target matching "[xX][mM][lL]" is not allowed.

Recommended Answers

All 2 Replies

thrusai,

Error is

The processing instruction target matching "[xX][mM][lL]" is not allowed.

Are you sure that the XSD is a valid xml document?
Please post the XML and XSD document : If XSD and XML are very large (more than 20 lines) then zip it and attach with your reply.

Both are valid documents .I am sure on that.I opened both the XSD and XML in the IE and found that they are well formed

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.