Name
The Attributes Interface
Synopsis
An object that implements the Attributes
interface represents a list
of attributes on a start-tag. The order of attributes in the list
is not guaranteed to match the order in the document itself.
Attributes
objects are passed
as arguments to the startElement(
)
method of ContentHandler
. You can access
particular attributes in three ways:
By number
By namespace URI and local name
By qualified name
This list does not include namespace declaration attributes
(xmlns
and xmlns
:prefix
)
unless the http://xml.org/sax/features/namespace-prefixes
feature is true. It is false by default.
If the http://xml.org/sax/features/namespace-prefixes
feature is false, qualified name access may not be available; if
the http://xml.org/sax/features/namespaces
feature is false, local names and namespace URIs may not be
available.
package org.xml.sax; public interfaceAttributes
{ public intgetLength
( ); public StringgetURI
(intindex
); public StringgetLocalName
(intindex
); public StringgetQName
(intindex
); public intgetIndex
(Stringuri
, StringlocalName
); public intgetIndex
(StringqualifiedName
); public StringgetType
(intindex
); public StringgetType
(Stringuri
, StringlocalName
); public StringgetType
(StringqualifiedName
); public StringgetValue
(Stringuri
, StringlocalName
); public StringgetValue
(StringqualifiedName
); public StringgetValue
(intindex
); }
Get XML in a Nutshell, 3rd Edition now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.