javascript with xsl

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Sergio del Amo

    javascript with xsl

    Hi,
    I post here because, i think that my problem can happen to a lot of
    people using javascript with xml and xsl and the future feedback can be
    useful to all of us.

    I hava an xml file with a tree structure and a xsl file to transform it
    into xhtml strict. In my file xsl i have:
    <head>
    <title>Generi c XHTML Treeview</title>
    <meta http-equiv="Content-type" content="text/html;
    charset=iso-8859-1"/>
    <link rel="stylesheet " type="text/css" href="format.cs s"/>
    <script src="functions. js" type="text/javascript"></script>
    </head>
    but when i transformate my xml code using xslt into xhtml. My xhtml code
    has:
    <head>
    <title>Generi c XHTML Treeview</title>
    <meta http-equiv="Content-type" content="text/html;
    charset=iso-8859-1"/>
    <link rel="stylesheet " type="text/css" href="format.cs s"/>
    <script src="functions. js" type="text/javascript"/>
    </head>
    und does not work correctly because of the unsatisfactory trasformation
    of the line about javascript. Does anyone know how con i make to obtain
    exactly the above line(exactly the same like in the xsl file).
    Thanks for the future feedback.

    --
    Sergio del Amo

  • Martin Honnen

    #2
    Re: javascript with xsl



    Sergio del Amo wrote:[color=blue]
    > I post here because, i think that my problem can happen to a lot of
    > people using javascript with xml and xsl and the future feedback can be
    > useful to all of us.
    >
    > I hava an xml file with a tree structure and a xsl file to transform it
    > into xhtml strict. In my file xsl i have:
    > <head>
    > <title>Generi c XHTML Treeview</title>
    > <meta http-equiv="Content-type" content="text/html;
    > charset=iso-8859-1"/>[/color]

    Content-Type text/html belongs to HTML and only to XHTML 1.0 when coded
    according to the compatibility guidelines in the Appendix of the XHTML
    1.0 specification.[color=blue]
    > <link rel="stylesheet " type="text/css" href="format.cs s"/>
    > <script src="functions. js" type="text/javascript"></script>
    > </head>
    > but when i transformate my xml code using xslt into xhtml. My xhtml code
    > has:
    > <head>
    > <title>Generi c XHTML Treeview</title>
    > <meta http-equiv="Content-type" content="text/html;
    > charset=iso-8859-1"/>
    > <link rel="stylesheet " type="text/css" href="format.cs s"/>
    > <script src="functions. js" type="text/javascript"/>
    > </head>
    > und does not work correctly because of the unsatisfactory trasformation
    > of the line about javascript. Does anyone know how con i make to obtain
    > exactly the above line(exactly the same like in the xsl file).[/color]

    The problem is that you want to author XHTML but send it to the browser
    as text/html. The best solution is to author HTML 4 instead, then simply use
    <xsl:output method="html"
    in your XSLT stylesheet. That should be supported by any XSLT 1.0
    compliant XSLT processor.

    If you want to stick with XHTML then you need to find an XSLT processor
    which supports
    <xsl:output method="xhtml"
    and then outputs XHTML compliant with the compatibility guidelines.


    --

    Martin Honnen


    Comment

    Working...