RE: That didnt work either! RE: How to add a "less than" or "greater than" sign?

Subject: RE: That didnt work either! RE: How to add a "less than" or "greater than" sign?
From: Wendell Piez <wapiez@xxxxxxxxxxxxxxxx>
Date: Thu, 13 Apr 2000 15:24:25 +0100
Francis,

I am assuming Moazzam wants to generate an element structure in his output
with element type names determined in his source. That's exactly what
<xsl:element/> is for. Both open and close tags, complete with tag
delimiters < and > will appear when his result tree is written as XML (or
HTML) to a file. (If you're not seeing this, check to see that <xsl:output
method="xml"/> ... if it's set to "text" then all bets are off. Text output
has no elements, hence no tags. Strings that may happen to resemble tags,
it may have....)

If he actually wants his XSL to generate the _characters_ '<' and '>' then
he has to use &lt;, &gt; and output escaping, as you suggested (one way to
do this is to set <xsl:output method="text"/>). But this is the hard way to
do it: inelegant, error-prone, and "contrary to the spirit of XSLT" (though
many of us have been known to resort to worse).

In general, this topic falls into the category of the misconception about
XSL as a fancy kind of string-munging. Don't think about '<' and '>': that
only gets you into trouble -- think about how you're trying to create
elements (with attributes) and move data (or maybe move elements and create
data).

There's a thread on this in the archive from not too long ago: it was
discussed quite thoroughly.

(And M., sorry to get your name wrong. Too many posts.)

--Wendell

At 09:53 AM 4/13/00 -0700, you wrote:
>But how will you make it to display ur open and close tags.It will display
>only the Type attribute name in ur output.right?.Or am I not getting this
>correctly.I thought Mozamm was asking for displaying his attribute names as
>tags and having a value for it.
>
>Francis


======================================================================
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