[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] RE: Formatting issue with HTML and TEXT output method
I'm having trouble understanding the question, but I suspect that what you are looking for is that newlines in the XML should render as newlines when the HTML is displayed in the browser. that is, if your input is <p> THREE BLIND MICE </p> then you want to generate HTML is such a way that the user sees three lines of text on the browser screen. As I expect you know, HTML treats a newline as equivalent to a space, so the normal way to do this is to replace newlines by <br/> elements. That's easy in XSLT 2.0 using <xsl:analyze-string>, it's a bit harder in 1.0 (google for "XSLT 1.0 replace newline by <br>" which gives you 39,000 hits). Another approach is to generate the <pre> tag in HTML, which causes newlines to be rendered as newlines. Michael Kay http://www.saxonica.com/ > -----Original Message----- > From: Senthilkumaravelan K [mailto:skumaravelan@xxxxxxxxxxxxxx] > Sent: 17 July 2008 00:39 > To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx > Subject: Formatting issue with HTML and TEXT output method > > Hi All, > We have xml > <note> > <cond> > <html> > <body> > <p align="center"> > TESTTESTTESTTESTTESTTESTTESTTESTTEST > TESTTESTTESTTESTTESTTESTTESTTESTTEST > TESTTESTTESTTESTTESTTESTTESTTESTTEST > </p> > <p align="center"> > TESTTESTTESTTESTTESTTESTTESTTESTTEST > TESTTESTTESTTESTTESTTESTTESTTESTTEST > TESTTESTTESTTESTTESTTESTTESTTESTTEST > </p> > </body> > </html> > </cond> > <note> > > When we write xslt one with "html" as output method and text > as output method. > > for html out method am using > <xsl:value-of select="//cond"> > > text output method > <xsl:copy-of select="//cond"> > > > How to make the text xslt output like formatted text output > pretty with alignment. > > Any idea would of great help. > > Thanks > Senthil
|
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
|