SAXAttributes
classin packageklyn.io.xml.sax
public class SAXAttributes extends Object implements Attributes2, AttributeList:
└ SAXAttributes
All Implemented Interfaces: Attributes2, AttributeList

Mutable SAX attribute collection used by the pure Klyn SAX parser.

The collection implements both the SAX2 Attributes2 contract and the deprecated SAX1 AttributeList contract so the same object can be reported to ContentHandler and DocumentHandler callbacks.

@example `klyn import klyn.io.xml.sax

attrs = SAXAttributes() attrs.add("", "id", "id", "CDATA", "42") print(attrs.getValue("id"))

Properties inherited from Object: type
Constructors
Modifier and Type Member Description
public SAXAttributes Creates an empty attribute collection.
Methods
Modifier and Type Member Description
public add
add(uri as String, localName as String, qName as String, type as String = "CDATA", value as String = "", declared as Boolean = false, specified as Boolean = true) as Void:
Adds one attribute to the collection.
public getIndex
getIndex(qName as String) as Int:
Finds an attribute by qualified name.
public getIndex
getIndex(uri as String, localName as String) as Int:
Finds an attribute by Namespace URI and local name.
public getLength
getLength() as Int:
Returns the number of attributes.
public getLocalName
getLocalName(index as Int) as String:
Returns the local name at an index.
public getName
getName(index as Int) as String:
Returns the SAX1 qualified attribute name at an index.
public getQName
getQName(index as Int) as String:
Returns the qualified name at an index.
public getType
getType(index as Int) as String:
Returns the attribute type at an index.
public getType
getType(qName as String) as String:
Returns an attribute type by qualified name.
public getType
getType(uri as String, localName as String) as String:
Returns an attribute type by Namespace URI and local name.
public getURI
getURI(index as Int) as String:
Returns the Namespace URI at an index.
public getValue
getValue(index as Int) as String:
Returns the attribute value at an index.
public getValue
getValue(qName as String) as String:
Returns an attribute value by qualified name.
public getValue
getValue(uri as String, localName as String) as String:
Returns an attribute value by Namespace URI and local name.
public isDeclared
isDeclared(index as Int) as Boolean:
Reports whether an indexed attribute was declared in a DTD.
public isDeclared
isDeclared(qName as String) as Boolean:
Reports whether a qualified attribute name was declared in a DTD.
public isDeclared
isDeclared(uri as String, localName as String) as Boolean:
Reports whether a Namespace/local-name attribute was declared in a DTD.
public isSpecified
isSpecified(index as Int) as Boolean:
Reports whether an indexed attribute was present in the source.
public isSpecified
isSpecified(qName as String) as Boolean:
Reports whether a qualified attribute name was present in the source.
public isSpecified
isSpecified(uri as String, localName as String) as Boolean:
Reports whether a Namespace/local-name attribute was present in the source.
Methods inherited from Object: fromJson, toDict, toJson, toString, toXml
Methods inherited from Attributes2: isDeclared, isDeclared, isDeclared, isSpecified, isSpecified, isSpecified
Methods inherited from AttributeList: getLength, getName, getType, getType, getValue, getValue
Methods inherited from Attributes: getIndex, getIndex, getLocalName, getQName, getType, getType, getURI, getValue, getValue