469,945 Members | 1,802 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,945 developers. It's quick & easy.

Same XML/XSLT doesn't transform the same - IE6 parser vs. .NET framework parser

Hi,

I have 2 XML files and 1 XSLT file.
The second XML file has the following declarative 1st line:

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>

....the 1st one (the one to be transformed) doesn't.

In the transform file I load the 2nd XML file which contains
a load of language lookups.

The transform then proceeds to output the 1st XML file
as-is, except it replaces certain attribute values with a value
in the documnet(filename) loaded XML.

Problem:

- If I alter the 1st XML file to include a reference to the XSLT
and the XSLT so that attributes are output as plain text and then
load it into IE6 SP1, then it works and certain attribute values
have been replaced.

BUT
- If I use .NET using the same XML and XSLT files, (except
the 1st XML file doesn't reference the XSLT) and do the
transform in code then it doesn't work. i.e the attribute values
that should be replaced aren't

I think it may have something to do with namespaces as, I
think(?), .NET is stricter, but I'm not sure.

Any help would be much appreciated.

Regards,
Peter
Jul 21 '05 #1
4 1572
Peter Row wrote:
- If I use .NET using the same XML and XSLT files, (except
the 1st XML file doesn't reference the XSLT) and do the
transform in code then it doesn't work. i.e the attribute values
that should be replaced aren't


That might be due to zillion of reasons. You need to find out what
exactly goes wrong. For instance - make sure 2nd XML is loaded successfully.
--
Oleg Tkachenko [XML MVP, XmlInsider]
http://blog.tkachenko.com
Jul 21 '05 #2
Peter Row wrote:
- If I use .NET using the same XML and XSLT files, (except
the 1st XML file doesn't reference the XSLT) and do the
transform in code then it doesn't work. i.e the attribute values
that should be replaced aren't


That might be due to zillion of reasons. You need to find out what
exactly goes wrong. For instance - make sure 2nd XML is loaded successfully.
--
Oleg Tkachenko [XML MVP, XmlInsider]
http://blog.tkachenko.com
Jul 21 '05 #3
Hi,

Ooops I forgot to mention something....

When the transform happens in .NET the 2nd XML file
loaded by the XSLT via a document() statement does not
appear to be working. No error occurs but the file does
not appear to have been loaded. I know it hasn't been
loaded because in my <xsl:template match="*"> I
added an extra attribute to each element I output from
the original 1st XML file. The value of which is a
count() of the nodes from the document() I read in;
it gives zero.

However as my original post said the same transform
(well except with the attributes output as text instead
of attributes) works when run through the IE6 parser,
it is only when the .NET parser does it that the XSLT
fails to load the 2nd XML file and hence make the
replacements.

Regards,
Peter

"Oleg Tkachenko [MVP]" <oleg@NO!SPAM!PLEASEtkachenko.com> wrote in message
news:eT**************@TK2MSFTNGP10.phx.gbl...
Peter Row wrote:
- If I use .NET using the same XML and XSLT files, (except
the 1st XML file doesn't reference the XSLT) and do the
transform in code then it doesn't work. i.e the attribute values
that should be replaced aren't
That might be due to zillion of reasons. You need to find out what
exactly goes wrong. For instance - make sure 2nd XML is loaded

successfully. --
Oleg Tkachenko [XML MVP, XmlInsider]
http://blog.tkachenko.com

Jul 21 '05 #4
Hi,

Ooops I forgot to mention something....

When the transform happens in .NET the 2nd XML file
loaded by the XSLT via a document() statement does not
appear to be working. No error occurs but the file does
not appear to have been loaded. I know it hasn't been
loaded because in my <xsl:template match="*"> I
added an extra attribute to each element I output from
the original 1st XML file. The value of which is a
count() of the nodes from the document() I read in;
it gives zero.

However as my original post said the same transform
(well except with the attributes output as text instead
of attributes) works when run through the IE6 parser,
it is only when the .NET parser does it that the XSLT
fails to load the 2nd XML file and hence make the
replacements.

Regards,
Peter

"Oleg Tkachenko [MVP]" <oleg@NO!SPAM!PLEASEtkachenko.com> wrote in message
news:eT**************@TK2MSFTNGP10.phx.gbl...
Peter Row wrote:
- If I use .NET using the same XML and XSLT files, (except
the 1st XML file doesn't reference the XSLT) and do the
transform in code then it doesn't work. i.e the attribute values
that should be replaced aren't
That might be due to zillion of reasons. You need to find out what
exactly goes wrong. For instance - make sure 2nd XML is loaded

successfully. --
Oleg Tkachenko [XML MVP, XmlInsider]
http://blog.tkachenko.com

Jul 21 '05 #5

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

2 posts views Thread by Neal | last post: by
3 posts views Thread by Paul Hatcher | last post: by
4 posts views Thread by WStoreyII | last post: by
8 posts views Thread by Hercules Dev. | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.