atom.core | index /usr/local/google/home/afshar/src/external-gdata-release/google3/src/atom/core.py

`# Copyright (C) 2008 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.`

Modules

``

xml.etree.cElementTree | inspect |  |

Classes

``

__builtin__.object
  XmlAttribute
  XmlElement

class XmlAttribute(__builtin__.object)

``

Methods defined here:

__init__(self, qname, value)

Data descriptors defined here:

__dict__
  `dictionary for instance variables (if defined)`

__weakref__
  `list of weak references to the object (if defined)`

class XmlElement(__builtin__.object)
`` | `Represents an element node in an XML document. The text member is a UTF-8 encoded str or unicode.`

Methods defined here:

FindChildren = get_elements(self, tag=None, namespace=None, version=1)

FindExtensions = get_elements(self, tag=None, namespace=None, version=1)

GetAttributes = get_attributes(self, tag=None, namespace=None, version=1)

GetElements = get_elements(self, tag=None, namespace=None, version=1)

ToString = to_string(self, version=1, encoding=None, pretty_print=None)

__init__(self, text=None, *args, **kwargs)

__str__(self)

get_attributes(self, tag=None, namespace=None, version=1)
  `Find all attributes which match the tag and namespace.
  To find all attributes in this object, call get_attributes with the tag
  and namespace both set to None (the default). This method searches
  through the object's members and the attributes stored in
  _other_attributes which did not fit any of the XML parsing rules for this
  class.
  Args:
  tag: str
  namespace: str
  version: int Specifies the version of the XML rules to be used when
  searching for matching attributes.
  Returns:
  A list of XmlAttribute objects for the matching attributes.`

get_elements(self, tag=None, namespace=None, version=1)
  `Find all sub elements which match the tag and namespace.
  To find all elements in this object, call get_elements with the tag and
  namespace both set to None (the default). This method searches through
  the object's members and the elements stored in _other_elements which
  did not match any of the XML parsing rules for this class.
  Args:
  tag: str
  namespace: str
  version: int Specifies the version of the XML rules to be used when
  searching for matching elements.
  Returns:
  A list of the matching XmlElements.`

to_string(self, version=1, encoding=None, pretty_print=None)
  `Converts this object to XML.`

Data descriptors defined here:

__dict__
  `dictionary for instance variables (if defined)`

__weakref__
  `list of weak references to the object (if defined)`

attributes

children

extension_attributes

extension_elements

namespace

tag

Data and other attributes defined here:

text = None

Functions

``

Parse = parse(xml_string, target_class=None, version=1, encoding=None)
  `Parses the XML string according to the rules for the target_class.
  Args:
  xml_string: str or unicode
  target_class: XmlElement or a subclass. If None is specified, the
  XmlElement class is used.
  version: int (optional) The version of the schema which should be used when
  converting the XML into an object. The default is 1.
  encoding: str (optional) The character encoding of the bytes in the
  xml_string. Default is 'UTF-8'.`

XmlElementFromString = parse(xml_string, target_class=None, version=1, encoding=None)
  `Parses the XML string according to the rules for the target_class.
  Args:
  xml_string: str or unicode
  target_class: XmlElement or a subclass. If None is specified, the
  XmlElement class is used.
  version: int (optional) The version of the schema which should be used when
  converting the XML into an object. The default is 1.
  encoding: str (optional) The character encoding of the bytes in the
  xml_string. Default is 'UTF-8'.`

parse(xml_string, target_class=None, version=1, encoding=None)
  `Parses the XML string according to the rules for the target_class.
  Args:
  xml_string: str or unicode
  target_class: XmlElement or a subclass. If None is specified, the
  XmlElement class is used.
  version: int (optional) The version of the schema which should be used when
  converting the XML into an object. The default is 1.
  encoding: str (optional) The character encoding of the bytes in the
  xml_string. Default is 'UTF-8'.`

xml_element_from_string = parse(xml_string, target_class=None, version=1, encoding=None)
  `Parses the XML string according to the rules for the target_class.
  Args:
  xml_string: str or unicode
  target_class: XmlElement or a subclass. If None is specified, the
  XmlElement class is used.
  version: int (optional) The version of the schema which should be used when
  converting the XML into an object. The default is 1.
  encoding: str (optional) The character encoding of the bytes in the
  xml_string. Default is 'UTF-8'.`

Data
`` |  | STRING_ENCODING = 'utf-8' __author__ = 'j.s@google.com (Jeff Scudder)'

Author
`` |  | j.s@google.com (Jeff Scudder)