[4suite] utf-8 encodings (getting to be long)

Phil Harris phil.harris at zope.co.uk
Fri Sep 8 08:29:34 MDT 2000


Uche,

Thanks for responding, below excerpts from my files:

XML text:

<?xml version="1.0" encoding="UTF-8"?>
<transdoc>
 <file charset="ANSI">
  <meta>
   <title>1</title>
   <author>Valued Compaq Customer</author>
   <creation-date>
    <year>2000</year>
    <month>7</month>
    <day>10</day>
    <hour>10</hour>
    <minute>55</minute>
   </creation-date>
   <revision-date>
    <year>2000</year>
    <month>7</month>
    <day>10</day>
    <hour>10</hour>
    <minute>55</minute>
   </revision-date>
   <company>media resources centre</company>
  </meta>
  <section>
   <footer>
    <normal fontname="Georgia" fontsize="11" stylename="Normal"
align="left">
     <field>
      <fldinst>PAGE  </fldinst>
      <fldrslt>
       <string fontname="Georgia" fontsize="11">
1</string>
      </fldrslt>
     </field>
    </normal>
    <normal fontname="Georgia" fontsize="11" stylename="Normal"
align="left"/>
   </footer>
   <heading1 bold="on" fontsize="14" stylename="heading 1"
fontname="Georgia" align="left">
    <string fontname="Georgia" bold="on" fontsize="14">
1.</string>
    <string fontname="Georgia" bold="on" fontsize="14">
Introduction.</string>
    <normal bold="on" fontsize="14" stylename="Normal" fontname="Georgia"
align="left"/>
    <quotations italic="on" fontname="Georgia" fontsize="11"
stylename="Quotations" align="left">
     <string italic="on" fontname="Georgia" fontsize="11">
&#x2003;&#147;No other design discipline requires so much learning and
training as fontography and by no other aspect can amateurs be so easily
distinguished from professionals. To be font literate a designer needs to
study the history and principles of font design&#148;</string>
    </quotations>


XSL text:

<?xml version="1.0"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
version="1.0">
<xsl:output encoding="UTF-8"/>
 <!--===============================
              Root node
    ===============================-->
 <xsl:template match="transdoc">
  <xsl:apply-templates/>
 </xsl:template>
 <!--===============================
    There could be multiple of
    these if docs are linked
    ===============================-->
 <xsl:template match="file">
  <html>
   <xsl:apply-templates/>
  </html>
 </xsl:template>


The originals are rather longer and seem to be well-formed etc.

Also, on another note I think I may have found a bug.

In the stylesheet above I did have a typo that made one of the lines look
like this:

<meta http-equiv="content-type" content="text/html; charset="UTF-8"/>
--------------------------------------------------------------^

instead of the correct:

<meta http-equiv="content-type" content="text/html; charset=UTF-8"/>

Notice the extra quote, well it actually didn't just given exception as I
would have expected, but actually made python die completely.

Any ideas on both fronts?

Thanks in advance.

Phil
phil.harris at zope.co.uk


----- Original Message -----
From: "Uche Ogbuji" <uche.ogbuji at fourthought.com>
To: "Phil Harris" <phil.harris at zope.co.uk>
Cc: <4suite at dollar.fourthought.com>
Sent: Friday, September 08, 2000 3:13 PM
Subject: Re: [4suite] utf-8 encodings


> Phil Harris wrote:
>
> > My first sojourn into 4suite and I've hit a problem.
> >
> > My xml doc is encoded in utf-8 and I want to run it through ans XSl
> > stylsheet.  I need to get the output into UTF-8 also, but I can't figure
out
> > how I'd go about doing that.
>
> Hmm.  Except for some rather non-trivial cases that Carey Evans has
> pointed out and that we're working on, I thing 4XSLT's encodings work
> for most everyday tasks.
>
> Of course I can't help you figure out what the exact problem is you face
> cause you give no data at all.
>
> UTF-8 is the default output encoding for XML output method.  You can set
> it explicitly using xsl:output.
>
> --
> Uche Ogbuji                               Principal Consultant
> uche.ogbuji at fourthought.com               +1 303 583 9900 x 101
> Fourthought, Inc.                         http://Fourthought.com
> 4735 East Walnut St, Ste. C, Boulder, CO 80301-2537, USA
> Software-engineering, knowledge-management, XML, CORBA, Linux, Python
> _______________________________________________
> 4suite mailing list
> 4suite at lists.fourthought.com
> http://lists.fourthought.com/mailman/listinfo/4suite




More information about the 4suite mailing list