javascript with xsl

S

Sergio del Amo

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.
 
M

Martin Honnen

Sergio said:
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:eek:utput 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:eek:utput method="xhtml"
and then outputs XHTML compliant with the compatibility guidelines.
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,999
Messages
2,570,246
Members
46,839
Latest member
MartinaBur

Latest Threads

Top