Re: Looking for help. Implementing a XML validation engine in JavaScript.

Casey,

I have attempted to write a Lint engine for HTML to imply conformance to an XHTML type syntax with rigid structure requirements to throw errors for violations that conflict with either semantics or accessibility.  The problems I ran into are:

1)  JavaScript is too slow for any sort of validation engine where structure is stressed as well as syntax.  JavaScript is a high level interpreted language, and so it about as slow as it gets with regards to programming.  My experience writing such things with JavaScript has left me to believe that in order to return any level of acceptable processing time you can have syntax validation like that of JSLint or structure analysis like that of the markup beautifier used by Pretty Diff tool, but you cannot have both.  I even mean far too slow even on the latest and greatest interpreters.

2) Logically, the natural inclination of JavaScript towards Lambda closures in theory should be helpful enough to solve the prior problem, but that is not so in practice.  This is line of thought is further enforced by the mere fact that XML namespace inheritance appears to likewise follow a Lambda model.  Unfortunately, this is not a benefit enough to over come the processing inefficiencies described in the prior point.  Additionally, Lambda models exist because they are helpful, however that do appear to directly represent strong potential towards the covert channels better described in systems architectures.  The covert channels are not so much a concern here for security violations, but rather for logic collision with regard to reuse of logic components where closure is manifest in that reuse, but scoped above the parts being reused.

These are the problems I ran into when using JavaScript in a similar manner.  For me the task became too ambitious for my feeble understanding of JavaScript and general inexperience programming.  I sincerely hope you succeed where I did not hope my pitfalls are something that are not present in your current frustrations.

Austin

Received on Tuesday, 10 August 2010 01:54:16 UTC