Loading ...
Sorry, an error occurred while loading the content.

1129Re: org.json.JSONML.java

Expand Messages
  • Stephen M. McKamey
    Jul 25, 2008
    • 0 Attachment
      I definitely agree. XML w/o namespaces is virtually useless these
      days.

      There is nothing about the format of JsonML that inhibits
      namespaces. Implementations either need to support some storage of
      the prefix/namespace aliasing (as Atif is showing) or be able to
      resolve the namespaces and use the fully qualified node names (as
      Mark is asking for). It seems that both are valid, just as they are
      in XML.

      Ignoring or dropping namespaces is not a good idea.

      --- In json@yahoogroups.com, "Mark Joseph" <mark@...> wrote:
      >
      > So when I read the original email about JSONML it was so
      > that any XML document could be encoded. And sorry
      > without namespaces that is not going to work very well.
      > Any XML tool, and we build several, that does not support
      > namespaces these days is not going to be used by anyone
      > doing serious work. So I suggest that the JSON group does
      > not ignore namespaces but figures out how to deal with
      > them,
      >
      > Best,
      > Mark
      > P6R, Inc
      >
      >
      > On Thu, 24 Jul 2008 23:22:28 +0200
      > Atif Aziz <atif.aziz@...> wrote:
      > > Like XML 1.0, JsonML does not need to care about
      > >namespaces. In XML 1.0, a colon (:) is a perfectly valid
      > >character in the element name. XML namespaces is nothing
      > >more than a standardized convention and interpretation of
      > >element and attributes names. Some XML parsers allow you
      > >to turn namespace handling on or off. Likewise, a JsonML
      > >encoder can look at XML without any regard for namespaces
      > >though the story could vary for a decoder. Here's an
      > >example. Suppose the following XML:
      > >
      > > <root xmlns:ns1="http://www.example.com/ns1"
      > > xmlns:ns2="http://www.example.com/ns2">
      > > <child />
      > > <ns1:child />
      > > <ns2:child />
      > > </root>
      > >
      > > In JsoML, this would become:
      > >
      > > [
      > > "root",
      > > {
      > > "xmlns:ns1": "http://www.example.com/ns1",
      > > "xmlns:ns2": "http://www.example.com/ns2"
      > > },
      > > ["child"],
      > > ["ns1:child"],
      > > ["ns2:child"]
      > > ]
      > >
      > > A JsonML decoder can decide to deliver the element and
      > >attribute names verbatim without any special
      > >interpretation of colon (:) in JSON object member names.
      > >If the user cares about URI + local name then he or she
      > >can put/pipe the XML delivered by the JsonML decoder
      > >through an XML parser implementation that will interpret
      > >and expose those properties. That's the approach Jayrock
      > >currently takes:
      > >
      > >
      http://svn.berlios.de/svnroot/repos/jayrock/trunk/src/Jayrock.Json/Jso
      nML/JsonMLEncoder.cs
      > >
      http://svn.berlios.de/svnroot/repos/jayrock/trunk/src/Jayrock.Json/Jso
      nML/JsonMLDecoder.cs
      > >
      > > - Atif
      > >
      > >
      > >From: json@yahoogroups.com [mailto:json@yahoogroups.com]
      > >On Behalf Of Mark Joseph
      > > Sent: Thursday, July 24, 2008 10:08 AM
      > > To: json@yahoogroups.com
      > > Subject: Re: [json] Re: org.json.JSONML.java
      > >
      > >
      > > Sorry I am just not getting this. The prefix, in my
      > > example is "P6R", but the prefix needs to be replaced by
      > > its matching URI. So the "P6R:tagName" in an XML
      > > processor
      > > gets replaced as "URI:tagName" since the prefix is not
      > > really important. So is that expansion done in JSONML?
      > >
      > > Best,
      > > Mark
      > >
      > > On Thu, 24 Jul 2008 05:35:53 -0000
      > > "Douglas Crockford" <douglas@...> wrote:
      > >> --- In json@yahoogroups.com, "Mark Joseph" <mark@>
      > >>wrote:
      > >>> Just so I understand your stuff resolves the XML
      > >>> namespace prefix (like "P6R:tagName") to the URI
      > >>> "http://www.p6r...:tagName", right? Because the URI is
      > >>> the real
      > >>> namespace name.
      > >>
      > >> It transforms <P6R:tagName> into
      > >>{"tagName":"P6R:tagName"} or
      > >> ["P6R:tagName"] and back.
      > >>
      > >
      > > -------------------------
      > > Mark Joseph, Ph.D.
      > > President and Secretary
      > > P6R, Inc.
      > > http://www.p6r.com
      > > 408-205-0361
      > >Fax: 831-476-7490
      > > Skype: markjoseph_sc
      > > IM: (Yahoo) mjoseph8888
      > > (AIM) mjoseph8888
      > >
      >
      > -------------------------
      > Mark Joseph, Ph.D.
      > President and Secretary
      > P6R, Inc.
      > http://www.p6r.com
      > 408-205-0361
      > Fax: 831-476-7490
      > Skype: markjoseph_sc
      > IM: (Yahoo) mjoseph8888
      > (AIM) mjoseph8888
      >
    • Show all 18 messages in this topic