xsl-list
[Top] [All Lists]

Re: [xsl] Source code formatting

2020-07-30 06:43:54
On Thu, Jul 30, 2020 at 4:00 PM Imsieke, Gerrit, le-tex
gerrit(_dot_)imsieke(_at_)le-tex(_dot_)de 
<xsl-list-service(_at_)lists(_dot_)mulberrytech(_dot_)com> wrote:

I'd really appreciate if xerces had an option to deactivate attribute
normalization that can be set by a Saxon configuration option or a
command line switch. I don't know how responsive/welcoming the Apache
XML maintainers are if someone of us submitted a patch, in particular if
it's a patch that enables non-standard behaviour.


Attribute value normalization, it seems, has a certain behaviour (it seems
to override the attribute value normalization definition as defined within
the XML spec) when doing XML Schema (XSD) validation. Please consider the
following XSD 1.1 validation example,

XML document
<?xml version="1.0"?>
<X att_1="v
"/>
(the attribute value is character v followed by an enter key. i.e, the
unnormalized attribute value string length is 2)

XSD 1.1 document
<?xml version="1.0"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema";>

   <xs:element name="X">
      <xs:complexType>
<xs:attribute name="att_1" type="xs:string"/>
<xs:assert test="string-length(@att_1) = 2"/>
      </xs:complexType>
   </xs:element>

</xs:schema>

When doing the above XSD validation, the validation passes (with both
Xerces & Saxon. The <assert>, <xs:assert test="string-length(@att_1) = 1"/>
makes the XML document invalid).

I think that, above XSD validation can be explained by following section of
XSD 1.1 data types spec:
https://www.w3.org/TR/xmlschema11-2/#rf-whiteSpace (the
spec says, 'for string the value of whiteSpace is preserve').




-- 
Regards,
Mukul Gandhi
--~----------------------------------------------------------------
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
EasyUnsubscribe: http://lists.mulberrytech.com/unsub/xsl-list/1167547
or by email: xsl-list-unsub(_at_)lists(_dot_)mulberrytech(_dot_)com
--~--
<Prev in Thread] Current Thread [Next in Thread>