Are all values stored as strings?

Hi Folks,

Consider these two ways of defining an element called "num":

-----------------------------------------------------------------
Version #1:

<xsd:element name="num" type="xsd:unsignedByte"/>

-----------------------------------------------------------------
Version #2:

<xsd:simpleType name="numType">
    <xsd:restriction base="xsd:string">
       <xsd:pattern 
          value="[0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5]"/>
   </xsd:restriction>
</xsd:simpleType>

<xsd:element name="num" type="numType

-----------------------------------------------------------------
Now, here is an example of an instance of "num":

<num>32</num>

Question: is it correct that num's value (32) is always represented as a
"string", regardless of how num is declared?  That is, are all values
just strings, with a "datatype label" associated with the string?

Let me ask it another way, is the value (32) represented by an XML
Schema validator as this:

   0010 0000

if "num" is declared using Version #1

and like this: 

   0011 0010

if "num" is declared using Version #2?

/Roger

Received on Friday, 9 May 2003 19:44:18 UTC