[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

RE: Problem using MSXML

Subject: RE: Problem using MSXML
From: "Michael Kay" <michael.h.kay@xxxxxxxxxxxx>
Date: Thu, 19 Sep 2002 15:20:51 +0100
merge xml using msxsl
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.H.Kay@xxxxxxxxxxxx
work: Michael.Kay@xxxxxxxxxxxxxx 

> -----Original Message-----
> From: owner-xsl-list@xxxxxxxxxxxxxxxxxxxxxx 
> [mailto:owner-xsl-list@xxxxxxxxxxxxxxxxxxxxxx] On Behalf Of 
> Kalyan Kumar Mudumbai
> Sent: 18 September 2002 06:53
> To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
> Subject:  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


Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.