Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
THRUST SERVICES & TOOLS
CLOUD EDITIONS
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Content Management (Extended ECM)
API, SDK, REST and Web Services
XML in OScript anyone?
Robert_Davies_(unlondonadmin_-_(deleted))
Hi there.I was wondering whether anyone had written an XML parser in OScript? Obviously I would like DOM support if possible but I'd happily take a bare-bones parser if anyone could help out...Best regards/matt.
Find more posts tagged with
Comments
Luciano_Borrel
YES, I've coded and XML Parser in OScript. My code is a translation of a JavaScript version called "xml for " (avaible at
http://www.idle.org/experimental/).If
you are interested in testing/debugging my OScript XML Parser, please contact me at e.papalini@idtech.it. I'll send you a copy, it is under GPL!Enrico Papalini---------------Software Eng.ID Technology -----------------------------------------------------------Extract from "xml for ":The essential implementation objectives were:Speed - use as little recursion as possible. Bitter experience of stack and memory limitations in version three and four JavaScript and JScript engines suggests that avoiding serious recursion is a good plan. There are some speed benefits to be gained here. Speed (2) - avoid character-by-character manipulation. Again, this is a speed issue. I wanted this parser to be feasible, so I implemented a three-pass parser. The first pass over the source marks out the beginnings and endings of tags ( < and > characters), so the later phase can use substring() calls to extract the tags and text - this means the string is analysed in larger chunks, which is an obvious speed gain. Clearly, some parts of the markup (notably attributes) need to be parsed in a character by character way. Compliance - implement as much of the 10-Feb-98 recommendation as is possible. This thing has to be useful. The subset of the standard I have implemented (this isn't the final implementation) is enough to use XML in several embedded applications. A more faithful rendering of the standard is in the works. Usefulness - provide DOM-like functionality. In order to make the parser slightly useful, some DOM-like methods are provided: getText(), getAttribute(), getElements(byName). These, along with direct access to the attributes[] and children[] array, should allow reasonable access to the document.