W3C home > Mailing lists > Public > xmlschema-dev@w3.org > September 2011

Question about validation xml with xsd

From: Milena K <milena.y.k@gmail.com>
Date: Wed, 31 Aug 2011 19:50:58 +0300
Message-ID: <CADxg=xyQViw+PTSFMMrVy084BetLkEjm2ZFxjb-XC_KwzVO0fA@mail.gmail.com>
To: xmlschema-dev@w3.org
I want to apologize in advance for my bad english.

I want to validate xml(1), which is as follows:

Hi <name>Milena</name>,
You have <count>1</count> unpaid bill.

The xsd must be:

*<xsd:element name="letter">
 <xsd:complexType mixed="true">
     <xsd:element name="name" type="xsd:string"/>
     <xsd:element name="count" type="xsd:integer"/>

But If I have that xml(2):

Hi <name>Milena</name>,
You have to give me <count>1</count> apple.

and If I try to validate this xml with the given xsd, the result will be
also OK.
I want to restrict character data in mixed content.
And If I have xml(2)  instead of xml(1), I want to know that.

My question is: How to write my xsd, so that validation of second xml to be

Thank you in advance.
Have a nice day!

Received on Monday, 5 September 2011 13:07:45 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 23:16:00 UTC