By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,199 Members | 1,724 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,199 IT Pros & Developers. It's quick & easy.

output of "<" and ">" in stylesheet

P: n/a
Does anyone have an idea, how to do it? Thanks in advance!
Jul 20 '05 #1
Share this Question
Share on Google+
7 Replies


P: n/a

Assuming you mean an xslt stylesheet (rather than css or some other
system) it's XML so for < you can use &gt; and for > you can use either
&gt; or >

David
Jul 20 '05 #2

P: n/a
David Carlisle <da****@nag.co.uk> wrote in message news:<yg*************@penguin.nag.co.uk>...
Assuming you mean an xslt stylesheet (rather than css or some other
system) it's XML so for < you can use &gt; and for > you can use either
&gt; or >

David


Hallo, David,

I am writing an xsl stylesheet. It seems that $lt; and $gt; don't work.
Jul 20 '05 #3

P: n/a
zh*******@hotmail.com (Diandian Zhang) writes:
David Carlisle <da****@nag.co.uk> wrote in message news:<yg*************@penguin.nag.co.uk>...
Assuming you mean an xslt stylesheet (rather than css or some other
system) it's XML so for < you can use &gt; and for > you can use either
&gt; or >

David


Hallo, David,

I am writing an xsl stylesheet. It seems that $lt; and $gt; don't work.


You are allowed to give us some clues:

Do you mean:

The system generates an error (if so, what error message)
or
the system generates the wrong output (if so, what output did you get
and what output did you want).

The way to specify a < in XML is to to use &gt;. Of course it will also
be output that way as well in the html or xml output methods.

If you mean you want a literal < in the ouput then perhaps you are not
generating XML and so should use xsl:output method="text"

David
Jul 20 '05 #4

P: n/a

someone wrote:
The way to specify a < in XML is to to use &gt;.

^^^^
&lt;

Jul 20 '05 #5

P: n/a
David Carlisle <da****@nag.co.uk> wrote in message news:<yg*************@penguin.nag.co.uk>...
someone wrote:
The way to specify a < in XML is to to use &gt;. ^^^^
&lt;


Hallo, David,

thank you for your reply. What I want to generate from a XML file, is
a text file as the following:
<'
some things
more things
...'


And my stylesheet looks like this:
<xsl:stylesheet ...>
<xsl:output method="text"/>
<xsl:template match="/">
<xsl:text>&lt;'</xsl:text>
...
</xsl:template>
</xsl:stylesheet>

The output is &lt;' instead of <'. Have I done anything wrong here?
Jul 20 '05 #6

P: n/a
The output is &lt;' instead of <'. Have I done anything wrong here?


Your stylesheet is fine but your system is clearly using XML not text
serialisation so is ignoring your xsl:output.

Usually this only happens if you output from XSLT to a DOM or other
kind of in memory structure rather than to a file and then get the final
output from the DOM (which doesn't know anything about xsl:output hints)

so it probably depends on what system you are using and how you are
calling it.

David
Jul 20 '05 #7

P: n/a
Diandian Zhang (zh*******@hotmail.com) wrote:

: thank you for your reply. What I want to generate from a XML file, is
: a text file as the following:
: <'
: some things
: more things
: ...
: >'

: And my stylesheet looks like this:
: <xsl:stylesheet ...>
: <xsl:output method="text"/>
: <xsl:template match="/">
: <xsl:text>&lt;'</xsl:text>

did you try

<xsl:text disable-output-escaping='yes'>

: ...
: </xsl:template>
: </xsl:stylesheet>

: The output is &lt;' instead of <'. Have I done anything wrong here?

--

This space not for rent.
Jul 20 '05 #8

This discussion thread is closed

Replies have been disabled for this discussion.