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

Re: Question about validation xml with xsd

From: Michael Kay <mike@saxonica.com>
Date: Mon, 05 Sep 2011 14:58:41 +0100
Message-ID: <4E64D591.4050202@saxonica.com>
To: xmlschema-dev@w3.org

I wonder why you would want to do this? I would expect to see the data 
being interchanged in XML form something like

<letter type="unpaid-bills">

with the fixed boilerplate text being added by an XSLT stylesheet at 
some later time. I'm not sure why you would want to validate that the 
XSLT stylesheet is doing its job? The main effect is surely that 
changing the boilerplate text of the letter becomes more burdensome, 
which doesn't seem to improve your overall system quality.

Michael Kay

On 31/08/2011 17:50, Milena K wrote:
> Hi,
> I want to apologize in advance for my bad english.I want to validate 
> xml(1), which is as follows:
> /<letter>
> Hi <name>Milena</name>,
> You have <count>1</count> unpaid bill.
> </letter>/
> The xsd must be:
> /<xsd:element name="letter">
> <xsd:complexType mixed="true">
> <xsd:sequence>
> <xsd:element name="name" type="xsd:string"/>
> <xsd:element name="count" type="xsd:integer"/>
> </xsd:sequence>
> </xsd:complexType>
> </xsd:element>/
> But If I have that xml(2):
> /<letter>
> Hi <name>Milena</name>,
> You have to give me <count>1</count> apple.
> </letter>/
> 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 ERROR?
> Thank you in advance.
> Have a nice day!
> --
> Milena
Received on Monday, 5 September 2011 13:59:13 UTC

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