Wrox Programmer Forums
Go Back   Wrox Programmer Forums > XML > XSLT
|
XSLT General questions and answers about XSLT. For issues strictly specific to the book XSLT 1.1 Programmers Reference, please post to that forum instead.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the XSLT section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old March 6th, 2007, 03:41 PM
Registered User
 
Join Date: Feb 2006
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via AIM to mangaroo
Default Rendering new line feeds in browsers

I'm testing out XSLT transform of XML to CSV and displaying this output in browser.

Using the XSLT and XML file I have, IE renders newlines in appropriately. I have to resize browser to force the newline where it should appear. Output in Firefox is perfect.

Is it a problem with IE. Is there a specific workaround for IE?

I've tried the following XSLT and then do reference the newline var/param where needed:

<xsl:variable name="newline" select=" '#10;' " />

<xsl:variable name="newline" select=" '#13;#10;' " />

<xsl:param name="newline"><xsl:text>
</xsl:text></xsl:param>
 
Old March 6th, 2007, 03:53 PM
mhkay's Avatar
Wrox Author
 
Join Date: Apr 2004
Posts: 4,962
Thanks: 0
Thanked 292 Times in 287 Posts
Default

Try to work out first what output you want to produce that will keep IE happy (that's an IE problem, not an XSLT problem). Then worry about how to write the XSLT to produce that output.

Michael Kay
http://www.saxonica.com/
Author, XSLT Programmer's Reference and XPath 2.0 Programmer's Reference
 
Old March 6th, 2007, 07:37 PM
Registered User
 
Join Date: Feb 2006
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via AIM to mangaroo
Default

Hmmm...so for XML/XSLT rendering issues on IE I should visit an IE forum?

I just want something like this for output in IE:

field1Name,field2Name,field3Name,...
row1val1,row1val2,row1val3,...
row2val1,row2val2,row2val3,...

The XSLT conversion simply dumps the value of some XML tags into the format above and inserts commas and newlines where appropriate.

Firefox renders the output right. IE (version 6) gives me something like:

field1Name,field2Name,field3Name,... row1val1,row1val2,row1val3,... row2val1,row2val2,row2val3,...

I'm just wondering if there is any IE specific XSLT (tag) that I must put in to get what I want.
 
Old March 6th, 2007, 07:51 PM
mhkay's Avatar
Wrox Author
 
Join Date: Apr 2004
Posts: 4,962
Thanks: 0
Thanked 292 Times in 287 Posts
Default

You haven't said anything about how you are running the transformation. Server side or client side? How invoked?

IE seems to be displaying the data as if it's HTML. Perhaps it always handles the output of XSLT as if it's HTML, or perhaps it depends on how you run the transformation, I've absolutely no idea. I can give you advice on XSLT coding but not on IE.

Michael Kay
http://www.saxonica.com/
Author, XSLT Programmer's Reference and XPath 2.0 Programmer's Reference
 
Old March 6th, 2007, 09:17 PM
Registered User
 
Join Date: Feb 2006
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via AIM to mangaroo
Default

Oh, sorry, I forgot about that. Client side. I have output XML that has an XSLT stylesheet link in it for doing the transformation. In my test, I load the XML file in browser and see the results.

I know XSLT stylesheet is working, as I've tested with XSLT tools. It is a browser rendering issue.

From your comment, maybe it's a mime type thing, but then I can't change that by loading a local XML file. Guess I'll have to try from a web server instead and force a mime type of text and see what happens.





Similar Threads
Thread Thread Starter Forum Replies Last Post
Rss feeds SKhna ASP.NET 2.0 Basics 0 April 17th, 2008 05:00 AM
Rss feeds SKhna ASP.NET 2.0 Basics 3 March 20th, 2008 02:07 PM
RSS feeds from the forum? javatis Forum and Wrox.com Feedback 1 February 2nd, 2006 03:44 PM
Adding line feeds and apostrophes to a database RiffAff Classic ASP Professional 1 January 21st, 2006 05:40 PM
RSS Feeds harpua PHP How-To 4 October 21st, 2005 09:59 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.