Re: double quotes in attributes
[yan bai] > I have some xml files which is produced by server. > Since xml files are produced from many sources, some > of them contains double quotes in attribute values. > e.g. > <info seq="21" > bind="S000003" > text="Alarm Status 00000100 stream-id="0 > LowAlarm"" /> > I need to transform the xml file which contains > attribute values very similar to the above example > into another xml file by using xsl. > > How should I handle the double quote problem here in > xsl? If the "xml" file is really exactly as you have copied it here, it is not well-formed xml, because in xml the double quotes cannot be nested like that. No true xml processor (which includes xslt processors) can handle the data. Therefore you must fix the data first, before sending to an xml processor. If __you__ are producing the "xml" files from those many sources, you need to change your producing software, otherwise work up some code in Python, perl, awk, or java, etc., whichever you can use the easiest, and convert these files into well-formed xml. Cheers, Tom P XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
PURCHASE STYLUS STUDIO ONLINE TODAY!
Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!
Download The World's Best XML IDE!
Accelerate XML development with our award-winning XML IDE - Download a free trial today!
Subscribe in XML format