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>
  


Constructor Index

 o CssXMLListener(URL, CssValidatorListener)
Create a new PipeListener.

Method Index

 o handleAttribute(String, Object)
This function is called by the parser when it has recognized an attribute/value pair.
 o handleComment(String)
This function is called by the parser when it has recognized a comment.
 o handleData(String)
This function is called by the parser when it has recognized character data.
 o handleEndDoc(String)
This function is called by the parser when it has recognized the end of a document or sub-document.
 o handleEndTag(String)
This function is called by the parser when it has recognized an end tag or the end of an empty tag.
 o handlePI(String)
This function is called by the parser when it has recognized a processing instruction.
 o handleStartDoc(String, String)
This function is called by the parser when it has recognized a doctype declaration.
 o handleStartTag(String)
This function is called by the parser when it has recognized a start tag.
 o isContextSensitive()
Returns true if the parser is in a contextual selector.
 o isDeclaration()
Returns true if the parser is in a declaration.
 o isRule()
Returns true if the parser is in a rule.
 o isSelector()
Returns true if the parser is in a selector.

Constructors

 o CssXMLListener
 public CssXMLListener(URL url,
                       CssValidatorListener parserListener)
Create a new PipeListener.

Parameters:
url - The URL to parse
parserListener - The listener

Methods

 o 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 <!-- -->)
 o 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
 o 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
 o 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
 o 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
 o 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 <? ?>)
 o 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)
 o 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
 o isRule
 public final boolean isRule()
Returns true if the parser is in a rule.

 o isContextSensitive
 public final boolean isContextSensitive()
Returns true if the parser is in a contextual selector.

 o isSelector
 public final boolean isSelector()
Returns true if the parser is in a selector.

 o isDeclaration
 public final boolean isDeclaration()
Returns true if the parser is in a declaration.


All Packages  Class Hierarchy  This Package  Previous  Next  Index