XML Inclusion Proposal

Paul Prescod paul at prescod.net
Mon Jun 7 03:03:44 BST 1999


"Joshua E. Smith" wrote:
> 
> An interesting philosophical question, first: if I make this inclusion
> mechanism available to authors of documents in my XML conformant language
> (which is not, I expect, a language which will be useful to any XML
> processor other than my own), would it be reasonable to omit support for
> general entity references?  

I'm reluctant to encourage half-way support of the XML specification. One
day there will be a standardized XML subset that does not include general
entities and I would be more comfortable then.

> Question 2: I think I understand your intent, but just to be sure: what do
> you *expect* the included document to look like?  Does it start with:
> 
> <?xml version="1.0" encoding="UTF-8"?>
> 
> Would you expect it to have a DOCTYPE, or not?

Any element in any XML document can be included. If you link to the full
document then it should be interpreted as an inclusion of the root element
(i.e. not the DOCTYPE and XML/encoding declaration, if present)

> I suspect I could just make my own rules for my authors (e.g., the included
> document must be well formed, must not includes a doctype, etc.), but I was
> wondering if you had a particular set of conventions in mind.  In
> particular, a well formed document has only one root node, which might be
> kind of inconvenient in a lot of cases (take your copyright example: I
> might want to always include both a
> <copyright>blah</copyright><GPL>blah</GPL> and if I require that the
> included doc is well formed, I'd have to wrap those together, right?).

Yes, but the specification allows you to make an inclusion link that ONLY
brings in the copyright and GPL, but not the wrapper element.

> Question 3: I'm not familiar enough with the XLink/XPointer specs to
> understand this part:
> 
> >Source Anchor:
> >
> >The source anchor may be identified as an anchor described in a locator
> >with the role "source". It must address a single node in the same
> >document as the link. If an inline link has no locator named "source",
> >then the local resource serves as the source anchor.
> >
> >Target Anchor:
> >
> >The target anchor may be identified by a locator with the role
> >"content". If the link has no such locator but it has only one  single
> >remote resource then that resource may be used as the content anchor.
> 
> Can you give examples of each kind of inclusion this can lead to?  I'm
> having a lot of trouble with understanding what these two paragraphs mean,
> exactly.

Here is the basic XLink data model:

link=role, anchor+
anchor=role, href

So an inclusion link looks like:

link = role, (source, target)
source="source", href (to a single node in the same document as the link)
target="content", href (to any node or node list in any document anywhere)

Inline links implicitly have an anchor which is the linking element
itself, like <a href="foo">this</a> or <img href="foo"/>. When the
inclusion specification sees a simple link, it presumes the content to be
the source anchor and the referenced nodes to be the target. Out-of-line
links do not treat the linking element as an anchor and instead link two
other things. In the case of an out-of-line link I don't know which anchor
is the source and which is the content so you have to say explicitly.

> Does this mean that I can include some miscellaneous nodes buried in the
> included document?  For example, can I have a document license.xml with
> various licenses, and then include the one in particular that I need by
> using these anchors?  How would that look?

<xml:include href="license.txt#somelicense"/>

-- 
 Paul Prescod  - ISOGEN Consulting Engineer speaking for only himself
 http://itrc.uwaterloo.ca/~papresco

"Silence," wrote Melville, "is the only Voice of God." The assertion,
like its subject, cuts both ways, negating and affirming, implying both
absence and presence, offering us a choice; it's a line that the Society
of American Atheists could put on its letterhead and the Society of
Friends could silently endorse while waiting to be moved by the spirit
to speak. - Listening for Silence by Mark Slouka, Apr. 1999, Harper's

xml-dev: A list for W3C XML Developers. To post, mailto:xml-dev at ic.ac.uk
Archived as: http://www.lists.ic.ac.uk/hypermail/xml-dev/ and on CD-ROM/ISBN 981-02-3594-1
To (un)subscribe, mailto:majordomo at ic.ac.uk the following message;
(un)subscribe xml-dev
To subscribe to the digests, mailto:majordomo at ic.ac.uk the following message;
subscribe xml-dev-digest
List coordinator, Henry Rzepa (mailto:rzepa at ic.ac.uk)





More information about the Xml-dev mailing list