W3C home > Mailing lists > Public > www-html@w3.org > February 2000

Seperating Document Content from Structure (was RE: inline CSS - score so far)

From: Murray Altheim <altheim@eng.sun.com>
Date: Wed, 23 Feb 2000 10:15:31 -0800
Message-ID: <38B423C3.E463A659@eng.sun.com>
To: Bertilo Wennergren <bertilow@hem.passagen.se>, www-html@w3.org
[I'm posting a private reply, but I don't think under the circumstances
Bertilo would mind. I don't see anything embarrassing or political
in it, and I'd written this anyway and would like to reply more publicly
since David has started this new thread.]

Bertilo Wennergren wrote:
> Murray Altheim:
> > David Wagner wrote:
> > [...]
> > > One more question reaching further into the future: we are dutifully
> > > seperating style from structure and content.  What about seperating
> > > document content from its structure?  Any plans for this?
> >
> > The role of markup is to perform this task. I don't see how you'd
> > separate the markup from the document content, or why you'd want to.
> > Perhaps you could clarify?
> I'm not actually supporting the idea, but this could be one, quite
> logical way to do just that:
>   <docbody>
>     <par src="content_por_paragraph_1.txt"/>
>     <par src="content_por_paragraph_2.txt"/>
>     <par src="content_por_paragraph_3.txt"/>
>   </docbody>

You're describing of course links that embed parseable document 
content. You'll be able to do this with XHTML 2.0 and XLink:

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 2.0//EN" >
    <a xlink:href="frontmatter.xml" 
       xlink:show="embed" xlink:actuate="onLoad"/>
    <a xlink:href="content_por_paragraph_1.xml" 
       xlink:show="embed" xlink:actuate="onLoad"/>
    <a xlink:href="content_por_paragraph_2.xml" 
       xlink:show="embed" xlink:actuate="onLoad"/>
    <a xlink:href="content_por_paragraph_3.xml" 
       xlink:show="embed" xlink:actuate="onLoad"/>

which is one of the nice things to look forward to in XHTML 2.0!

But without XLink, you can do this with simply XML 1.0, and indeed, 
it's very common in professional publishing to break up larger 
documents into functional entities, eg., chapter or section-level,
sometimes smaller. Entity structure can be pretty independent of 
markup structure, which is I'm guessing the intent of the suggestion
in the originating thread.

> Or another way:
>   <docbody>
>     <par>&content_for_paragraph_1;</par>
>     <par>&content_for_paragraph_2;</par>
>     <par>&content_for_paragraph_3;</par>
>   </docbody>

More explicitly, here's some perfectly legal XML that does
basically the same thing:

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" [
    <!ENTITY frontmatter SYSTEM "frontmatter.xml">
    <!ENTITY content_for_paragraph_1 SYSTEM "para1.xml">
    <!ENTITY content_for_paragraph_2 SYSTEM "para2.xml">
    <!ENTITY content_for_paragraph_3 SYSTEM "para3.xml">
    <!ENTITY backmatter SYSTEM "backmatter.xml">

Which you can do today with XML-compliant tools.

> It sure makes for clean looking docs!

Yes, and this is how I've structured some of my documents as well.
I've been working on a large work of historical fiction, and the
entire thing is managed via entities. I would certainly consider
XLink once it hits REC and we have some tools, although the only
thing I'd really gain would be the minor amount of metainformation
that are contained in the links.

There's also a proposal in the W3C for something called 'XInclude'
which does this in yet another way. Some people don't like entities
(despite their relative simplicity and proven years of use), and 
for some purposes I'm guessing XLink won't do either, so XInclude 
is a proposed change to XML itself.

I don't know what more you might need. I use the entity mechanism
all the time, and it works in any compliant XML parser, even over
the web using URLs. No need to reinvent the wheel yet again.


Murray Altheim                            <mailto:altheim&#x40;eng.sun.com>
XML Technology Center
Sun Microsystems, Inc., MS MPK17-102, 1601 Willow Rd., Menlo Park, CA 94025

   the honey bee is sad and cross and wicked as a weasel 
   and when she perches on you boss she leaves a little measle -- archy
Received on Wednesday, 23 February 2000 13:15:26 UTC

This archive was generated by hypermail 2.3.1 : Wednesday, 7 January 2015 15:05:53 UTC