This week's book giveaway is in the Jobs Discussion forum.
We're giving away four copies of Customer Requirements for Developers and have Marcho Behler on-line!
See this thread for details.
The moose likes XML and Related Technologies and the fly likes How to emit doctype from xsl? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Customer Requirements for Developers this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Engineering » XML and Related Technologies
Bookmark "How to emit doctype from xsl?" Watch "How to emit doctype from xsl?" New topic
Author

How to emit doctype from xsl?

Siegfried Heintze
Ranch Hand

Joined: Aug 11, 2000
Posts: 396
I'm trying to create an xslt that will mimic the SVG produced by adobe illustrator.

What XSL tags would I use to emit that funky doctype tag?
Can XSL also emit XML comments?

Thanks,
Siegfried

Sample from Adobe:
<blockquote>code:
<pre name="code" class="core">
<?xml version="1.0" encoding="utf-8"?>
<!-- Generator: Adobe Illustrator 13.0.2, SVG Export Plug-In . SVG Version: 6.00 Build 14948) -->
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
width="1192.203px" height="1060.515px" viewBox="0 0 1192.203 1060.515" enable-background="new 0 0 1192.203 1060.515"
xml:space="preserve">
<g id="BLOCK_x5F_RECORD_3_">
</pre>
</blockquote>
Carey Evans
Ranch Hand

Joined: May 27, 2008
Posts: 225

See http://www.w3.org/TR/xslt#output and http://www.w3.org/TR/xslt#section-Creating-Comments.

The first quoted part of the DOCTYPE is set by doctype-public, the second by doctype-system.
Paul Clapham
Sheriff

Joined: Oct 14, 2005
Posts: 19693
    
  10

And yes, there's an <xsl:comment> element in XSLT.
Siegfried Heintze
Ranch Hand

Joined: Aug 11, 2000
Posts: 396
Thanks! That works!
 
jQuery in Action, 3rd edition
 
subject: How to emit doctype from xsl?
 
It's not a secret anymore!