[x3d-public] X3dToJson.xslt error. \n converted to \\ in script
John Carlson
yottzumm at gmail.com
Sun Apr 17 18:31:51 PDT 2016
Also compare quoting in scripts for these two files:
/www.web3d.org/x3d/content/examples//Basic/development/CameraPrototypes.json
/www.web3d.org/x3d/content/examples//Basic/development/CameraPrototypes.x3d
\’ gets translated to \\ (left out the ‘)
Probably below, \n should be translated to \\n or just left as is, I am not sure, something we could try.
there may be others.
Perhaps we need to write down all the initial states (in comment, in script, in shader, in url, etc) and all the transformations we need to do.
I am just running X3dToJson.xslt with saxon.jar. If there’s any more processing I need to do, let me know.
I include Java source code below for debugging. Source code for roundtripping is here: https://github.com/coderextreme/x3droundtrip Bug reports/Issues are welcome.
class RunSaxon {
protected static class ExitException extends SecurityException
{
public final int status;
public ExitException(int status)
{
super("There is no escape!");
this.status = status;
}
}
private static class NoExitSecurityManager extends SecurityManager
{
@Override
public void checkPermission(java.security.Permission perm)
{
// allow anything.
}
@Override
public void checkPermission(java.security.Permission perm, Object context)
{
// allow anything.
}
@Override
public void checkExit(int status)
{
super.checkExit(status);
throw new ExitException(status);
}
}
public static void main(String args[]) {
try {
System.setSecurityManager(new NoExitSecurityManager());
for (int a = 0; a < args.length; a++) {
try {
System.err.println("BEGIN "+args[a]);
net.sf.saxon.Transform.main(new String[] {
"-warnings:recover",
"-o",
args[a].substring(0, args[a].lastIndexOf("."))+".json",
args[a],
"X3dToJson.xslt" });
// -t #timing -c # compiled
System.err.println("END "+args[a]);
} catch (Throwable e) {
System.err.println("FATAL "+args[a]);
System.err.println(e.getMessage());
}
}
System.setSecurityManager(null); // or save and restore original
} catch (ExitException ee) {
ee.printStackTrace();
}
}
}
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://web3d.org/pipermail/x3d-public_web3d.org/attachments/20160417/35cda8ec/attachment-0001.html>
More information about the x3d-public
mailing list