OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.


Help: OASIS Mailing Lists Help | MarkMail Help

docbook-apps message

[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [Elist Home]

Subject: DOCBOOK-APPS: Re: conditionalization of XML

Hash: SHA1

/ "Eric S. Raymond" <esr@thyrsus.com> was heard to say:
| Norman Walsh <ndw@nwalsh.com>:
|> 1. Entities should be expanded. If users process
| Right.  I know this.  This is why I suggested that the facility might belong in
| the XSLT engine itself.

Ah, but now you're mixing two processes together that are in principle
distinct. I like the idea of the profiling processor, but I don't
think it belongs in XSLT, it's more general than that.

|> 2. The downside of expanding entities is that &nbsp; is going to become &#160;.
|>    Is this really a problem? You're not going to edit the profiled content,
|>    right?
| Yes, it is really a problem.  Precisely because you cannot predict in advance
| what kind of postprocessing the user will want to do.
| For any filter to throw away semantic information that it doesn't
| absolutely have to is bad design.  If your tools force you to do this,
| your tools are broken.  XSLT is a broken tool for this purpose.

No, the culprit here is XML. Entities are defined in the surface
syntax. It's really hard to parse XML without expanding entities. (In
fact, it's impossible to do a validating parse without expanding

The problem is that entities are used for four different purposes that
we'd like to be able to distinguish:

1. For including external parsed content.

   <!ENTITY foo.xml SYSTEM "foo.xml">

2. For including internal parsed content ("macro expansion")

   <!ENTITY bar "Bar">

3. For referencing characters we can't type on our keyboards

   <!ENTITY nbsp "&#160;">

4. For referencing external unparsed content

   <!ENTITY foo.png SYSTEM "foo.png" NDATA PNG>

Unfortunately, 1-3 are all referenced the same way in content. (I
included 4 just just for completeness, it isn't relevant to what we're

There's little point in blaming XSLT for expanding &nbsp; when we're
asking it to expand &foo.xml; and &bar;. (And because entities are a
syntactic device, it would be very hard to define a generally useful
XML data model for XSLT that left entities unexpanded.)

                                        Be seeing you,

- -- 
Norman Walsh <ndw@nwalsh.com>      | On the other hand, you have
http://www.oasis-open.org/docbook/ | different fingers.
Chair, DocBook Technical Committee |
Version: GnuPG v1.0.6 (GNU/Linux)
Comment: Processed by Mailcrypt 3.5.7 <http://mailcrypt.sourceforge.net/>


[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [Elist Home]

Powered by eList eXpress LLC