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

RE: Assign the xsl:copy-of output to the value attrib

Subject: RE: Assign the xsl:copy-of output to the value attribute of checkbox input xsl:element OR copying a node as a xml string to value of a geckbox
From: <Jarno.Elovirta@xxxxxxxxx>
Date: Mon, 31 Jan 2005 10:31:28 +0200
xslt escape output
Hi,

snip

> Expected xslt output:
> <html xmlns:xhtml="http://www.w3.org/1999/xhtml">
> <body>
> <script language="Javascript">
> function msg(val)
> {
>   alert(val);
> }
> </script>
> <form name="f" onsubmit="return false;">
> <div>
> NAME: Bugs &lt; Bunny<br>
> DOB: 03/21/1970<br>
> AGE: 31<br>
> ADDRESS: 4895 Wabbit Hole Road<br>
> PHONE: 865-111-1111<br>
> <input name="lastEvent" type="checkbox" value="
> <programmer>

You want to write elements into an attribute value. Why? Why not escaped
markup? This is not well-formed XML and cannot be achived with vanilla XSLT.
Either you output

<input name="lastEvent" type="checkbox" value="
&lt;programmer&gt;
...

by using a XML serializer written in XSLT (e.g.
<http://www.xmlportfolio.com/xml-to-string/>), or if you absolutely need

<input name="lastEvent" type="checkbox" value="
<programmer>
...

Then use the above method in conjunction with a result tree serializer that
doesn't escape the output for that particular element. IIRC, Saxon also has an
extension to use DOE in xsl:attribute.

Cheers,

Jarno - SITD: Venom

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.