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

Re: force apostrophed attribute values

Subject: Re: force apostrophed attribute values
From: Abel Online <abel.online@xxxxxxxxx>
Date: Tue, 29 Aug 2006 12:07:59 +0200
xslt filter attribute value
The short answer: no.

But I can think of several tricks you might pull off to get this done anyway. But that will not be regular usage of XSLT (here's some but not all info, hidden in another subject: http://www.dpawson.co.uk/xsl/sect2/N1553.html#d2116e259)

Trick 1: use a filter after parsing XSLT. This filter should be smart enough to know to find attribute values and fieldnames, dealing correctly with whitespace and escaping any single quotes inside the attribute value.

Trick 2: same as trick one, but now you use XSLT for it. In this second phase (the filter phase), you open the result of your transformation using unparsed-text(yourdoc.xml). You output it as text. You parse each line in yourdoc.xml as if it were a regular text file and use the regular expression matching mechanism of XSLT to do the work for you. This requires XSLT 2.0.

Perhaps some processors have extension methods that you can use to force single quotes on output, but I don't know of any.

Abel Braaksma

Frank Marent wrote:

is there a way in xslt to force the creation of xml files with apostrophed attributes instead of quotation marked values?

not: <Element attribute="value">

but: <Element attribute='value'>

the reason why we need apostrophes is that a silly application we're using seems to accept only apostrophed values and quotation marks are causing troubles.

thanks to all


Current Thread


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.
First Name
Last Name
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.