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

RE: Single, Simple, Powerful Mechanism for Expressing XMLRelationships

  • From: "Costello, Roger L." <costello@mitre.org>
  • To: "xml-dev@lists.xml.org" <xml-dev@lists.xml.org>
  • Date: Thu, 9 Dec 2010 05:32:56 -0500

RE: Single
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]


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.