xsl-list
[Top] [All Lists]

RE: Problem using MSXML

2002-09-19 07:20:51
I suspect no-one looked at your problem because your stylesheet was so
long. See if you can reproduce the essence of the problem with a simpler
stylesheet that's cut down to the bare essentials. 

The most common reason for discrepancies between Microsoft and other
processors is that the MSXML parser strips whitespace by default. Try
running it with MSXML, this time building the DOM using
preserveWhitespace=true, and see if the problem still exists.

The second most common reason is that Microsoft doesn't always
concatenate adjacent text nodes, e.g. if there are entity boundaries or
CDATA sections in the XML, you can get multiple text nodes, which means
that constructs like select="text()" only pick up part of the content.

Michael Kay
Software AG
home: Michael(_dot_)H(_dot_)Kay(_at_)ntlworld(_dot_)com
work: Michael(_dot_)Kay(_at_)softwareag(_dot_)com 

-----Original Message-----
From: owner-xsl-list(_at_)lists(_dot_)mulberrytech(_dot_)com 
[mailto:owner-xsl-list(_at_)lists(_dot_)mulberrytech(_dot_)com] On Behalf Of 
Kalyan Kumar Mudumbai
Sent: 18 September 2002 06:53
To: xsl-list(_at_)lists(_dot_)mulberrytech(_dot_)com
Subject: [xsl] Problem using MSXML


Hi All,
     I posted this earlier, but unfortunately couldn't get any 
help on it. So, I am reposting it again.
     I've a problem while using MSXML3 or MSXML4 as my 
processor,
which I do not get when I use Saxon or Xalan-J processors. 
The following are the input files and the output files. Please can 
some one explain me why MSXML does create this problem?

Here I am merging 2 xml files using an XSL file
---------------------------
InputFile_1.xml
---------------------------
<?xml version="1.0" encoding="UTF-8"?>
<Root xmlns:m="http://www.xyz.com/m";>
   <Header>
     <Version>1.0</Version>
   </Header>
   <Message>
     <Type>Response</Type>
     <SubType>CALCULATION</SubType>
     <Calculate>
       <Data>
         <A>
           <Time>
             <B Unit="XY">+21.0</B>
             <C Unit="XY">+5.0</C>
             <D>0</D>
           </Time>
         </A>
       </Data>
     </Calculate>
   </Message>
</Root>
------------------------------------
InputFile_2.xml
------------------------------------
<?xml version="1.0" encoding="UTF-8"?>
<Root>
     <Message>
       <Calculate>
         <Data>
           <A>
              <Time>
               <BDesc stage="LM">Some Text 1</BDesc>
               <CDesc stage="LM">Some Text 2</CDesc>
               <D>0</D>
             </Time>
           </A>
         </Data>
       </Calculate>
     </Message>
</Root>

----------------------------------
Output.xml using Saxon or Xalan
----------------------------------
   <?xml version="1.0" encoding="UTF-8" ?>
- <Root>
- <Header xmlns:m="http://www.xyz.com/m";>
   <Version>1.0</Version>
   </Header>
- <Message>
   <Type xmlns:m="http://www.xyz.com/m";>Response</Type>
   <SubType xmlns:m="http://www.xyz.com/m";>CALCULATION</SubType>
- <Calculate>
- <Data>
- <A>
- <Time>
   <B xmlns:m="http://www.xyz.com/m"; Unit="XY">+21.0</B>
   <C xmlns:m="http://www.xyz.com/m"; Unit="XY">+5.0</C>
   <BDesc stage="LM">Some Text 1</BDesc>
   <CDesc stage="LM">Some Text 2</CDesc>
   <D>0</D>
   </Time>
   </A>
   </Data>
   </Calculate>
   </Message>
   </Root>
-----------------------------------------------
Output.xml using MSXML 3 or 4
---------------------------------
<?xml version="1.0" encoding="UTF-16" ?>
- <Root xmlns:m="http://www.xyz.com/m";>
- <Header>
   <Version>1.0</Version>
   </Header>
- <Message>
   <Type>Response</Type>
   <SubType>CALCULATION</SubType>
- <Calculate>
- <Data>
- <A>
- <Time>
   <B Unit="XY">+21.0</B>
   <C Unit="XY">+5.0</C>
   <BDesc stage="LM">Some Text 1</BDesc>
   <CDesc stage="LM">Some Text 2</CDesc>
   <D stage="LM">0</D>
   </Time>
   </A>
   </Data>
   </Calculate>
   </Message>
   </Root>
-------------------------------------------

If you can notice, there is a very small difference in the above 2 
output files. The element <<D>> has an attribute "stage" in the 
second output file(using MSXML) where as it doesn't have any 
attribute and is copied down as expected in the first output 
file(using Saxon or Xalan). Can someone explain me what could be 
the reason behind this discrepancy.

Thanks,
Kalyan

P.S:- I have posted the XSLT file used for this transformation in 
my earlier posting. Thinking that it's length would constrain 
people from having a look at this mail, I did not repost it again. 
If you think you need, please let me know, I'd post it.

 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list



 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list



<Prev in Thread] Current Thread [Next in Thread>