All Packages Class Hierarchy This Package Previous Next Index
Class org.w3c.css.parser.CssXMLListener
java.lang.Object
|
+----org.w3c.css.parser.CssXMLListener
- public class CssXMLListener
- extends Object
- implements XMLListener
This is a XML listener for cascading style sheet.
Example:
<xml>
<rule>
<selector type="A" pseudo-class="link"/>
<declaration property="color" value="rgb(0,68,17)"/>
</rule>
<rule>
<context-sensitive>
<selector type="DIV" class="main"/>
<selector type="H3"/>
</context-sensitive>
<declaration property="margin-left" value="-9.0%"/>
<declaration property="font-size" value="12pt" important/>
</rule>
</xml>
-
CssXMLListener(URL, CssValidatorListener)
- Create a new PipeListener.
-
handleAttribute(String, Object)
- This function is called by the parser when it has
recognized an attribute/value pair.
-
handleComment(String)
- This function is called by the parser when it has
recognized a comment.
-
handleData(String)
- This function is called by the parser when it has
recognized character data.
-
handleEndDoc(String)
- This function is called by the parser when it has
recognized the end of a document or sub-document.
-
handleEndTag(String)
- This function is called by the parser when it has
recognized an end tag or the end of an empty tag.
-
handlePI(String)
- This function is called by the parser when it has
recognized a processing instruction.
-
handleStartDoc(String, String)
- This function is called by the parser when it has
recognized a doctype declaration.
-
handleStartTag(String)
- This function is called by the parser when it has
recognized a start tag.
-
isContextSensitive()
- Returns
true
if the parser is in a contextual selector.
-
isDeclaration()
- Returns
true
if the parser is in a declaration.
-
isRule()
- Returns
true
if the parser is in a rule.
-
isSelector()
- Returns
true
if the parser is in a selector.
CssXMLListener
public CssXMLListener(URL url,
CssValidatorListener parserListener)
- Create a new PipeListener.
- Parameters:
- url - The URL to parse
- parserListener - The listener
handleComment
public void handleComment(String comment)
- This function is called by the parser when it has
recognized a comment.
- Parameters:
- comment - the comment string (without <!-- -->)
handleStartTag
public void handleStartTag(String tag)
- This function is called by the parser when it has
recognized a start tag.
- Parameters:
- tag - the tag name in lowercase
handleAttribute
public void handleAttribute(String attribute,
Object value)
- This function is called by the parser when it has
recognized an attribute/value pair. The attribute
belongs to the tag that was handled by the most recent
call to handleStartTag().
Note that there is no indication of whether this
attribute was actually on the tag, or whether it
is the declared default value for the attribute on
this tag (<?XML DEFAULT...?>)
The attribute value can be any value, but the expected
values are String, Double, or Boolean.TRUE.
- Parameters:
- attribute - the name of the attribute in lowercase
- value - the value of the attribute
handleEndTag
public void handleEndTag(String tag)
- This function is called by the parser when it has
recognized an end tag or the end of an empty tag.
- Parameters:
- tag - the name of the tag in lowercase
handleData
public void handleData(String data)
- This function is called by the parser when it has
recognized character data. The function may be called
several times without intervening calls to handleStartTag()
or handleEndTag(). The content of an element is thus the
concatenation of all consecutive calls to handleData().
- Parameters:
- data - the character data
handlePI
public void handlePI(String pi)
- This function is called by the parser when it has
recognized a processing instruction.
- Parameters:
- pi - the processing instruction (without <? ?>)
handleStartDoc
public void handleStartDoc(String root,
String doctype)
- This function is called by the parser when it has
recognized a doctype declaration.
- Parameters:
- root - the name of the start tag
- doctype - the URL defining the document type (may be null)
handleEndDoc
public void handleEndDoc(String root)
- This function is called by the parser when it has
recognized the end of a document or sub-document.
- Parameters:
- root - the name of the start tag
isRule
public final boolean isRule()
- Returns
true
if the parser is in a rule.
isContextSensitive
public final boolean isContextSensitive()
- Returns
true
if the parser is in a contextual selector.
isSelector
public final boolean isSelector()
- Returns
true
if the parser is in a selector.
isDeclaration
public final boolean isDeclaration()
- Returns
true
if the parser is in a declaration.
All Packages Class Hierarchy This Package Previous Next Index