Wrox Programmer Forums
Go Back   Wrox Programmer Forums > XML > XSLT
|
XSLT General questions and answers about XSLT. For issues strictly specific to the book XSLT 1.1 Programmers Reference, please post to that forum instead.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the XSLT section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old September 1st, 2006, 05:57 AM
Authorized User
 
Join Date: Jun 2006
Posts: 23
Thanks: 0
Thanked 0 Times in 0 Posts
Default output symbol '>'

Hi,

How do i output the symbol '>' or '<' ?
i've tried <xsl:text> > </xsl:text> but saxon complies about it
when i put &gt; it outputs &gt;


 
Old September 1st, 2006, 06:10 AM
joefawcett's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 3,074
Thanks: 1
Thanked 38 Times in 37 Posts
Default

What method do you declare in xsl:output, if any?
If it's text then it should output the literal character rather than an entity. If xml, html or nothing then for XML it has to be the entity, for HTML I believe it is allowed to choose either.
Show your XML and XSLT if necessary.

--

Joe (Microsoft MVP - XML)
 
Old September 1st, 2006, 06:50 AM
mhkay's Avatar
Wrox Author
 
Join Date: Apr 2004
Posts: 4,962
Thanks: 0
Thanked 292 Times in 287 Posts
Default

XSLT outputs a result tree, it doesn't output symbols. You need to describe your required output in terms of a tree containing elements, attributes, and text nodes. If you want one of the attributes or text nodes to have a "<" character in it, then you can achieve this using <xsl:text>&lt;</xsl:text>; when you serialize this to XML, it will necessarily be escaped as &lt;.

If you want to produce a "<" character as part of the markup, then you've got things wrong: you should be producing element nodes, not tags.

Michael Kay
http://www.saxonica.com/
Author, XSLT Programmer's Reference and XPath 2.0 Programmer's Reference





Similar Threads
Thread Thread Starter Forum Replies Last Post
<?javax.xml.transform.disable-output-escaping ?> robbert XSLT 5 January 5th, 2011 07:28 PM
<xsl:output method=”xhtml”> crashes Tomcat li72 XSLT 1 August 13th, 2007 07:30 AM
<xsl:output method=”xhtml”> problem li72 XSLT 5 May 16th, 2007 10:45 AM
Need "&" and "<!-- -->" in the output sunrain XSLT 2 January 19th, 2007 05:29 PM
Response.Write output is of <body></body> yoord BOOK: Beginning ASP.NET 1.0 0 October 13th, 2004 07:06 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.