Xerces-C++: AbstractDOMParser.hpp Source File (original) (raw)

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

18

19

20

21

22#if !defined(XERCESC_INCLUDE_GUARD_ABSTRACTDOMPARSER_HPP)

23#define XERCESC_INCLUDE_GUARD_ABSTRACTDOMPARSER_HPP

24

30#include <xercesc/util/ValueStackOf.hpp>

31#include <xercesc/validators/DTD/DocTypeHandler.hpp>

33#include <xercesc/validators/DTD/DTDElementDecl.hpp>

34#include <xercesc/framework/XMLBufferMgr.hpp>

36

38

39class XMLPScanToken;

40class XMLScanner;

42class DOMDocumentImpl;

43class DOMDocumentTypeImpl;

44class DOMEntityImpl;

46class GrammarResolver;

49

55

60 , public DocTypeHandler

62{

63public :

64

65

66

69

78 {

79 Val_Never

80 , Val_Always

81 , Val_Auto

83

85

86

87

88

89

92

97

99

100

101

102

103

112

127

129

130

131

132

133

134

137

150

159

168

180

192

204

217

229

243

255

265 bool getCreateEntityReferenceNodes()const;

266

277 bool getIncludeIgnorableWhitespace() const;

278

299

320

337

352

366

380

393

402 bool getCreateCommentNodes()const;

403

416

428

436

443 const PSVIHandler* getPSVIHandler() const;

444

454 bool getCreateSchemaInfo() const;

455

465 bool getDoXInclude() const;

466

479

488

497

506

515

525

526

527

528

529

530

545

554

570

588

609

628 void setCreateEntityReferenceNodes(const bool create);

629

651 void setIncludeIgnorableWhitespace(const bool include);

652

670

687

705

720

742

752

768

778

795

810

827

846

863

874 void setCreateCommentNodes(const bool create);

875

889

901

910

918 void useImplementation(const XMLCh* const implementationFeatures);

919

929

940

950 void setDoXInclude(const bool newState);

951

962

978

992

1006

1007

1008

1009

1010

1011

1014

1031

1049

1065 void parse(const char* const systemId);

1066

1094 (

1095 const XMLCh* const systemId

1096 , XMLPScanToken& toFill

1097 );

1098

1127 (

1128 const char* const systemId

1129 , XMLPScanToken& toFill

1130 );

1131

1160 (

1162 , XMLPScanToken& toFill

1163 );

1164

1188

1215

1217

1218

1219

1220

1221

1224

1236 (

1237 const XMLCh* const localName

1238 , const XMLCh* const uri

1240 );

1241

1243 (

1244 const XMLCh* const localName

1245 , const XMLCh* const uri

1247 );

1260 (

1261 const XMLCh* const localName

1262 , const XMLCh* const uri

1264 );

1266

1267

1268

1269

1270

1273

1287 (

1288 const XMLCh* const chars

1290 , const bool cdataSection

1291 );

1292

1302 (

1303 const XMLCh* const comment

1304 );

1305

1319 (

1320 const XMLCh* const target

1321 , const XMLCh* const data

1322 );

1323

1329

1347 (

1349 , const unsigned int urlId

1350 , const bool isRoot

1351 , const XMLCh* const elemPrefix

1352 );

1353

1363 (

1365 );

1366

1386 (

1387 const XMLCh* const chars

1389 , const bool cdataSection

1390 );

1391

1399

1405

1434 (

1436 , const unsigned int urlId

1437 , const XMLCh* const elemPrefix

1438 , const RefVectorOf& attrList

1440 , const bool isEmpty

1441 , const bool isRoot

1442 );

1443

1454 (

1456 );

1457

1477 (

1478 const XMLCh* const versionStr

1479 , const XMLCh* const encodingStr

1480 , const XMLCh* const standaloneStr

1481 , const XMLCh* const actualEncStr

1482 );

1483

1485

1486

1487

1488

1489

1493 (

1494 const DTDElementDecl& elemDecl

1495 , const DTDAttDef& attDef

1496 , const bool ignoring

1497 );

1498

1500 (

1501 const XMLCh* const comment

1502 );

1503

1505 (

1506 const DTDElementDecl& elemDecl

1507 , const XMLCh* const publicId

1508 , const XMLCh* const systemId

1509 , const bool hasIntSubset

1510 , const bool hasExtSubset = false

1511 );

1512

1514 (

1515 const XMLCh* const target

1516 , const XMLCh* const data

1517 );

1518

1520 (

1521 const XMLCh* const chars

1523 );

1524

1526 (

1527 const DTDElementDecl& decl

1528 , const bool isIgnored

1529 );

1530

1532 (

1533 const DTDElementDecl& elemDecl

1534 );

1535

1537

1539

1541 (

1542 const DTDEntityDecl& entityDecl

1543 , const bool isPEDecl

1544 , const bool isIgnored

1545 );

1546

1548

1550 (

1552 , const bool isIgnored

1553 );

1554

1556 (

1557 const DTDElementDecl& elemDecl

1558 );

1559

1561

1563

1565 (

1566 const XMLCh* const versionStr

1567 , const XMLCh* const encodingStr

1568 );

1569

1571

1572protected:

1573

1574

1575

1578

1581 const XMLCh* elemPrefix,

1582 const XMLCh* localName,

1583 const XMLCh* qName);

1584

1587 const XMLCh* elemPrefix,

1588 const XMLCh* localName,

1589 const XMLCh* qName);

