Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > XML > How does union datatype handle leading/trailing white space?

Reply
Thread Tools

How does union datatype handle leading/trailing white space?

 
 
Leo
Guest
Posts: n/a
 
      08-31-2004
Can the value of the union datatype contain leading/trailing white
space if it's not allowed by the member datatypes? For example, in the
following example:

t1.xsd:
<?xml version="1.0"?>
<xsd:schema xmlnssd="http://www.w3.org/2001/XMLSchema"
targetNamespace="http://www.t1.org"
xmlns="http://www.t1.org"
elementFormDefault="qualified">
<xsd:simpleType name="enum_type">
<xsd:restriction base="xsd:string">
<xsd:enumeration value="enum_type_val_1"/>
</xsd:restriction>
</xsd:simpleType>
<xsd:simpleType name="union_type">
<xsd:union memberTypes="enum_type"/>
</xsd:simpleType>
<xsd:element name="root">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="elem_1" type="union_type"
maxOccurs="unbounded"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
</xsd:schema>

t1.xml:
<?xml version="1.0"?>
<root xmlns="http://www.t1.org"
xmlnssi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.t1.org t1.xsd">
<elem_1> enum_type_val_1 </elem_1>
</root>

Should the validator reject elem_1 value because of the both
leading/trailing white space?

Xerces-C 2.5 does not. However, if enum_type is used directly, without
the union, then Xerces raises an error, stating that "Message:Value '
enum_type_val_1 ' is not in enumeration"

Thanks,
Leo.
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
any datatype which can handle GB's of Data. Garg Java 9 04-25-2007 12:04 AM
database datatype bit what is the C# datatype? Jeff ASP .Net 2 04-16-2007 08:26 PM
Color.white vs. Color.WHITE Niels Dybdahl Java 3 10-06-2004 03:21 PM
union in struct without union name Peter Dunker C Programming 2 04-26-2004 07:23 PM
map XML union to C union (and vice-versa) Matt Garman XML 1 04-25-2004 12:40 AM



Advertisments