XML.orgXML.org
FOCUS AREAS |XML-DEV |XML.org DAILY NEWSLINK |REGISTRY |RESOURCES |ABOUT
OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.

 


Help: OASIS Mailing Lists Help | MarkMail Help

[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index]
RE: Single, Simple, Powerful Mechanism for Expressing XMLRelationships

Andrew Townley wrote:

> Here are some of the initial thoughts I had on how to apply 
> TMRM fundamentals to the problems being discussed on the 
> list about where to go with XML. ...

Hi Andrew,

This is excellent information. I am still working to fully grasp it all. Perhaps some concrete examples would be instructive. 

In an earlier message I gave examples of the multiple ways that relationships are expressed in XML, XSLT, and XML Schema. Can we please take some of those examples and recast them using the concepts you described?

First, let's start with an XML Schema example. XML Schemas makes frequent use of QNames to express relationships--one element is connected (related) to another element through a shared QName. In the below XML Schema snippet this Book element declaration:

    <element name="Book">

is referenced from within BookStore:

    <?xml version="1.0"?>
    <schema xmlns="http://www.w3.org/2001/XMLSchema";
            targetNamespace="http://www.books.org";
            xmlns:bk="http://www.books.org";
            elementFormDefault="qualified">

        <element name="BookStore">
            <complexType>
                <sequence>
                    <element ref="bk:Book" maxOccurs="unbounded"/>
                </sequence>
            </complexType>
        </element>

        <element name="Book">
        ...

    </schema>

These two expressions:

    ref="bk:Book"
    name="Book"

are connected by the shared QName:

    {http://www.books.org}Book
  

How would this XML Schema example be recast to use the concepts you describe?


Second, let's consider an XSLT example. The XSLT document() function is a mechanism for expressing cross-document relationships. Here's an example:

    <xsl:for-each select="document('bookstore2.xml')//book">
       ...
    </xsl:for-each>

How would this XSLT example be recast to use the concepts you describe?


Third, let's consider an ID/IDREF example. The below snippet shows a relationship between Picker John and Lot 1; namely, Picker John is located on Lot 1. This is employing the ID/IDREF relationship mechanism provided by the XML specification.

    <Lot id="1">
        ...
    </Lot>
    <Picker id="John" locatedOn="1">
        ...
    </Picker>

How would this ID/IDREF example be recast to use the concepts you describe?

Thanks!

/Roger


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


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

Copyright 1993-2007 XML.org. This site is hosted by OASIS