1590

1591

1592

1593

1594protected :

1595

1596

1597

1617 (

1621 );

1622

1624

1625

1626

1627

1635 DOMNode* getCurrentNode();

1636

1641 XMLScanner* getScanner() const;

1642

1647 GrammarResolver* getGrammarResolver() const;

1648

1654 bool getParseInProgress() const;

1655

1657

1659

1660

1661

1662

1663

1664

1667

1675 void setCurrentNode(DOMNode* toSet);

1676

1684

1691 void setParseInProgress(const bool toSet);

1693

1694

1695

1696

1700

1705

1707

1708

1709private :

1710

1711

1712

1713 void initialize();

1714 void cleanUp();

1715 void resetInProgress();

1716

1717

1718

1719

1722

1723protected:

1724

1725

1726

1727

1728

1729

1730

1731

1732

1733

1734

1735

1736

1737

1738

1739

1740

1741

1742

1743

1744

1745

1746

1747

1748

1749

1750

1751

1752

1753

1754

1755

1756

1757

1758

1759

1760

1761

1762

1763

1764

1765

1766

1767

1768

1769

1770

1771

1772

1773

1774

1775

1776

1777

1778

1779

1780

1781

1782

1783

1784

1785

1786

1787

1788

1789

1790

1791

1792

1793

1794

1795

1820};

1821

1822

1823

1824

1825

1826

1831

1836

1841

1846

1851

1856

1861

1866

1871

1876

1877

1878

1883

1888

1893

1899

1904

1905

1906

1907

1912

1917

1918

1919

1920

1925

1930

1932

1933#endif

#define PARSERS_EXPORT

Definition XercesDefs.hpp:168

#define XERCES_CPP_NAMESPACE_BEGIN

Definition XercesDefs.hpp:112

#define XERCES_CPP_NAMESPACE_END

Definition XercesDefs.hpp:113

size_t XMLSize_t

Definition Xerces_autoconf_config.hpp:112

char16_t XMLCh

Definition Xerces_autoconf_config.hpp:120

This class implements the Document Object Model (DOM) interface.

Definition AbstractDOMParser.hpp:62

void setCreateEntityReferenceNodes(const bool create)

Set the 'include entity references' flag.

Definition AbstractDOMParser.hpp:1879

bool isDocumentAdopted() const

Returns true if the user has adopted the document.

void setExternalSchemaLocation(const XMLCh *const schemaLocation)

This method allows the user to specify a list of schemas to use.

XMLValidator * fValidator

Definition AbstractDOMParser.hpp:1814

DOMDocumentImpl * fDocument

Definition AbstractDOMParser.hpp:1809

virtual void docComment(const XMLCh *const comment)

