<html xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40"><head><meta http-equiv=Content-Type content="text/html; charset=utf-8"><meta name=Generator content="Microsoft Word 15 (filtered medium)"><style><!--
/* Font Definitions */
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri",sans-serif;}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:#954F72;
        text-decoration:underline;}
.MsoChpDefault
        {mso-style-type:export-only;}
@page WordSection1
        {size:8.5in 11.0in;
        margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
        {page:WordSection1;}
--></style></head><body lang=EN-US link=blue vlink="#954F72"><div class=WordSection1><p class=MsoNormal>I would like to set the XsltEngine ConfigurationProperty from the command line.</p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>Small favor will help immensely I think.</p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>-Dx3djsail.xslt.engine=NATIVE_JAVA</p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>Or:</p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>-Dx3djsail.xslt.engine=SAXON9HE</p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>Or:</p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>Another way?</p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>And how do I put it in the build.xml? Trying to put it before the java class….</p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>Thanks,</p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>John</p><p class=MsoNormal>Sent from <a href="https://go.microsoft.com/fwlink/?LinkId=550986">Mail</a> for Windows 10</p><p class=MsoNormal><o:p> </o:p></p><div style='mso-element:para-border-div;border:none;border-top:solid #E1E1E1 1.0pt;padding:3.0pt 0in 0in 0in'><p class=MsoNormal style='border:none;padding:0in'><b>From: </b><a href="mailto:yottzumm@gmail.com">John Carlson</a><br><b>Sent: </b>Thursday, December 14, 2017 6:03 AM<br><b>To: </b><a href="mailto:brutzman@nps.edu">Don Brutzman</a><br><b>Cc: </b><a href="mailto:x3d-public@web3d.org">x3d-public@web3d.org</a><br><b>Subject: </b>RE: feature request for X3DJSAIL</p></div><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>Thanks Don, I knew I should have looked at ConfigurationProperties. Is there a way to load ConfigurationProperties through a Properties file?  I see the use of Properties in BrowserFactory, but I think it may be unrelated.<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>I’m not saying I’m fond of Properties files, or want you to implement it, as it appears counter to web-development in general.  In otherwords, I can deal with it if my only option is to set it in the program itself.  In fact, I would prefer it if you didn’t use Properties at all for portability.<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>It’s much more important that we figure out how do export to JSON (for use in the intermediate step of the to JavaScript serializer).  And how that is different (or even the same) from the JSON produced from X3dToJson.xslt for example.<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal style='text-align:justify;text-justify:inter-ideograph'>If on the other hand, you want to pursue a stylesheet solution for generating JavaScript (and a variety of other programming languages we’re working on), like you did with X3dToJava.xslt, that’s okay by me, as I’ve suggested.  I don’t expect to be supporting any stylesheets myself, and am still pursuing other options for DOM->JSON conversion, so I am freed from stylesheets.<o:p></o:p></p><p class=MsoNormal style='text-align:justify;text-justify:inter-ideograph'><o:p> </o:p></p><p class=MsoNormal style='text-align:justify;text-justify:inter-ideograph'>As usual, I want to do the stylesheets in the web browser, and so far, it looks like that is not a viable option for low cost (free).  I would love to be proved wrong, and that I can use X3dToJson.xlst in the web browser for free.  Ideally, I would have no server-side dependencies besides serving files, and perhaps file search.    The use case I am trying to solve is where someone enters XML into X3DJSONLD and wants a conversion to JSON.  I believe this is mostly solved with server-side support at this time.  My attempts at using Saxon-CE have failed in the past, and it may be that I even attempt a conversion with Saxon-CE at this point, and the results are not what I expect.  To see for yourself, visit <a href="https://coderextreme.net/X3DJSONLD/">https://coderextreme.net/X3DJSONLD/</a> and click on the “here” in the sentence that appears on the website: <span style='font-size:13.5pt;font-family:"Times New Roman",serif;color:black'>Click </span>here<span style='font-size:13.5pt;font-family:"Times New Roman",serif;color:black'> to load X3D XML into Cobweb and XML X3DOM viewer.<o:p></o:p></span></p><p class=MsoNormal style='text-align:justify;text-justify:inter-ideograph'><span style='font-size:13.5pt;font-family:"Times New Roman",serif;color:black'><o:p> </o:p></span></p><p class=MsoNormal style='text-align:justify;text-justify:inter-ideograph'>Observe the alerts, then peruse the JSON result at left to see the problems.   The result JSON doesn’t even parse properly and if you try to load it, it will blank out the JSON. Whoops!  As far as I know, the original JSON that does come from the XML does parse properly.<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>It looks like EXI is broken in X3DJSONLD.  As I download the code from external sources, perhaps something broke, not sure.  I will have to look into it.<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>Thanks,<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>John<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>Sent from <a href="https://go.microsoft.com/fwlink/?LinkId=550986">Mail</a> for Windows 10<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><div style='border:none;border-top:solid #E1E1E1 1.0pt;padding:3.0pt 0in 0in 0in'><p class=MsoNormal><b>From: </b><a href="mailto:brutzman@nps.edu">Don Brutzman</a><br><b>Sent: </b>Wednesday, December 13, 2017 12:19 PM<br><b>To: </b><a href="mailto:yottzumm@gmail.com">John Carlson</a><br><b>Cc: </b><a href="mailto:x3d-public@web3d.org">x3d-public@web3d.org</a><br><b>Subject: </b>Re: feature request for X3DJSAIL<o:p></o:p></p></div><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>Thanks for the interesting suggestion John.  Hmmm...<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>On 12/10/2017 11:49 PM, John Carlson wrote:<o:p></o:p></p><p class=MsoNormal>> Provide an argument or CommandLine parameter or ConfigurationProperty which allows you to bypass the validation check, or at least ignore the results, and produce a partial output file (XML and JSON only initially).<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>It looks like your wish is already granted as part of ConfigurationProperties class, available to X3DJSAIL programmers.  Also some fine-tuning options.<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>Looking at X3DObject, am finding the following code block under toFileX3D(fileName) method.  Note inclusion of ConfigurationProperties.isValidationExceptionAllowed() call.  Javadoc follows.<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>==============================================<o:p></o:p></p><p class=MsoNormal>                public File toFileX3D(String fileName)<o:p></o:p></p><p class=MsoNormal>                {<o:p></o:p></p><p class=MsoNormal>                                String errorNotice = new String();<o:p></o:p></p><p class=MsoNormal>                                if ((fileName == null || fileName.isEmpty()))<o:p></o:p></p><p class=MsoNormal>                                {<o:p></o:p></p><p class=MsoNormal>                                                throw new X3DException("toFileX3D(fileName) fileName not provided;" +<o:p></o:p></p><p class=MsoNormal>                                                                " be sure to end with extension \"" + FILE_EXTENSION_X3D + "\"");<o:p></o:p></p><p class=MsoNormal>                                }<o:p></o:p></p><p class=MsoNormal>                                if (!fileName.endsWith(FILE_EXTENSION_X3D) && !fileName.endsWith(FILE_EXTENSION_XML))<o:p></o:p></p><p class=MsoNormal>                                {<o:p></o:p></p><p class=MsoNormal>                                                throw new X3DException("fileName " + fileName + " does not end with extension " +<o:p></o:p></p><p class=MsoNormal>                             "\"" + FILE_EXTENSION_X3D + "\" or " +<o:p></o:p></p><p class=MsoNormal>                             "\"" + FILE_EXTENSION_XML + "\"");<o:p></o:p></p><p class=MsoNormal>                                }<o:p></o:p></p><p class=MsoNormal>                                Path outputFilePath = Paths.get(fileName);<o:p></o:p></p><p class=MsoNormal>                                if (ConfigurationProperties.isDebugModeActive()) // debug check, defaults to local directory<o:p></o:p></p><p class=MsoNormal>                                {<o:p></o:p></p><p class=MsoNormal>                                                errorNotice += "[debug] Output file path=" + outputFilePath.toAbsolutePath() + "\n";<o:p></o:p></p><p class=MsoNormal>                                                System.out.println (errorNotice);<o:p></o:p></p><p class=MsoNormal>                                }<o:p></o:p></p><p class=MsoNormal>                                <o:p></o:p></p><p class=MsoNormal>                                // http://docs.oracle.com/javase/8/docs/technotes/guides/intl/encoding.doc.html<o:p></o:p></p><p class=MsoNormal>                                // http://docs.oracle.com/javase/8/docs/api/java/nio/charset/Charset.html<o:p></o:p></p><p class=MsoNormal>                                Charset charset = Charset.forName(ConfigurationProperties.XML_ENCODING_DECLARATION_DEFAULT); // "UTF-8"<o:p></o:p></p><p class=MsoNormal>                                                                                                                                                <o:p></o:p></p><p class=MsoNormal>                                try<o:p></o:p></p><p class=MsoNormal>                                {              <o:p></o:p></p><p class=MsoNormal>                                                validate(); // strict checks before serializing scene and saving file<o:p></o:p></p><p class=MsoNormal>                                }<o:p></o:p></p><p class=MsoNormal>                                catch (Exception e)<o:p></o:p></p><p class=MsoNormal>                                {<o:p></o:p></p><p class=MsoNormal>                                                System.out.println (e); // output exception but allow serialization to continue, file may be editable<o:p></o:p></p><p class=MsoNormal>                                                e.printStackTrace();<o:p></o:p></p><p class=MsoNormal>                                                if (ConfigurationProperties.isValidationExceptionAllowed())<o:p></o:p></p><p class=MsoNormal>                                                                System.out.println ("Output serialization allowed to continue, file may be editable...");<o:p></o:p></p><p class=MsoNormal>                                                else throw (e);<o:p></o:p></p><p class=MsoNormal>                                }<o:p></o:p></p><p class=MsoNormal>[...]<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>==============================================<o:p></o:p></p><p class=MsoNormal>public static boolean isValidationExceptionAllowed()<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>Indicate whether partial results are allowed if validation exception occurs when serializing scene output.<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>Returns:<o:p></o:p></p><p class=MsoNormal>     whether validation exceptions are allowed (and operation continues)<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>http://www.web3d.org/specifications/java/javadoc/org/web3d/x3d/jsail/ConfigurationProperties.html#isValidationExceptionAllowed--<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>==============================================<o:p></o:p></p><p class=MsoNormal>public static void setValidationExceptionAllowed(boolean newValidationExceptionAllowed)<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>Set whether partial results are allowed (and operation continues) if validation exception occurs when serializing scene output. Can be useful technique for debugging, default value is false for strict operation.<o:p></o:p></p><p class=MsoNormal>Warning: setting value to true permits creation of an invalid scene graph.<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>Parameters:<o:p></o:p></p><p class=MsoNormal>     newValidationExceptionAllowed - whether validation exceptions are allowed (and operation continues)<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>http://www.web3d.org/specifications/java/javadoc/org/web3d/x3d/jsail/ConfigurationProperties.html#setValidationExceptionAllowed-boolean-<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>==============================================<o:p></o:p></p><p class=MsoNormal>public static boolean isCreationConnectionValidationExceptionAllowed()<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>Indicate whether continuation is allowed if validation exception occurs when creating an object.<o:p></o:p></p><p class=MsoNormal>Warning: TODO experimental.<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>Returns:<o:p></o:p></p><p class=MsoNormal>     whether validation exceptions are allowed (and operation continues) during object creation<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>http://www.web3d.org/specifications/java/javadoc/org/web3d/x3d/jsail/ConfigurationProperties.html#isCreationConnectionValidationExceptionAllowed--<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>==============================================<o:p></o:p></p><p class=MsoNormal>public static void setCreationConnectionValidationExceptionAllowed(boolean newCreationConnectionValidationExceptionAllowed)<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>Set whether partial results are allowed (and operation continues) if validation exception occurs when creating an object. Can be useful technique for debugging, default value is true for permissive order of object creation.<o:p></o:p></p><p class=MsoNormal>Warning: be sure to validate() this scene once construction is complete.<o:p></o:p></p><p class=MsoNormal>Warning: TODO experimental.<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>Parameters:<o:p></o:p></p><p class=MsoNormal>     newCreationConnectionValidationExceptionAllowed - whether validation exceptions are allowed (and object creation continues)<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>http://www.web3d.org/specifications/java/javadoc/org/web3d/x3d/jsail/ConfigurationProperties.html#setCreationConnectionValidationExceptionAllowed-boolean-<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>==============================================<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>all the best, Don<o:p></o:p></p><p class=MsoNormal>-- <o:p></o:p></p><p class=MsoNormal>Don Brutzman  Naval Postgraduate School, Code USW/Br       brutzman@nps.edu<o:p></o:p></p><p class=MsoNormal>Watkins 270,  MOVES Institute, Monterey CA 93943-5000 USA   +1.831.656.2149<o:p></o:p></p><p class=MsoNormal>X3D graphics, virtual worlds, navy robotics http://faculty.nps.edu/brutzman<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal><o:p> </o:p></p></div></body></html>