RE: [xsl] a way to use Ampersands in xsl file

Subject: RE: [xsl] a way to use Ampersands in xsl file
From: "Yates, Danny (ANTS)" <danny.yates@xxxxxxxxxx>
Date: Wed, 12 Feb 2003 15:42:56 -0000
Exposing users to &amp; etc. is ugly, I agree. Best to let the users
operate in their natural fashion, and then escape what they give you
when you put it into XML.

It sounds like the editor you were using was broken. At least, if it
claimed to be an XML editor.

With respect to CDATA sections and JAXB, I have no specific experience,
but CDATA sections and escaping produce exactly the same results in the
XML data model. If JAXB was using an existing XML parser (and the
chances are it is using Xerces or Crimson), then it shouldn't have any
problems unless the particular version of the parser was exhibiting a
bug.

Dan.

-----Original Message-----
From: Bill Chmura [mailto:Bill@xxxxxxxxxxxxx]
Sent: 12 February 2003 15:18
To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
Subject: RE: [xsl] a way to use Ampersands in xsl file



I had a problem with an editor I was working on and saving the XML...  I
could not get JAXB to work with CDATA sections.   I had to parse the
data first and do the translation back and forth so the user would not
have to do &amp; themselves...



-----Original Message-----
From: owner-xsl-list@xxxxxxxxxxxxxxxxxxxxxx
[mailto:owner-xsl-list@xxxxxxxxxxxxxxxxxxxxxx] On Behalf Of Yates, Danny
(ANTS)
Sent: Wednesday, February 12, 2003 10:00 AM
To: 'xsl-list@xxxxxxxxxxxxxxxxxxxxxx'
Subject: RE: [xsl] a way to use Ampersands in xsl file


Why do you say

"I will not use &amp;"?

It's the right way. It's the only way. If you "will not use &amp;" you
will be writing in a syntax which looks a lot like XML, but ISN'T XML.

OK - that's not quite true. You could use CDATA sections instead, but
the net effect is the same - you are escaping the & character (and some
other special characters, like < and >)

Dan.

-----Original Message-----
From: 1alp@xxxxxx [mailto:1alp@xxxxxx]
Sent: 12 February 2003 13:42
To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
Subject: [xsl] a way to use Ampersands in xsl file


hello
there is a sample of my xsl file.
in "Line 150" i use an Ampersand.
After trying to parse this with saxon i get this Error:

############################################################
Fatal error reported by XML parser: name expected (found " ")
  URL:    file:/C://myfile.xsl
  Line:   150
  Column: 23
Transformation failed
#############################################################
is there a way to use Ampersands (i will not use  &amp;)in xsl files?

thanks

<?xml version="1.0" encoding="iso-8859-1" ?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform";>
<xsl:output method="html" indent="yes"/>
<xsl:template match="/document">
<html>
<head><title></title></head>
<body>
<pre>
<br/>

         Line1 text....................
         Line2 text....................
         Line3 text....................
         line......................  

      
         Line 150 ...ouer company & some of other clients....
         line  text ......................
       

</pre>
</body>
</html>
</xsl:template>
</xsl:stylesheet

-- 
+++ GMX - Mail, Messaging & more  http://www.gmx.net +++
Bitte lächeln! Fotogalerie online mit GMX ohne eigene Homepage!


 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


************************************************************************
***
This communication (including any attachments) contains confidential
information.  If you are not the intended recipient and you have
received this communication in error, you should destroy it without
copying, disclosing or otherwise using its contents.  Please notify the
sender immediately of the error.

Internet communications are not necessarily secure and may be
intercepted or changed after they are sent.  Abbey National Treasury
Services plc does not accept liability for any loss you may suffer as a
result of interception or any liability for such changes.  If you wish
to confirm the origin or content of this communication, please contact
the sender by using an alternative means of communication.

This communication does not create or modify any contract and, unless
otherwise stated, is not intended to be contractually binding.

Abbey National Treasury Services plc. Registered Office:  Abbey National
House, 2 Triton Square, Regents Place, London NW1 3AN.  Registered in
England under Company Registration Number: 2338548.  Regulated by the
Financial Services Authority (FSA).
************************************************************************
***


 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


***************************************************************************
This communication (including any attachments) contains confidential information.  If you are not the intended recipient and you have received this communication in error, you should destroy it without copying, disclosing or otherwise using its contents.  Please notify the sender immediately of the error.

Internet communications are not necessarily secure and may be intercepted or changed after they are sent.  Abbey National Treasury Services plc does not accept liability for any loss you may suffer as a result of interception or any liability for such changes.  If you wish to confirm the origin or content of this communication, please contact the sender by using an alternative means of communication.

This communication does not create or modify any contract and, unless otherwise stated, is not intended to be contractually binding.

Abbey National Treasury Services plc. Registered Office:  Abbey National House, 2 Triton Square, Regents Place, London NW1 3AN.  Registered in England under Company Registration Number: 2338548.  Regulated by the Financial Services Authority (FSA).
***************************************************************************


 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Current Thread