Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


Re: [xml-dev] Mixed content in data-binding (Was: Re: [xml-dev] Interesting pair of comments (was: ...))

From: "Pete Cordell" <petexmldev@--------------.--->
To: "Paul Downey" <paul.downey@----------.--->
Date: 7/15/2005 8:59:00 AM
Original Message From: "Paul Downey"
> On 15 Jul 2005, at 08:24, Pete Cordell wrote:
>
>> 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.  ...
>
> For me, I really like the notion of being able to write an XML document, 
> not necessarily XHTML, which contains information to be gleaned using 
> XPath and XSLT. Mixed is where it's at.
> ...
> Whilst I might be willing to give up all sorts of bits of a schema 
> language just to nurse-maid users of data binding tools into having a 
> better time, I'm loathed to give up mixed given that turns my documents 
> inside out.
>
> Eric's Catch 22 is the problem here, and it's a crying shame the data 
> binding tools don't make a better fist of preserving the text which 
> surrounds the nuggets of data they're often only interested in.

Being guilty of being a code-head (and a binding one at that - can it get 
worse!), I'm keen to know how you'd like us to make a better fist of it. 
One way of binding the example of "<p>This is <strong>very</strong> 
important</p>" might be to have a class structure that (with any unused 
elements ignored) looks like:-

    class p
    {
        string cdata1;        // = "This is "
        class strong strong;
        string cdata2;        // = " important"
    };

    class strong
    {
        string cdata1;        // = "very"
    };

as opposed to (ignoring the CDATA):

    class p
    {
        class strong strong;
    };

    class strong
    {
    };

or (lumping all the mixed text together):

    class p
    {
        string mixedContent;    // = "<p>This is <strong>very</strong> 
important</p>"
    };

Or do you just decide that binding isn't the right solution in this case, or 
a hybrid is required?

Thanks,

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)
=============================================


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