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

Re: Mixed content in data-binding (Was: Re: Interestingpair of


xml currency data
On ven, 2005-07-15 at 08:24 +0100, Pete Cordell wrote:
> Original Message From: "Eric van der Vlist"
> 
> > On jeu, 2005-07-14 at 11:54 -0400, Elliotte Harold wrote:
> >
> >> regardless, mixed content is not as uncommon or unexpected as many
> >> people think. It is not an accident. It is not bad form. It is not
> >> something to be avoided. It is the very natural way to express many
> >> extremely common constructs when modeling information, including
> >> so-called data-oriented applications (as if any information content were
> >> not data).
> >
> > Well said!
> >
> > Unfortunately, most people tend to exclude any mixed content from
> > data-oriented applications ...
> 
> How do you think a data binding app should handle mixed content?  

Some data binding applications do already support mixed content (IMO,
it's mostly a matter of defining that support as a requirement!).
Examples that come to mind are Amara
(http://uche.ogbuji.net/tech/4Suite/amara/) but also XMLBeans (see
http://www.rpbourret.com/xml/XMLDataBinding.htm)

Eric

> We lump a 
> complex types mixed content into a string and stop there, which I don't 
> think is ideal (although it is a common approach).  Another approach could 
> be to have strings in your language binding classes (in our case C++) 
> interleaved with the data elements that would store the CDATA parts.  Would 
> this be better?  Is there a need for both?
> 
> The example that Elliotte gave earlier (<p>This is <strong>very</strong> 
> important</p>) could possibly have been handled with an <xs:any 
> namespace='xhtml'> construct.  Do you have any other examples of mixed use 
> in data-oriented applications that would not be treated as xhtml?

I give one in the chapter of my RNG book that I mentioned in my previous
mail (http://books.xmlschemata.org/relaxng/relax-CHP-7-SECT-10.html):

<price><currency>USD</currency>20</price>
<price>20<currency>Euro</currency></price>

I you were using an attribute to specify the currency, you would need to
find a way to specify if you want to display the currency before or
after the amount...

Of course, you can write:

<price>
  <amount>20</amount>
  <currency>USD</currency>
 </price>

but you can also consider that wrapping the amount into an amount
element is not really needed.

Eric 

-- 
Read me on Advogato.
                                         http://advogato.org/person/vdv/
------------------------------------------------------------------------
Eric van der Vlist       http://xmlfr.org            http://dyomedea.com
(ISO) RELAX NG   ISBN:0-596-00421-4 http://oreilly.com/catalog/relax
(W3C) XML Schema ISBN:0-596-00252-1 http://oreilly.com/catalog/xmlschema
------------------------------------------------------------------------


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-2013 All Rights Reserved.