First point: the character references such as are converted to regular
characters by the XML parser. The XSLT processor never gets to see the
character references, so it can't pass them through.
Second point: character references such as are a feature of XML and
HTML, so you can produce them when using the xml and html output methods,
but not when using the text output method. Characters are never escaped with
the text output method, so disabling escaping achieves nothing.
I think you need to use something like (in XPath 2.0) replace(' ',
'
')
Michael Kay
http://www.saxonica.com/
-----Original Message-----
From: David(_dot_)McKay(_at_)racalinstrumentsgroup(_dot_)co(_dot_)uk
[mailto:David(_dot_)McKay(_at_)racalinstrumentsgroup(_dot_)co(_dot_)uk]
Sent: 27 January 2005 15:56
To: xsl-list(_at_)lists(_dot_)mulberrytech(_dot_)com
Subject: [xsl] "Passing through" special characters
--- XSL Processor Details
Vendor: SAXON 6.5.3 from Michael Kay
Vendor URL: http://saxon.sf.net/
---
I have some xml, the important part of which looks like this:
<RS422Tx name="RS422Tx1" baud_rate="19200"
data_word="ABC DEF "/>
I am trying to parse to a text output file. Problem is, I
can't figure out a way to generate the following:
CALCULATE, TX$="ABC DEF "
This:
<xsl:if test="@data_word">CALCULATE, TX$="<xsl:value-of
select="@data_word"/>"</xsl:if>
results in:
CALCULATE, TX$="ABC
DEF
"
I tried both settings of disable-output-escaping, neither of
which seemed to make a difference.
There may also be a requirement to output as follows:
CALCULATE, TX$="ABC"+CHR$(13)+CHR$(10)+"DEF"+CHR$(13)+CHR$(10)
Can anyone offer any hints for either problem?
Thanks.
Dave McKay
**********************************************************************
IMPORTANT NOTICE
The information contained in this e-mail is confidential. It may also
be legally privileged. It is intended only for the stated
addressee(s)
and access to it by any other person is unauthorised. If you are not
an addressee, you must not disclose, copy, circulate or in any other
way use or rely on the information contained in this e-mail. Such
unauthorised use may be unlawful.
If you have received this e-mail in error, please inform
Racal Instruments Group Ltd. immediately by
emailing postmaster(_at_)racalinstrumentsgroup(_dot_)co(_dot_)uk
or
phoning +44 (0)1202 872800 (ask for the I.T. Dept.)
and delete it and all copies from your system.
www.racalinstrumentsgroup.co.uk
**********************************************************************
--~------------------------------------------------------------------
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail:
<mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--
--~------------------------------------------------------------------
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--