This is the mail archive of the xsl-list@mulberrytech.com mailing list .


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

RE: •


Anybody have helpful advice on why XML-Spy/xalan won't let me redefine a numeric entity in a stylesheet but will let me redefine other entities.

--------------
(Redefining the entity using disable-output-escaping in the XSL stylesheet DOES control the output. I got this technique out of Bob Ducharme's "XSLT Quickly." Only I am unable for some reason to redefine a NUMERIC entity in the XSL transform which was the point of my question.

And the setup works for a dynamic browser transform just fine; but it also needs to work for html which is going to be posted after the transform.)





You can't control that with XSLT. After parsing, the XSLT processor just
sees the Unicode character 8226, no matter how it was written in the source
file. How it will be serialized in the result depends on output method and
encoding, bút *never* on the actual source format.

If you have problems "displaying" the character in the result, there's
probably a problem with your encoding declarations and your setup.

 -----Original Message-----
 From: owner-xsl-list@lists.mulberrytech.com
 [mailto:owner-xsl-list@lists.mulberrytech.com]On Behalf Of Greg Martel
 Sent: Saturday, June 08, 2002 5:35 PM
 To: xsl-list@lists.mulberrytech.com
 Subject: RE: [xsl] •


 But I think I do if I want to make it so that this entity, and quite
 a few other numeric entities, survive the transform to html for later
 posting. Otherwise I get "*" in my html code rather than "&8226;"
 which displays like this "⤢".


 >Simple answer: you don't need to declare the entity at all.
 >
 >>  -----Original Message-----
 >>  From: owner-xsl-list@lists.mulberrytech.com
 >>  [mailto:owner-xsl-list@lists.mulberrytech.com]On Behalf Of Greg Martel
 >>  Sent: Saturday, June 08, 2002 4:34 PM
 >>  To: xsl-list@lists.mulberrytech.com
 >>  Subject: Re: [xsl] •
 >>
 >>
 >>  Thanks guys, this is helpful; but as for using
 >>  disable-output-escaping, I was not able to use it for this character
 >>  (yes, Wendell, I tried). When I tried to define either #8226 or 8226
 >>  as the entity reference in my stylesheet, I got a message that the
 >>  file was not well-formed. However, when I changed the entity
 >>  reference to anything that starts with a letter "<!ENTITY bull"
 >>  instead of "<!ENTITY #8226" or "<!ENTITY 8226" I was able to save the
 >>  file without incident. I use XML spy over Xalan-Java, or MSXML4 so
 >>  maybe what I am seeing is caused by XML SPY? Doesn't seem likely.
 >>
 >>  Anyway, when I was unable to save the file, I leaped to the (wrong)
 >>  conclusion that somehow defining an entity that doesn't start with a
 >>  letter of the alphabet is illegal in XML, at least in an XSL
 >>  stylesheet. Any guesses as to why I get the message telling me that
 >>  this can be saved:
 >>
 >>  <?xml version ="1.0"?>
 >>  <!DOCTYPE stylesheet [
 >>  <!ENTITY ntilde
 >>  "<xsl:text disable-output-escaping>&amp;ntilde;</xsl:text>">
 >>  ]>
 >>  <xsl:stylesheet . . .
 >>
 >>
 >>  and this:
 >>
 >>  <?xml version ="1.0"?>
 >>  <!DOCTYPE stylesheet [
 >>  <!ENTITY #8226
 >>  "<xsl:text disable-output-escaping>&amp;8226;</xsl:text>">
 >>  ]>
 >>  <xsl:stylesheet . . .
 >>
 >>
 >>  cannot because it's not well-formed?
 >>
 >>
 >>
 >>
 >>
 >>
 >>  >>  Why doesn't this XML content:      &amp;#8226;
 >>  >>  produce this output:               &#8226;
 >>  >
 >>  >Why do you think it should? The first is 6 characters in the
 stylesheet.
 >>  >6 non white space characters in character data always just produce 6
 >>  >characters in the output. Your required output is one character
 >>  >reference. To get that character put &#8226; into the stylesheet.
 >>  >
 >>  >>  It's bloody nigh impossible to get my XML parser
 (Xalan-Java) NOT to
 >>  >>  recognize entities except for this one case where recognizing it
 >>  >
 >>  >It does recognise it. &amp; means an ampersand as character not as
 >>  >markup, so that's what appears in the result tree. But that ampersamd
 >>  >character in teh result tree has to be linearised as &amp; otherwise
 >>  >parsing teh result wouldn't reproduce that character.
 >>  >
 >>  >You haven't said why you think just putting &#8226; into the
 stylesheet
 >>  >does not work.
 >>  >
 >>  >David
 >>  >
 >>  >
 >>  >_____________________________________________________________________
 >>  >This message has been checked for all known viruses by Star Internet
 >>  >delivered through the MessageLabs Virus Scanning Service. For further
 >>  >information visit http://www.star.net.uk/stats.asp or
 alternatively call
 >>  >Star Internet for details on the Virus Scanning Service.
 >>  >
 >>  >  XSL-List info and archive:
http://www.mulberrytech.com/xsl/xsl-list
  --
  Thanks,

  gregm

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

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

gregm

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


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

gregm

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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]