Re: [xml-dev] Brain Teaser: Element Author is of type xsd:string, what's an illegal value of Author?

From
Brendan <>
To
"Costello, Roger L." <>,
Date
2007-02-09T19:22:50Z
ID
<>
Thread
Re: [xml-dev] Brain Teaser: Element Author is of type xsd:string, what's an illegal value of Author?
Hi Roger,

Ah, I see now that it's not valid with respect to the schema.
ie. the problem with <tag/> is not that it's an illegal string, but that it's not a string at all.

   <xsd:element name="Author" type="xsd:string" />

   <Author> <tag/> </Author>

> However, that's not the same thing as giving Author a non-string value.
Being pedantic, I guess <tag/> is a "non-string" value.

PS: I think you meant "not valid", instead of "non-well-formed" - I always get those two confused, and had to look it up.


Brendan

On 10/02/07, Costello, Roger L. <[email protected]> wrote:
Hi Brendan,
 
I think that's an example of <Author> having non-well-formed content, not an example of <Author> having an illegal string value.  Certainly if the "<" is escaped then <Author> is legal:
 
    <Author> &lt;tag/> </Author>
 
I'm not sure what the answer is.
 
/Roger


From: Brendan [mailto:[email protected]]
Sent: Friday, February 09, 2007 1:29 PM
To: Costello, Roger L.
Subject: Re: [xml-dev] Brain Teaser: Element Author is of type xsd:string, what's an illegal value of Author?

What about
   <Author> <tag/> </Author>
Isn't an element a non-string value, and therefore illegal?


Brendan Macmillan


<xsd:element name="Author" type="xsd:string" />

<?xml version="1.0"?>
<Book>
        <Author>...</Author>
</Book>

Question: what is an invalid (non-string) value for <Author>?