Hi Bruno,
Sorry for the very long delay in responding to your note - I was busy
with something else, but made a note to look into your issue when I had a
chance.
I believe that you should be able get at the default attribute value
using the parser features you've specified. I seem to recall that there
was a serious bug in Xerces-J 2.0.0 that involved attribute values and
schema validation.
When I tried your code fragment with Xalan-J 2.3.1 (which included
Xerces-J 2.0.0) it failed to retrieve the default attribute value, but it
succeeds with Xalan-J 2.4D1 (which includes Xerces-J 2.0.1).
Thanks,
Henry
------------------------------------------------------------------
Henry Zongaro Xalan development
IBM SWS Toronto Lab Tie Line 969-6044; Phone (905) 413-6044
mailto:[EMAIL PROTECTED]
"Bruno Chatel" <[EMAIL PROTECTED]>
02/07/17 10:06 AM
To: <[EMAIL PROTECTED]>
cc:
Subject: Re: Schema and fixed attribute value
No way to do this ?
----- Original Message -----
From: "Bruno Chatel" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Tuesday, July 16, 2002 11:13 PM
Subject: Schema and fixed attribute value
> Hello,
>
> I am looking for a way to get the value of an attributes declared as
fixed
> in my w3c schema, from a stylesheet...
>
> Something like this :
>
> *) unit.xsd
>
> <xs:complexType name="m">
> <xs:simpleContent>
> <xs:extension base="xs:string">
> <xs:attribute name="unit�" type="xs:string" fixed="m"/>
> </xs:extension>
> </xs:simpleContent>
> </xs:complexType>
>
> <xs:element name="DIAM_ANALYSE" type="m"/>
>
> *) unit.xml
>
> <DIAM_ANALYSE>3.14159</DIAM_ANALYSE>
>
> *) unit.xsl
>
> <xsl:value-of select="DIAM_ANALYSE/@unit�"/>
>
> I tried to load the unit.xml as a DOMSource by using Xerces2 parser
> with features like
>
parser.setFeature("http://apache.org/xml/features/validation/schema-full-checking",true);
> parser.setFeature("http://apache.org/xml/features/validation/schema",true);
> parser.setFeature("http://xml.org/sax/features/namespaces", true);
>
parser.setFeature("http://apache.org/xml/features/validation/schema/normalized-value",true
> );
>
parser.setFeature("http://apache.org/xml/features/validation/schema/element-default",true)
> ;
>
> but the attribute value seems to be not accessible in my stylesheet.
>
> Any idea ?
>
> Thanks in advance
>
> Regards
>
> -- bruno --
> Bruno Chatel
> Tel : (+33)[0] 4 96 11 14 57
> Email : [EMAIL PROTECTED]
> http://www.chadocs.com
> ----------------------------------------