Saiboro

Hi,

I have a Web application that works as follows:

- An ASP.net page generates an XML string linked to an XSLT stylesheet and sends it to Internet Explorer.
- Internet Explorer applies the stylesheet and displays the resulting HTML page in the browser.

Everything worked great with IE6 and most of this still works fine in IE7 except for one page. In that page, I return an XML string similar to the following:

1 < xml version="1.0" encoding="utf-8" >
2 < xml-stylesheet type="text/xsl" href="styles/volumetryAdmin.xslt" >
3 <ifinance xmlns="urn:ifinance" auth="0" lang="fr" today="20061109">
4 <precomps>
5 <precomp id="5">
6 <name>procRefresh_Precomp_SharedRu_Client_DistributedValue</name>
7 <last-success-time>2006-11-09 08:25:53</last-success-time>
8 <next-exec-time>2006-11-09 09:23:53</next-exec-time>
9 <current-state></current-state>
10 </precomp>
11</precomps>
12 <msg></msg>
13</ifinance>

What stands out about this page are the strings in bold (line 6,7,8). In IE7, it's as if the xslt stylesheet is ignored and it simply displays a white page with the content of the text nodes:

"procRefresh_Precomp_SharedRu_Client_DistributedValue 2006-11-09 08:25:53 2006-11-09 09:23:53"

If I remove lines 6 to 9, the page is rendered correctly (i.e. the stylesheet is applied and the complete HTML from the stylesheet is displayed, instead of a white page with a string).

In most of my other pages, I usually put text information in attributes instead of in nodes and those other pages still work fine. So normally, I would code lines 5 to 10 like this:

<precomp id="5"
name="procRefresh_Precomp_SharedRu_Client_DistributedValue"
last-success-time="2006-11-09 08:25:53"
next-exec-time="2006-11-09 09:23:53"
current-state=""/>

So I know how I can "fix" my problem but is the behavior I'm observing "normal" and/or "expected" Is there another way to fix this



Re: Internet Explorer Web Development IE7 displays my xml/xslt page differently from IE6

Saiboro

So Anyone has any clue By the way, if this is the wrong forum and/or if you think I might be more lucky on another one, please let me know.



Re: Internet Explorer Web Development IE7 displays my xml/xslt page differently from IE6

Saiboro

Am I the only one generating his Web pages in a similar way (i.e. XML data linked to XSLT) Anyone is able to do so with a dataset similar to the one in my first post

I'm wondering if there is something wrong with my XML, my XSLT or IE7. IE6 interprets it "correctly" and if I do the transformation server-side using .NET classes and send the resulting HTML to IE7, the page is also displayed correctly. This is why I think the bug is in IE7 but I may be missing something...

Any input would be appreciated.

Thanks.





Re: Internet Explorer Web Development IE7 displays my xml/xslt page differently from IE6

genel

I'm not having any problems with xml/xslt processing on IE7, and my xml is not much different, although I don't use linked xslt but use scripts to apply the xslt to the xml on the page.

Sure seems as if the problem is really in the xslt.





Re: Internet Explorer Web Development IE7 displays my xml/xslt page differently from IE6

Saiboro

Hi genel,

Thanks for your input.

Would you try the linked xslt approach I'm pretty sure IE transformation doesn't use the same code as the javascript transformation. I recall trying javascript transformation with IE6 and for very large datasets, javascript was much slower.

And if I do the transformation server side, using .NET (v1.1) classes, I also get the correct result. This is why I think the problem is really with IE7 "built-in" xslt transformation.

Thanks





Re: Internet Explorer Web Development IE7 displays my xml/xslt page differently from IE6

genel

FWIW mine works as long as there is no "&" in the xslt href. But that's an IE6 feature also.

XML I tried

< xml version="1.0" encoding="ISO-8859-1" >

< xml-stylesheet type="text/xsl" href="/data/list.fxsl file=AC" >
- <AC>
- <ROW>
<ACN>1</ACN>
<ACNUM>01</ACNUM>
<ACNAME>Waterloo Region Dist. Schools</ACNAME>
</ROW>
- <ROW>
<ACN>2</ACN>
<ACNUM>99</ACNUM>
<ACNAME>Out of Circulation</ACNAME>
</ROW>
</AC>
formatting provided by IE7




Re: Internet Explorer Web Development IE7 displays my xml/xslt page differently from IE6

Saiboro

Thanks for your help genel.

This is really the strangest problem I've ever encountered. I've tried to simplify to the extreme. Here is the page code, as seen when I do "View source":

