473,385 Members | 1,356 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

How does union datatype handle leading/trailing white space?

Leo
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 xmlns:xsd="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"
xmlns:xsi="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.
Jul 20 '05 #1
0 1381

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Maxime Biais | last post by:
Hello, I know how to print a string without the trailing newline with a coma like : print "hello word", but this example add a white space after the string :( Do you know how to avoid...
2
by: \Dandy\ Randy | last post by:
Hello everyone. I have been following misc posts, as well as reading several FAQ's on this issue, unfortunatley I cannot locate a solution. I am hoping that someone will be able to provide me with...
1
by: Paul | last post by:
I am fairly new to HTML. The application I inherited gets a record set, determines how many rows it can display, and starts filling the table. Some of my character data contain spaces. I want to...
4
by: ucfcpegirl06 | last post by:
Hi, I need help getting rid of trailing white spaces. I am searching a file for various data (not important) and retrieving it. I output the data if found to a file. An example would be:...
4
by: Albert | last post by:
This isn't entirely related to C, but Kernighan and Ritchie asks in Execise 1-18 of their C programming language book to 'Write a program to remove trailing blanks and tabs from each line of input,...
17
by: tommy | last post by:
Hi all, I' m adding strings to some fields in my table via Access. The strings sometimes have trailing spaces and I really need to have it that way, but Access truncates trailing spaces. How can...
5
by: tim | last post by:
I am new to Regular Expressions and need some assistance with my Zip Code field validator. I am currently using the following regex to validate a zip code: ^(\d{5}(( |-)\d{4})?)|(\d( |-)\d\d)$...
1
by: Steve Richter | last post by:
when I run the following code the leading spaces of the "data" node are removed. How do I retain whitespace? private void CreateBasicXmlDocument() { XmlWriterSettings writeSettings = new...
3
by: PengYu.UT | last post by:
Hi, I'm reading an R-tree implementation converted from C to C++. A union is used for the internal nodes and the leaves of the tree. union { Node* m_child; ...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.