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

Re: Xlink Isn't Dead

  • From: Philippe Poulard <Philippe.Poulard@s...>
  • To: Michael Kay <mike@s...>
  • Date: Fri, 22 Sep 2006 14:46:18 +0200

Re:  Xlink Isn't Dead
Michael Kay wrote:
>>         If a styling language were able to say "this is a 
>>link" and "that attribute is the link address" and other such 
>>goodness, what else would be needed in core XML?
> 
> 
> Look at what we've got:
> 
> parent/child relationships: fine so long as the data is hierarchic
> 
> ID/IDREF, with strange lexical rules on the form of an identifier, with no
> ability to have more than one domain of identifiers in the same document,
> with no ability to say what kind of thing an IDREF is supposed to identify,
> and which is confined in scope to a single document.
> 
> key/keyref in XML Schema, which removes many of the constraints of ID/IDREF
> but which is still, crucially, confined to intra-document relationships (and
> whose specification is incomprehensible to mortals)
> 
> URIs, which mean anything you want them to mean: a semantic-free zone, but
> one with ugly syntactic constraints
> 
> RDF, which is impractical for most applications and bears very little
> relationship to XML.
> 
> What's needed is a mechanism for declaring and maintaining non-hierarchic
> relationships between objects (elements) that allows:
> 
> * freedom of choice in the syntactic form of the identifier
> 
> * freedom of choice in the naming of identifiers 
> 
> * independence of document boundaries
> 
> * indirection between identifiers of objects and the addresses of the
> documents containing them 
> 
> * indirection between identifiers of objects and their XML representations
> 
> * bi-directional (inverse) relationships
> 
> * flexibility in the management of referential integrity
> 
> * versioning
> 
> etc.
> 
> Michael Kay
> http://www.saxonica.com/
> 

I have experimented for my own documents a kind of links based on QNames

As usual, these links are in the source documents and have to be 
published in a way understandable by the target device (for a web 
browser, it will be an URL). I never localize my documents, I always 
name them ; URNs seem to be good candidates (this is the indirection 
layer Michael is talking about).

The idea is to specify a link to an identifier of a document thanks to a 
QName where the namespace URI is the URN of the target document, and the 
local name is an identifier within the target document :

<document xmlns:foo="urn:acme:the-doc-1">
     <link target="foo:bar"/>
</document>

By defining the namespace binding at the root element, the prefixes can 
be used at several places inside the document, this is the rules of XML 
namespaces. It is certainly usefull to define systematically a namespace 
binding for the current document, bound to a convenient prefix :

==== urn:acme:the-doc-2 ====
<document
   xmlns:foo="urn:acme:the-doc-1"
   xmlns:this="urn:acme:the-doc-2">
     <link target="foo:bar"/>
     <link target="this:part"/>
     ...
     <anchor id="this:part"/>
</document>

==== urn:acme:the-doc-1 ====
<anotherdoc
   xmlns:this="urn:acme:the-doc-1"
   xmlns:doc2="urn:acme:the-doc-2">
     <link target="doc2:part"/>
</anotherdoc>

To specify the entire document use simply : <link target="doc2"/>

Of course, <link> or @target and <anchor> or @id should themselves be 
bound to a namespace URI, like XLink does for its attributes, so that 
the semantic of these things can be interpreted by the applications.

This approach has a great advantage : when my programs cut and paste a 
part of a document that contains a link, it also copy the namespace 
binding ; when necessary, the prefix are renamed. After the operation, 
the links in the new document are preserved (the target is still the same).
The drawback is that each of my documents must define dozens of xmlns 
declarations... I also know there are some other issues.

-- 
Cordialement,

               ///
              (. .)
  --------ooO--(_)--Ooo--------
|      Philippe Poulard       |
  -----------------------------
  http://reflex.gforge.inria.fr/
        Have the RefleX !


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


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.