[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [syndication] XML validation with XSD
I'd greatly prefer using a parser that stopped and demanded things get fixed
before proceeding. Otherwise you're off sliding down a slipperly slope of
trying to recurse over/around what might be even greater amounts of invalid XML.
Trying to code around those things is a nightmare. Granted, I could see some
cases where some folks might really think this is a good idea. I'd suggest they
boot the questionable XML out of the sequence and handle in their own routines
to try. Perhaps they could try and clean it up following what they consider to
be 'reasonable' mistakes. Then push that cleaned data back into their regular
stream.
To try to brute force your way around bad XML is a bad idea. And I've seen from
Syndic8 most of the developers are willing to actually fix their abberant output
routines. All is takes is asking them. Most of the time they really have no
idea the mistake existed. Nor were they aware of people wanting to "do more"
with the data. They're often quite pleased to get feedback and are quite quick
to fix errors. This is a hell of a lot better than assuming they'll never fix
it and driving yourself insane trying to work around them.
-Bill
> I can't find anything that says this in the spec [1] - do you have a ref?
> This would certainly be expected behaviour if the XML wasn't well-formed (no
> way of telling what was meant to come next). But Kanimozhi's data is well
> formed, and I think it probably should be possible to report more than a
> terminatin validation error. I haven't personally done much with XSD
> validation, but I'm guessing that even if existing tools don't support full
> error reporting then there are at least two (hacky) possibilities - dive
> into the parser's source and get rid of all the "System.exit()"s or
> whatever; or write a series of schema, separating out the constraints - run
> them in different orders (sounds a bit unlikely, but I think it might just
> work).
>
> Cheers,
> Danny.
>
> [1] http://www.w3.org/TR/REC-xml#proc-types
>
> >On Thu, 14 Nov 2002, skanimozhi_sel wrote:
> >
> >> hi,
> >> we at present doing an application which requires the validation
> >> of well formed XML file across an XSD.But the problem we faced is,all
> >> the parsers stopped parsing when it encounterd the first error in the
> >> XML file .Our requirement is we want the xml file to be parsed fully
> >> and get all he errors in that file.Can anybody help me
> >>
> >> Thanks
> >> Kanimozhi
> >>
> >>
> >>
> >>
> >>
> >> Your use of Yahoo! Groups is subject to
> >http://docs.yahoo.com/info/terms/
> >>
> >>
> >>
> >
> >
> >
> >
> >Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
> >
> >
>
>
>
>
> Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
>