xml/ XmlSax.js

an XML SAX parser in JavaScript.

Version

3.1

Copyright

© 20012002 David Joham (djo.nosp@m.ham@yaho.nosp@m.o.com) and Scott Severtson

This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version.

This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA

Visit the XML for <SCRIPT> home page at http://xmljs.sourceforge.net

CONSTANTS

Summary
an XML SAX parser in JavaScript.
Author: Scott Severtson
Author: Scott Severtson
Author: Scott Severtson
Author: Scott Severtson
Author: Scott Severtson
Author: Scott Severtson
Author: Scott Severtson
Author: Scott Severtson
Author: Scott Severtson
Author: Scott Severtson
Author: Scott Severtson
Author: Scott Severtson
Author: Scott Severtson
Author: Scott Severtson
Author: Scott Severtson
Author: Scott Severtson
Author: Scott Severtson
Author: Scott Severtson
Author: Scott Severtson
Author: Scott Severtson
Author: Scott Severtson
Author: Scott Severtson
Author: Scott Severtson
Author: Scott Severtson
Author: Scott Severtson
Author: Scott Severtson
Author: Scott Severtson
Author: Scott Severtson
Author: Scott Severtson
an object that basically wraps an XMLP instance, and provides an event-based interface for parsing.
Author: Scott Severtson
Author: Scott Severtson
Author: Scott Severtson
Author: Scott Severtson
Author: Scott Severtson
Author: Scott Severtson
Author: Scott Severtson
Author: Scott Severtson
Author: Scott Severtson
Author: Scott Severtson
Author: Scott Severtson
Author: Scott Severtson
Author: Scott Severtson
Author: Scott Severtson
Author: Scott Severtson
Author: Scott Severtson
a useful object containing string manipulation functions This is the constructor of the SAXStrings object
Author: Scott Severtson
Author: Scott Severtson
Author: Scott Severtson
Author: Scott Severtson
Author: Scott Severtson
Author: Scott Severtson
Author: Scott Severtson
A simple stack class, used for verifying document structure.
Author: Scott Severtson
Author: Scott Severtson
Author: Scott Severtson
Author: Scott Severtson
Author: Scott Severtson
Author: Scott Severtson

Functions

this is the constructor to the XMLP Object

Author: Scott Severtson

Description

Instantiates and initializes the object

_addAttribute

XMLP.prototype._addAttribute = function(name,
value)

Author: Scott Severtson

_checkStructure

XMLP.prototype._checkStructure = function(iEvent)

Author: Scott Severtson

_clearAttributes

XMLP.prototype._clearAttributes = function()

Author: Scott Severtson

findAttributeIndex

XMLP.prototype._findAttributeIndex = function(name)

Author: Scott Severtson

getAttributeCount

XMLP.prototype.getAttributeCount = function()

Author: Scott Severtson

getAttributeName

XMLP.prototype.getAttributeName = function(index)

Author: Scott Severtson

getAttributeValue

XMLP.prototype.getAttributeValue = function(index)

Author: Scott Severtson

getAttributeValueByName

XMLP.prototype.getAttributeValueByName = function(name)

Author: Scott Severtson

getColumnNumber

XMLP.prototype.getColumnNumber = function()

Author: Scott Severtson

getContent

XMLP.prototype.getContent = function()

Author: Scott Severtson

getContentBegin

XMLP.prototype.getContentBegin = function()

Author: Scott Severtson

getContentEnd

XMLP.prototype.getContentEnd = function()

Author: Scott Severtson

getLineNumber

XMLP.prototype.getLineNumber = function()

Author: Scott Severtson

getName

XMLP.prototype.getName = function()

Author: Scott Severtson

next

XMLP.prototype.next = function()

Author: Scott Severtson

_parse

XMLP.prototype._parse = function()

Author: Scott Severtson

_parseAttribute

XMLP.prototype._parseAttribute = function(iB,
iE)

Author: Scott Severtson

_parseCDATA

XMLP.prototype._parseCDATA = function(iB)

Author: Scott Severtson

_parseComment

XMLP.prototype._parseComment = function(iB)

Author: Scott Severtson

_parseDTD

XMLP.prototype._parseDTD = function(iB)

Author: Scott Severtson

_parseElement

XMLP.prototype._parseElement = function(iB)

Author: Scott Severtson

_parseEntity

XMLP.prototype._parseEntity = function(iB)

Author: Scott Severtson

_parsePI

XMLP.prototype._parsePI = function(iB)

Author: Scott Severtson

_parseText

XMLP.prototype._parseText = function(iB)

