Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


Re: XML parse validation

From: Peter Flynn <peter.nosp@-.--------.-->
To: 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/





transparent
Print
Mail
Like It
Disclaimer
.

These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on www.altova.com/list/index.html. Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.

.
.

transparent

transparent