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

RE: character entities

Subject: RE: character entities
From: "Edward Bryant" <bryant_edward@xxxxxxxxxxx>
Date: Thu, 28 Apr 2005 15:22:24 -0500
xslt ampersand
The &amp; represents an ampersand; it's seen within the XSLT stylesheet as a single character (for example, string-length() is 1); but if you serialize the result as XML or HTML then it will be >output as &amp; because that's how an ampersand is represented in XML and HTML.

I get that the "&amp;" is the unicode for an ampersand, but what do you mean by "serialize" ?


So, if a character reference is in an XML source file it will show up as a reference in an XHTML output file (I got the impression from other posts that the XSLT would change the reference into the actual character)?

You can't create character references in an XSLT template.

So what is the accepted way to add character references to the output? Would I have to run some kind of find-and-replace script after the XSLT transformation? What do other people do?


I came across "xmlchar" at XML.com. I didn't what to use it, but it changes an element into a character reference. Looking at their stylesheets, I don't understand how that works but my attempt to change <quote></quote> into the #8220 and #8221 entities won't?

That's not the output of the stylesheet (or even of the serializer): that's the output of the software that you're using to display the output of the serializer on your screen.

Sorry, I am an idiot, if I would have checked the XHTML output in notepad I would have noticed that.


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.