OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.


Help: OASIS Mailing Lists Help | MarkMail Help

relax-ng message

[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [Elist Home]

Subject: [relax-ng] Binary XML by using RELAX NG

This is just a toy idea I'm playing with.

The idea of "binary XML" has been around for a while. One kind of binary
XML can handle any well-formed XML. There is another kind of binary XML
where the format uses schema information to further compress data.

I saw these schema-guided binary XML formats for DTD and XML Schema,
then I thought RELAX NG is even better framework for schema-guided XML
as well.

The idea is this. If you have a schema 

<element name="foo">
    <attribute name="xyz"/>
    <element name="bar"><text/></element>

and an instance


then you can reproduce the same document from a set of "instructions"
that basically describe which branch of choice you had taken. For
example, the first choice you hit is <optional>, so the first
instruction is "skip". Then the next choice is <zeroOrMore>, so the
instruction is "twice". You can record texts and values as you go.

So the complete instructions to reproduce the binary are:

1. skip  (the first <optional>)
2. twice (repeat <oneOrMore> twice.)
3. "abc" (the contents of the <text/> in the first iteration)
4. "def" (the contents of the <text/> in the second iteration)

How is this?

Sun Microsystems                   kohsuke.kawaguchi@sun.com

[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [Elist Home]

Powered by eList eXpress LLC