You are viewing a plain text version of this content. The canonical link for it is here.
Posted to j-users@xalan.apache.org by Bruno Chatel <bc...@chadocs.net> on 2002/07/16 23:13:54 UTC

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 : bcha@chadocs.com
http://www.chadocs.com
----------------------------------------



Re: Schema and fixed attribute value

Posted by Bruno Chatel <bc...@chadocs.net>.
No way to do this ?


----- Original Message -----
From: "Bruno Chatel" <bc...@chadocs.net>
To: <xa...@xml.apache.org>
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 : bcha@chadocs.com
> http://www.chadocs.com
> ----------------------------------------
>
>
>