I have a xml file and a xsd file that is validating the xml successfully.
I want to add one attribute to an element in the xml, and change the xsd accordingly, so the validation will still pass successfully.
I have a xml file that passes validation.
I added one attribute to one element type. the attribute name is 'letterspacing', it's value suppose to be of type string.
I tried to define the attribute locally for the element in the xsd, with name and type that corresponds to the name and value that appears in the xml, but without a namespace (which I don't want to include, if possible) and without a reference to an attribute that is defined elsewhere.
All the other elements and attributes that are defined in the xsd pass the validation, even other local attributes that are defined on other elements, without a namespace or a reference.
I couldn't find any reason for the attribute not to be supported, but I probably miss something.
xsd:
<xs:schema ...>
...
<xs:element name="style">
...
<xs:attribute name="letterspacing" type="xs:string" />
</xs:element>
</xs:schema>
xml:
<tt:style tts:backgroundColor="#aaaaaaff" xml:id="styPar0" letterspacing="8px"/>
attributeFormDefault is not defined in the schema, so the attributes don't need to be qualified with a namespace prefix.
I think this context is enough since without that attribute the validation works fine, I just want to know how to add support in a new local attribute.
I'm using notepade++ XML Tools to validate against my xsd file.
I expect the definition of the new attribute in the xsd will validate the new attribute in the xml, but I get "ERROR: Element '{http://www.w3.org/ns/ttml}style', attribute 'letterspacing': The attribute 'letterspacing' is not allowed."