|
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] RE: Understanding xmlns declaration and encoding
> When I exclude this > xmlns="http://www.w3.org/1999/xhtml" > > from the stylesheet decleration, I notice that <br/> tags and > <hr/> tags > end up like this: <br> and <hr>. Including it results in the > <html> tag > looking like this: > <HTML xmlns="http://www.w3.org/1999/xhtml"> > > and the <br> and <hr> tags are now <br/> and <hr/> in the result. > > Is this all confirmed and normal behaviour? Yes. The output method defaults to HTML if the outermost element in the result tree is an <html> element in the null namespace. And whether or not the output method is HTML, elements in a non-null namespace are serialized using XML rules, so an empty <br> element in the XHTML namespace is written as <br/>. > > I guess I don't understand when: > <xsl:output method="html" encoding="??????????"/> > The encoding has any effect on the outcome. > The encoding parameter affects the outcome if (a) you are using the XSLT processor to do the serialization (and not, say, the DOM save method), and (b) the destination of the output is a byte stream rather than a character stream. A common mistake for Microsoft users is to serialize to a character stream, in which case the final encoding is outside the control of the XSLT processor. Michael Kay
|
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
|

Cart