1 < xml version="1.0" encoding="utf-8" >
2 < xml-stylesheet type="text/xsl" href="styles/dummyAdmin.xslt" >
3 <ifinance xmlns="urn:ifinance" userid="" auth="0" lang="en" today="20061211"
4 can-manage-security="false" can-close-period="false" forecasts-locked="true"
5 can-lock-unlock-forecasts="false" can-request-upd-precomp="false">
6 <!--
7 <precomps>
8 </precomps>
9 -->

10 <msg></msg>
11 </ifinance>

Here is the stylesheet "dummyAdmin.xslt":

1 < xml version="1.0" encoding="iso-8859-1" >
2 <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
3 xmlns="http://www.w3.org/TR/REC-html40"
4 xmlns:t="urn:ifinance" version="1.0">
5 <xsl:output method="html" />

6 <xsl:template match="t:ifinance">
7 <html>
8 <body>
9 <p>test</p>
10 </body>
11 </html>
12 </xsl:template>
13 </xsl:stylesheet>

It can hardly be simpler than that. Essentially, the stylesheet ignores the content of the source page and simply displays "test". With IE6, everything is OK.

With IE7, I get a blank page. Now, if some of you can reproduce the issue, I'd appreciate if you let me know. Now, as you can see, in the source page, there is a comment block (lines 6 to 9). Normally, these should be ignored, right Well if I delete those lines, I get my "test" message.

Also, something I've noticed, if I put the source code in a page named "dummyAdmin.aspx" or "dummyAdmin.html", I get the blank page (assuming the comment block is there). However, if I simply change to extension to ".xml" or ".txt", the page is displayed correctly.

This is really driving me nuts! And the "funny" thing is that I have very similar (and arguably much more complex) pages that display correctly under both IE6 and IE7, so I really don't know what sets this page apart.

I'd appreciate if some of you could try to reproduce the issue and tell me either that I'm not alone here or that you don't see any problems, no matter what. Of course, don't forget to remove to numbers in front of each line. And don't forget to clear your temporary files between each test.

Thanks in advance,

Nicolas





Re: Internet Explorer Web Development IE7 displays my xml/xslt page differently from IE6

genel

After futzing around with your sample so that it would load here, I was able to duplicate the problem. As soon as I removed the attributes to a separate tag:

<ifinance>
<args xmlns="urn:ifinance" userid="" auth="0" lang="en" today="20061211" can-manage-security="false" can-close-period="false" forecasts-locked="true" can-lock-unlock-forecasts="false" can-request-upd-precomp="false"/>

the TEST page displayed. This is the same way IE6 works when handling "data islands" it fails to recognize as valid xml any tags that use attributes if there is also data in the body of the tag. I think it has something to do with dso handling.

Perhaps ie7 tries to load the xml as a dso prior to applying the style sheet





Re: Internet Explorer Web Development IE7 displays my xml/xslt page differently from IE6

genel

I just recalled that if you include any attributes in a tag ie essential takes the body of the tag and attempts to make it another attribute.

Given:

<tag a="stuff">data</tag>

ie interprets this as:

<tag a="stuff" body="data"/>

Although for the life of me I can't remember what "body" actually is. And of course if the data contains more tags they are essentially ignored.

Gene





Re: Internet Explorer Web Development IE7 displays my xml/xslt page differently from IE6

Saiboro

Hi Gene,

Thanks again for your help.

If I understand you correctly, you're saying the following page should work:

< xml version="1.0" encoding="utf-8" >
< xml-stylesheet type="text/xsl" href="styles/dummyAdmin.xslt" >
<ifinance>
<args xmlns="urn:ifinance" userid="" auth="0" lang="en" today="20061211" can-manage-security="false" can-close-period="false" forecasts-locked="true" can-lock-unlock-forecasts="false" can-request-upd-precomp="false"/>
<msg></msg>
</ifinance>

For me it doesn't and I don't see why this should work, given that the xmlns attribute is no longer at the root level (how could the stylesheet be applied if the root is not part of the namespace )

For me the following does work:

< xml version="1.0" encoding="utf-8" >
< xml-stylesheet type="text/xsl" href="styles/dummyAdmin.xslt" >
<ifinance xmlns="urn:ifinance">
<args userid="" auth="0" lang="en" today="20061211" can-manage-security="false" can-close-period="false" forecasts-locked="true" can-lock-unlock-forecasts="false" can-request-upd-precomp="false"/>
<msg></msg>
</ifinance>

However, it works because my "precomps" part is not present. This is not really a step forward for me since

