Copyright © 2015 Open Geospatial Consortium.
25
NOTE: the line peach : some, is missing in the original example.
To access the text node you simple repeated the name of the node: branch.branch The section 6.1.3 in OGC 14-009r1 does not state that a combination of a XML element
containing a text node and one of more attributes is in the scope of the same problem even if these cases cannot be called a mixed XML element. This case is much more
common in the OGC. For example, this situation is already present in WFS Capabilities documents such as this one:
http:cida.usgs.govnwcgeoserverNHDPlusFlowlinesows?service=WFSversion=1.0. 0request=GetCapabilities:
ogc:Function_Name nArgs=1absogc:Function_Name
that will end in:
ogc_Function_Name: {
ogc_Function_Name: abs; nArgs:1
}
6.1.1.3 NULL elements
OGC 14-009r1 Section 6.2.4 says: “The XML empty elements must be explicitly transformed to the null JSON object.”
This way an XML fragment like this:
tree value=false child
tree
is transformed into this:
tree : { child : null
}
In this explanation, it would be good to add this similar case:
Get onlineResource=http:cida.usgs.gov:80nwcgeoserverNHDPlusFlow
lineswfs?request=GetCapabilities
In this case there is no need to generate a null element and the transformation would be:
Get:
26
Copyright © 2015 Open Geospatial Consortium.
{ onlineResource:
http:cida.usgs.gov:80nwcgeoserverNHDPlusFlowlineswfs?reque st=GetCapabilities
}
In addition, it could be useful to differentiate an empty attribute from a null element. For example:
tree value=false child
child2child2 tree
it will be transformed into this:
tree : { child : null
child2 : }
Recommendation 8: Produce an OGC best practice for converting XML documents into JSON based on OGC 14-009r1 and some other considerations exposed in this ER.
Target: OWS Common
6.1.2 Exceptions to the general rules
6.1.2.1 Encoding the Object-property alternation in JSON
GML and ISO 19115 are two examples of documents that use the object-property model where objects names in fact the class names in UpperCamelCase contain only property
names in lowerCamelCase. Properties can be defined as objects again in UpperCamelCase. When translating into JSON the class name needs to be removed and
substituted by a type key e.g. type with a reference to a class type name.
This way, the following XML fragment:
mdb:MD_Metadata mdb:contact
cit:CI_Responsibility cit:party
cit:CI_Organisation cit:name
gco:CharacterStringInstitut Cartogrà fic de Catalunya ICCgco:CharacterString
cit:name cit:contactInfo
cit:CI_Contact