<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">It doesn’t work because it’s an XSLT 2.0 stylesheet.  You can use it with SaxonCE, available here: <a href="http://saxonica.com/ce/index.xml" class="">http://saxonica.com/ce/index.xml</a><div class=""><br class=""></div><div class="">John</div><div class=""><br class=""><div><blockquote type="cite" class=""><div class="">On Nov 28, 2015, at 3:30 AM, John Carlson <<a href="mailto:yottzumm@gmail.com" class="">yottzumm@gmail.com</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><meta http-equiv="Content-Type" content="text/html charset=utf-8" class=""><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">Okay, I was able to replace X3dToJson.xslt with xml2json.xsl and my webpage “worked.”  So now we have to track down why Don’s stylesheet doesn’t work in browsers.  My brain is coming back to life.<div class=""><br class=""></div><div class="">John<br class=""><div class=""><blockquote type="cite" class=""><div class="">On Nov 28, 2015, at 2:31 AM, John Carlson <<a href="mailto:yottzumm@gmail.com" class="">yottzumm@gmail.com</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><meta http-equiv="Content-Type" content="text/html charset=utf-8" class=""><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">I tried removing all line breaks outputted from the stylesheet.  Same result.  and xmlsh works.  This is getting strange.<div class=""><br class=""></div><div class="">John<br class=""><div class=""><blockquote type="cite" class=""><div class="">On Nov 28, 2015, at 1:35 AM, John Carlson <<a href="mailto:yottzumm@gmail.com" class="">yottzumm@gmail.com</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><meta http-equiv="Content-Type" content="text/html charset=utf-8" class=""><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div class="">Don, I’m trying to use X3dToJson.xslt in a web page to produce JSON from X3D XML.</div><div class=""><br class=""></div><div class="">Here’s what I get:</div><div class=""><br class=""></div><div class=""><br class=""></div><div class="">{ "X3D": {</div><div class=""><br class=""></div><div class=""><br class=""></div><div class="">Here’s my function:</div><div class=""><br class=""></div><div class=""><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class=""><span class="Apple-tab-span" style="white-space:pre">  </span>function convertXMLToJSON() {</div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class=""><span class="Apple-tab-span" style="white-space:pre">            </span>$.get("X3dToJson.xslt", function(xsl) {</div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class=""><span class="Apple-tab-span" style="white-space:pre">                        </span>var content = $('textarea#xml').val();</div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class=""><span class="Apple-tab-span" style="white-space:pre">                   </span>var xml = $.parseXML(content);</div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class=""><span class="Apple-tab-span" style="white-space:pre">                   </span>// code for IE</div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class=""><span class="Apple-tab-span" style="white-space:pre">                   </span>if (window.ActiveXObject) {</div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class=""><span class="Apple-tab-span" style="white-space:pre">                              </span>json = xml.transformNode(xsl);</div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class=""><span class="Apple-tab-span" style="white-space:pre">                   </span>}</div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class=""><span class="Apple-tab-span" style="white-space:pre">                        </span>// code for Chrome, Firefox, Opera, etc.</div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class=""><span class="Apple-tab-span" style="white-space:pre">                 </span>else if (document.implementation && document.implementation.createDocument) {</div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class=""><span class="Apple-tab-span" style="white-space:pre">                            </span>xsltProcessor = new XSLTProcessor();</div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class=""><span class="Apple-tab-span" style="white-space:pre">                             </span>xsltProcessor.importStylesheet(xsl);</div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class=""><span class="Apple-tab-span" style="white-space:pre">                             </span>json = xsltProcessor.transformToDocument(xml);</div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class=""><span class="Apple-tab-span" style="white-space:pre">                   </span>}</div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class=""><span class="Apple-tab-span" style="white-space:pre">                        </span>console.log('JSON', json);</div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class=""><span class="Apple-tab-span" style="white-space:pre">                       </span>$('textarea#json').val(getXmlString(json));</div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class=""><span class="Apple-tab-span" style="white-space:pre">              </span>}, "xml");</div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class=""><span class="Apple-tab-span" style="white-space:pre">     </span>}</div></div><div class=""><br class=""></div><div class="">The stylesheet and input works fine in xmlsh.  Would it be possible to change a stylesheet parameter to not emit newlines or line breaks—or possibly remove all line breaks in output at the end—or my problem might be solved a different way?  I’m going to work on a simpler example.</div><div class=""><br class=""></div><div class="">John</div></div></div></blockquote></div><br class=""></div></div></div></blockquote></div><br class=""></div></div></div></blockquote></div><br class=""></div></body></html>