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

ug in MSXML3: An element has two attributes with the

Subject: ug in MSXML3: An element has two attributes with the same name -- DTD default not overriden
From: Dimitre Novatchev <dnovatchev@xxxxxxxxx>
Date: Thu, 18 Jan 2001 12:20:06 -0800 (PST)
bottom
As promised earlier today, here's some information about this bug, that
may be useful to stylesheet authors using MSXML3.

xml source1:
-------------
<?xml version="1.0" ?>

<!DOCTYPE gifts [
<!ENTITY nbsp " ">
<!ELEMENT gifts (ModelNumber+)>
<!ELEMENT ModelNumber (#PCDATA)>
<!ATTLIST ModelNumber
               group (gold | red)  "red"
               dep (gold | red)  "red"
               prod (gold | red)  "red"
               location  CDATA    #IMPLIED
               ref  CDATA    #IMPLIED
               id  ID    #IMPLIED  >
]>

<gifts>
  <ModelNumber prod="gold">P6205</ModelNumber>
</gifts>


The stylesheet:
----------------
<?xml version="1.0"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="xml" omit-xml-declaration="yes"/>
<xsl:template match="/">
  <xsl:for-each select="/gifts/ModelNumber/@*">
    <xsl:value-of select="name()"/>
 <xsl:text>&#xA;</xsl:text>
  </xsl:for-each>
</xsl:template>
</xsl:stylesheet>

Result:
-------
prod
group
dep
prod


Note the two attriute with the name "prod" !!!!

Saxon produces:
-----------------
prod
group
dep

MSXML3 July Beta rel. produces:
------------------------------------
prod
group
dep


Another result of this bug -- let's apply the identity transformation,
as
defined in the XSLT spec to the same xml doc:

The stylesheet:
----------------
<?xml version="1.0"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="xml" omit-xml-declaration="yes"/>
<xsl:template match="@*|node()">
  <xsl:copy>
    <xsl:apply-templates select="@*|node()"/>
  </xsl:copy>
</xsl:template>
</xsl:stylesheet>

Result:
--------
<gifts>
<ModelNumber prod="red" group="red" dep="red">P6205</ModelNumber>
</gifts>


As you can see here, the problem is that the default value for @prod
("red")from the DTD was used by MSXML3 to override the value ("gold")
that was in fact specified in the xml document !!!


Saxon produces:
------------------
<gifts>
  <ModelNumber prod="gold" group="red" dep="red">P6205</ModelNumber>
</gifts>

MSXML3 July Beta rel. produces:
--------------------------------------
<gifts>
<ModelNumber prod="gold" group="red" dep="red">P6205</ModelNumber>
</gifts>


Cheers,
Dimitre Novatchev.








__________________________________________________
Do You Yahoo!?
Get email at your own domain with Yahoo! Mail. 
http://personal.mail.yahoo.com/

 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.