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]
When converting XML to JSON, you can safely drop all id attributes

Hi Folks,

 

Common practice in XML design is to liberally sprinkle id attributes throughout the XML. Why? Because it facilitates intra-document linking (via the id-idref mechanism) and inter-document linking.

 

The following example shows the use of an id attribute to facilitate an intra-document reference:

 

 

JSON does not have attributes. The JSON Reference specification [1] defines a syntax for intra-document and inter-document references and it does not use anything like an id attribute. The above intra-document reference is expressed like this:

 

{ "$ref": "#/Library/BookCatalogue/Book" }

 

Lesson Learned: when converting XML to JSON you can safely drop all id attributes.

 

/Roger

 

[1] http://tools.ietf.org/html/draft-pbryan-zyp-json-ref-03

 



[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