W3C home > Mailing lists > Public > xmlschema-dev@w3.org > January 2013

Re: Simple node type with attribute

From: Michael Kay <mike@saxonica.com>
Date: Sat, 05 Jan 2013 17:49:54 +0000
Message-ID: <50E867C2.7080300@saxonica.com>
To: xmlschema-dev@w3.org
Of course. This is known (clumsily) as a complex type with simple 
content, and a typical example is:

    <xs:element name="test">
         <xs:annotation>
             <xs:documentation>
                 ...
             </xs:documentation>
         </xs:annotation>
         <xs:complexType>
             <xs:simpleContent>
                 <xs:extension base="xs:string">
                     <xs:attribute name="file" type="xs:anyURI" 
use="optional"/>
                 </xs:extension>
             </xs:simpleContent>
         </xs:complexType>
     </xs:element>

However, in your example the only attributes are namespace declarations 
and the xsi:type attribute; neither of these needs to be declared as an 
attribute in your schema.

Michael Kay
Saxonica

On 04/01/2013 15:40, Róbert Horný wrote:
>
> Hi,
>
>  is possible to declare scheme for simple node type with attribute ?
>
> <ACTLOGLINE xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>
> xmlns:xsd="http://www.w3.org/2001/XMLSchema">
>
> <ACTLOGLINE>
>
> <DTTIMESTAMP xsi:type="xsd:string">41262.718611111111</DTTIMESTAMP>
>
> </ACTLOGLINE>
>
> </ACTLOGLINE>
>
> S pozdravom/Kind regards,
>
> Róbert Horný
>
> mobil > 0918785483
>
> mail  > rhorny@maind.sk
>
> logo Maind
>
Received on Saturday, 5 January 2013 17:50:15 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Saturday, 5 January 2013 17:50:15 GMT