Package cssutils :: Package css :: Module cssnamespacerule :: Class CSSNamespaceRule |
[hide private]
[frames] | no frames]

# Class CSSNamespaceRule

source code

     object --+
              |
      util.Base --+
                  |
    cssrule.CSSRule --+
                      |
                     CSSNamespaceRule

Represents an @namespace rule within a CSS style sheet.

The @namespace at-rule declares a namespace prefix and associates it with a given namespace (a string). This namespace prefix can then be used in namespace-qualified names such as those described in the Selectors Module [SELECT] or the Values and Units module [CSS3VAL].

# Properties

cssText: of type DOMString
  The parsable textual representation of this rule
uri: of type DOMString
  The namespace URI (a simple string!) which is bound to the given prefix. If no prefix is set (`CSSNamespaceRule.prefix==''`) the namespace defined by uri is set as the default namespace.
prefix: of type DOMString
  The prefix used in the stylesheet for the given `CSSNamespaceRule.nsuri`. If prefix is empty uri sets the default namespace for the stylesheet.

## cssutils only

atkeyword:
  the literal keyword used

Inherits properties from CSSRule

# Format

namespace
  : NAMESPACE_SYM S* [namespace_prefix S*]? [STRING|URI] S* ';' S* ;
namespace_prefix
  : IDENT ;

Nested Classes | [hide private]
Inherited from `util.Base` (private): `_ttypes`

Instance Methods | [hide private]
__init__(self, uri=None, prefix=`u'````'`, readonly=False) if readonly allows setting of properties in constructor only | source code
_getURI(self) returns uri as a string | source code
_setURI(self, uri) DOMException on setting | source code
_getPrefix(self) returns prefix | source code
_setPrefix(self, prefix=`u'````'`) DOMException on setting | source code
_getCssText(self) returns serialized property cssText | source code
_setCssText(self, cssText) DOMException on setting | source code
__repr__(self) repr(x) | source code
__str__(self) str(x) | source code
Inherited from `cssrule.CSSRule` (private): `_getTypeString` Inherited from `util.Base` (private): `_checkReadonly`, `_tokenize`, `_tokensupto`, `_valuestr` Inherited from `object`: `__delattr__`, `__getattribute__`, `__hash__`, `__new__`, `__reduce__`, `__reduce_ex__`, `__setattr__`

Static Methods | [hide private]
Inherited from `util.Base` (private): `_normalize`

Class Variables | [hide private]
| type = `7` The type of this rule, as defined by a CSSRule type constant.
Inherited from `cssrule.CSSRule`: `FONT_FACE_RULE`, `UNKNOWN_RULE` Inherited from `cssrule.CSSRule` (private): `_typestrings` Inherited from `util.Base` (private): `_log`

Properties | [hide private]
| uri URI (string!) of the defined namespace.
| prefix Prefix used for the defined namespace.
| cssText (DOM attribute) The parsable textual representation.
Inherited from `cssrule.CSSRule`: `typeString` Inherited from `object`: `__class__`

Method Details | [hide private]

### __init__(self, uri=None, prefix=`u'````'`, readonly=False) (Constructor) | source code
if readonly allows setting of properties in constructor only Do not use as positional but as keyword attributes only! uri The namespace URI (a simple string!) which is bound to the given prefix. If no prefix is set (`CSSNamespaceRule.prefix==''`) the namespace defined by uri is set as the default namespace prefix The prefix used in the stylesheet for the given `CSSNamespaceRule.uri`. Overrides: cssrule.CSSRule.__init__

### _setURI(self, uri) | source code
DOMException on setting SYNTAX_ERR: (not checked here) Raised if the specified CSS string value has a syntax error and is unparsable. NO_MODIFICATION_ALLOWED_ERR: (CSSRule) Raised if this rule is readonly.

### _setPrefix(self, prefix=`u'````'`) | source code
DOMException on setting SYNTAX_ERR: (not checked here) Raised if the specified CSS string value has a syntax error and is unparsable. NO_MODIFICATION_ALLOWED_ERR: (CSSRule) Raised if this rule is readonly.

### _getCssText(self) | source code
returns serialized property cssText Overrides: cssrule.CSSRule._getCssText

### _setCssText(self, cssText) | source code
DOMException on setting HIERARCHY_REQUEST_ERR: (CSSStylesheet) Raised if the rule cannot be inserted at this point in the style sheet. INVALID_MODIFICATION_ERR: (self) Raised if the specified CSS string value represents a different type of rule than the current one. NO_MODIFICATION_ALLOWED_ERR: (CSSRule) Raised if the rule is readonly. SYNTAX_ERR: (self) Raised if the specified CSS string value has a syntax error and is unparsable. Overrides: cssrule.CSSRule._setCssText

### __repr__(self) (Representation operator) | source code
repr(x) Overrides: object.__repr__ (inherited documentation)

### __str__(self) (Informal representation operator) | source code
str(x) Overrides: object.__str__ (inherited documentation)

Property Details | [hide private]

  ### uri URI (string!) of the defined namespace. Get Method: cssutils.css.cssnamespacerule.CSSNamespaceRule._getURI(self) - returns uri as a string Set Method: cssutils.css.cssnamespacerule.CSSNamespaceRule._setURI(self, uri) - DOMException on setting Delete Method:
      None

  ### prefix Prefix used for the defined namespace. Get Method: cssutils.css.cssnamespacerule.CSSNamespaceRule._getPrefix(self) - returns prefix Set Method: cssutils.css.cssnamespacerule.CSSNamespaceRule._setPrefix(self, prefix=`u'````'`) - DOMException on setting Delete Method:
      None

  ### cssText (DOM attribute) The parsable textual representation. Get Method: cssutils.css.cssnamespacerule.CSSNamespaceRule._getCssText(self) - returns serialized property cssText Set Method: cssutils.css.cssnamespacerule.CSSNamespaceRule._setCssText(self, cssText) - DOMException on setting Delete Method:
      None