[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] RE: general gripe - html output
> When my code looks like this: > > <xsl:template match="/"> > <html> > <body> > <br/> > </body> > </html> > </xsl:template> > > The processor decides that I really want <br>, because it can > see <html>. If I trick the processor, and take advantage of > sloppy html and > use: > > <xsl:template match="/"> > <body> > <br/> > </body> > </xsl:template> > > It gives me <br/> as I want, because it doesnt know any > different. If you want the output serialized as XML rather than HTML, then use <xsl:output method="xml"/>. But I want to be good, so I'll use: > > <xsl:template match="/"> > <html> > <head> > </head> > <body> > <br/> > </body> > </html> > </xsl:template> > > In which case, I get a nice line inserted as a child of <head>: > > <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> > > All well and good, but when I attempt to use html-tidy I get > informed of my ill-formed html (</head> in <meta> etc). What exactly is the processor producing, that html-tidy complains of? > > So what do I do to solve all this helpfulness? > > I use: > > <xsl:output method="xml"/> > > Its a funny old world. > I can't quite see what you're griping about. Is it that the HTML and XML serializations are different? Is it that you don't like the rules for choosing a default output method if you haven't asked for one explicitly? Is it that you don't like the HTML serialization? Michael Kay Software AG home: Michael.H.Kay@xxxxxxxxxxxx work: Michael.Kay@xxxxxxxxxxxxxx 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
|