Handle a document comment event.

void setExitOnFirstFatalError(const bool newState)

Set the 'exit on first error' flag.

void useScanner(const XMLCh *const scannerName)

Set the scanner to use when scanning the XML document.

void parseReset(XMLPScanToken &token)

Reset the parser after a progressive parse.

virtual void doctypePI(const XMLCh *const target, const XMLCh *const data)

void setDisallowDoctype(const bool newState)

Set the 'Disallow DOCTYPE (DTD)' flag.

bool getDisallowDoctype() const

Get the 'Disallow DOCTYPE (DTD)' flag.

PSVIHandler * fPSVIHandler

Definition AbstractDOMParser.hpp:1819

virtual void startEntityReference(const XMLEntityDecl &entDecl)

Handle a start entity reference event.

virtual DOMElement * createElementNS(const XMLCh *namespaceURI, const XMLCh *elemPrefix, const XMLCh *localName, const XMLCh *qName)

bool getHandleMultipleImports() const

Get the 'handle multiple schema imports' flag.

void setExternalNoNamespaceSchemaLocation(const XMLCh *const noNamespaceSchemaLocation)

This method allows the user to specify the no target namespace XML Schema Location externally.

void setCreateCommentNodes(const bool create)

Set the 'create comment nodes' flag.

Definition AbstractDOMParser.hpp:1889

void setDoNamespaces(const bool newState)

Set the 'do namespaces' flag.

virtual void endEntityReference(const XMLEntityDecl &entDecl)

Handle and end of entity reference event.

bool fDoXInclude

Definition AbstractDOMParser.hpp:1803

bool getDoSchema() const

Get the 'do schema' flag.

bool parseNext(XMLPScanToken &token)

Continue a progressive parse operation.

XMLScanner * getScanner() const

Get the XML scanner.

Definition AbstractDOMParser.hpp:1842

const XMLValidator & getValidator() const

Get a const reference to the validator.

virtual void handlePartialElementPSVI(const XMLCh *const localName, const XMLCh *const uri, PSVIElement *elementInfo)

Receive notification of partial PSVI properties of an element.

DOMEntityImpl * fCurrentEntity

Definition AbstractDOMParser.hpp:1808

PSVIHandler * getPSVIHandler()

This method returns the installed PSVI handler.

Definition AbstractDOMParser.hpp:1857

void setHandleMultipleImports(const bool newValue)

Set the 'handle multiple schema imports' flag.

virtual void docPI(const XMLCh *const target, const XMLCh *const data)

Handle a document PI event.

XMLGrammarPool * fGrammarPool

Definition AbstractDOMParser.hpp:1816

virtual void endElement(const XMLElementDecl &elemDecl, const unsigned int urlId, const bool isRoot, const XMLCh *const elemPrefix)

Handle and end of element event.

virtual void startIntSubset()

void setIgnoreAnnotations(const bool newValue)

Set the 'ignore annotation' flag.

void setLoadSchema(const bool newState)

Set the 'Loading Schema' flag.

ValSchemes

ValScheme enum used in setValidationScheme Val_Never: Do not report validation errors.

Definition AbstractDOMParser.hpp:78

bool parseFirst(const XMLCh *const systemId, XMLPScanToken &toFill)

Begin a progressive parse operation.

void reset()

Reset the parser.

virtual void endIntSubset()

bool fCreateCommentNodes

Definition AbstractDOMParser.hpp:1800

virtual void resetDocument()

Handle a document reset event.

virtual ~AbstractDOMParser()

Destructor.

XMLCh * getExternalNoNamespaceSchemaLocation() const

Get the noNamespace SchemaLocation that is specified externally.

virtual void endAttList(const DTDElementDecl &elemDecl)

XMLBuffer & fInternalSubset

Definition AbstractDOMParser.hpp:1818

virtual void startAttList(const DTDElementDecl &elemDecl)

bool fCreateEntityReferenceNodes

Definition AbstractDOMParser.hpp:1796

void setDisableDefaultEntityResolution(const bool newValue)

Set the 'disable default entity resolution' flag.

