Re: [xsl] Ignoring specific characters like > in the XML while doing XSLT

Subject: Re: [xsl] Ignoring specific characters like > in the XML while doing XSLT
From: Wendell Piez <wapiez@xxxxxxxxxxxxxxxx>
Date: Thu, 16 Oct 2003 15:58:48 -0400

The character sequence "& g t ;" (no spaces), by definition, is an entity reference in XML, and by definition it represents the character ">".

(Hey, where's Dave C or Mike B? This thing is an entity reference that happens to be built in, not a character reference, right?)

When you say "I am getting text output" are you trying to tell us you have

<xsl:output method="text"/>

? since if so, this method is specifically required not to escape characters such as "<" and ">" and "&" into their well-formed XML representations "&lt;" and "&gt;" and "&amp;" but to leave them as "<" and ">" and "&" -- since it's making plain text (not XML), and these are the plain text characters those references refer to.

Try outputting XML (method="xml") instead of text, and you'll find the serializer will escape the thing back again. (Of course you may not like the output for another reason.)

How do i ignore special characters like those ? I mean i don't want XSLT to
change it.

The XSLT processor isn't changing it; it's the parser sitting in front that is resolving it -- from this point of view, it isn't a change, it's only making it into what it "really is" (what it is always supposed to represent).


====================================================================== Wendell Piez mailto:wapiez@xxxxxxxxxxxxxxxx Mulberry Technologies, Inc. 17 West Jefferson Street Direct Phone: 301/315-9635 Suite 207 Phone: 301/315-9631 Rockville, MD 20850 Fax: 301/315-8285 ---------------------------------------------------------------------- Mulberry Technologies: A Consultancy Specializing in SGML and XML ======================================================================

XSL-List info and archive:

Current Thread