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

Attribute default values (using SAXON/XALAN/MSXML) --

Subject: Attribute default values (using SAXON/XALAN/MSXML) --BUG in MSXML?--
From: Eric Vermetten <EVermetten@xxxxxxxxxxxxx>
Date: Sun, 21 Jan 2001 20:16:27 -0000
msxml attribute value
using: SAXON 6.0.2 and msxml production release and XALAN-j 1.2.2

Hello all,

I really need to get hold of DTD defined attribute values.
I have the following stylesheet and two XML files:

<?xml version="1.0"?> 
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
version="1.0">

<xsl:output method="xml" 	indent="yes"	encoding="UTF-8" />

<xsl:variable name='global'> <!-- I really like to get the attributes here!
-->
	<xsl:value-of select='count(//x/@*)' />
</xsl:variable>

<xsl:template match="x" >
<xsl:variable name='from-global' select="count(//x/@*)" />
<xsl:variable name='from-current' select="count(@*)" />
	<out>
		<xsl:value-of  select="$global" /><xsl:text>|</xsl:text>
		<xsl:value-of  select="$from-current"
/><xsl:text>|</xsl:text>
		<xsl:value-of  select="$from-global" />
	</out>
</xsl:template>

</xsl:stylesheet>

++++++++++++++XML:mail.txt+++++++++++++++++++++++++
<?xml version='1.0' encoding='UTF-8' ?>
<x e='1' a='2'></x>

++++++++++++++XML:mail2.txt+++++++++++++++++++++++++
<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE x [
<!ELEMENT x EMPTY >
<!ATTLIST x e CDATA #FIXED '1'
            a CDATA #FIXED '2' >
]>
<x/>

XALAN and SAXON always give: <out>2|2|2</out>
msxml gives <out>2|2|2</out> on mail.txt and <out>0|2|0</out> on mail2.txt

Reading section 3.3.2 on attribute default values of the XML-rec I 
conclude that I should *always* get output '2|2|2' as content of <out>.
Is this right? So is this another bug in msxml? 
For the job at hand I'm bound to msxml, 
so if in error, is there a work around?


Thanks in advance,
Eric Vermetten

 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.