Validate both element and attribute with XSD

I have this XML snippet that I need to validate:


I want to validate both the attribute ‘model’ content and the element content ‘Volvo’. Here is one way of doing it (thank you Alex):


        <xs:attribute name="model" type="xsd:string"/>


The base attribute will validate the element content ‘Volvo’ and the attribute type will validate the ‘model’

Leave a Comment

NOTE - You can use these HTML tags and attributes:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong> <pre lang="" line="" escaped="" cssfile="">

This site uses Akismet to reduce spam. Learn how your comment data is processed.