Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


RE: Mixed content and empty content

From: dmaze@--.---.---
To: xmlschema-dev@--.---
Date: 11/1/2007 6:39:00 AM
Michael Kay <mike@s...> wrote on 11/01/2007 08:52:14 AM:

> > What I'm not sure about is, given:
> > 
> >     <xsd:element name="foo">
> >         <xsd:complexType/>
> >     </xsd:element>
> > 
> > Is:
> >     <foo>
> >     </foo>
> > 
> > a valid instance, i.e. is whitespace forbidden in an empty element?
> 
> Empty is a special case of element-only content, and whitespace is 
always
> allowed in element-only content. I think.

XML Schema 1.0, section 3.4.4, clause 2.1 states that if the {content 
type} of a complex type is empty(which is the case for an empty 
<xs:complexType/> declaration with mixed="false") then the element being 
validated may have no character or element information item [children] at 
all, which sounds like it explicitly excludes whitespace.  So <foo/> and 
<foo></foo> would both be valid, but not <foo> </foo>.

David Maze
Engineer, IBM WebSphere DataPower SOA Appliances
One Rogers Street, Cambridge, MA 02142
Phone: 617-693-1306  Fax: 617-693-5541


transparent
Print
Mail
Like It
Disclaimer
.

These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on www.altova.com/list/index.html. Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.

.
.

transparent

transparent