tcl tdom parsing failed due to special charecters in xml tags -


i trying remove special characters existed in xml tags, can use regsubs or string map function eliminate xml special chars in tagged text, lengthy/time consuming process because our log file huge around ~25 mb.

is there special method/tip eliminate special chars in xml tags

here sample looks like

<?xml version="1.0" encoding="utf-8" standalone="no" ?> <customers>     <customer>         <customerid>blaus</customerid>         <companyname>blauer see delikatessen</companyname>         <contactname>hanna moos</contactname>         **<region>test<ing</region>**     </customer>     <customer>         <customerid>splir</customerid>         <companyname>split rail beer & ale</companyname>         <contactname>art raunschweiger</contactname>         <region>wy</region>     </customer> </customers> 

thanks malli

if mean ampersand, not in tag, in text appears between 2 tags.

the reason people choose use xml data interchange it's standard, , there's lots of software around handle it. advantage disappears entirely if try use that's xml not quite.

by far best solution fix program generating not-quite-xml.

if can't that, you'll have try , repair it, , way of doing depends on nature of damage. example use language supports regular expressions replace ampersand in sequence of characters ampersand isn't followed either '#' or sequence of alphanumerics , semicolon, "&amp;". however, if data contains error, means it's been generated carelessly, , contain number of other errors well.


Comments

Popular posts from this blog

javascript - Google App Script ContentService downloadAsFile not working -

javascript - IIFE: var vs this - is there any difference? -

r - Grow a ffdf data frame on disk gradually -