[x3d-public] Stuck on Inlining JSON--Question for JSON Loader customers

Leonard Daly Leonard.Daly at realism.com
Tue Apr 5 20:14:32 PDT 2016


Catching up...


> Well I totally messed that up.  I'll add another pass that handles 
> Inline.  Does anyone know the semantics of Inlines and the best way to 
> splice/graft it into the main scenegraph body in DOM?  Obviously, it's 
> about time to integrate a JSON loader into X3DOM  and other Web 
> tools.  An alternative for X3DOM  is to use css selectors to patch in 
> the inline....will that even work naively?
>

I am familiar with the way X3DOM handles Inline files. X3DOM makes an 
HTTP GET request then runs the result back through the node parser. The 
node parser inserts the contents into the scene graph and DOM if 
nameSpaceName is defined.

I could see something like one of the following:
1) Provide a JSON parser as X3DOM code that performs the correct calls 
to add the node content. This would duplicate the current parser and 
would lead to multiple code paths for populating the 3D scene graph
2) Provide a JSON -> X3D converter that transforms the returned JSON 
file to an X3D file, then feed that to the X3DOM parser. This has the 
advantage of being simpler but slower. Inline is not run frequently nor 
many times, so this may not be such a bad way to start.

X3DOM is not really set up for plugin code, especially for parsing. 
Jumping to (1) may involve a lot of code maintenance if X3DOM undergoes 
a lot of changes.


Leonard Daly




> On Mar 30, 2016 12:05 AM, "John Carlson" <yottzumm at gmail.com 
> <mailto:yottzumm at gmail.com>> wrote:
>
>     Let me be more clear.  Do people want to use "Inline" as a key to
>     an object containing a JSON @url in a file received unto my X3D
>     JSON Loader?  I am thinking of adding a separate pass exclusively
>     for doing Inline downloading and substitution in the scenegraph. 
>     I may do Inlines before protos so I can create protos from inlines
>     (or vica versa if someone has a good feel for which comes first.)
>     If no one is using the Inline tag to Inline JSON (they should be
>     able to use Protos or ExternProtoDeclare with my server prototype
>     expander).
>
>     The X3D JSON loader already has mechanisms for loading JavaScript
>     objects, and a currently adjunct library for loading JSON URIs
>     called loaderJQuery.js.
>
>     On Mar 29, 2016 11:50 PM, "Leonard Daly" <Leonard.Daly at realism.com
>     <mailto:Leonard.Daly at realism.com>> wrote:
>
>         John,
>
>         I am not sure I have a full understanding of what you are
>         asking. I am going to restate and provide my view.
>
>         Are you asking if people will use an X3D JSON loader using
>         data stored in an HTML file rather than GETting it from a
>         server? The data would be stored as a JavaScript variable
>         (object) inside of a (HTML) script element.
>
>         It seems to me that including data in code in a file that is
>         meant for display is not good practice. The data is content,
>         but it needs to be processed before it is viewable as content.
>         I see JSON as far more useful as downloaded data. This doesn't
>         decrease the need for a XML->-JSON->XML converter chain. Does
>         your JSON loader load the scene into an X3DOM environment? If
>         not, what runtime do you use for display of the 3D content?
>
>         If it does load it into an X3DOM run-time, perhaps it is
>         better written as the download callback routine for X3DOM's
>         Inline.
>
>         Leonard Daly
>
>
>
>
>>         Do people want to Inline JSON files in my X3D JSON Loader?  I think they do, but I’m pretty sure I want to separate the code out into my prototype expander.  How do people feel about this?  Ultimately, I think that X3DOM and Cobweb will fully support JSON, but until they do, can we develop a stopgap measure?
>>
>>         I don’t want to put Inline JSON in my X3D JSON Loader, because it introduces a dependency on AJAX/JQuery, and changes the DOM/XML so I can’t do roundtrip comparisons with the original X3D.
>>
>>         Who is using the X3D JSON Loader at this time and what are the requirements?  The loader is moving towards a support role for verifying the JSON encoding, and unless my customers speak up, it will continue to move that way.
>>
>>         John
>>         _______________________________________________
>>         x3d-public mailing list
>>         x3d-public at web3d.org <mailto:x3d-public at web3d.org>
>>         http://web3d.org/mailman/listinfo/x3d-public_web3d.org
>
>
>         -- 
>         *Leonard Daly*
>         3D Systems & Cloud Consultant
>         X3D Co-Chair on Sabbatical
>         LA ACM SIGGRAPH Chair
>         President, Daly Realism - /Creating the Future/
>
>         _______________________________________________
>         x3d-public mailing list
>         x3d-public at web3d.org <mailto:x3d-public at web3d.org>
>         http://web3d.org/mailman/listinfo/x3d-public_web3d.org
>


-- 
*Leonard Daly*
3D Systems & Cloud Consultant
X3D Co-Chair on Sabbatical
LA ACM SIGGRAPH Chair
President, Daly Realism - /Creating the Future/
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://web3d.org/pipermail/x3d-public_web3d.org/attachments/20160405/717ae12f/attachment-0001.html>


More information about the x3d-public mailing list