I have an xml I want to validate against an xsd after adding a new attribute.
I tried to declare the attribute locally for some element in the xsd, but couldn't figure out how to do it.
On a whim, I took an already validated xml and added the new attribute to an element without any change to the xsd, and the validation passed successfully.
The attribute (letter-spacing) passed the validation only of it had a namespace prefix (namespace 'dptt' that is defined in the xsd and appears in the xml):
An example of a line that passed the validation:
<tt:style dptt:letter-spacing="4px" style="s01" tts:lineHeight="120px" xml:id="1"/>
An example of a line that didn't pass the validation:
<tt:style letter-spacing="4px" style="s01" tts:lineHeight="120px" xml:id="1"/>
This is the part of the xsd that defines the style attribute:
<xs:element name="style">
<xs:complexType>
<xs:sequence>
<xs:element ref="tt:metadata" minOccurs="0"/>
</xs:sequence>
<xs:attribute ref="xml:id" use="required">
</xs:attribute>
<xs:attribute name="style" type="xs:IDREFS">
</xs:attribute>
<xs:attribute ref="tts:direction" >
</xs:attribute>
<xs:attribute ref="tts:fontFamily" >
</xs:attribute>
<xs:attribute ref="tts:fontSize" >
</xs:attribute>
<xs:attribute ref="tts:lineHeight" >
</xs:attribute>
<xs:attribute ref="tts:textAlign" >
</xs:attribute>
<xs:attribute ref="tts:color" >
</xs:attribute>
<xs:attribute ref="tts:backgroundColor" >
</xs:attribute>
<xs:attribute ref="tts:fontStyle" >
</xs:attribute>
<xs:attribute ref="tts:fontWeight" >
</xs:attribute>
<xs:attribute ref="tts:textDecoration" >
</xs:attribute>
<xs:attribute ref="tts:unicodeBidi" >
</xs:attribute>
<xs:attribute ref="tts:padding">
</xs:attribute>
<xs:attribute ref="ebutts:multiRowAlign"/>
</xs:complexType>
</xs:element>
I expect that an undeclared attribute won't pass the validation.
I also wonder why the addition of a namespace is crucial for validation.