Author: Scott Severtson

_replaceEntities

XMLP.prototype._replaceEntities = function(strD,
iB,
iE)

Author: Scott Severtson

_replaceEntity

XMLP.prototype._replaceEntity = function(strD,
iB,
iE)

Author: Scott Severtson

_setContent

XMLP.prototype._setContent = function(iSrc)

Author: Scott Severtson

_setErr

XMLP.prototype._setErr = function(iErr)

Author: Scott Severtson

SAXDriver

an object that basically wraps an XMLP instance, and provides an event-based interface for parsing.  This is the object users interact with when coding with XML for <SCRIPT>

Author: Scott Severtson

Summary
Author: Scott Severtson
Author: Scott Severtson
Author: Scott Severtson
Author: Scott Severtson
Author: Scott Severtson
Author: Scott Severtson
Author: Scott Severtson
Author: Scott Severtson
Author: Scott Severtson
Author: Scott Severtson
Author: Scott Severtson
Author: Scott Severtson
Author: Scott Severtson
Author: Scott Severtson
Author: Scott Severtson
Author: Scott Severtson

Functions

parse

SAXDriver.prototype.parse = function(strD)

Author: Scott Severtson

setDocumentHandler

SAXDriver.prototype.setDocumentHandler = function(hnd)

Author: Scott Severtson

setErrorHandler

SAXDriver.prototype.setErrorHandler = function(hnd)

Author: Scott Severtson

setLexicalHandler

SAXDriver.prototype.setLexicalHandler = function(hnd)

Author: Scott Severtson

getSystemId

Author: Scott Severtson

getLineNumber

SAXDriver.prototype.getLineNumber = function()

Author: Scott Severtson

getMessage

SAXDriver.prototype.getMessage = function()

Author: Scott Severtson

getPublicID

Author: Scott Severtson

getSystemId

SAXDriver.prototype.getSystemId = function()

Author: Scott Severtson

getLength

SAXDriver.prototype.getLength = function()

Author: Scott Severtson

getName

SAXDriver.prototype.getName = function(index)

Author: Scott Severtson

getValue

SAXDriver.prototype.getValue = function(index)

Author: Scott Severtson

getValueByName

SAXDriver.prototype.getValueByName = function(name)

Author: Scott Severtson

_fireError

SAXDriver.prototype._fireError = function(strMsg)

Author: Scott Severtson

_fireEvent

SAXDriver.prototype._fireEvent = function(iEvt)

Author: Scott Severtson

_parseLoop

SAXDriver.prototype._parseLoop = function(parser)

Author: Scott Severtson

SAXStrings

a useful object containing string manipulation functions This is the constructor of the SAXStrings object

Author: Scott Severtson

Summary
Author: Scott Severtson
Author: Scott Severtson
Author: Scott Severtson
Author: Scott Severtson
Author: Scott Severtson
Author: Scott Severtson
Author: Scott Severtson

Functions

replace

Author: Scott Severtson

getLineNumber

SAXStrings.getLineNumber = function(strD,
iP)

Author: Scott Severtson

indexOfNonWhitespace

SAXStrings.indexOfNonWhitespace = function(strD,
iB,
iE)

Author: Scott Severtson

indexOfWhitespace

SAXStrings.indexOfWhitespace = function(strD,
iB,
iE)

Author: Scott Severtson

isEmpty

SAXStrings.isEmpty = function(strD)

Author: Scott Severtson

lastIndexOfNonWhiteSpace

Author: Scott Severtson

replace

SAXStrings.replace = function(strD,
iB,
iE,
strF,
strR)

Author: Scott Severtson

Stack

A simple stack class, used for verifying document structure.

Author: Scott Severtson

Summary
Author: Scott Severtson
Author: Scott Severtson
Author: Scott Severtson
Author: Scott Severtson
Author: Scott Severtson
Author: Scott Severtson

Functions

clear

Stack.prototype.clear = function()

Author: Scott Severtson

count

Stack.prototype.count = function()

Author: Scott Severtson

destroy

Stack.prototype.destroy = function()

Author: Scott Severtson

peek

Stack.prototype.peek = function()

Author: Scott Severtson

pop

Stack.prototype.pop = function()

Author: Scott Severtson

push

Stack.prototype.push = function(o)

Author: Scott Severtson

isEmpty

function isEmpty(str)

Author: mi.nosp@m.ke@idle.nosp@m..org

Description

convenience function to identify an empty string

trim

function trim(trimString,
leftTrim,
rightTrim)

Author: may.nosp@m.106@psu.nosp@m..edu

Description

