469,923 Members | 1,528 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,923 developers. It's quick & easy.

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>Generic XHTML Treeview</title>
<meta http-equiv="Content-type" content="text/html;
charset=iso-8859-1"/>
<link rel="stylesheet" type="text/css" href="format.css"/>
<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>Generic XHTML Treeview</title>
<meta http-equiv="Content-type" content="text/html;
charset=iso-8859-1"/>
<link rel="stylesheet" type="text/css" href="format.css"/>
<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

Jul 20 '05 #1
1 4302


Sergio del Amo wrote:
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>Generic XHTML Treeview</title>
<meta http-equiv="Content-type" content="text/html;
charset=iso-8859-1"/>
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. <link rel="stylesheet" type="text/css" href="format.css"/>
<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>Generic XHTML Treeview</title>
<meta http-equiv="Content-type" content="text/html;
charset=iso-8859-1"/>
<link rel="stylesheet" type="text/css" href="format.css"/>
<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).


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
http://JavaScript.FAQTs.com/

Jul 20 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.

By using this site, you agree to our Privacy Policy and Terms of Use.