[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: double quotes in attributes

Subject: Re: double quotes in attributes
From: "Thomas B. Passin" <tpassin@xxxxxxxxxxxx>
Date: Tue, 27 Aug 2002 17:38:27 -0400
xml double quote problem
[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


Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.