void setExternalNoNamespaceSchemaLocation(const char *const noNamespaceSchemaLocation)

This method is same as setExternalNoNamespaceSchemaLocation(const XMLCh* const).

bool getStandardUriConformant() const

Get the 'force standard uri flag'.

virtual void XMLDecl(const XMLCh *const versionStr, const XMLCh *const encodingStr, const XMLCh *const standaloneStr, const XMLCh *const actualEncStr)

Handle an XMLDecl event.

DOMNode * getCurrentNode()

Get the current DOM node.

Definition AbstractDOMParser.hpp:1908

bool getCreateSchemaInfo() const

Get the 'associate schema info' flag.

Definition AbstractDOMParser.hpp:1867

virtual void entityDecl(const DTDEntityDecl &entityDecl, const bool isPEDecl, const bool isIgnored)

bool getGenerateSyntheticAnnotations() const

Get the 'generate synthetic annotations' flag.

DOMDocumentTypeImpl * fDocumentType

Definition AbstractDOMParser.hpp:1810

bool getValidateAnnotations() const

Get the 'validate annotations' flag.

void setValidateAnnotations(const bool newValue)

set the 'validlate annotations' flag

void setDocument(DOMDocument *toSet)

Set the document node.

XMLScanner * fScanner

Definition AbstractDOMParser.hpp:1804

virtual void handleElementPSVI(const XMLCh *const localName, const XMLCh *const uri, PSVIElement *elementInfo)

Receive notification of the PSVI properties of an element.

DOMNode * fCurrentNode

Definition AbstractDOMParser.hpp:1807

void setLoadExternalDTD(const bool newState)

Set the 'Loading External DTD' flag.

void useImplementation(const XMLCh *const implementationFeatures)

Set the implementation to use when creating the document.

Definition AbstractDOMParser.hpp:1894

const XMLSize_t & getLowWaterMark() const

Get the raw buffer low water mark for this parser.

void setDoSchema(const bool newState)

Set the 'do schema' flag.

DOMDocument * adoptDocument()

Adopt the DOM document.

void setParseInProgress(const bool toSet)

Set the parse in progress flag.

Definition AbstractDOMParser.hpp:1926

virtual DOMCDATASection * createCDATASection(const XMLCh *, XMLSize_t)

virtual DOMAttr * createAttrNS(const XMLCh *namespaceURI, const XMLCh *elemPrefix, const XMLCh *localName, const XMLCh *qName)

bool getIgnoreAnnotations() const

Get the 'ignore annotations' flag.

void setExternalSchemaLocation(const char *const schemaLocation)

This method is same as setExternalSchemaLocation(const XMLCh* const).

virtual void startExtSubset()

XMLSize_t getErrorCount() const

Get error count from the last parse operation.

GrammarResolver * getGrammarResolver() const

Get the Grammar resolver.

Definition AbstractDOMParser.hpp:1847

DOMDocument * getDocument()

Get the DOM document.

void setCalculateSrcOfs(const bool newState)

Enable/disable src offset calculation.

void setValidationSchemaFullChecking(const bool schemaFullChecking)

This method allows the user to turn full Schema constraint checking on/off.

virtual void doctypeComment(const XMLCh *const comment)

ValSchemes getValidationScheme() const

This method returns an enumerated value that indicates the current validation scheme set on this pars...

XMLCh * fImplementationFeatures

Definition AbstractDOMParser.hpp:1805

bool fParseInProgress

Definition AbstractDOMParser.hpp:1799

bool getCreateEntityReferenceNodes() const

Get the 'include entity references' flag.

Definition AbstractDOMParser.hpp:1827

bool fIncludeIgnorableWhitespace

Definition AbstractDOMParser.hpp:1797

bool getSkipDTDValidation() const

Get the 'skip DTD validation' flag.

virtual void doctypeDecl(const DTDElementDecl &elemDecl, const XMLCh *const publicId, const XMLCh *const systemId, const bool hasIntSubset, const bool hasExtSubset=false)

bool parseFirst(const char *const systemId, XMLPScanToken &toFill)

Begin a progressive parse operation.