< xml version="1.0" encoding="utf-8" >
< xml-stylesheet type="text/xsl" href="styles/dummyAdmin.xslt" >
<ifinance xmlns="urn:ifinance" userid="" auth="0" lang="en" today="20061211" can-manage-security="false" can-close-period="false" forecasts-locked="true" can-lock-unlock-forecasts="false" can-request-upd-precomp="false">
<msg></msg>
</ifinance>

...was also working (i.e. the reason it works is not because I've extracted the attributes out of the root node).

If I add back the precomps block like this:

< xml version="1.0" encoding="utf-8" >
< xml-stylesheet type="text/xsl" href="styles/dummyAdmin.xslt" >
<ifinance xmlns="urn:ifinance">
<args userid="" auth="0" lang="en" today="20061211" can-manage-security="false" can-close-period="false" forecasts-locked="true" can-lock-unlock-forecasts="false" can-request-upd-precomp="false"/>
<precomps>
</precomps>
<msg></msg>
</ifinance>

... it still won't work.

Also your explanation that "when handling "data islands" [IE] fails to recognize as valid xml any tags that use attributes if there is also data in the body of the tag" sound strange to me, especially since that's something I'm using in just about all my pages (basically, all my pages start with an ifinance tag with attributes and something inside). And if my XML was invalid, shouldn't IE throw me an invalid XML error message instead of a white page

Did I misunderstand your solution Also, have you made sure you've cleared your temporary files before testing your working solution

Thanks again for your support.





Re: Internet Explorer Web Development IE7 displays my xml/xslt page differently from IE6

genel

The following works here:

< xml version="1.0" encoding="iso-8859-1" >
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns="http://www.w3.org/TR/REC-html40" version="1.0">
<xsl:output method="html" />
<xsl:template match="ifinance">
<html>
<body>
<p>test</p>
</body>
</html>
</xsl:template>
</xsl:stylesheet>

< xml version="1.0" encoding="utf-8" >
< xml-stylesheet type="text/xsl" href="style/junk.xslt" >
<ifinance>
<args xmlns="urn:ifinance" userid="" auth="0" lang="en" today="20061211" can-manage-security="false" can-close-period="false" forecasts-locked="true" can-lock-unlock-forecasts="false" can-request-upd-precomp="false"/>
<precomps>
</precomps>
<msg></msg>
</ifinance>

This works in ie6 ie7 and mozilla here. As you'll notice I made a couple of changes to your source to work here.

When I refered to data islands I meant using an <XML> tag to bring in the data, and then using tables with "datasrc" and "datafld" attributes. Somewhere on MSDN it explains exactly why you shouldn't mix attributes with data in a dso. This isn't an issue with xslt but is when using the built in "datafld" "datasrc" attributes.

One of the things I changed to get your xslt to work is to drop the name space stuff, which I've never really understood how to use. Perhaps that is where the problem lies.





Re: Internet Explorer Web Development IE7 displays my xml/xslt page differently from IE6

Saiboro

Hi again Gene,

Thank you for your support. However, I could not really afford to remove the namespace from all my data and stylesheet (it seemed a major change to correct a simple issue on a single page) and namespaces should work.

Upon further experimentations, it really seemed to me that the "precomps" tag itself was the problem (after all, in the same xml, I had also the <msg> tags with did not seem to cause any problems).

Simply renaming precomps for something else (say, dummy) fixes the problem. And it doesn't appear that the problem is with "precomps" itself: I've renamed it to "precomp", "precom", "preco", "prec" and "pre" which all failed. Renaming to "pr" stopped the problem.

So it would appear I cannot have a tag which starts with "pre"...

The only possible reason I thought of was that maybe it was "conflicting" with the "<pre>" HTML tag (for preformatted text). This is all pretty weird but I've fixed my problem by renamming precomps, so the following works just fine:

< xml version="1.0" encoding="utf-8" >
< xml-stylesheet type="text/xsl" href="styles/dummyAdmin.xslt" >
<ifinance xmlns="urn:ifinance" userid="" auth="0" lang="en" today="20061211" can-manage-security="false" can-close-period="false" forecasts-locked="true" can-lock-unlock-forecasts="false" can-request-upd-precomp="false">
<msg1></msg1>
<msg2></msg2>
<msg3></msg3>
<msg4></msg4>
<pr></pr>
</ifinance>

So i'll just avoid tags starting with "pre" for the time being...





Re: Internet Explorer Web Development IE7 displays my xml/xslt page differently from IE6

genel

I'm glad it works, sorry I couldn't be of more help.