[XML-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: Mixed content in data-binding (Was: Re: Interest

  • To: "Michael Kay" <mike@s...>,"'Peter Gerstbach'" <peter.gerstbach@g...>,"'XML-dev'" <xml-dev@l...>
  • Subject: Re: Mixed content in data-binding (Was: Re: Interesting pair of comments
  • From: "Pete Cordell" <petexmldev@t...>
  • Date: Fri, 15 Jul 2005 10:26:56 +0100
  • References: <E1DtLf0-0001Ed-00@p...>

xs cdata
Original Message From: "Michael Kay"
> There are also applications of mixed content that don't fall into the
> classic "marked-up text" model. For example, it can be used to record
> "properties of properties", as in
>
> <email>fred@s...<last-modified>2005-02-02</last-modified></email>
...
> But it's an area where the XML Schema spec didn't carry through its design
> principle that elements should be able to do anything that attributes can
> do: if last-modified were an attribute then I could constrain the email
> address with a pattern facet.
...
> Michael Kay
> http://www.saxonica.com/

Thanks for the example Michael.  As I think you infer, XSD itself doesn't 
really support this either.  For example, if <email> was marked as mixed, 
the following would also be legal wouldn't it?:

<email>fred@s...<last-modified>2005-02-02</last-modified>What's 
this?</email>

Also, it is only implied, perhaps through documentation, that the first 
CDATA event is the actual e-mail address value.  To capture it precisely, an 
(abridged) schema would have to look something like:

<xs:element name=email><xs:ct>
    <xs:sequence>
        <xs:CDATA identifyingName=email><!-- new construct -->
        <xs:element name=last-modified ...
...

That said, I do find what you suggest aesthetically pleasing and I agree 
that tools could do better here!

Pete.
--
=============================================
Pete Cordell
Tech-Know-Ware Ltd
                         for XML to C++ data binding visit
                         http://www.tech-know-ware.com/lmx
                         (or http://www.xml2cpp.com)
=============================================


PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
 

Stylus Studio has published XML-DEV in RSS and ATOM formats, enabling users to easily subcribe to the list from their preferred news reader application.


Stylus Studio Sponsored Links are added links designed to provide related and additional information to the visitors of this website. they were not included by the author in the initial post. To view the content without the Sponsor Links please click here.

Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2007 All Rights Reserved.