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

 


Help: OASIS Mailing Lists Help | MarkMail Help

 


 

   Re: [xml-dev] Alternative "character entity" proposal

[ Lists Home | Date Index | Thread Index ]

Hi Richard,

On Tue, 2003-10-21 at 16:14, Richard Tobin wrote:
> This is a proposal for a new mechanism for declaring internal entities,
> requiring a new version of XML.
> 
> [I am not proposing this because I think it's a good idea - I can't see
> a good solution at all - but because it's an obvious approach that
> several people have talked to me about at W3C meetings and which has
> not been discussed in the recent threads on the subject.  Henry
> Thompson proposed a similar mechanism a few years ago.]
> 
> Since XML 1.0, replacements have been invented for most aspects of DTDs:
> 
>  - content restriction and typing is provided by XML Schemas, Relax NG,
>    Schematron etc
> 
>  - something similar to external entity inclusion is provided by XInclude
> 
>  - ID-ness is being addressed by the current work on xml:id
>
> In each case the replacement uses (or can use) XML instance syntax
> rather than DTD syntax.

And none of them is requiring any modification to XML (which is probably
the main reason why they are sometimes ugly) and your proposal does
require such a modification.

> The obvious missing item from the list is internal entities,
> especially in their use as names for characters.
> 
> In theory, XInclude can replace internal entities.  The href in an
> xinclude element can refer to a fragment of the same document.  But
> this is hardly convenient: it is very verbose, and you have to find
> somewhere to put the text itself.  XInclude works well for merging
> small documents into a large document, but not so well for defining
> frequently-used short sequences of characters.

Sounds like a good direction to look at: the use case of utf-8+names was
to replace internal entities, but those of them in external DTDs.

Let's say I define a document "entities.xml" to describe my entities as:

<entities xmlns="http://dyomedea.com/ns/entities";>
 <entity id="nbsp">&#160;</entity>
 <entity id="signature">
   <p xmlns="http://www.w3.org/1999/xhtml";>Eric van der Vlist</p>
 </entity>
</entities>

With the existing specs, I have no problem using these definitions in
the elements of instance documents:

<div>
<p>This is a non breaking space: "<xi:include
href="entities.xml#nbsp"/></p>
<xi:include href="entities.xml#signature"/>
</div>

The only assumption is that my XPointer is using an
"externally-determined ID" [1] defined as identifying the content of the
entity element with the matching id. That's not very usual, but I don't
think anything in the XPointer spec prevents me from doing this...

[1] http://www.w3.org/TR/xptr-framework/#term-xdi

There are two issues with this:

     1. It can't be used within attributes
     2. <xi:include href="entities.xml#signature"/> is verbose compared
        to &signature;

James Clark suggested that for MathML, the first issue shouldn't be a
problem and such a mechanism could still be useful if it was restricted
to element content.

If the second one is considered important, it should be possible to
define a mechanism (who said architectural forms?) to mach something
shorter to full xi:include elements but I am not sure that it's really
worth the pain.

My 0.02 Euros

Eric
-- 
Don't you think all these XML schema languages should work together?
                                                         http://dsdl.org
Upcoming schema tutorial:
 - Philadelphia (7/12/2003)       http://makeashorterlink.com/?V28612FC5
Tutoriel XSLT:
 - Paris (25/11/2003)             http://makeashorterlink.com/?L2C623FC5
------------------------------------------------------------------------
Eric van der Vlist       http://xmlfr.org            http://dyomedea.com
(W3C) XML Schema ISBN:0-596-00252-1 http://oreilly.com/catalog/xmlschema
------------------------------------------------------------------------





 

News | XML in Industry | Calendar | XML Registry
Marketplace | Resources | MyXML.org | Sponsors | Privacy Statement

Copyright 2001 XML.org. This site is hosted by OASIS