You can use something called Clark notation, but that’s not a standard and is a
convention wherein part of the name can be treated as a namespace.
{
“{http://my.namespace.com/some/uri}id”: 1234
}
http://www.jclark.com/xml/xmlns.htm
But if you need namespace support, it’s hard to beat XML.
Paul Hoehne
Senior Consultant
MarkLogic Corporation
[email protected]
mobile: +1 571 830 4735
www.marklogic.com
Click http://po.st/hMGDFm to get your free NoSQL For Dummies e-book!
From: Justin Makeig
<[email protected]<mailto:[email protected]>>
Reply-To: MarkLogic Developer Discussion
<[email protected]<mailto:[email protected]>>
Date: Wednesday, May 6, 2015 at 12:32 PM
To: MarkLogic Developer Discussion
<[email protected]<mailto:[email protected]>>
Subject: Re: [MarkLogic Dev General] JSON with namespace (XML to JSON - JSON to
XML)
No, for better or worse, JSON doesn't have the concept of namespaces as part of
the data model like XML. You could capture the XML namespace as a property of
the JSON document during transformation or use a naming convention for property
names, e.g. "person$firstName". For namespaces that cover the entire document
you might also consider a MarkLogic collection, for example,
<person
xmlns="http://example.org/ns/person"><first-name>Gnanaprakash</first-name></person>
would map to
{ "firstName": "Gnanaprakash" } in the collection
http://example.com/ns/person#Person, capturing the fully namespaced root
element.
Justin
On May 5, 2015, at 6:12 AM,
[email protected]<mailto:[email protected]>
wrote:
Hi
I am just wondering is there any way we have JSON documents with namespaces.
When an XML document is converted as JSON we lose the namespaces as JSON won’t
carry namespace
and we try to covert JSON back to XML, the XML no longer carry the namespace as
the source is JSON.
Is there any solution for this?
Regards,
Gnanaprakash Bodireddy
This e-mail and any files transmitted with it are for the sole use of the
intended recipient(s) and may contain confidential and privileged information.
If you are not the intended recipient(s), please reply to the sender and
destroy all copies of the original message. Any unauthorized review, use,
disclosure, dissemination, forwarding, printing or copying of this email,
and/or any action taken in reliance on the contents of this e-mail is strictly
prohibited and may be unlawful. Where permitted by applicable law, this e-mail
and other e-mail communications sent to and from Cognizant e-mail addresses may
be monitored.
_______________________________________________
General mailing list
[email protected]<mailto:[email protected]>
Manage your subscription at:
http://developer.marklogic.com/mailman/listinfo/general
_______________________________________________
General mailing list
[email protected]
Manage your subscription at:
http://developer.marklogic.com/mailman/listinfo/general