Bug 3662 - Xerces always trims attribute values regardless of datatype defined in schema
Summary: Xerces always trims attribute values regardless of datatype defined in schema
Status: NEW
Alias: None
Product: Xerces-J
Classification: Unclassified
Component: Core (show other bugs)
Version: 1.4.3
Hardware: All All
: P3 major
Target Milestone: ---
Assignee: Xerces-J Developers Mailing List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2001-09-17 13:19 UTC by Takuki Kamiya
Modified: 2005-03-20 17:06 UTC (History)
0 users



Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Takuki Kamiya 2001-09-17 13:19:56 UTC
Xerces appears to be always trimming leading and trailing whitespaces
for attribute values regardless of the datatype defined in the schema.

For example, given the following XML and schema,

<?xml version="1.0"?>
<A>
  <B attB1="  A   B   C   "/>
</A>

<?xml version ="1.0"?>

<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">

  <xs:element name="A" >
    <xs:complexType>
      <xs:sequence>
        <xs:element ref="B" maxOccurs="unbounded" />
      </xs:sequence>
    </xs:complexType>
  </xs:element>

  <xs:element name="B" >
    <xs:complexType>
      <xs:attribute name="attB1" type="xs:string" use="required" />
    </xs:complexType>
  </xs:element>

</xs:schema>


The value of attB1 is reported as "A   B   C" rather than "  A   B   C   ".
attB1 is defined as "string", so the value of which should be reported
as intact.

-Takuki Kamiya