Re: problem with Transforming dynamically generated xmll



reed.emmons@xxxxxxxxx wrote:
I'm trying to load and transform dynamically created xml. It works
great in IE but in Mozilla, it will not transform. I discovered that
when I copy the generated xml into a flat file, it works.

You will need to show a minimal but complete sample of the XML and XSLT demonstrating the problem. Make sure that the server sends the HTTP Content-Type: application/xml header for your XML as otherwise Mozilla does not build an XML DOM document at all.


function loadXMLDoc(fileName)
{
var xmlDoc;
// code for IE
if (window.ActiveXObject){
xmlDoc=new ActiveXObject("Microsoft.XMLDOM");

Note that only Msxml2.DOMDocument.3.0 and later (e.g. Msxml2.DOMDocument.4.0, 5.0, 6.0) support XSLT 1.0 while Microsoft.XMLDOM might give you a DOM document that does not support XSLT 1.0.

// code for Mozilla, Firefox, Opera, etc.
else if (document.implementation &&
document.implementation.createDocument){

If you want to use XSLTProcessor then why do you check for other unrelated objects? I strongly suggest to check
if (typeof XSLTProcessor != 'undefined')

xsltProcessor=new XSLTProcessor();
xsltProcessor.importStylesheet(xsl);
resultDocument = xsltProcessor.transformToFragment(xml,document);
document.getElementById("inventory").appendChild(resultDocument);
}

I don't see anything wrong with the code that would cause it to fail, as said, show us the XML and XSLT and we can tell you more.


--

Martin Honnen
http://JavaScript.FAQTs.com/
.



Relevant Pages

  • Re: Mapper - Transforming flat file layout to parent/child hierarchy
    ... FFDasm rip appart the flat file and turn it into a single large XML ... Then you can use a map to transform the 'flatfile-xml' into ...
    (microsoft.public.biztalk.general)
  • Re: Display XML in WebBrowser Control
    ... XsltSettings xsltSettings = new XsltSettings ... XML files other than the ones that you provide, ... If I try to transform using .NET and the following code ... feed of XML and am trying to inject it into the control. ...
    (microsoft.public.dotnet.xml)
  • Re: How to split a flat file using Document and Envelope Schemas
    ... The example in the SDK directory that demonstrates how to split a flat file ... Run the sample and save the output xml file for later use. ... > I defined schema for Employees and Employee separately. ... > samples regarding flat file disassembler but there is no sample for XML ...
    (microsoft.public.biztalk.general)
  • Re: Display XML in WebBrowser Control
    ... I see you want to transform this using .NET XslCompiledTransform ... "Dimitre Novatchev" wrote: ... XML files other than the ones that you provide, ... feed of XML and am trying to inject it into the control. ...
    (microsoft.public.dotnet.xml)
  • Re: Looking for Ideas: Translating Document into Commands in XML
    ... > The resultant file, with no transform, was 9 Mb. ... automate cleaning up the document first. ... Getting it closer to a "nicer" XML ... >> eliminate the need for the XSLT transform. ...
    (microsoft.public.dotnet.languages.vb)