1

In XML and JSON we may have namespaces in property/element names like so:

<system:example>test</system:example>

or

{ "system:example" : test }

In general, does it violate some rules or conventions to have "multi-nested" namespaces like the following?

<myapp:sys:authorization>...</myapp:sys:authorization>

or

 { "myapp:sys:authorization" : { ... } }
Ciabaros
  • 1,984
  • 13
  • 15

1 Answers1

1

You really have two questions here...

JSON

Base JSON allows multiple colons in string,

enter image description here

and makes no reference to namespaces.

XML

There cannot be multiple namespace prefixes in namespace-well-formed XML. The base XML recommendation allows multiple colons in a tag name but specifically says that colons should be used for namespace prefixes per the XML Namespaces recommendation, which does not allow multiple namespace prefixes in a tag name. See Is it possible to have multiple namespace prefixes in XML? for details.

Interoperability

If you're looking for maximal interoperability between JSON and XML, do not use multiple namespace prefixes.

Community
  • 1
  • 1
kjhughes
  • 106,133
  • 27
  • 181
  • 240