Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


Re: RFC, an ugly parser hack (and a bin-xml variant)

From: Soren Kuula <dongfang@--------.-->
To: NULL
Date: 9/7/2005 2:52:00 AM
cr88192 wrote:
> for various reasons, I added an imo ugly hack to my xml parser.
> basically, I wanted the ability to have binary payload within the xml parse 
> trees.
> 
> this was partly because I came up with a binary xml format (mentioned more 
> later), and thought it would be "useful" to be able to store binary data 
> inline with this format, and still wanted to keep things balanced (whatever 
> the binary version can do, the textual version can do as well).
> 
> the approach involved, well, a bastardized subset of xml-data.
> the attribute 'dt:dt' now has a special meaning (along with the rest of the 
> 'dt' namespace prefix), and the contents of such nodes are parsed specially 
> (though still within xml's syntactic rules, eg, as a normal xml text glob).

My comment: Why don't you use the normal namespace mechanism, instead of 
magic prefixes?

The parser must store the namespace prefix-->URI bindings is had 
encountered so far at some place anyway (if it's a namespace aware 
parser). It should then also be possible to modify it to go to binary 
mode when entering elements in your special namespace -- and leave it 
again when exiting (keep a counter of the nesting depth, increment, 
decrement). In binary mode, it will decode text to binary.

Søren


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