File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
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
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: 381
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
Bartender

Joined: Oct 14, 2005
Posts: 18570
    
    8

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

Joined: Aug 11, 2000
Posts: 381
Thanks! That works!
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: How to emit doctype from xsl?