Print

Print


> From: Sam Hunting

> I can see how you could build a tree out of element content very
easily. But
> what about mixed content?

There are a number of simple ways of treating 'mixed content'. If we
have:

        <TEXT>
                <QUOTE>
                        Living in the
                        <COUNTRY ISO="US">States</COUNTRY>
                        must be great y'all
                </QUOTE>
                , said
                <CHARACTER>Winnie the Pooh<CHARACTER>
                .
        </TEXT>

Additional text can be represented in the database as a child in its own
right:

        <TEXT>
                <QUOTE>
                        <PCDATA>Living in the</PCDATA>
                        <COUNTRY ISO="US">States</COUNTRY>
                        <PCDATA>must be great y'all</PCDATA>
                </QUOTE>
                <PCDATA>, said</PCDATA>
                <CHARACTER>Winnie the Pooh<CHARACTER>
                <PCDATA>.</PCDATA>
        </TEXT>

A cheat alternative is to have two system attributes available to every
object type, for text that precedes and follows the object:

        <TEXT>
                <QUOTE>
                        <COUNTRY ISO="US" PRE="Living in the" POST="must
be great y'all">States</COUNTRY>
                </QUOTE>
                <CHARACTER PRE=", said" POST=".">Winnie the
Pooh<CHARACTER>
        </TEXT>

The first solution feels more 'correct'; I haven't delved far enough
into the XML definition but it may even be 'implied' by the definition,
since untagged data is PCDATA. The second, however, is slightly easier
to implement in a user interface, and given that's where most of the
problems lie, that's what we've done for now!

> How do you do a join on XML data that looks like this:

> <element>This is #PCDATA<mixed>with mixed content</mixed>and an
element
> mixed.</element>

Not sure what you mean by 'JOIN'. If you clarify I'll gladly try to
answer.

Regards,

Mark


Mark Birbeck
Managing Director
Intra Extra Digital Ltd.
39 Whitfield Street
London
W1P 5RE
w: http://www.iedigital.net/
t: 0171 681 4135
e: [log in to unmask]