0
votes

I have HTTP Server 3 from http://www.boost.org/doc/libs/1_47_0/doc/html/boost_asio/examples.html running on localhost. I want to transform .xml file using javascript. I use these examples: http://www.w3schools.com/xsl/xsl_client.asp These examples work for me when I am using web server (not Boost), so i know that the code is OK. Boost server displays nothing. loadXMLDoc and xsltProcessor return null.

Anyone knows what's the problem? thanks

Edit: actually xsltProcessor returns object, but xsltProcessor.transformToFragment(xml, document); returns null.

Edit2: loadXMLDoc("cdcatalog.xml") returns object, but loadXMLDoc("cdcatalog.xsl") returns null.

Edit3: Added mime type in mime-types.cpp

{ "xml", "application/xml"},

 { "xsl", "text/xsl" },

now it is working in Chrome but still not working in Firefox, IE.

Edit4: Debugging in IE displays error:

The stylesheet does not contain a document element. The stylesheet may be empty, or it may not be a well-formed XML document.

after line:

ex = xml.transformNode(xsl);

Firefox executes xsltProcessor.importStylesheet(xsl); but then jumps to line: document.getElementById("example").appendChild(resultDocument);

both IE and Firefox display nothing.

1

1 Answers

0
votes

If anyone will be interested the problem was with mime types. Mime types should be:

{ "xml", "application/xml"},

{ "xsl", "text/xml" },