pxml.h
Go to the documentation of this file.
/*
* pxml.h
*
* XML parser support
*
* Portable Windows Library
*
* Copyright (c) 2002 Equivalence Pty. Ltd.
*
* The contents of this file are subject to the Mozilla Public License
* Version 1.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.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS IS"
* basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
* the License for the specific language governing rights and limitations
* under the License.
*
* The Original Code is Portable Windows Library.
*
* The Initial Developer of the Original Code is Equivalence Pty. Ltd.
*
* Contributor(s): ______________________________________.
*
* $Revision: 28994 $
* $Author: rjongbloed $
* $Date: 2013-01-25 02:06:35 -0600 (Fri, 25 Jan 2013) $
*/
#ifndef PTLIB_PXML_H
#define PTLIB_PXML_H
#ifdef P_USE_PRAGMA
#pragma interface
#endif
#include <ptlib.h>
#include <ptbuildopts.h>
#ifndef P_EXPAT
namespace PXML {
extern PString EscapeSpecialChars(const PString & str);
};
#else
#include <ptclib/http.h>
class PXMLElement;
class PXMLData;
class PXMLObject;
class PXMLElement;
class PXMLData;
class PXMLBase : public PObject
{
public:
enum {
DEFAULT_MAX_ENTITY_LENGTH = 4096
};
enum Options {
NoOptions = 0x0000,
Indent = 0x0001,
NewLineAfterElement = 0x0002,
NoIgnoreWhiteSpace = 0x0004,
CloseExtended = 0x0008,
WithNS = 0x0010,
FragmentOnly = 0x0020,
AllOptions = 0xffff
};
__inline friend Options operator|(Options o1, Options o2) { return (Options)(((unsigned)o1) | ((unsigned)o2)); }
__inline friend Options operator&(Options o1, Options o2) { return (Options)(((unsigned)o1) & ((unsigned)o2)); }
enum StandAloneType {
UninitialisedStandAlone = -2,
UnknownStandAlone = -1,
NotStandAlone,
IsStandAlone
};
PXMLBase(int opts = NoOptions);
void SetOptions(int opts)
{ m_options = opts; }
int GetOptions() const { return m_options; }
virtual PBoolean IsNoIndentElement(
const PString & /*elementName*/
) const
{
return false;
}
void SetMaxEntityLength(unsigned len) { m_maxEntityLength = len; }
unsigned GetMaxEntityLength() const { return m_maxEntityLength; }
protected:
int m_options;
unsigned m_maxEntityLength;
};
class PXML : public PXMLBase
{
PCLASSINFO(PXML, PObject);
public:
PXML(
int options = NoOptions,
const char * noIndentElements = NULL
);
PXML(
const PString & data,
int options = NoOptions,
const char * noIndentElements = NULL
);
PXML(const PXML & xml);
~PXML();
bool IsLoaded() const { return rootElement != NULL; }
bool IsDirty() const;
bool Load(const PString & data, Options options = NoOptions);
bool LoadFile(const PFilePath & fn, Options options = NoOptions);
virtual void OnLoaded() { }
bool Save(Options options = NoOptions);
bool Save(PString & data, Options options = NoOptions);
bool SaveFile(const PFilePath & fn, Options options = NoOptions);
void RemoveAll();
PBoolean IsNoIndentElement(
const PString & elementName
) const;
PString AsString() const;
void PrintOn(ostream & strm) const;
void ReadFrom(istream & strm);
PXMLElement * GetElement(const PCaselessString & name, const PCaselessString & attr, const PString & attrval) const;
PXMLElement * GetElement(const PCaselessString & name, PINDEX idx = 0) const;
PXMLElement * GetElement(PINDEX idx) const;
PINDEX GetNumElements() const;
PXMLElement * GetRootElement() const { return rootElement; }
PXMLElement * SetRootElement(PXMLElement * p);
PXMLElement * SetRootElement(const PString & documentType);
bool RemoveElement(PINDEX idx);
PCaselessString GetDocumentType() const;
enum ValidationOp {
EndOfValidationList,
DocType,
ElementName,
RequiredAttribute,
RequiredNonEmptyAttribute,
RequiredAttributeWithValue,
RequiredElement,
Subtree,
RequiredAttributeWithValueMatching,
RequiredElementWithBodyMatching,
OptionalElement,
OptionalAttribute,
OptionalNonEmptyAttribute,
OptionalAttributeWithValue,
OptionalAttributeWithValueMatching,
OptionalElementWithBodyMatching,
SetDefaultNamespace,
SetNamespace,
RequiredAttributeWithValueMatchingEx = RequiredAttributeWithValueMatching + 0x8000,
OptionalAttributeWithValueMatchingEx = OptionalAttributeWithValueMatching + 0x8000,
RequiredElementWithBodyMatchingEx = RequiredElementWithBodyMatching + 0x8000,
OptionalElementWithBodyMatchingEx = OptionalElementWithBodyMatching + 0x8000
};
struct ValidationContext {
PString m_defaultNameSpace;
PStringToString m_nameSpaces;
};
struct ValidationInfo {
ValidationOp m_op;
const char * m_name;
union {
const void * m_placeHolder;
const char * m_attributeValues;
ValidationInfo * m_subElement;
const char * m_namespace;
};
PINDEX m_minCount;
PINDEX m_maxCount;
};
bool Validate(const ValidationInfo * validator);
bool ValidateElements(ValidationContext & context, PXMLElement * baseElement, const ValidationInfo * elements);
bool ValidateElement(ValidationContext & context, PXMLElement * element, const ValidationInfo * elements);
bool LoadAndValidate(const PString & body, const PXML::ValidationInfo * validator, PString & error, int options = NoOptions);
PString GetErrorString() const { return m_errorString; }
unsigned GetErrorColumn() const { return m_errorColumn; }
unsigned GetErrorLine() const { return m_errorLine; }
PString GetDocType() const { return docType; }
void SetDocType(const PString & v) { docType = v; }
PMutex & GetMutex() { return rootMutex; }
// static methods to create XML tags
static PString CreateStartTag (const PString & text);
static PString CreateEndTag (const PString & text);
static PString CreateTagNoData (const PString & text);
static PString CreateTag (const PString & text, const PString & data);
static PString EscapeSpecialChars(const PString & string);
protected:
void Construct(int options, const char * noIndentElements);
PXMLElement * rootElement;
PMutex rootMutex;
bool loadFromFile;
PFilePath loadFilename;
PString version, encoding;
StandAloneType m_standAlone;
PStringStream m_errorString;
unsigned m_errorLine;
unsigned m_errorColumn;
PSortedStringList noIndentElements;
PString docType;
PString m_defaultNameSpace;
};
#if P_HTTP
class PXML_HTTP : public PXML
{
PCLASSINFO(PXML_HTTP, PXML);
public:
PXML_HTTP(
int options = NoOptions,
const char * noIndentElements = NULL
);
bool StartAutoReloadURL(
const PURL & url,
const PTimeInterval & timeout,
const PTimeInterval & refreshTime,
Options options = NoOptions
);
bool StopAutoReloadURL();
PString GetAutoReloadStatus() { PWaitAndSignal m(autoLoadMutex); PString str = autoLoadError; return str; }
bool AutoLoadURL();
virtual void OnAutoLoad(PBoolean ok);
bool LoadURL(const PURL & url);
bool LoadURL(const PURL & url, const PTimeInterval & timeout, Options options = NoOptions);
protected:
PDECLARE_NOTIFIER(PTimer, PXML_HTTP, AutoReloadTimeout);
PDECLARE_NOTIFIER(PThread, PXML_HTTP, AutoReloadThread);
PTimer autoLoadTimer;
PURL autoloadURL;
PTimeInterval autoLoadWaitTime;
PMutex autoLoadMutex;
PString autoLoadError;
};
#endif // P_HTTP
PARRAY(PXMLObjectArray, PXMLObject);
class PXMLObject : public PObject {
PCLASSINFO(PXMLObject, PObject);
public:
PXMLObject(PXMLElement * par)
: parent(par) { dirty = false; }
PXMLElement * GetParent() const
{ return parent; }
PXMLObject * GetNextObject() const;
void SetParent(PXMLElement * newParent)
{
PAssert(parent == NULL, "Cannot reparent PXMLElement");
parent = newParent;
}
PString AsString() const;
virtual void Output(ostream & strm, const PXMLBase & xml, int indent) const = 0;
virtual PBoolean IsElement() const = 0;
void SetDirty();
bool IsDirty() const { return dirty; }
virtual PXMLObject * Clone(PXMLElement * parent) const = 0;
protected:
PXMLElement * parent;
bool dirty;
};
class PXMLData : public PXMLObject {
PCLASSINFO(PXMLData, PXMLObject);
public:
PXMLData(PXMLElement * parent, const PString & data);
PXMLData(PXMLElement * parent, const char * data, int len);
PBoolean IsElement() const { return false; }
void SetString(const PString & str, bool dirty = true);
PString GetString() const { return value; }
void Output(ostream & strm, const PXMLBase & xml, int indent) const;
PXMLObject * Clone(PXMLElement * parent) const;
protected:
PString value;
};
class PXMLElement : public PXMLObject {
PCLASSINFO(PXMLElement, PXMLObject);
public:
PXMLElement(PXMLElement * parent, const char * name = NULL);
PXMLElement(PXMLElement * parent, const PString & name, const PString & data);
PBoolean IsElement() const { return true; }
void PrintOn(ostream & strm) const;
void Output(ostream & strm, const PXMLBase & xml, int indent) const;
PCaselessString GetName() const
{ return name; }
PCaselessString GetPathName() const;
void SetName(const PString & v)
{ name = v; }
PINDEX GetSize() const
{ return subObjects.GetSize(); }
PXMLObject * AddSubObject(PXMLObject * elem, bool dirty = true);
PXMLElement * AddChild (PXMLElement * elem, bool dirty = true);
PXMLData * AddChild (PXMLData * elem, bool dirty = true);
PXMLElement * AddElement(const char * name);
PXMLElement * AddElement(const PString & name, const PString & data);
PXMLElement * AddElement(const PString & name, const PString & attrName, const PString & attrVal);
void SetAttribute(const PCaselessString & key,
const PString & value,
bool setDirty = true);
PString GetAttribute(const PCaselessString & key) const;
PString GetKeyAttribute(PINDEX idx) const;
PString GetDataAttribute(PINDEX idx) const;
bool HasAttribute(const PCaselessString & key) const;
bool HasAttributes() const { return attributes.GetSize() > 0; }
PINDEX GetNumAttributes() const { return attributes.GetSize(); }
PXMLElement * GetElement(const PCaselessString & name, const PCaselessString & attr, const PString & attrval) const;
PXMLElement * GetElement(const PCaselessString & name, PINDEX idx = 0) const;
PXMLObject * GetElement(PINDEX idx = 0) const;
bool RemoveElement(PINDEX idx);
PINDEX FindObject(const PXMLObject * ptr) const;
bool HasSubObjects() const
{ return subObjects.GetSize() != 0; }
PXMLObjectArray GetSubObjects() const
{ return subObjects; }
PXMLObject * GetSubObject(PINDEX idx = 0) const
{ return GetElement(idx); }
PString GetData() const;
void SetData(const PString & data);
void AddData(const PString & data);
PXMLObject * Clone(PXMLElement * parent) const;
void GetFilePosition(unsigned & col, unsigned & line) const { col = column; line = lineNumber; }
void SetFilePosition(unsigned col, unsigned line) { column = col; lineNumber = line; }
void AddNamespace(const PString & prefix, const PString & uri);
void RemoveNamespace(const PString & prefix);
bool GetDefaultNamespace(PCaselessString & str) const;
bool GetNamespace(const PCaselessString & prefix, PCaselessString & str) const;
PCaselessString PrependNamespace(const PCaselessString & name) const;
bool GetURIForNamespace(const PCaselessString & prefix, PCaselessString & uri);
protected:
PCaselessString name;
PStringToString attributes;
PXMLObjectArray subObjects;
bool dirty;
unsigned column;
unsigned lineNumber;
PStringToString m_nameSpaces;
PCaselessString m_defaultNamespace;
};
class PConfig; // stupid gcc 4 does not recognize PConfig as a class
class PXMLSettings : public PXML
{
PCLASSINFO(PXMLSettings, PXML);
public:
PXMLSettings(Options options = NewLineAfterElement);
PXMLSettings(const PString & data, Options options = NewLineAfterElement);
PXMLSettings(const PConfig & data, Options options = NewLineAfterElement);
bool Load(const PString & data);
bool LoadFile(const PFilePath & fn);
bool Save();
bool Save(PString & data);
bool SaveFile(const PFilePath & fn);
void SetAttribute(const PCaselessString & section, const PString & key, const PString & value);
PString GetAttribute(const PCaselessString & section, const PString & key) const;
bool HasAttribute(const PCaselessString & section, const PString & key) const;
void ToConfig(PConfig & cfg) const;
};
class PXMLParser : public PXMLBase
{
PCLASSINFO(PXMLParser, PXMLBase);
public:
PXMLParser(int options = NoOptions);
~PXMLParser();
bool Parse(const char * data, int dataLen, bool final);
void GetErrorInfo(PString & errorString, unsigned & errorCol, unsigned & errorLine);
virtual void StartElement(const char * name, const char **attrs);
virtual void EndElement(const char * name);
virtual void AddCharacterData(const char * data, int len);
virtual void XmlDecl(const char * version, const char * encoding, int standAlone);
virtual void StartDocTypeDecl(const char * docTypeName,
const char * sysid,
const char * pubid,
int hasInternalSubSet);
virtual void EndDocTypeDecl();
virtual void StartNamespaceDeclHandler(const char * prefix, const char * uri);
virtual void EndNamespaceDeclHandler(const char * prefix);
PString GetVersion() const { return version; }
PString GetEncoding() const { return encoding; }
StandAloneType GetStandAlone() const { return m_standAlone; }
PXMLElement * GetXMLTree() const;
PXMLElement * SetXMLTree(PXMLElement * newRoot);
protected:
void * expat;
PXMLElement * rootElement;
bool rootOpen;
PXMLElement * currentElement;
PXMLData * lastElement;
PString version, encoding;
StandAloneType m_standAlone;
PStringToString m_tempNamespaceList;
};
class PXMLStreamParser : public PXMLParser
{
PCLASSINFO(PXMLStreamParser, PXMLParser);
public:
PXMLStreamParser();
virtual void EndElement(const char * name);
virtual PXML * Read(PChannel * channel);
protected:
PQueue<PXML> messages;
};
#endif // P_EXPAT
#endif // PTLIB_PXML_H
// End Of File ///////////////////////////////////////////////////////////////
PDECLARE_NOTIFIER
#define PDECLARE_NOTIFIER(notifier, notifiee, func)
Declare PNotifier derived class with INT parameter. Uses PDECLARE_NOTIFIER2 macro.
Definition: notifier.h:174
PWaitAndSignal
This class waits for the semaphore on construction and automatically signals the semaphore on destruc...
Definition: psync.h:86
PXMLParser::GetVersion
PString GetVersion() const
Definition: pxml.h:494
PObject::Clone
virtual PObject * Clone() const
Create a copy of the class on the heap.
PXMLElement::subObjects
PXMLObjectArray subObjects
Definition: pxml.h:435
PXMLBase::SetOptions
void SetOptions(int opts)
Definition: pxml.h:93
PXMLBase::operator &
__inline friend Options operator &(Options o1, Options o2)
Definition: pxml.h:82
PXML::SetDefaultNamespace
Definition: pxml.h:184
PXML::GetElement
PXMLElement * GetElement(const PCaselessString &name, const PCaselessString &attr, const PString &attrval) const
PXMLBase::m_maxEntityLength
unsigned m_maxEntityLength
Definition: pxml.h:110
PXML::Subtree
Definition: pxml.h:175
PXML::m_defaultNameSpace
PString m_defaultNameSpace
Definition: pxml.h:252
PXMLElement::GetNumAttributes
PINDEX GetNumAttributes() const
Definition: pxml.h:397
PXML::OptionalNonEmptyAttribute
Definition: pxml.h:180
PXML::IsDirty
bool IsDirty() const
PXML::m_errorLine
unsigned m_errorLine
Definition: pxml.h:246
PTimeInterval
This class defines an arbitrary time interval to millisecond accuracy.
Definition: timeint.h:55
PXMLParser::currentElement
PXMLElement * currentElement
Definition: pxml.h:506
PXML::GetNumElements
PINDEX GetNumElements() const
PXMLElement::GetSubObject
PXMLObject * GetSubObject(PINDEX idx=0) const
Definition: pxml.h:412
PXMLStreamParser
Definition: pxml.h:515
PXML::GetDocType
PString GetDocType() const
Definition: pxml.h:222
PXMLBase
Definition: pxml.h:64
PXMLBase::WithNS
Definition: pxml.h:77
PCLASSINFO
#define PCLASSINFO(cls, par)
Declare all the standard PTLib class information.
Definition: object.h:1049
PXMLBase::PXMLBase
PXMLBase(int opts=NoOptions)
PXML::loadFromFile
bool loadFromFile
Definition: pxml.h:240
PXML::ValidationInfo::m_op
ValidationOp m_op
Definition: pxml.h:199
PXML::SetNamespace
Definition: pxml.h:185
PXML::LoadFile
bool LoadFile(const PFilePath &fn, Options options=NoOptions)
PXML::GetRootElement
PXMLElement * GetRootElement() const
Definition: pxml.h:159
PXMLData::value
PString value
Definition: pxml.h:348
PXML::DocType
Definition: pxml.h:169
PXML::ValidationInfo::m_maxCount
PINDEX m_maxCount
Definition: pxml.h:210
PXMLBase::operator|
__inline friend Options operator|(Options o1, Options o2)
Definition: pxml.h:81
PXMLData
Definition: pxml.h:331
PConfig
A class representing a configuration for the application.
Definition: config.h:67
PXMLObject::GetParent
PXMLElement * GetParent() const
Definition: pxml.h:302
PXML::ValidationOp
ValidationOp
Definition: pxml.h:167
PXML::Load
bool Load(const PString &data, Options options=NoOptions)
PStringStream
This class is a standard C++ stream class descendent for reading or writing streamed data to or from ...
Definition: pstring.h:1878
PXML::CreateTagNoData
static PString CreateTagNoData(const PString &text)
PXMLElement::GetFilePosition
void GetFilePosition(unsigned &col, unsigned &line) const
Definition: pxml.h:421
PXML::RequiredElementWithBodyMatchingEx
Definition: pxml.h:189
PXML::ValidationInfo::m_minCount
PINDEX m_minCount
Definition: pxml.h:209
PStringToString
This is a dictionary collection class of PString objects, keyed by another string.
Definition: pstring.h:2784
PFilePath
This class describes a full description for a file on the particular platform.
Definition: filepath.h:65
PXML::SaveFile
bool SaveFile(const PFilePath &fn, Options options=NoOptions)
PXMLStreamParser::messages
PQueue< PXML > messages
Definition: pxml.h:525
PXML::OptionalElementWithBodyMatching
Definition: pxml.h:183
PXML::OptionalAttributeWithValueMatching
Definition: pxml.h:182
PXMLElement::SetFilePosition
void SetFilePosition(unsigned col, unsigned line)
Definition: pxml.h:422
PCaselessString
This class is a variation of a string that ignores case.
Definition: pstring.h:1708
PXML::ValidationContext
Definition: pxml.h:193
PXMLBase::DEFAULT_MAX_ENTITY_LENGTH
Definition: pxml.h:68
PXMLParser
Definition: pxml.h:473
PXMLObject::PXMLObject
PXMLObject(PXMLElement *par)
Definition: pxml.h:299
PXMLElement::lineNumber
unsigned lineNumber
Definition: pxml.h:438
PXML::RequiredElementWithBodyMatching
Definition: pxml.h:177
PXML::OptionalAttributeWithValue
Definition: pxml.h:181
PXML::OptionalAttributeWithValueMatchingEx
Definition: pxml.h:188
PXMLBase::CloseExtended
ignored
Definition: pxml.h:76
PXML::Validate
bool Validate(const ValidationInfo *validator)
PXMLElement::IsElement
PBoolean IsElement() const
Definition: pxml.h:359
PXML::PXML
PXML(int options=NoOptions, const char *noIndentElements=NULL)
PXML::ValidationInfo::m_attributeValues
const char * m_attributeValues
Definition: pxml.h:204
PXML::ValidationInfo
Definition: pxml.h:198
PXML::ValidationInfo::m_subElement
ValidationInfo * m_subElement
Definition: pxml.h:205
PXML::m_standAlone
StandAloneType m_standAlone
Definition: pxml.h:243
PXML_HTTP::autoLoadWaitTime
PTimeInterval autoLoadWaitTime
Definition: pxml.h:286
PXML::GetMutex
PMutex & GetMutex()
Definition: pxml.h:225
PXMLData::IsElement
PBoolean IsElement() const
Definition: pxml.h:337
http.h
PXML
Definition: pxml.h:114
PXML::IsNoIndentElement
PBoolean IsNoIndentElement(const PString &elementName) const
PXML::Save
bool Save(Options options=NoOptions)
PXML::RequiredNonEmptyAttribute
Definition: pxml.h:172
PTimer
A class representing a system timer.
Definition: timer.h:181
PBoolean
BOOL PBoolean
Definition: object.h:102
PXML::ValidationInfo::m_name
const char * m_name
Definition: pxml.h:200
PXMLBase::NoIgnoreWhiteSpace
ignored
Definition: pxml.h:75
PXMLElement::GetSubObjects
PXMLObjectArray GetSubObjects() const
Definition: pxml.h:409
PXML::OptionalElementWithBodyMatchingEx
Definition: pxml.h:190
PXML::RequiredAttributeWithValueMatching
Definition: pxml.h:176
PXML::SetRootElement
PXMLElement * SetRootElement(PXMLElement *p)
PXML::PrintOn
void PrintOn(ostream &strm) const
Output the contents of the object to the stream.
PXMLBase::NotStandAlone
Definition: pxml.h:87
PXML::EscapeSpecialChars
static PString EscapeSpecialChars(const PString &string)
PXML_HTTP::GetAutoReloadStatus
PString GetAutoReloadStatus()
Definition: pxml.h:273
PXMLSettings
Definition: pxml.h:447
PXML::ValidationContext::m_nameSpaces
PStringToString m_nameSpaces
Definition: pxml.h:195
PSortedStringList
This is a sorted list collection class of PString objects.
Definition: pstring.h:2296
PXML::version
PString version
Definition: pxml.h:242
PXML::EndOfValidationList
Definition: pxml.h:168
PXML::RemoveAll
void RemoveAll()
PXMLBase::GetOptions
int GetOptions() const
Definition: pxml.h:96
PXMLParser::m_standAlone
StandAloneType m_standAlone
Definition: pxml.h:509
PXML::RemoveElement
bool RemoveElement(PINDEX idx)
PXML::ReadFrom
void ReadFrom(istream &strm)
Input the contents of the object from the stream.
PChannel
Abstract class defining I/O channel semantics.
Definition: channel.h:107
PXML::LoadAndValidate
bool LoadAndValidate(const PString &body, const PXML::ValidationInfo *validator, PString &error, int options=NoOptions)
PXMLParser::GetEncoding
PString GetEncoding() const
Definition: pxml.h:495
PXML::ElementName
Definition: pxml.h:170
PXMLBase::UninitialisedStandAlone
Definition: pxml.h:85
PXMLBase::m_options
int m_options
Definition: pxml.h:109
PXMLObject::SetParent
void SetParent(PXMLElement *newParent)
Definition: pxml.h:307
PXMLBase::NewLineAfterElement
Definition: pxml.h:74
PXML::CreateEndTag
static PString CreateEndTag(const PString &text)
PXML::CreateStartTag
static PString CreateStartTag(const PString &text)
PXML_HTTP::autoLoadError
PString autoLoadError
Definition: pxml.h:288
PXML::OptionalElement
Definition: pxml.h:178
PXML_HTTP::autoLoadMutex
PMutex autoLoadMutex
Definition: pxml.h:287
PString
The character string class.
Definition: pstring.h:108
PQueue< PXML >
PXMLElement::SetName
void SetName(const PString &v)
Definition: pxml.h:373
PXMLObject::IsDirty
bool IsDirty() const
Definition: pxml.h:320
PXMLElement
Definition: pxml.h:353
PXMLParser::expat
void * expat
Definition: pxml.h:503
PXMLParser::m_tempNamespaceList
PStringToString m_tempNamespaceList
Definition: pxml.h:510
PXMLElement::HasSubObjects
bool HasSubObjects() const
Definition: pxml.h:406
PXML::ValidationInfo::m_placeHolder
const void * m_placeHolder
Definition: pxml.h:203
PXML::Construct
void Construct(int options, const char *noIndentElements)
PXMLElement::HasAttributes
bool HasAttributes() const
Definition: pxml.h:396
PXML::~PXML
~PXML()
PXML::encoding
PString encoding
Definition: pxml.h:242
PXML::docType
PString docType
Definition: pxml.h:251
PThread
This class defines a thread of execution in the system.
Definition: thread.h:66
PXML::rootElement
PXMLElement * rootElement
Definition: pxml.h:237
PXML::OnLoaded
virtual void OnLoaded()
Definition: pxml.h:138
PXMLElement::GetSize
PINDEX GetSize() const
Definition: pxml.h:376
PXML::GetErrorLine
unsigned GetErrorLine() const
Definition: pxml.h:220
PXML::AsString
PString AsString() const
PXMLBase::IsNoIndentElement
virtual PBoolean IsNoIndentElement(const PString &) const
Definition: pxml.h:98
PXMLBase::StandAloneType
StandAloneType
Definition: pxml.h:84
PXML::GetErrorString
PString GetErrorString() const
Definition: pxml.h:218
PXMLParser::version
PString version
Definition: pxml.h:508
PXMLParser::GetStandAlone
StandAloneType GetStandAlone() const
Definition: pxml.h:497
PXML::RequiredAttributeWithValue
Definition: pxml.h:173
PXMLBase::AllOptions
Definition: pxml.h:79
PXML::loadFilename
PFilePath loadFilename
Definition: pxml.h:241
PXMLElement::dirty
bool dirty
Definition: pxml.h:436
PXMLBase::NoOptions
Definition: pxml.h:72
PXML_HTTP::autoloadURL
PURL autoloadURL
Definition: pxml.h:285
PXMLElement::m_defaultNamespace
PCaselessString m_defaultNamespace
Definition: pxml.h:440
PXML::rootMutex
PMutex rootMutex
Definition: pxml.h:238
PXML::ValidateElement
bool ValidateElement(ValidationContext &context, PXMLElement *element, const ValidationInfo *elements)
PXMLBase::UnknownStandAlone
Definition: pxml.h:86
PXML::CreateTag
static PString CreateTag(const PString &text, const PString &data)
PXML::IsLoaded
bool IsLoaded() const
Definition: pxml.h:132
PXMLBase::SetMaxEntityLength
void SetMaxEntityLength(unsigned len)
Definition: pxml.h:105
PXMLParser::rootOpen
bool rootOpen
Definition: pxml.h:505
PXMLObject::dirty
bool dirty
Definition: pxml.h:326
PXMLElement::attributes
PStringToString attributes
Definition: pxml.h:434
PMutex
Synonym for PTimedMutex.
PAssert
#define PAssert(b, msg)
This macro is used to assert that a condition must be true.
Definition: object.h:192
PARRAY
PARRAY(PXMLObjectArray, PXMLObject)
PXML::OptionalAttribute
Definition: pxml.h:179
PXML::GetErrorColumn
unsigned GetErrorColumn() const
Definition: pxml.h:219
PXML::SetDocType
void SetDocType(const PString &v)
Definition: pxml.h:223
PXMLElement::name
PCaselessString name
Definition: pxml.h:433
PXMLBase::IsStandAlone
Definition: pxml.h:88
PXML::RequiredElement
Definition: pxml.h:174
PXMLBase::GetMaxEntityLength
unsigned GetMaxEntityLength() const
Definition: pxml.h:106
PXMLObject::parent
PXMLElement * parent
Definition: pxml.h:325
PXMLBase::FragmentOnly
XML fragment, not complete document.
Definition: pxml.h:78
PXML::GetDocumentType
PCaselessString GetDocumentType() const
PXMLBase::Indent
Definition: pxml.h:73
PXMLBase::Options
Options
Definition: pxml.h:71
PXMLParser::lastElement
PXMLData * lastElement
Definition: pxml.h:507
PXML::ValidationInfo::m_namespace
const char * m_namespace
Definition: pxml.h:206
PObject
Ultimate parent class for all objects in the class library.
Definition: object.h:1118
PXML::RequiredAttribute
Definition: pxml.h:171
PXML::RequiredAttributeWithValueMatchingEx
Definition: pxml.h:187
PXMLElement::GetName
PCaselessString GetName() const
Definition: pxml.h:364
PXML::m_errorString
PStringStream m_errorString
Definition: pxml.h:245
PXML::noIndentElements
PSortedStringList noIndentElements
Definition: pxml.h:249
PURL
This class describes a Universal Resource Locator.
Definition: url.h:54
PXML::ValidateElements
bool ValidateElements(ValidationContext &context, PXMLElement *baseElement, const ValidationInfo *elements)
PXML_HTTP
Definition: pxml.h:257
PXML::ValidationContext::m_defaultNameSpace
PString m_defaultNameSpace
Definition: pxml.h:194
PXMLObject
Definition: pxml.h:296
PXMLParser::rootElement
PXMLElement * rootElement
Definition: pxml.h:504
PXMLElement::m_nameSpaces
PStringToString m_nameSpaces
Definition: pxml.h:439
PXML_HTTP::autoLoadTimer
PTimer autoLoadTimer
Definition: pxml.h:284
PXMLElement::column
unsigned column
Definition: pxml.h:437
PXMLData::GetString
PString GetString() const
Definition: pxml.h:341
PXML::m_errorColumn
unsigned m_errorColumn
Definition: pxml.h:247