[x3d-public] glTF to XML-like language (not COLLADA, I don't think). Just for fun!
John Carlson
yottzumm at gmail.com
Fri Sep 29 00:46:50 PDT 2017
So you want glTF (Or many other JSON objects?) as XML wrapped in gltf tags? Try this:
https://github.com/coderextreme/X3DJSONLD/blob/master/gltf2xml.js
Use at your own risk!
Usage:
node gltf2xml.js file.gltf > file.xml ← this file gets overwritten
writeAsXML(indentLevel, parentName, jsonObject, indexOfJsonObjectInParent);
Problem reports are welcome.
I’m missing the xml header, I know. I am thinking this will be a document fragment, and will convert it over to creating DOM.
I can’t really mix scalars and objects in an array yet. Modifications are welcome.
gltfxml events and mutations anyone?
Writes to standard out. Desirable to write to file descriptor. Use this shell script to overwrite xml files.
#!/bin/bash
# usage: $0 file.gltf
node.exe gltf2xml.js $1 > `dirname $1`/`basename $1 .gltf`.xml
John
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://web3d.org/pipermail/x3d-public_web3d.org/attachments/20170929/3cad060f/attachment.html>
More information about the x3d-public
mailing list