Problem with ValidationEventHandler

  • Thread starter Thread starter Konrad
  • Start date Start date
K

Konrad

Hi
I've got a xml file and xsd with only one namespace -
xmlns:media="http://search.yahoo.com/mrss". When I'm getting the rss
feed for example from Youtube there're also others namespaces such as
xmlns:atom or xmlns:yt. When I'm trying to validate this Xml with my
xsd the validationeventhandler show me only the first error. But what
when we got xml file like:

<channel>
<atom:id> Ident </atom:id>
<atom:name> Name </atom:name>
.....
</channel>

The Validator show me the atom:id is not in my xsd file but there's
nothing about next wrong items such as atom:name.
What should I do to change this to show me all the errors??

Thanks
kplazinski
 
Hi
I've got a xml file and xsd with only one namespace -
xmlns:media="http://search.yahoo.com/mrss". When I'm getting the rss
feed for example from Youtube there're also others namespaces such as
xmlns:atom or xmlns:yt. When I'm trying to validate this Xml with my
xsd the validationeventhandler show me only the first error. But what
when we got xml file like:

<channel>
<atom:id> Ident </atom:id>
<atom:name> Name </atom:name>
....
</channel>

The Validator show me the atom:id is not in my xsd file but there's
nothing about next wrong items such as atom:name.
What should I do to change this to show me all the errors??

You should have a look at XmlSchemaValidator class. It allows you to
validate XML node by node, and to skip over nodes when you want (e.g.
when the node itself didn't validate).
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top