This is the mail archive of the xsl-list@mulberrytech.com mailing list .


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]