Out of interest, my confustion here stemmed from the content returned when
the token type is invalid.
I was testing an xs:token type that was (intentionally) invalid according to
its type.
E.g. Testing <testA B C </testwhere "test" is defined as type:
<xs:simpleType name="token2_Type">
<xs:restriction base="xs:token">
<xs:minLength value="1"/>
<xs:maxLength value="2"/>
</xs:restriction>
</xs:simpleType>
Typically you wouldn't want to continue if the token value is invalid.
But should you want to continue then the value returned is not normalized
and you would have to do so manually.
So it appears the PSVI property "[schema normalized value]" is either not
created or not returned via the reader.ReadElementContentAsString() method
invocation (in cases where the element content is not schema valid).
My expectation for normalization in this case stemmed from the behaviour
of Xerces-J.
I suspect Xerces is just being helpful in this case as a quick review of
the XML Schema spec suggests the [schema normalized value] does not have to
be created
when the item is not locally valid (?):
(from
http://www.w3.org/TR/xmlschema-1/)
<quote>
If clause 3 of Attribute Locally Valid (ยง3.2.4) applies with respect to an
attribute information item, in the post-schema-validation infoset the
attribute information item has a property: [schema normalized value]
</quote>
Regards,
Nick.
"Martin Honnen" wrote:
Quote:
Originally Posted by
Martin Honnen wrote:
>
Quote:
Originally Posted by
Output is
test content: |A B C|
so that value seems fine. Tested with .NET 3.5 however, will later test
with .NET 2.0 too.
>
Result with .NET 2.0 is the same.
>
--
>
Martin Honnen --- MVP XML
http://JavaScript.FAQTs.com/
>