[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] RE: Should You Comment XSLT And If So, How?
Ryan Gallagher <binerman@xxxxxxxxxxxxxxxxxxxxx> wrote: > Use XML TAGS in your xsl... > > <doc type="variable"> > <desc>This variable is for X</desc> > </doc> > <xsl:variable name="foobar" select="Hello World!"/> > > <doc type="template"> > <desc type="short">This template does foo.</desc> > <desc type="long">I'm the verbose desc...</desc> > </doc> > <xsl:template match="foo"> > ... > </xsl:template> Your example is illegal because top-level elements may not have a null namespace URI: http://www.w3.org/TR/xslt#stylesheet-element "In addition, the xsl:stylesheet element may contain any element not from the XSLT namespace, provided that the expanded-name of the element has a non-null namespace URI. The presence of such top-level elements must not change the behavior of XSLT elements and functions defined in this document; for example, it would not be permitted for such a top-level element to specify that xsl:apply-templates was to use different rules to resolve conflicts. Thus, an XSLT processor is always free to ignore such top-level elements, and must ignore a top-level element without giving an error if it does not recognize the namespace URI." > If you like you can even give your comments a namespace and DTD, but from what > i've read/understand anything not in the xsl namespace will be safely ignored > outside of templates. Inside templates i'm not positive, but namespaces would > certainly resolve the conflicts. Such elements inside templates won't work because they are literal result elements and will be copied to the result tree: <xsl:template match="/" xmlns:doc="http://mycompany.com/doc"> <doc:doc type="something"> </doc:doc> </xsl:template> Other top-level elements may not allow children, may restrict what sort of children are allowed, or will consider elements not in the XSLT namespace as literal result elements. Dave 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
|