[x3d-public] Fwd: New X3D JSON Loader that is namespace unaware

John Carlson yottzumm at gmail.com
Sat Mar 12 17:52:52 PST 2016



> Begin forwarded message:
> 
> From: John Carlson <john.carlson3 at sbcglobal.net>
> Subject: New X3D JSON Loader that is namespace unaware
> Date: March 12, 2016 at 8:52:25 PM EST
> To: Clement IGONET <clement at igonet.fr>, Don Brutzman <brutzman at nps.edu>, Roy Walmsley <roy.walmsley at ntlworld.com>
> Cc: x3dom mlist <x3dom-users at lists.sourceforge.net>
> 
> I have stripped out the namespace functionality out of the X3DJSON loader.  It was too problematic. After I generate the XML, I do the following JavaScript:
> 
>                 var serializer = new XMLSerializer();
>                 var xmlstr = serializer.serializeToString(child);
> 
>                 // get rid of self-closing tags
>                 xmlstr = xmlstr.replace(/(<[ \t]*)([A-Za-z0-9]+)([^>]*)\/>/g, "$1$2$3></$2>");
>                 // strip out namespace
>                 xmlstr = xmlstr.replace(/xmlns="[^"]*"/g, "");
> 
>                 // strip out schema
>                 xmlstr = xmlstr.replace(/xsd:noNamespaceSchemaLocation="[^"]*"/g, "");
> 
> I am happy to report that the X3DJSON loader works with Cobweb in Chrome now (yay!).  The major problem appeared to be the specification of the X3D XML schema, for those of you trying to incorporate your X3D into Cobweb.  Cobweb or the browser gets tired of loading scenes after a while, it appears.
> 
> 
> Note that while I am getting good results on some files, some of *my* files aren’t working and I’m going to do more research.  This is just to announce that I’ve removed namespaces from my code (although the xml serializer still produces it).
> 
> https://github.com/coderextreme/X3DJSONLD/ <https://github.com/coderextreme/X3DJSONLD/>
> http://coderextreme.net/X3DJSONLD/ <http://coderextreme.net/X3DJSONLD/>
> 
> John

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://web3d.org/pipermail/x3d-public_web3d.org/attachments/20160312/b8b6beef/attachment.html>


More information about the x3d-public mailing list