As it currently works(until DOM support is added),
it is simply a function that takes a string and parses it,
extracting the tags and their attributes.
It collects the tags and all of the textual information into some objects, then
returns the object as one main "root" object.
For now, the API is extreemly simple
and only for read-only purposes. There are four types of objects, listed here with each of their properties:
- An Element: <tag>
- type - "element"
- name - string containing the elements name
- attributes - array containing name=value pairs for each attribute
- contents - array containing objects for everything within the tag
- PI's - Processing Instructions: <? some data ?>
- type - "pi"
- value - string containing the data in the pi for the target
- Comments: <!-- my comment -->
- type - "comment"
- value - string containing the text in the comment
- Textual Information
- type - "chardata"
- value - string containing the text
Download the source JavaScript library clicking(right-click/save-as) here. Use it by including it into your web page:
<SCRIPT SRC="xparse.js"></SCRIPT>
[© Copyright 1998 Jeremie, All Rights Reserved]
[Modified Monday October 19th 1998, 10:09:06 PM CST
By jer@jeremie.com]