Download NHK English news podcast automatically. This application requires mpod mother board. See also http://mbed.org/users/geodenx/notebook/mpod/

Dependencies:   BlinkLed HTTPClient EthernetInterface FatFileSystemCpp MSCFileSystem mbed-rtos mbed

Embed: (wiki syntax)

« Back to documentation index

XMLDeclaration Class Reference

XMLDeclaration Class Reference

In correct XML the declaration is the first entry in the file. More...

#include <tinyxml2.h>

Inherits tinyxml2::XMLNode.

Public Member Functions

virtual XMLDeclarationToDeclaration ()
 Safely cast to a Declaration, or null.
virtual bool Accept (XMLVisitor *visitor) const
 Accept a hierarchical visit of the nodes in the TinyXML DOM.
virtual XMLNodeShallowClone (XMLDocument *document) const
 Make a copy of this node, but not its children.
virtual bool ShallowEqual (const XMLNode *compare) const
 Test if 2 nodes are the same, but don't test children.
const XMLDocumentGetDocument () const
 Get the XMLDocument that owns this XMLNode.
XMLDocumentGetDocument ()
 Get the XMLDocument that owns this XMLNode.
virtual XMLElementToElement ()
 Safely cast to an Element, or null.
virtual XMLTextToText ()
 Safely cast to Text, or null.
virtual XMLCommentToComment ()
 Safely cast to a Comment, or null.
virtual XMLDocumentToDocument ()
 Safely cast to a Document, or null.
virtual XMLUnknownToUnknown ()
 Safely cast to an Unknown, or null.
const char * Value () const
 The meaning of 'value' changes for the specific type.
void SetValue (const char *val, bool staticMem=false)
 Set the Value of an XML node.
const XMLNodeParent () const
 Get the parent of this node on the DOM.
bool NoChildren () const
 Returns true if this node has no children.
const XMLNodeFirstChild () const
 Get the first child node, or null if none exists.
const XMLElementFirstChildElement (const char *value=0) const
 Get the first child element, or optionally the first child element with the specified name.
const XMLNodeLastChild () const
 Get the last child node, or null if none exists.
const XMLElementLastChildElement (const char *value=0) const
 Get the last child element or optionally the last child element with the specified name.
const XMLNodePreviousSibling () const
 Get the previous (left) sibling node of this node.
const XMLElementPreviousSiblingElement (const char *value=0) const
 Get the previous (left) sibling element of this node, with an opitionally supplied name.
const XMLNodeNextSibling () const
 Get the next (right) sibling node of this node.
const XMLElementNextSiblingElement (const char *value=0) const
 Get the next (right) sibling element of this node, with an opitionally supplied name.
XMLNodeInsertEndChild (XMLNode *addThis)
 Add a child node as the last (right) child.
XMLNodeInsertFirstChild (XMLNode *addThis)
 Add a child node as the first (left) child.
XMLNodeInsertAfterChild (XMLNode *afterThis, XMLNode *addThis)
 Add a node after the specified child node.
void DeleteChildren ()
 Delete all the children of this node.
void DeleteChild (XMLNode *node)
 Delete a child of this node.

Detailed Description

In correct XML the declaration is the first entry in the file.

        <?xml version="1.0" standalone="yes"?>
    

TinyXML2 will happily read or write files without a declaration, however.

The text of the declaration isn't interpreted. It is parsed and written as a string.

Definition at line 689 of file tinyxml2.h.


Member Function Documentation

bool Accept ( XMLVisitor visitor ) const [virtual]

Accept a hierarchical visit of the nodes in the TinyXML DOM.

Every node in the XML tree will be conditionally visited and the host will be called back via the TiXmlVisitor interface.

