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: Why processor or stylesheets puts strange output


abradoom wrote:
> I am aware of very few character entities like < > etc.
> where can i get  details of those

How about the XML 1.0 specification? But the list is very short:

  &lt;   <
  &gt;   >
  &amp;  &
  &quot; "
  &apos; '

These are the only built-in character entities. You never actually need
&gt;, and you rarely need &quot; or &apos; except in attribute values
that use the same kind of quotes as delimiters around the value. Examples:

  <foo bar="&quot;hello world&quot; isn't what I said"/>
  <foo bar='"hello world" isn&apos;t what I said'/>

You can load up your XML document's DTD with more entities if you like. A
standard set of SGML entities (the ones used by HTML) can be obtained at
http://www.oasis-open.org/cover/xml-ISOents.txt

So for example, in your stylesheet, if you really want to use &nbsp;, and
typing numeric character references like &#xA0; or &#160; or the literal
character (alt-0160 on WinNT,2K,XP) is too difficult for some reason, then
you can put

  <!DOCTYPE xsl:stylesheet SYSTEM "xml-ISOents.txt">

in the document. (and don't forget to put standalone="no" in your XML
declaration).

If typing numeric character references like &#1234; is easier (I would say it
certainly is, and is guaranteed to work), then you can get a list of what
numbers correspond to what characters by looking at the Unicode charts at
http://www.unicode.org/charts/

Also try http://www.macchiato.com/unicode/charts.html ..but not that it will
only show you printable characters that your browser is capable of displaying.
On the plus side it shows you UTF-8 and UTF-16 code value sequences.

In Unicode there are currently 95221 non-private characters assigned numbers
between 0 and 917631 (the range goes up to 1114111, hex 10FFFF), so don't
expect it all to fit on a chart that you can put in your pocket. It's worth
buying the Unicode Standard (hardcover book) if you need such a reference.

   - Mike
____________________________________________________________________________
  mike j. brown                   |  xml/xslt: http://skew.org/xml/
  denver/boulder, colorado, usa   |  resume: http://skew.org/~mike/resume/

 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]