helper function to trip a string (trimString) of leading (leftTrim) and trailing (rightTrim) whitespace

XMLP.prototype._addAttribute = function(name,
value)
Author: Scott Severtson
XMLP.prototype._checkStructure = function(iEvent)
Author: Scott Severtson
XMLP.prototype._clearAttributes = function()
Author: Scott Severtson
XMLP.prototype._findAttributeIndex = function(name)
Author: Scott Severtson
XMLP.prototype.getAttributeCount = function()
Author: Scott Severtson
XMLP.prototype.getAttributeName = function(index)
Author: Scott Severtson
XMLP.prototype.getAttributeValue = function(index)
Author: Scott Severtson
XMLP.prototype.getAttributeValueByName = function(name)
Author: Scott Severtson
XMLP.prototype.getColumnNumber = function()
Author: Scott Severtson
XMLP.prototype.getContent = function()
Author: Scott Severtson
XMLP.prototype.getContentBegin = function()
Author: Scott Severtson
XMLP.prototype.getContentEnd = function()
Author: Scott Severtson
XMLP.prototype.getLineNumber = function()
Author: Scott Severtson
XMLP.prototype.getName = function()
Author: Scott Severtson
XMLP.prototype.next = function()
Author: Scott Severtson
XMLP.prototype._parse = function()
Author: Scott Severtson
XMLP.prototype._parseAttribute = function(iB,
iE)
Author: Scott Severtson
XMLP.prototype._parseCDATA = function(iB)
Author: Scott Severtson
XMLP.prototype._parseComment = function(iB)
Author: Scott Severtson
XMLP.prototype._parseDTD = function(iB)
Author: Scott Severtson
XMLP.prototype._parseElement = function(iB)
Author: Scott Severtson
XMLP.prototype._parseEntity = function(iB)
Author: Scott Severtson
XMLP.prototype._parsePI = function(iB)
Author: Scott Severtson
XMLP.prototype._parseText = function(iB)
Author: Scott Severtson
XMLP.prototype._replaceEntities = function(strD,
iB,
iE)
Author: Scott Severtson
XMLP.prototype._replaceEntity = function(strD,
iB,
iE)
Author: Scott Severtson
XMLP.prototype._setContent = function(iSrc)
Author: Scott Severtson
XMLP.prototype._setErr = function(iErr)
Author: Scott Severtson
SAXDriver.prototype.parse = function(strD)
Author: Scott Severtson
SAXDriver.prototype.setDocumentHandler = function(hnd)
Author: Scott Severtson
SAXDriver.prototype.setErrorHandler = function(hnd)
Author: Scott Severtson
SAXDriver.prototype.setLexicalHandler = function(hnd)
Author: Scott Severtson
SAXDriver.prototype.getLineNumber = function()
Author: Scott Severtson
SAXDriver.prototype.getMessage = function()
Author: Scott Severtson
SAXDriver.prototype.getSystemId = function()
Author: Scott Severtson
SAXDriver.prototype.getLength = function()
Author: Scott Severtson
SAXDriver.prototype.getName = function(index)
Author: Scott Severtson
SAXDriver.prototype.getValue = function(index)
Author: Scott Severtson
SAXDriver.prototype.getValueByName = function(name)
Author: Scott Severtson
SAXDriver.prototype._fireError = function(strMsg)
Author: Scott Severtson
SAXDriver.prototype._fireEvent = function(iEvt)
Author: Scott Severtson
SAXDriver.prototype._parseLoop = function(parser)
Author: Scott Severtson
SAXStrings.getLineNumber = function(strD,
iP)
Author: Scott Severtson
SAXStrings.indexOfNonWhitespace = function(strD,
iB,
iE)
Author: Scott Severtson
SAXStrings.indexOfWhitespace = function(strD,
iB,
iE)
Author: Scott Severtson
SAXStrings.isEmpty = function(strD)
Author: Scott Severtson
SAXStrings.replace = function(strD,
iB,
iE,
strF,
strR)
Author: Scott Severtson
Stack.prototype.clear = function()
Author: Scott Severtson
Stack.prototype.count = function()
Author: Scott Severtson
Stack.prototype.destroy = function()
Author: Scott Severtson
Stack.prototype.peek = function()
Author: Scott Severtson
Stack.prototype.pop = function()
Author: Scott Severtson
Stack.prototype.push = function(o)
Author: Scott Severtson
function isEmpty(str)
Author: mi.nosp@m.ke@idle.nosp@m..org
function trim(trimString,
leftTrim,
rightTrim)
Author: may.nosp@m.106@psu.nosp@m..edu