|
[XML-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Best Practice for adding a "standard data item" to pre-existing XML voca
Hi Folks, I am interested in your thoughts on this issue. Please see the questions interspersed below. /Roger ISSUE Suppose that a number of different communities have already created their own unique XML vocabularies. To promote cross-community interoperability (including mashups) the communities decide to standardize "When" information since they all have, in one form or another, "When" information. What is best practice for incorporating a standard information item (e.g. a "When" information item) into a diverse set of pre-existing XML vocabularies? EXAMPLE Suppose there are three communities: 1. The Office Supplies Community 2. The Airline Community 3. The Book Community Here are three XML documents which illustrate the XML vocabularies that each community already has created: SAMPLE XML DOCUMENT FOR THE OFFICE SUPPLIES COMMUNITY <Memo> Hi Folks, Let's meet in <time>one hour</time> to discuss our strategy for the way ahead. </Memo> SAMPLE XML DOCUMENT FOR THE AIRLINE COMMUNITY <Flight> <takeoff-time>Saturday, March 14, 4:30 PM EST</takeoff-time> <arrival-time>Sunday, March 15, 6:00 PM (local time)</arrival-time> </Flight> SAMPLE XML DOCUMENT FOR THE BOOK COMMUNITY <Book> <publication-date> <month>January</month> <year>2005</year> </publication-date> </Book> EVERY COMMUNITY USES "WHEN" SO LET'S STANDARDIZE THAT! All three communities express "When" information, albeit in unique ways: Office Community: <time>one hour</time> Airline Community: <takeoff-time>Saturday, March 14, 4:30 PM EST</takeoff-time> <arrival-time>Sunday, March 15, 6:00 PM (local time)</arrival-time> Book Community: <publication-date> <month>January</month> <year>2005</year> </publication-date> It is decided to use ISO-8601 as the standard. What approach should be used to add the standard datetime information? DESIRED FEATURES OF A SOLUTION 1. Basic interoperability: standardizing just the "When" data obviously will not magically enable, for example, the Airlines' applications to be able to process all the data in an XML document from the Book community. It will, however, provide one common piece of understanding. Thus, for example, an Airline application could pull out the "When" data from a document it receives from the Book community and do a mashup of it with its timeline application. 2. Progressive Enhancement (Scalable): today the communities standardize on ISO-8601 but in the future they may want to use other standards as well, such as the vCard dtstart and dtend (datetime-start and datetime-end). 3. Graceful Degradation: suppose some of the Airlines' applications upgrade to be able to process the new "When" standard while others don't. Suppose an application that has not been upgraded to understand the new "When" standard receives a document that uses it. The application must be able to safely ignore it and gracefully degrade to the basic Airline markup. 4. Minimally Disruptive: each community already has a significant investment in their XML vocabularies (including applications designed to manipulate those vocabularies). So, a solution must be minimally disruptive for it to be cost-effective. QUESTION: what other desired features that should be listed here? EXEMPLARS (EXISTING COW PATHS) There are a number of technologies that address similar problems, and exhibit the desired features listed above: 1. XLink 2. RDFa 3. Microformats 4. Nonintrusive CSS 5. Nonintrusive JavaScript The first three work by providing attributes that can be injected anywhere into an existing XML vocabulary. The later two work by placing the enhancements into separate documents. SOLUTION #1 Create an attribute of type ISO-8601: <schema targetNamespace="http://www.example.com/standard/when" <attribute name="when" type="datetime" /> </schema> Here's how the three communities utilize this solution: SAMPLE XML DOCUMENT FOR THE OFFICE SUPPLIES COMMUNITY (ENHANCED) <Memo xmlns:common="http://www.example.com/standard/when"> Hi Folks, Let's meet in <time common:when="2008-03-28T13:30:00">one hour</time> to discuss our strategy for the way ahead. </Memo> SAMPLE XML DOCUMENT FOR THE AIRLINE COMMUNITY (ENHANCED) <Flight> <takeoff-time common:when="2008-03-14T16:30:00">Saturday, March 14, 4:30 PM EST</takeoff-time> <arrival-time common:when="2008-03-15T18:00:00">Sunday, March 15, 6:00 PM (local time)</arrival-time> </Flight> SAMPLE XML DOCUMENT FOR THE BOOK COMMUNITY (ENHANCED) <Book> <publication-date common:when="2005-01-01T00:00:00"> <month>January</month> <year>2005</year> </publication-date> </Book> Each community adds the standard "common:when" attribute to whatever element makes sense for their XML vocabulary. An application that has been upgraded to understand the new standard can simply extract the "common:when" attribute value. SOLUTION #2 Solution #1 is slightly disruptive - each community will need to modify their schemas and instance documents to account for the new attribute. However, solution #1 does exhibit all of the other desired features listed above. Solution #2 is: put the standard "When" information into a completely separate document (analogous to how CSS can be put into a completely separate document, and yet it still gets integrated with the markup by the browser). I am stuck. I do not know how to implement this second solution. How would, say, the Book community markup this data 2005-01-01T00:00:00, put it into a separate document, and then connect the markup to the <publication-date> element in the other document? Any exemplars (existing cow paths) for this second solution? 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! Cast Your Vote
We need your help – Vote for DataDirect XML Products!
Winners and finalists announced at SOA World Conference in November. Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|
|||||||||







