471,066 Members | 1,005 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,066 software developers and data experts.

need help to add a comment before <!DOCTYPE ... in xsl

Hi all,

Need some help here. I'm using these in a xsl:
~~~~~~~~~~~~~~~
<?xml version="1.0" encoding="ISO-8859-1"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="html"
doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-
transitional.dtd"
doctype-public="-//W3C//DTD XHTML 1.0 Transitional//EN" indent="yes"/
>
<html>
<head>

After transform, the html output is:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://
www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html>
<head>
~~~~~~~~~
I will need to add a comment before the <!DOCTYPE ... and would like
the HTML output as:
<!-- something as a comment must be added here -->
<!DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://
www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

Can anyone please help? What can I do to create this comment? Can
this be done on the client side (xslt, scripting...) or should it be
done on the server side when Java code does the transform?

Any help is really appreciated!

Thanks in advance, Jane

Dec 20 '07 #1
2 3628
Hi Martin,

Thanks for the help. It did work after I comment out the xsl:output.
It works great!

A good day,
Jane
Dec 20 '07 #2
On Dec 20, 12:14 pm, Martin Honnen <mahotr...@yahoo.dewrote:
That way it will occur before the root element. Whether it will occur
before the DOCTYPE might be implementation dependent
I believe it _is_ implementation dependent, at least in XSLT 1.0 where
the doctype is not an explicit part of the XPath 1.0 data model.
Dec 21 '07 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

1 post views Thread by RSG | last post: by
35 posts views Thread by Boobie | last post: by
2 posts views Thread by Ron James | last post: by
11 posts views Thread by news.microsoft.net | last post: by
4 posts views Thread by dsimmons | last post: by
2 posts views Thread by Jacob Lyles | last post: by
6 posts views Thread by patrick j | last post: by
reply views Thread by leo001 | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.