Serialized grammars are a good idea. Standardized and architecture neutral
serialized grammars are even better.  I tried to get it in W3C EXI (and I
will, at some point, as an extension).  It is even more important for EXI
than in general XML cases.

It really is not hard to make data formats like these portable and
architecturally neutral.  Byte order can be handled in just a few lines of
code, for instance.

Stephen


On Wed, Feb 23, 2011 at 5:17 PM, David Bertoni (JIRA) <
xerces-c-...@xml.apache.org> wrote:

>  [image: Boxbe] <https://www.boxbe.com/overview> Junk Score: 1 out of 10
> (below your Auto Allow threshold <https://www.boxbe.com/mail-screening>) |
> Approve sender <https://www.boxbe.com/anno?tc=7045170930_887573393> | Block
> sender <https://www.boxbe.com/anno?tc=7045170930_887573393&disp=b> | Block
> domain <https://www.boxbe.com/anno?tc=7045170930_887573393&disp=b&dom>
>
>
>    [
> https://issues.apache.org/jira/browse/XERCESC-1959?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12998651#comment-12998651]
>
> David Bertoni commented on XERCESC-1959:
> ----------------------------------------
>
> The serialization of grammars was never designed to be portable across
> machines. There are issues with 32-bit and 64-bit builds and big-endian and
> little-endian machines. For example:
>
> void XSerializeEngine::writeString(const XMLCh* const toWrite
>                                 , const XMLSize_t    bufferLen
>                                 , bool               toWriteBufLen)
> {
>    if (toWrite)
>    {
>        if (toWriteBufLen)
>            *this<<(unsigned long)bufferLen;
>
>        XMLSize_t strLen = XMLString::stringLen(toWrite);
>        *this<<(unsigned long)strLen;
>
>        write(toWrite, strLen);
>    }
>    else
>    {
>        *this<<noDataFollowed;
>    }
>
> }
>
> Note that XMLSize_t is being cast to unsigned long, which will be a 32-bit
> value using a 32-bit binary, and a 64-bit value using a 64-bit binary.
>
> The only way to make this work properly would be to store integrals as
> 64-bit values in both 32-bit and 64-bit binaries. And that still would not
> deal with any endianness issues.
>
> Is there some reason you can't keep different serialized grammars for
> 32-bit and 64-bit builds?
>
> > serializeGrammars does not work between 32 and 64 bit systems
> > -------------------------------------------------------------
> >
> >                 Key: XERCESC-1959
> >                 URL: https://issues.apache.org/jira/browse/XERCESC-1959
> >             Project: Xerces-C++
> >          Issue Type: Bug
> >          Components: Validating Parser (XML Schema)
> >    Affects Versions: 3.1.1
> >         Environment: Win Vista 32 bit + VS 2010 express, Xerces-C 3.1.1
> binary
> > Ubuntu 10.10 64 bit, Xerces-C 3.1 installed
> >            Reporter: Daniel Turcanu
> >
> > Serialization of schema grammar does not work between Windows 32 and
> Linux 64 bit. Serializing on one machine (with serializeGrammars) and
> deserializing on the other (with deserializeGrammars) fails ungracefully.
> > Serializing and deserializing on the same machine works fine.
>
> --
> This message is automatically generated by JIRA.
> -
> For more information on JIRA, see: http://www.atlassian.com/software/jira
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: c-dev-unsubscr...@xerces.apache.org
> For additional commands, e-mail: c-dev-h...@xerces.apache.org
>
>
>


-- 
-- 
Stephen D. Williams s...@lig.net scient...@gmail.com LinkedIn:
http://sdw.st/in
V:650-450-UNIX (8649) V:866.SDW.UNIX V:703.371.9362 F:703.995.0407
AIM:sdw Skype:StephenDWilliams Resume: http://sdw.st/gres
Personal: sdw.st facebook.com/sdwlig twitter.com/scienteer

Reply via email to