public interface XMLToken
All XMLParser applications with Tokenizer feature must implement this interface.
The interface has to be registered using XMLTokenizer
method
setTokenHandler(XMLToken handler)
.
If XMLtoken handler != null then for each registered and found token
the parser calls the XMLToken call-back method token(int token, String value)
.
During tokenizing the parser doesn't validate the document and doesn't include/read
internal/external entities.
If XMLtoken handler == null then the parser parses as usual.
A request for XML token is registered (on/off) using XMLParser method
setToken (int token, boolean set)
. The requests could be registered
during the parsing (from inside the call-back method) as well.
The XML tokens are defined as public constants in XMLToken
interface.
They correspond to the XML syntax variables from W3C XML Syntax Specification.
Modifier and Type | Field and Description |
---|---|
static int |
AttListDecl
AttListDecl ::= '<' '!'< div>
'> |
static int |
AttName
AttName ::= Name
|
static int |
Attribute
Attribute ::= AttName Eq AttValue
|
static int |
AttValue
AttValue ::= '"' ([^<&"] | reference)* '"' "'" ([^<&'] < div>
&"]> |
static int |
CDSect
CDSect ::= CDStart CData CDEnd
CDStart ::= '<' '!'< div>
'> |
static int |
CharData
CharData ::= [^<&]* - ([^<&]* ']]>' [^<&]*) < div>
&]*)>&]*> |
static int |
Comment
Comment ::= '<' '!'< div>
'> |
static int |
DTDName
DTDName ::= name
|
static int |
ElemDeclName
ElemDeclName ::= name
|
static int |
elementdecl
elementdecl ::= '<' '!< div>
'> |
static int |
EmptyElemTag
EmptyElemTag ::= '<' stagname (s attribute)* s?< div>
'> |
static int |
EntityDecl
EntityDecl ::= '<' '!'< div>
'> |
static int |
EntityDeclName
EntityValue ::= '"' ([^%&"] | PEReference | Reference)* '"'
| "'" ([^%&'] | PEReference | Reference)* "'"
|
static int |
EntityValue
EntityDeclName ::= Name
|
static int |
ETag
ETag ::= '<' ' etagname s?< div>
'> |
static int |
ETagName
ETagName ::= Name
|
static int |
ExternalID
ExternalID ::= 'SYSTEM' S SystemLiteral
| 'PUBLIC' S PubidLiteral S SystemLiteral
|
static int |
NotationDecl
NotationDecl ::= '<' '!< div>
'> |
static int |
PI
PI ::= '<' '?'< div>
'> |
static int |
PITarget
PITarget ::= Name - (('X' | 'x') ('M' | 'm') ('L' | 'l'))
|
static int |
Reference
Reference ::= EntityRef | CharRef | PEReference
EntityRef ::= '&' Name ';'
PEReference ::= '%' Name ';'
CharRef ::= '' [0-9]+ ';' | '' [0-9a-fA-F]+ ';
|
static int |
STag
STag ::= '<' stagname (s attribute)* s?< div>
'> |
static int |
STagName
STagName ::= Name
|
static int |
TextDecl
TextDecl ::= '<' '?'< div>
'> |
static int |
XMLDecl
XMLDecl ::= '<' '?'< div>
'> |
Modifier and Type | Method and Description |
---|---|
void |
token(int token,
java.lang.String value)
The interface call-back method.
|
static final int STag
STag ::= '<' stagname (s attribute)* s? '>''>
static final int EmptyElemTag
EmptyElemTag ::= '<' stagname (s attribute)* s? '>' '>
static final int STagName
STagName ::= Name
static final int AttValue
AttValue ::= '"' ([^<&"] | reference)* '"' < p>
| "'" ([^<&'] | reference)* "'" < p>&']>
&"]>static final int AttName
AttName ::= Name
static final int Attribute
Attribute ::= AttName Eq AttValue
static final int ETag
ETag ::= '<' ' etagname s?>' '>
static final int ETagName
ETagName ::= Name
static final int CharData
CharData ::= [^<&]* - ([^<&]* ']]>' [^<&]*) < p>&]*)>&]*>
static final int Comment
Comment ::= '<' '!' '--' ((char - '-') | ('-' (char '-')))* '-->' '>
static final int Reference
Reference ::= EntityRef | CharRef | PEReference
EntityRef ::= '&' Name ';'
PEReference ::= '%' Name ';'
CharRef ::= '' [0-9]+ ';' | '' [0-9a-fA-F]+ ';
static final int CDSect
CDSect ::= CDStart CData CDEnd
CDStart ::= '<' '!' '[cdata[' < p>
CData ::= (Char* - (Char* ']]>' Char*))
CDEnd ::= ']]>'
'>static final int PI
PI ::= '<' '?' pitarget (s (char* - '?>' Char*)))? '?' '>' '>
static final int PITarget
PITarget ::= Name - (('X' | 'x') ('M' | 'm') ('L' | 'l'))
static final int XMLDecl
XMLDecl ::= '<' '?' 'xml' versioninfo encodingdecl? sddecl? s? '>''>
static final int TextDecl
TextDecl ::= '<' '?' 'xml' versioninfo? encodingdecl s? '?>' '>
static final int DTDName
DTDName ::= name
static final int AttListDecl
AttListDecl ::= '<' '!' 'attlist' s name attdef* s? '>''>
static final int elementdecl
elementdecl ::= '<' '!element' s elemdeclname contentspec s? '>' '>
static final int ElemDeclName
ElemDeclName ::= name
static final int EntityDecl
EntityDecl ::= '<' '!' entity' s entitydeclname entitydef s? '>' '>
| '<' '!' entity' s '%' entitydeclname pedef s? '>' '>
EntityDef ::= EntityValue | (ExternalID NDataDecl?)
PEDef ::= EntityValue | ExternalID
static final int EntityValue
EntityDeclName ::= Name
static final int EntityDeclName
EntityValue ::= '"' ([^%&"] | PEReference | Reference)* '"'
| "'" ([^%&'] | PEReference | Reference)* "'"
static final int NotationDecl
NotationDecl ::= '<' '!notation' s name (externalid | publicid) s? '>' '>
static final int ExternalID
ExternalID ::= 'SYSTEM' S SystemLiteral
| 'PUBLIC' S PubidLiteral S SystemLiteral
Copyright © 2020, 2024, Oracle and/or its affiliates.