<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=""><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=""><p 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() {</p>
<p 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) {</p>
<p 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();</p>
<p 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);</p>
<p 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</p>
<p 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) {</p>
<p 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);</p>
<p style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class=""><span class="Apple-tab-span" style="white-space:pre">                    </span>}</p>
<p 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.</p>
<p 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) {</p>
<p 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();</p>
<p 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);</p>
<p 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);</p>
<p style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class=""><span class="Apple-tab-span" style="white-space:pre">                    </span>}</p>
<p 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);</p>
<p 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));</p>
<p style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class=""><span class="Apple-tab-span" style="white-space:pre">            </span>}, "xml");</p>
<p style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class=""><span class="Apple-tab-span" style="white-space:pre">    </span>}</p></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></body></html>