attaboy Posted May 18, 2012 Share Posted May 18, 2012 I have a XML file: <?xml version="1.0"?><?xml-stylesheet type="text/xsl" href="letter2text.xsl"?><letter> <to>Mom</to> <from>Tom</from> <message>Happy Mother's Day</message> </letter> it uses this stylesheet: <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"><xsl:output method="text"/><xsl:template match="/letter"><xsl:apply-templates select="*"/></xsl:template><xsl:template match="to"><xsl:text>TO: </xsl:text><xsl:apply-templates/> <xsl:text></xsl:text></xsl:template><xsl:template match="from"><xsl:text>FROM: </xsl:text> <xsl:apply-templates/> <xsl:text></xsl:text></xsl:template> <xsl:template match="message"><xsl:text>MESSAGE: </xsl:text> <xsl:apply-templates/> <xsl:text></xsl:text></xsl:template></xsl:stylesheet> The output looks like this in all browsers except IE8TO: MomFROM: TomMESSAGE: Happy Mother's DayIE8 sees it as:TO: Mom FROM: Tom MESSAGE: Happy Mother's DayIE doesn't seem to be the sharpest knife in the drawer.Is there any way to indicate line break that even IE will understand? Link to comment Share on other sites More sharing options...
boen_robot Posted May 19, 2012 Share Posted May 19, 2012 The problem is IE re-parses the XSLT output as HTML. What other browsers do instead is use the XSLT result directly.This behavior of IE is the cause of a few issues, and this is one of them.The only way to make IE understand is that you use <xsl:output method="html" />, and rewrite the rest of your XSLT accordingly, with <br/>'s and everything. Link to comment Share on other sites More sharing options...
attaboy Posted May 19, 2012 Author Share Posted May 19, 2012 Thanks for responding. After posting this I read a little further in my book and found what you just mentioned. IE always has to ruin the fun don't they. I wonder if anyone has come up with an IE voodoo doll for web developers/designers. btw is there a way to flag these posts as solved? Link to comment Share on other sites More sharing options...
boen_robot Posted May 19, 2012 Share Posted May 19, 2012 I believe you should be able to edit the title of the topic by editing your first post. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.