|
|
O'Reilly Network Script Library -- Javascript Simple Parser
This small application serves to purposes, it's an example of a very simple XML/XHTML parser as well as a required addition to DOM Level 1, which has no method defined to transform and insert plain markup into a document. The only method available, Instead choosing one of proprietary methods available, this function only builds on top of standard DOM methods and transforms any valid plain markup into a corresponding DOM tree and inserts it into under a given element. InstructionsSupported platforms: You can use the The ZIP file contains two files:
To insert this function into your own documents you have to import the JavaScript source file into your document:
Example call:
Calling this snippet will result in having the parsed output appended under the element with ID pointer. To include your own markup, you have to assign an ID to an existing element by saying:
Now you can add new contents to this element by calling |
|
|
|
--> |
||||||||