jQuery in Action, 3rd edition
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 Introducing JavaFX 8 Programming this week in the JavaFX 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

How to emit doctype from xsl?

Siegfried Heintze
Ranch Hand

Joined: Aug 11, 2000
Posts: 397
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?


Sample from Adobe:
<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"
<g id="BLOCK_x5F_RECORD_3_">
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

Joined: Oct 14, 2005
Posts: 19739

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

Joined: Aug 11, 2000
Posts: 397
Thanks! That works!
I agree. Here's the link: http://aspose.com/file-tools
subject: How to emit doctype from xsl?
It's not a secret anymore!