Sign In/My Account | View Cart  
advertisement

Article:
 Non-Extractive Parsing for XML
Subject: not new... or usable
Date: 2004-05-20 13:35:38
From: Richard Hough

I used an XML parser, called the Generic Restricted XML parser or something, several years back that did this. I did not find it very useful.


As other posters pointed out, it does not handle encodings or character entities. It does not do normalization, which we needed. It is also inefficient in dealing with large files which you only need a small portion of. These are the majority of XML files in my experience.


The suggestion to do such transformations "on the fly" is a poor one since it requires the processing to be done every time the element is used, rather than just once when the file is loaded. It will also not work if the element refers to external files, such as with XIncludes.


Previous Message Previous Message   Next Message Next Message


Titles Only Full Threads Newest First
  • not new... or usable
    2004-05-20 14:09:14 jimmy_z [Reply]

    Thanks for the question.


    For a network device, loading XML in a byte array is usually needed for store and forward applications, and is less CPU-intensive than parsing in general.


    Decoding on the fly is usually pretty simple, partly because most characters are ASCII ( I could be wrong, but that is my experience thus far)


    To test equality of two UCS2 characters
    String s1;
    String s2;
    if (s1.charAt(i) == s2.charAt(k))
    {}


    the code for testing the equality in "non-extractive" parsing is
    String s1;
    byte[] xml;
    if (s1.charAt(i) == xml[k])
    {
    }


Sponsored By: