Re: [json] Stoppable SAX-like interface for streaming input of JSON text
- On Fri, Feb 6, 2009 at 5:33 PM, Fang Yidong <fangyidong@...> wrote:
>Yes, if your document has nesting level of about million or so. :-D
>> Maybe, but not necessarily, because this information if implicit
>> within call stack (except for having to track end markers).
>> That is, it's a recursive-descent kind of approach where you know
>> where you came from, usually without additional tracking of location.
>> Code branches based on constructs encountered.
> Yes, it's convenient. But I think it may result in a call stack based processor instead of a heap based
> one, right? The former will cause stack overflow issues in a deep nesting level. Here's a heap
So I don't think that is a practical concern.
If it happens to be, then one can construct explicit stack, similar to
how one has to do it with SAX-like interfaces.
> based processor for building object graph with SAX-like interface:Right: that builds "poor man's object binding", List/Map/primitive
structure from Json.
Most Json parsers offer that functionality via API, so it need not be
built from low-level components (json.org and others).
Code with pull API would be quite similar, although one could choose
between recursion and iteration with explicit stack.
-+ Tatu +-
- Ah I am sorry I was not clear we provide the JSON and XML
tools to C++ users not Java.
On Sat, 7 Feb 2009 19:10:21 -0800
Tatu Saloranta <tsaloranta@...> wrote:
> On Sat, Feb 7, 2009 at 4:25 PM, Mark Joseph-------------------------
>> I was reading over the StAX specification and BEA
>> licenses to the API, but that license prevents
>> sublicenses. This means I as a vendor cannot provide my
>> own implementation and license that to customers. So
> I don't see why you would need a license to implement an
> Generally licensing governs usage of API itself,
>distributing it, modifying etc.
> None of those are usually needed, because Stax is part
>of JDK 1.6.
> Or you point users to download API jar itself from
>whoever can provide it.
> Also: whatever stax specs download bundle claims is
> But yes, clearly BEA screwed up licensing mentions and
>> I am reading that right what is the point of that
>> We at P6R provide JSON and XML tools (amoung others),
>> if the standard has restrictions on it then its not a
>> standard that we can use.
> Just to be clear: Stax API itself has little to do with
>Json. It is a
> Java xml processing API, and would be of little help for
> no point in trying to implement it, due to fundamental
> between xml and json data formats.
> But similar style ("pull parsing") is useful.
> -+ Tatu +-
Mark Joseph, Ph.D.
President and Secretary
IM: (Yahoo) mjoseph8888
- On Sat, Feb 7, 2009 at 8:35 PM, Mark Joseph <mark@...> wrote:
> Ah I am sorry I was not clear we provide the JSON and XMLOk that explains it. I shouldn't have assume it's for Java either.
> tools to C++ users not Java.
And it is true that for products that cover both xml and json, it is
advantageous to use same or similar interfaces too. There are some
java libraries that do something similar, such as jettison that
exposes json through java xml interfaces (stax in this case).
-+ Tatu +-