none
Q: about [MS-BINXML], SQL Server Binary XML Structure RRS feed

  • Question

  • Hi,

    I've got a question regarding [MS-BINXML] format description. It might be quite silly since I am using this document for the first time, However ...

    It is stated that BNFa format (standard [RFC5234]) is used to describe parsing rules. For example, blob64 is described through "blob64 = length64 *byte". This is just a simple grammatic rule. However, I think everybody understand that practically, we should first read length64 (the number of bytes), and ONLY THEN read all the bytes in a loop (1..length64). And this (how we should implement and read the data) should be somewhere described. Not sure when, but as for "blob64" rule, I can't find an
    appropriate description in [MS-BINXML].pdf document (using revision 6.0).

    Could you please explain how should I proceed with such kind of rules? Or, may be I've missed something.

    Thank you in advance.

    Aleksandr
    Wednesday, February 5, 2020 5:30 AM

All replies

  • Hi DTMuser1, I will be helping you with your question. I am currently researching the problem and will provide you with an update soon. Thank you for your patience.

    Regards,
    Sreekanth Nadendla
    Microsoft Windows Open specifications

    Wednesday, February 5, 2020 4:05 PM
    Moderator
  • length64 is itself encoded.  Binary blocks MUST be represented by an mb32/mb64 encoded length in bytes and then followed by the binary data itself. See the following section for complete details.

     

    2.3.18  Binary

    Atomic types SQL-VARBINARY, SQL-BINARY, SQL-IMAGE, and SQL-UDT are all treated by Binary
    XML as a block of binary data. Both parser and writer MUST treat them as such and MUST NOT
    perform any validation on their content.
    The block of binary data MUST be encoded as specified by the following grammar:

    length = mb32
    length64 = mb64
    data = *byte
    blob = length
    data blob64 = length64 data

    Binary blocks MUST be represented by an mb32/mb64 encoded length in bytes and then followed by the binary data itself.

     

    So, it says how many bytes of data follows the length indicator, and implies that the reader would be continuously reading that many bytes.

    Regards,
    Sreekanth Nadendla
    Microsoft Windows Open specifications

    Tuesday, February 11, 2020 7:15 PM
    Moderator