XML XLS Problem

Discussion in 'XML' started by micu.radu@gmail.com, Nov 14, 2006.

  1. Guest

    Hello,

    Here is my problem,
    I was trying to generate an html table from an xml file... the easy
    method is to to use span an data src but this only works in IE so to
    make it work in mozzila browsers I have made a different load for each
    and used XSL for generatig the table:

    XSL File
    <?xml version="1.0" encoding="ISO-8859-1"?>
    <xsl:stylesheet version="1.0"
    xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
    <xsl:template match="/">
    <xsl:for-each select="PRODUSE/PRODUS">
    <tr onmouseover="this.style.background='#fe9'"
    onmouseout="this.style.background='#fff'">
    <td class="lCell"><xsl:value-of select="NrCrt"/></td>
    <td><xsl:value-of select="Denumire"/></td>
    <td><xsl:value-of select="Reper"/></td>
    <td><xsl:value-of select="Stocuri"/></td>
    <td><xsl:value-of select="Pret"/></td>
    </tr>
    </xsl:for-each>
    </xsl:template>
    </xsl:stylesheet>

    The XML File
    <?xml version="1.0"?>
    <PRODUSE>
    <PRODUS>
    <NrCrt>1</NrCrt>
    <Denumire>Cuzinet biela 87790328</Denumire>
    <Reper>N\A</Reper>
    <Stocuri>5</Stocuri>
    <Pret>106.32</Pret>
    <Link>#</Link>
    </PRODUS>
    </PRODUSE>

    And the code...
    <script type="text/javascript">
    var isIE;
    var isNav;
    isIE = (navigator.appName == "Microsoft Internet Explorer");
    isNav = (navigator.appName == "Netscape");
    if (isIE)
    {
    // Load XML
    var xml = new ActiveXObject("Microsoft.XMLDOM")
    xml.async = false
    xml.load("produse/Produse.xml")
    // Load XSL
    var xsl = new ActiveXObject("Microsoft.XMLDOM")
    xsl.async = false
    xsl.load("produse/Produse.xsl")
    // Transform
    document.write(xml.transformNode(xsl))
    }
    if (isNav)
    {
    //for mozilla/netscape
    var processor = new XSLTProcessor();
    var xslt = document.implementation.createDocument("", "", null);
    xslt.async = false;
    xslt.load("produse/Produse.xsl");
    processor.importStylesheet(xslt);
    var src_doc = document.implementation.createDocument("","", null);
    src_doc.async = false;

    src_doc.load("produse/Produse.xml");
    var result = processor.transformToDocument(src_doc);
    var xmls = new XMLSerializer();
    var output = xmls.serializeToString(result);
    document.write(output);
    }
    </script>

    On my PC WORKS BEAUTIFULL but when I tryed it on my server booom on IE
    works fine and on Firefox does't shows anythig

    Why why... :)

    Pls help me. I cant find the solution for this one.

    Thx in advance.
     
    , Nov 14, 2006
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. =?Utf-8?B?QmVybmFyZG8gR29tZXM=?=

    Displaying a XML using XLS

    =?Utf-8?B?QmVybmFyZG8gR29tZXM=?=, Feb 4, 2004, in forum: ASP .Net
    Replies:
    3
    Views:
    2,472
    Felbrigg
    Feb 4, 2004
  2. Dana B
    Replies:
    1
    Views:
    1,380
    Richard Wheeldon
    Mar 17, 2005
  3. Richard Koch

    XML transform via XLS

    Richard Koch, Feb 1, 2004, in forum: XML
    Replies:
    6
    Views:
    628
    Dimitre Novatchev
    Feb 2, 2004
  4. sachin
    Replies:
    1
    Views:
    355
    Tjerk Wolterink
    Dec 1, 2005
  5. Pravin
    Replies:
    1
    Views:
    2,821
    Dirk Wendland
    Apr 18, 2005
Loading...

Share This Page