Re: [xsl] converting XML to XML problem

Subject: Re: [xsl] converting XML to XML problem
From: Wendell Piez <wapiez@xxxxxxxxxxxxxxxx>
Date: Tue, 11 Nov 2003 17:50:53 -0500
Abhi,

It's not whitespace inside the &_amp; entity, it's the whitespace between the output ampersand (an actual ampersand, when you have disabled output escaping) and the string that is to be the name of your newly constructed entity reference, that will be a problem.

Look at the code of your post this morning and you'll see that there is whitespace that will appear *after* your ampersand but *before* the value of the attribute representing the entity name:

<xsl:text disable-output-escaping="yes">
  &_amp;
</xsl:text>
<xsl:value-of select="@entity-name"/>

... the whitespace after the &_amp; and before the close </xsl:text> tag is what will get you.

Really all you have to do is to run the code you sent to the list this a.m. (which was much like above) exactly as given, and then try to parse the result. (This kind of fragility is one of several reasons why we frown on d-o-e-based approaches except as a last resort.)

Cheers,
Wendell

At 04:32 PM 11/11/2003, you wrote:
Hi Wendell,
Yes now I get what you were saying. But the white
space is before
"&amp;" and not as "&   amp;" so I do not see any
reason why

<xsl:text> &amp;</xsl:text> should not work the same
way as
<xsl:text>&amp;</xsl:text>.
The only thing that may happen is that there will be
an extra space in the output xml if I am correct.
Help me understand if you think I did not catch what
you are trying to say.
Thanks,
Abhi


======================================================================
Wendell Piez                            mailto:wapiez@xxxxxxxxxxxxxxxx
Mulberry Technologies, Inc.                http://www.mulberrytech.com
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: http://www.mulberrytech.com/xsl/xsl-list



Current Thread