[XML-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: XML Inclusion Proposal

  • From: Paul Prescod <paul@p...>
  • To: "XML Developers' List" <xml-dev@i...>
  • Date: Sun, 06 Jun 1999 19:51:43 -0500

source anchors
"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@i...
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@i... the following message;
(un)subscribe xml-dev
To subscribe to the digests, mailto:majordomo@i... the following message;
subscribe xml-dev-digest
List coordinator, Henry Rzepa (mailto:rzepa@i...)



PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
 

Stylus Studio has published XML-DEV in RSS and ATOM formats, enabling users to easily subcribe to the list from their preferred news reader application.


Stylus Studio Sponsored Links are added links designed to provide related and additional information to the visitors of this website. they were not included by the author in the initial post. To view the content without the Sponsor Links please click here.

Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.