Logo Search packages:      
Sourcecode: poco version File versions  Download package

Poco::XML::CDATASection Class Reference

#include <CDATASection.h>

Inheritance diagram for Poco::XML::CDATASection:

Poco::XML::Text Poco::XML::CharacterData Poco::XML::AbstractNode Poco::XML::Node Poco::XML::EventTarget Poco::XML::DOMObject

List of all members.

Detailed Description

CDATA sections are used to escape blocks of text containing characters that would otherwise be regarded as markup. The only delimiter that is recognized in a CDATA section is the "]]>" string that ends the CDATA section. CDATA sections cannot be nested. Their primary purpose is for including material such as XML fragments, without needing to escape all the delimiters.

The DOMString attribute of the Text node holds the text that is contained by the CDATA section. Note that this may contain characters that need to be escaped outside of CDATA sections and that, depending on the character encoding ("charset") chosen for serialization, it may be impossible to write out some characters as part of a CDATA section.

The CDATASection interface inherits from the CharacterData interface through the Text interface. Adjacent CDATASection nodes are not merged by use of the normalize method on the Element interface.

Note: Because no markup is recognized within a CDATASection, character numeric references cannot be used as an escape mechanism when serializing. Therefore, action needs to be taken when serializing a CDATASection with a character encoding where some of the contained characters cannot be represented. Failure to do so would not produce well-formed XML. One potential solution in the serialization process is to end the CDATA section before the character, output the character using a character reference or entity reference, and open a new CDATA section for any further characters in the text node. Note, however, that some code conversion libraries at the time of writing do not return an error or exception when a character is missing from the encoding, making the task of ensuring that data is not corrupted on serialization more difficult.

Definition at line 51 of file CDATASection.h.

Public Types

enum  {

Public Member Functions

void addEventListener (const XMLString &type, EventListener *listener, bool useCapture)
NodeappendChild (Node *newChild)
void appendData (const XMLString &arg)
NamedNodeMapattributes () const
virtual void autoRelease ()
NodeListchildNodes () const
NodecloneNode (bool deep) const
const XMLString & data () const
void deleteData (unsigned long offset, unsigned long count)
 Insert a string at the specified character offset.
bool dispatchEvent (Event *evt)
void duplicate () const
NodefirstChild () const
const XMLString & getData () const
const XMLString & getNodeValue () const
bool hasAttributes () const
 Returns the local name of the node.
bool hasChildNodes () const
XMLString innerText () const
 Returns whether this node (if it is an element) has any attributes.
NodeinsertBefore (Node *newChild, Node *refChild)
void insertData (unsigned long offset, const XMLString &arg)
bool isSupported (const XMLString &feature, const XMLString &version) const
NodelastChild () const
unsigned long length () const
const XMLString & localName () const
 Returns the namespace prefix from the qualified name of the node.
const XMLString & namespaceURI () const
NodenextSibling () const
const XMLString & nodeName () const
unsigned short nodeType () const
const XMLString & nodeValue () const
 Returns the name of this node, depending on its type.
void normalize ()
DocumentownerDocument () const
NodeparentNode () const
 Returns a code representing the type of the underlying object.
XMLString prefix () const
NodepreviousSibling () const
void release () const
 Increases the object's reference count.
NoderemoveChild (Node *oldChild)
void removeEventListener (const XMLString &type, EventListener *listener, bool useCapture)
NodereplaceChild (Node *newChild, Node *oldChild)
void replaceData (unsigned long offset, unsigned long count, const XMLString &arg)
 Remove a range of characters from the node.
void setData (const XMLString &data)
void setNodeValue (const XMLString &value)
 Returns the value of this node, depending on its type.
TextsplitText (unsigned long offset)
XMLString substringData (unsigned long offset, unsigned long count) const
XMLString trimmedData () const

Protected Member Functions

void bubbleEvent (Event *evt)
void captureEvent (Event *evt)
 CDATASection (Document *pOwnerDocument, const CDATASection &sec)
 CDATASection (Document *pOwnerDocument, const XMLString &data)
NodecopyNode (bool deep, Document *pOwnerDocument) const
void dispatchAttrModified (Attr *pAttr, MutationEvent::AttrChangeType changeType, const XMLString &prevValue, const XMLString &newValue)
void dispatchCharacterDataModified (const XMLString &prevValue, const XMLString &newValue)
void dispatchNodeInserted ()
virtual void dispatchNodeInsertedIntoDocument ()
void dispatchNodeRemoved ()
virtual void dispatchNodeRemovedFromDocument ()
void dispatchSubtreeModified ()
virtual bool events () const
virtual bool eventsSuspended () const
void setOwnerDocument (Document *pOwnerDocument)

Static Protected Attributes

static const XMLString EMPTY_STRING

Static Private Attributes

static const XMLString NODE_NAME = toXMLString("#cdata-section")


class Document

The documentation for this class was generated from the following files:

Generated by  Doxygen 1.6.0   Back to index