This is essentially a SAX interface for TinyXML. (Note however it doesn't re-parse the XML for the callbacks, so the performance of TinyXML is unchanged by using this interface versus any other.)

The interface has been based on ideas from:

Which are both good references for "visiting".

An example of using Accept():

        TiXmlPrinter printer;
        tinyxmlDoc.Accept( &printer );
        const char* xmlcstr = printer.CStr();
        

Implements XMLNode.

Definition at line 943 of file tinyxml2.cpp.

void DeleteChild ( XMLNode node ) [inherited]

Delete a child of this node.

Definition at line 601 of file tinyxml2.cpp.

void DeleteChildren (  ) [inherited]

Delete all the children of this node.

Definition at line 571 of file tinyxml2.cpp.

const XMLNode* FirstChild (  ) const [inherited]

Get the first child node, or null if none exists.

Definition at line 484 of file tinyxml2.h.

const XMLElement * FirstChildElement ( const char *  value = 0 ) const [inherited]

Get the first child element, or optionally the first child element with the specified name.

Definition at line 676 of file tinyxml2.cpp.

XMLDocument* GetDocument (  ) [inherited]

Get the XMLDocument that owns this XMLNode.

Definition at line 445 of file tinyxml2.h.

const XMLDocument* GetDocument (  ) const [inherited]

Get the XMLDocument that owns this XMLNode.

Definition at line 443 of file tinyxml2.h.

XMLNode * InsertAfterChild ( XMLNode afterThis,
XMLNode addThis 
) [inherited]

Add a node after the specified child node.

Definition at line 655 of file tinyxml2.cpp.

XMLNode * InsertEndChild ( XMLNode addThis ) [inherited]

Add a child node as the last (right) child.

Definition at line 608 of file tinyxml2.cpp.

XMLNode * InsertFirstChild ( XMLNode addThis ) [inherited]

Add a child node as the first (left) child.

Definition at line 631 of file tinyxml2.cpp.

const XMLNode* LastChild (  ) const [inherited]

Get the last child node, or null if none exists.

Definition at line 493 of file tinyxml2.h.

const XMLElement * LastChildElement ( const char *  value = 0 ) const [inherited]

Get the last child element or optionally the last child element with the specified name.

Definition at line 690 of file tinyxml2.cpp.

const XMLNode* NextSibling (  ) const [inherited]

Get the next (right) sibling node of this node.

Definition at line 511 of file tinyxml2.h.

const XMLElement * NextSiblingElement ( const char *  value = 0 ) const [inherited]

Get the next (right) sibling element of this node, with an opitionally supplied name.

Definition at line 704 of file tinyxml2.cpp.

bool NoChildren (  ) const [inherited]

Returns true if this node has no children.

Definition at line 481 of file tinyxml2.h.

const XMLNode* Parent (  ) const [inherited]

Get the parent of this node on the DOM.

Definition at line 477 of file tinyxml2.h.

const XMLNode* PreviousSibling (  ) const [inherited]

Get the previous (left) sibling node of this node.

Definition at line 503 of file tinyxml2.h.

const XMLElement * PreviousSiblingElement ( const char *  value = 0 ) const [inherited]

Get the previous (left) sibling element of this node, with an opitionally supplied name.

Definition at line 717 of file tinyxml2.cpp.

void SetValue ( const char *  val,
bool  staticMem = false 
) [inherited]

Set the Value of an XML node.

See also:
Value()

Definition at line 562 of file tinyxml2.cpp.

XMLNode * ShallowClone ( XMLDocument document ) const [virtual]

Make a copy of this node, but not its children.

You may pass in a Document pointer that will be the owner of the new Node. If the 'document' is null, then the node returned will be allocated from the current Document. (this->GetDocument())

Note: if called on a XMLDocument, this will return null.

Implements XMLNode.

Definition at line 926 of file tinyxml2.cpp.

bool ShallowEqual ( const XMLNode compare ) const [virtual]

Test if 2 nodes are the same, but don't test children.

The 2 nodes do not need to be in the same Document.

Note: if called on a XMLDocument, this will return false.

Implements XMLNode.

Definition at line 936 of file tinyxml2.cpp.

virtual XMLComment* ToComment (  ) [virtual, inherited]

Safely cast to a Comment, or null.

Reimplemented in XMLComment.

Definition at line 449 of file tinyxml2.h.

virtual XMLDeclaration* ToDeclaration (  ) [virtual]

Safely cast to a Declaration, or null.

Reimplemented from XMLNode.

Definition at line 693 of file tinyxml2.h.

virtual XMLDocument* ToDocument (  ) [virtual, inherited]

Safely cast to a Document, or null.

Reimplemented in XMLDocument.

Definition at line 450 of file tinyxml2.h.

virtual XMLElement* ToElement (  ) [virtual, inherited]

Safely cast to an Element, or null.

Reimplemented in XMLElement.

Definition at line 447 of file tinyxml2.h.

virtual XMLText* ToText (  ) [virtual, inherited]

Safely cast to Text, or null.

Reimplemented in XMLText.

Definition at line 448 of file tinyxml2.h.

virtual XMLUnknown* ToUnknown (  ) [virtual, inherited]

Safely cast to an Unknown, or null.

Reimplemented in XMLUnknown.

Definition at line 452 of file tinyxml2.h.

const char* Value (  ) const [inherited]

The meaning of 'value' changes for the specific type.

        Document:    empty
        Element:    name of the element
        Comment:    the comment text
        Unknown:    the tag contents
        Text:        the text string
        

Definition at line 470 of file tinyxml2.h.