MemoryManager * fMemoryManager

Definition AbstractDOMParser.hpp:1815

AbstractDOMParser(XMLValidator *const valToAdopt=0, MemoryManager *const manager=XMLPlatformUtils::fgMemoryManager, XMLGrammarPool *const gramPool=0)

Construct a AbstractDOMParser, with an optional validator.

bool getIdentityConstraintChecking() const

Get the identity constraint checking' flag.

void setValidationScheme(const ValSchemes newScheme)

This method allows users to set the validation scheme to be used by this parser.

void setCurrentNode(DOMNode *toSet)

Set the current DOM node.

Definition AbstractDOMParser.hpp:1921

void setSecurityManager(SecurityManager *const securityManager)

This allows an application to set a SecurityManager on the parser; this object stores information tha...

void setDoXInclude(const bool newState)

Set the 'do XInclude' flag.

Definition AbstractDOMParser.hpp:1900

XMLCh * getExternalSchemaLocation() const

Get the set of Namespace/SchemaLocation that is specified externally.

bool fDocumentAdoptedByUser

Definition AbstractDOMParser.hpp:1801

virtual void setPSVIHandler(PSVIHandler *const handler)

This method installs the user specified PSVI handler on the parser.

void setSkipDTDValidation(const bool newValue)

Set the 'skip DTD validation' flag.

void setGenerateSyntheticAnnotations(const bool newValue)

set the 'generate synthetic annotations' flag

void parse(const InputSource &source)

Parse via an input source object.

bool getValidationSchemaFullChecking() const

Get the 'full schema constraint checking' flag.

virtual void doctypeWhitespace(const XMLCh *const chars, const XMLSize_t length)

virtual void endDocument()

Handle the end of document event.

virtual void elementDecl(const DTDElementDecl &decl, const bool isIgnored)

bool getDoNamespaces() const

Get the 'do namespaces' flag.

virtual void resetDocType()

bool parseFirst(const InputSource &source, XMLPScanToken &toFill)

Begin a progressive parse operation.

void parse(const char *const systemId)

Parse via a file path or URL (in the local code page)

bool getCreateCommentNodes() const

Get the 'create comment node' flag.

Definition AbstractDOMParser.hpp:1852

virtual void TextDecl(const XMLCh *const versionStr, const XMLCh *const encodingStr)

bool getParseInProgress() const

Get the parse in progress flag.

Definition AbstractDOMParser.hpp:1837

void setStandardUriConformant(const bool newState)

Force standard uri.

bool fWithinElement

Definition AbstractDOMParser.hpp:1798

virtual void ignorableWhitespace(const XMLCh *const chars, const XMLSize_t length, const bool cdataSection)

Handle an ignorable whitespace vent.

bool getValidationConstraintFatal() const

This method returns the state of the parser's validation-constraint-fatal flag.

SecurityManager * getSecurityManager() const

Get the SecurityManager instance attached to this parser.

virtual DOMText * createText(const XMLCh *, XMLSize_t)

bool getLoadSchema() const

Get the 'Loading Schema' flag.

bool getDoXInclude() const

Get the 'do XInclude' flag.

Definition AbstractDOMParser.hpp:1872

virtual void handleAttributesPSVI(const XMLCh *const localName, const XMLCh *const uri, PSVIAttributeList *psviAttributes)

Enables PSVI information about attributes to be passed back to the application.

virtual void startElement(const XMLElementDecl &elemDecl, const unsigned int urlId, const XMLCh *const elemPrefix, const RefVectorOf< XMLAttr > &attrList, const XMLSize_t attrCount, const bool isEmpty, const bool isRoot)

Handle a start element event.

DOMNode * fCurrentParent

Definition AbstractDOMParser.hpp:1806

virtual void notationDecl(const XMLNotationDecl &notDecl, const bool isIgnored)

XMLStringPool * fURIStringPool

Definition AbstractDOMParser.hpp:1813

MemoryManager * getMemoryManager() const

Definition AbstractDOMParser.hpp:1913

virtual void docCharacters(const XMLCh *const chars, const XMLSize_t length, const bool cdataSection)

