You are viewing a plain text version of this content. The canonical link for it is here.
Posted to general@xml.apache.org by "Thomas B. Passin" <tp...@mitretek.org> on 2000/04/05 21:33:12 UTC

Re: code a DTD in a XML output using XSLT (update)

Here is an update to my recent post:
    It looks like you are  using the Microsoft parser in IE5.  If you were using an xslt processor following the current standard, you could do this:
     
    <?xml version="1.0"?>
    <xsl:stylesheet xmlns:xsl='http://www.w3.org/1999/XSL/Transform' version='1.0'>
     
    <xsl:template match="/">
    <xsl:text disable-output-escaping="yes">
    &lt;!DOCTYPE wml PUBLIC '-//WAPFORUM//DTD WML 1.1//EN' 'http://www.wapforum.org/DTD/wml_1.1.xml'>
    </xsl:text>
    <xsl:apply-templates/>
    </xsl:template>
     
    <xsl:template>
     <xsl:copy>
       <xsl:apply-templates select="*|@*|comment()|processing-instruction()|text()"/>
     </xsl:copy>
    </xsl:template>
    
    </xsl:stylesheet>
     
    pi() has been changed to processing-instruction() in the xslt standard.  I tested this using XT (not Apache, I know :-(   ). It should work with the new release of the MS parser, too, but I didn't try it.
     
    Tom Passin.
    
        -----Original Message-----
        From: Benwa <be...@ifrance.com>
        To: general@xml.apache.org <ge...@xml.apache.org>; xalan-dev@xml.apache.org <xa...@xml.apache.org>
        Date: Wednesday, April 05, 2000 12:25 AM
        Subject: 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.