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

=?UTF-8?Q?Re=3A_=5Bxml=2Ddev=5D_Adding_a_layer_of_extensibility_to_XML?=

  • From: Dan Brickley <danbri@danbri.org>
  • To: Roger L Costello <costello@mitre.org>
  • Date: Wed, 24 Nov 2021 14:47:53 +0000

=?UTF-8?Q?Re=3A_=5Bxml=2Ddev=5D_Adding_a_layer_of_extensibility_to_XML?=


On Wed, 24 Nov 2021 at 14:20, Roger L Costello <costello@mitre.org> wrote:

Hi Folks,

Yesterday Michael Kay posted [1] a fascinating message. I’d like to summarize what I learned from reading his post. [Michael, please correct any mistakes in my summary.] At the end of this message I have two questions.

Consider this XML document containing data about a book:

<Book>
    <Title>Siddhartha</Title>
    <Author>Hermann Hesse</Author>
</Book>

 

We have direct access to the data by simply navigating to an appropriate element and then “peek inside” the element. For example, we can access the data “Siddhartha” by navigating to the Title element and then peek inside the element.

XML is, of course, extensible so we can extend the XML vocabulary:

<Book>
    <Title>Siddhartha</Title>
    <Author>Hermann Hesse</Author>
    <Date>1951</Date>
</Book>

 

To recap, the document is extensible with direct access.

Sometimes it is not easy to extend an XML vocabulary in a timely fashion. If the XML vocabulary is specified by an XML Schema, and changes to the XML Schema is under the control of a slow-moving organization, then timely extensions to the XML vocabulary may be difficult. To deal with this we modify the design by turning the tags into data:

<Book>
    <NameValuePair>
        <Name>Title</Name>
        <Value>Siddhartha</Value>
    </NameValuePair>
    <NameValuePair>
        <Name>Author</Name>
        <Value>Hermann Hesse</Value>
    </NameValuePair>
</Book>

 

Accessing data now involves a level of indirection. For example, to access the data “Siddhartha” requires finding the NameValuePair with the Name element containing “Title” and then peeking inside the Value element.

The document may be extended in the normal XML fashion by adding more NameValuePair elements, but we can also add another layer of extensibility by adding new names:

<Book>
    <NameValuePair>
        <Name>Title</Name>
        <Value>Siddhartha</Value>
    </NameValuePair>
    <NameValuePair>
        <Name>Author</Name>
        <Value>Hermann Hesse</Value>
    </NameValuePair>
    <NameValuePair>
        <Name>Date</Name>
        <Value>1951</Value>
    </NameValuePair>
</Book>

 

To recap, the document has two layers of extensibility and a level of indirection.

“All problems in computer science can be solved by another level of indirection.”


This is pretty close to how RDF works, in general and in the RDF/XML specifics. It specifies a general bland structure (edge-labelled graphs) and rules about how things like document ordering affect what the data is saying. But then your actual data can use any types and properties whatever, without the outer generic structure needing to be evolved (e.g. rdfxml syntax grammar is https://www.w3.org/2013/10/rdfxml.rnc )

Dan
 

Question: Is it possible to add another level of indirection? Is it possible to add another layer of extensibility?

[1] http://lists.xml.org/archives/xml-dev/202111/msg00088.html

 



[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.