Handle document character events.

void setIncludeIgnorableWhitespace(const bool include)

Set the 'include ignorable whitespace' flag.

Definition AbstractDOMParser.hpp:1884

bool getDisableDefaultEntityResolution() const

Get the 'disable default entity resolution' flag.

void setLowWaterMark(XMLSize_t lwm)

Set the raw buffer low water mark for this parser.

virtual void attDef(const DTDElementDecl &elemDecl, const DTDAttDef &attDef, const bool ignoring)

XMLBufferMgr fBufMgr

Definition AbstractDOMParser.hpp:1817

virtual DOMElement * createElement(const XMLCh *name)

bool getExitOnFirstFatalError() const

Get the 'exit on first error' flag.

void parse(const XMLCh *const systemId)

Parse via a file path or URL.

virtual DOMAttr * createAttr(const XMLCh *name)

void setValidationConstraintFatal(const bool newState)

This method allows users to set the parser's behaviour when it encounters a validation constraint err...

bool getIncludeIgnorableWhitespace() const

Get the 'include ignorable whitespace' flag.

Definition AbstractDOMParser.hpp:1832

bool fCreateSchemaInfo

Definition AbstractDOMParser.hpp:1802

bool getLoadExternalDTD() const

Get the 'Loading External DTD' flag.

void setIdentityConstraintChecking(const bool newState)

This method allows users to enable or disable the parser's identity constraint checks.

virtual void startDocument()

Handle a start document event.

RefVectorOf< DOMDocumentImpl > * fDocumentVector

Definition AbstractDOMParser.hpp:1811

GrammarResolver * fGrammarResolver

Definition AbstractDOMParser.hpp:1812

bool getCalculateSrcOfs() const

Get the 'calculate src offset flag'.

virtual void endExtSubset()

void setCreateSchemaInfo(const bool newState)

Set the 'associate schema info' flag.

CDATA sections are used to escape blocks of text containing characters that would otherwise be regard...

Definition DOMCDATASection.hpp:65

The DOMDocument interface represents the entire XML document.

Definition DOMDocument.hpp:67

By far the vast majority of objects (apart from text) that authors encounter when traversing a docume...

Definition DOMElement.hpp:66

The DOMNode interface is the primary datatype for the entire Document Object Model.

Definition DOMNode.hpp:139

The DOMText interface inherits from DOMCharacterData and represents the textual content (termed chara...

Definition DOMText.hpp:51

A single input source for an XML entity.

Definition InputSource.hpp:63

Configurable memory manager.

Definition MemoryManager.hpp:40

virtual void deallocate(void *p)=0

This method deallocates memory.

Definition PSVIAttributeList.hpp:60

Definition PSVIElement.hpp:42

This abstract class provides the interface for the scanner to return PSVI information to the applicat...

Definition PSVIHandler.hpp:39

Allow application to force the parser to behave in a security-conscious way.

Definition SecurityManager.hpp:52

This abstract class provides the interface for the scanner to return XML document information up to t...

Definition XMLDocumentHandler.hpp:43

This class defines the core information of an element declaration.

Definition XMLElementDecl.hpp:52

This class defines that core information that defines an XML entity, no matter what validator is used...

Definition XMLEntityDecl.hpp:51

This abstract class is a callback mechanism for the scanner.

Definition XMLEntityHandler.hpp:44

This abstract class defines a callback mechanism for the scanner.

Definition XMLErrorReporter.hpp:43

Definition XMLGrammarPool.hpp:44

This class represents the core information about a notation declaration that all validators must at l...

Definition XMLNotationDecl.hpp:42

static MemoryManager * fgMemoryManager

The configurable memory manager.

Definition PlatformUtils.hpp:121

static char * replicate(const char *const toRep, MemoryManager *const manager=XMLPlatformUtils::fgMemoryManager)

Replicates a string NOTE: The returned buffer is allocated with the MemoryManager.

This abstract class provides the interface for all validators.

Definition XMLValidator.hpp:53

This class makes it possible to override the C++ memory management by adding new/delete operators to ...

Definition XMemory.hpp:41