Re: Doubt regarding content model of <xsl:template>
> Amit Rekhi wrote: (snip) > After having looked at the DTD defination of <xsl:template> > given in the XSL specification, I wonder whether it is syntactically > correct to be including elements like <HTML> etc > to the content of <xsl:template>. If you validate a stylesheet against the DTD as given in the 1.0 draft, xsl:template can contain only markup defined in the "result-elements" parameter entity in the DTD. In the first working draft this is defined as formatting objects. The key principle you are looking for is in the overview of the 1.0 working draft: "XSL does not require result trees to use the formatting vocabulary and thus can be used for general XML transformations. For example, XSL can be used to transform XML to "well-formed" HTML, that is, XML that uses the element types and attributes defined by HTML." So, for example, if you change the content of the "result-elements" parameter entity to HTML elements or another XML, you could continue to run validating applications to achieve those result transformations. Why bother with XSL DTDs, though? In practice, a well-formed stylesheet containing well-formed XML/HTML elements can be used with a non-validating parser without the DTD. > * Is this pattern rule syntactically correct according to the > content model defination of <xsl:template>? Not according to the given DTD, but... > * Is it syntactically correct to have <HTML>,<HEAD> > as content of <xsl:template> without having their mention > in the content model defination of <xsl:template>? Quite okay, if your XSL application parses the stylesheet as well-formed, if it is indeed well-formed to begin with. In general, once a stylesheet has been validated prior to use, it need not be validated each time it is served with a document. > Thanks for any answers , > > AMIT I hope this helps. This is only how I grok the issue, not any official statement of the XSL Working Group. Regards, -- Don Day <donday at bga.com> <dond at us.ibm.com> XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
PURCHASE STYLUS STUDIO ONLINE TODAY!
Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!
Download The World's Best XML IDE!
Accelerate XML development with our award-winning XML IDE - Download a free trial today!
Subscribe in XML format