Altova Mailing List Archives>Archive Index >comp.text.xml Archive Home >Recent entries >Thread Prev - Re: XML parse validation [Thread Next] Re: XML parse validationTo: NULL Date: 1/12/2008 3:42:00 PM On Tue, 08 Jan 2008 22:29:35 -0800, sarosh.shirazi wrote: [snip] > To Joseph: It's part of the requirement that such characters would come > up...so i'll have to bear the heck :) Then as Joseph said, your file is not an XML file, so you must use non-XML software to process it. > Is there any way other than ascii preprocessing or preparsing. Not as far as I am aware. > I know > the tags which shall have these chars. Can i somehow have these > particular tags and their data simply ignored in XML? No, because (as already explained) your file is not an XML file. You cannot use XML software and methods on non-XML files in this way (apart from the method Martin suggested). If you can fix it by exchanging the invalid characters on a 1:1 basis, then just use a simple inline filter like tr, which is extremely fast. Alternatively, change all the invalid characters to some form of markup, eg <junk char="0"/> so that they can be transformed back again after processing. A stream editor like sed is very fast for this kind of thing. And tell your data source that their data will process more easily if they generate well-formed XML. A "requirement" like the one you mention is simply evidence of bad planning on their part. ///Peter -- XML FAQ: http://xml.silmaril.ie/ | ||||||
| Company | Legal | Press | Partners | Careers | Sitemap | Contact Us | Altova Blog | Mobile | Full Site | |||
|
