You are viewing a plain text version of this content. The canonical link for it is here.
Posted to general@xml.apache.org by Benwa <be...@ifrance.com> on 2000/04/04 16:10:13 UTC

code a DTD in a XML output using XSLT

Hi !
Can someone tell me how I can code a DTD in a XML doc that I output using XSL
( I have XMLsource + XSL => XMLoutput using DOM parser )

The stylesheet is (for the moment) looking like this :

<?xml version="1.0"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/TR/WD-xsl">

<!DOCTYPE wml PUBLIC '-//WAPFORUM//DTD WML 1.1//EN' 'http://www.wapforum.org/DTD/wml_1.1.xml'>

<xsl:template>
 <xsl:copy>
  <xsl:apply-templates select="*|@*|comment()|pi()|text()"/>
 </xsl:copy>
</xsl:template>

</xsl:stylesheet>

But It is making an error.
Does someone know the <xsl:output> element ?
(I tried that:
<xsl:output method="wml" doctype-public="-//WAPFORUM//DTD WML 1.1//EN" media-type="text/vnd.wap.wml" doctype-system="http://www.wapforum.org/DTD/wml_1.1.xml" encoding="ISO-8859-1"/>
but not work...)

Thanks for help.
Ben.

Re: code a DTD in a XML output using XSLT

Posted by Richard Light <ri...@light.demon.co.uk>.
In message <01...@csi.crosssystems.com>, Benwa
<be...@ifrance.com> writes
>    Hi !
>    Can someone tell me how I can code a DTD in a XML doc that I output 
>    using XSL
>    ( I have XMLsource + XSL => XMLoutput using DOM parser )
>     
>    The stylesheet is (for the moment) looking like this :
>     
>    <?xml version="1.0"?>
>    <xsl:stylesheet xmlns:xsl="http://www.w3.org/TR/WD-xsl">
>     
>    <!DOCTYPE wml PUBLIC '-//WAPFORUM//DTD WML 1.1//EN' 
>    'http://www.wapforum.org/DTD/wml_1.1.xml'>
>     
>    <xsl:template>
>     <xsl:copy>
>      <xsl:apply-templates select="*|@*|comment()|pi()|text()"/>
>     </xsl:copy>
>    </xsl:template>
>     
>    </xsl:stylesheet>
>     
>    But It is making an error.
>    Does someone know the <xsl:output> element ?
>    (I tried that:
>    <xsl:output method="wml" doctype-public="-//WAPFORUM//DTD WML 
>    1.1//EN" media-type="text/vnd.wap.wml" 
>    doctype-system="http://www.wapforum.org/DTD/wml_1.1.xml" 
>    encoding="ISO-8859-1"/>
>    but not work...)

I think you're close ...  

One obvious error is the method attribute, which should have the value
"xml".  What you're outputting is, generically speaking, an XML
document, even though it conforms more specifically to the WML
application.  That's the level that xsl:output is interested in.

You don't need to specify the doctype "wml" - it will work this out for
itself.

Richard Light.

Richard Light
SGML/XML and Museum Information Consultancy
richard@light.demon.co.uk