1 | <HTML><HEAD><META content="text/html; charset=utf8" http-equiv="Content-Type"><SCRIPT language="JavaScript" src="resources/script.js" type="text/javascript"></SCRIPT><TITLE>SAX1 Programming Guide</TITLE></HEAD><BODY alink="#ff0000" bgcolor="#ffffff" leftmargin="4" link="#0000ff" marginheight="4" marginwidth="4" text="#000000" topmargin="4" vlink="#0000aa"><TABLE border="0" cellpadding="0" cellspacing="0" width="620"><TR><TD align="left" height="60" rowspan="3" valign="top" width="135"><IMG border="0" height="60" hspace="0" src="resources/logo.gif" vspace="0" width="135"></TD><TD align="left" colspan="4" height="5" valign="top" width="456"><IMG border="0" height="5" hspace="0" src="resources/line.gif" vspace="0" width="456"></TD><TD align="left" height="60" rowspan="3" valign="top" width="29"><IMG border="0" height="60" hspace="0" src="resources/right.gif" vspace="0" width="29"></TD></TR><TR><TD align="left" bgcolor="#0086b2" colspan="4" height="35" valign="top" width="456"><IMG alt="" border="0" height="35" hspace="0" src="graphics/program-sax-header.jpg" vspace="0" width="456"></TD></TR><TR><TD align="left" height="20" valign="top" width="168"><IMG border="0" height="20" hspace="0" src="resources/bottom.gif" vspace="0" width="168"></TD><TD align="left" height="20" valign="top" width="96"><A href="http://xml.apache.org/" onMouseOut="rolloverOff('xml');" onMouseOver="rolloverOn('xml');" target="new"><IMG alt="http://xml.apache.org/" border="0" height="20" hspace="0" name="xml" onLoad="rolloverLoad('xml','resources/button-xml-hi.gif','resources/button-xml-lo.gif');" src="resources/button-xml-lo.gif" vspace="0" width="96"></A></TD><TD align="left" height="20" valign="top" width="96"><A href="http://www.apache.org/" onMouseOut="rolloverOff('asf');" onMouseOver="rolloverOn('asf');" target="new"><IMG alt="http://www.apache.org/" border="0" height="20" hspace="0" name="asf" onLoad="rolloverLoad('asf','resources/button-asf-hi.gif','resources/button-asf-lo.gif');" src="resources/button-asf-lo.gif" vspace="0" width="96"></A></TD><TD align="left" height="20" valign="top" width="96"><A href="http://www.w3.org/" onMouseOut="rolloverOff('w3c');" onMouseOver="rolloverOn('w3c');" target="new"><IMG alt="http://www.w3.org/" border="0" height="20" hspace="0" name="w3c" onLoad="rolloverLoad('w3c','resources/button-w3c-hi.gif','resources/button-w3c-lo.gif');" src="resources/button-w3c-lo.gif" vspace="0" width="96"></A></TD></TR></TABLE><TABLE border="0" cellpadding="0" cellspacing="0" width="620"><TR><TD align="left" valign="top" width="120"><IMG border="0" height="14" hspace="0" src="resources/join.gif" vspace="0" width="120"><BR>
|
---|
2 |
|
---|
3 |
|
---|
4 | <A href="../index.html" onMouseOut="rolloverOff('side-ext-2');" onMouseOver="rolloverOn('side-ext-2');"><IMG alt="Home" border="0" height="12" hspace="0" name="side-ext-2" onLoad="rolloverLoad('side-ext-2','graphics/ext-2-label-2.jpg','graphics/ext-2-label-3.jpg');" src="graphics/ext-2-label-3.jpg" vspace="0" width="120"></A><BR>
|
---|
5 |
|
---|
6 |
|
---|
7 |
|
---|
8 | <IMG border="0" height="6" hspace="0" src="resources/separator.gif" vspace="0" width="120"><BR>
|
---|
9 |
|
---|
10 | <A href="index.html" onMouseOut="rolloverOff('side-index');" onMouseOver="rolloverOn('side-index');"><IMG alt="Readme" border="0" height="12" hspace="0" name="side-index" onLoad="rolloverLoad('side-index','graphics/index-label-2.jpg','graphics/index-label-3.jpg');" src="graphics/index-label-3.jpg" vspace="0" width="120"></A><BR>
|
---|
11 | <A href="releases.html" onMouseOut="rolloverOff('side-releases');" onMouseOver="rolloverOn('side-releases');"><IMG alt="Release Info" border="0" height="12" hspace="0" name="side-releases" onLoad="rolloverLoad('side-releases','graphics/releases-label-2.jpg','graphics/releases-label-3.jpg');" src="graphics/releases-label-3.jpg" vspace="0" width="120"></A><BR>
|
---|
12 |
|
---|
13 |
|
---|
14 |
|
---|
15 |
|
---|
16 |
|
---|
17 |
|
---|
18 | <IMG border="0" height="6" hspace="0" src="resources/separator.gif" vspace="0" width="120"><BR>
|
---|
19 |
|
---|
20 | <A href="install.html" onMouseOut="rolloverOff('side-install');" onMouseOver="rolloverOn('side-install');"><IMG alt="Installation" border="0" height="12" hspace="0" name="side-install" onLoad="rolloverLoad('side-install','graphics/install-label-2.jpg','graphics/install-label-3.jpg');" src="graphics/install-label-3.jpg" vspace="0" width="120"></A><BR>
|
---|
21 | <A href="http://xml.apache.org/xerces-c/download.cgi" onMouseOut="rolloverOff('side-ext-18');" onMouseOver="rolloverOn('side-ext-18');"><IMG alt="Download" border="0" height="12" hspace="0" name="side-ext-18" onLoad="rolloverLoad('side-ext-18','graphics/ext-18-label-2.jpg','graphics/ext-18-label-3.jpg');" src="graphics/ext-18-label-3.jpg" vspace="0" width="120"></A><BR>
|
---|
22 | <A href="build.html" onMouseOut="rolloverOff('side-build');" onMouseOver="rolloverOn('side-build');"><IMG alt="Build Instructions" border="0" height="12" hspace="0" name="side-build" onLoad="rolloverLoad('side-build','graphics/build-label-2.jpg','graphics/build-label-3.jpg');" src="graphics/build-label-3.jpg" vspace="0" width="120"></A><BR>
|
---|
23 |
|
---|
24 |
|
---|
25 |
|
---|
26 |
|
---|
27 | <IMG border="0" height="6" hspace="0" src="resources/separator.gif" vspace="0" width="120"><BR>
|
---|
28 |
|
---|
29 | <A href="faqs.html" onMouseOut="rolloverOff('side-faqs');" onMouseOver="rolloverOn('side-faqs');"><IMG alt="FAQs" border="0" height="12" hspace="0" name="side-faqs" onLoad="rolloverLoad('side-faqs','graphics/faqs-label-2.jpg','graphics/faqs-label-3.jpg');" src="graphics/faqs-label-3.jpg" vspace="0" width="120"></A><BR>
|
---|
30 |
|
---|
31 | <A href="samples.html" onMouseOut="rolloverOff('side-samples');" onMouseOver="rolloverOn('side-samples');"><IMG alt="Samples" border="0" height="12" hspace="0" name="side-samples" onLoad="rolloverLoad('side-samples','graphics/samples-label-2.jpg','graphics/samples-label-3.jpg');" src="graphics/samples-label-3.jpg" vspace="0" width="120"></A><BR>
|
---|
32 |
|
---|
33 |
|
---|
34 |
|
---|
35 |
|
---|
36 |
|
---|
37 |
|
---|
38 |
|
---|
39 |
|
---|
40 |
|
---|
41 |
|
---|
42 |
|
---|
43 |
|
---|
44 |
|
---|
45 |
|
---|
46 |
|
---|
47 |
|
---|
48 | <A href="api.html" onMouseOut="rolloverOff('side-api');" onMouseOver="rolloverOn('side-api');"><IMG alt="API Docs" border="0" height="12" hspace="0" name="side-api" onLoad="rolloverLoad('side-api','graphics/api-label-2.jpg','graphics/api-label-3.jpg');" src="graphics/api-label-3.jpg" vspace="0" width="120"></A><BR>
|
---|
49 |
|
---|
50 | <IMG border="0" height="6" hspace="0" src="resources/separator.gif" vspace="0" width="120"><BR>
|
---|
51 |
|
---|
52 | <A href="ApacheDOMC++Binding.html" onMouseOut="rolloverOff('side-ext-68');" onMouseOver="rolloverOn('side-ext-68');"><IMG alt="DOM C++ Binding" border="0" height="12" hspace="0" name="side-ext-68" onLoad="rolloverLoad('side-ext-68','graphics/ext-68-label-2.jpg','graphics/ext-68-label-3.jpg');" src="graphics/ext-68-label-3.jpg" vspace="0" width="120"></A><BR>
|
---|
53 |
|
---|
54 | <A href="program.html" onMouseOut="rolloverOff('side-program');" onMouseOver="rolloverOn('side-program');"><IMG alt="Programming" border="0" height="12" hspace="0" name="side-program" onLoad="rolloverLoad('side-program','graphics/program-label-2.jpg','graphics/program-label-3.jpg');" src="graphics/program-label-3.jpg" vspace="0" width="120"></A><BR>
|
---|
55 |
|
---|
56 |
|
---|
57 |
|
---|
58 |
|
---|
59 |
|
---|
60 |
|
---|
61 |
|
---|
62 |
|
---|
63 | <A href="migrate.html" onMouseOut="rolloverOff('side-migrate');" onMouseOver="rolloverOn('side-migrate');"><IMG alt="Migration Guide" border="0" height="12" hspace="0" name="side-migrate" onLoad="rolloverLoad('side-migrate','graphics/migrate-label-2.jpg','graphics/migrate-label-3.jpg');" src="graphics/migrate-label-3.jpg" vspace="0" width="120"></A><BR>
|
---|
64 |
|
---|
65 |
|
---|
66 | <IMG border="0" height="6" hspace="0" src="resources/separator.gif" vspace="0" width="120"><BR>
|
---|
67 |
|
---|
68 | <A href="feedback.html" onMouseOut="rolloverOff('side-feedback');" onMouseOver="rolloverOn('side-feedback');"><IMG alt="Feedback" border="0" height="12" hspace="0" name="side-feedback" onLoad="rolloverLoad('side-feedback','graphics/feedback-label-2.jpg','graphics/feedback-label-3.jpg');" src="graphics/feedback-label-3.jpg" vspace="0" width="120"></A><BR>
|
---|
69 | <A href="bug-report.html" onMouseOut="rolloverOff('side-bug-report');" onMouseOver="rolloverOn('side-bug-report');"><IMG alt="Bug-Reporting" border="0" height="12" hspace="0" name="side-bug-report" onLoad="rolloverLoad('side-bug-report','graphics/bug-report-label-2.jpg','graphics/bug-report-label-3.jpg');" src="graphics/bug-report-label-3.jpg" vspace="0" width="120"></A><BR>
|
---|
70 | <A href="pdf.html" onMouseOut="rolloverOff('side-pdf');" onMouseOver="rolloverOn('side-pdf');"><IMG alt="PDF Document" border="0" height="12" hspace="0" name="side-pdf" onLoad="rolloverLoad('side-pdf','graphics/pdf-label-2.jpg','graphics/pdf-label-3.jpg');" src="graphics/pdf-label-3.jpg" vspace="0" width="120"></A><BR>
|
---|
71 |
|
---|
72 | <IMG border="0" height="6" hspace="0" src="resources/separator.gif" vspace="0" width="120"><BR>
|
---|
73 |
|
---|
74 |
|
---|
75 | <A href="http://xml.apache.org/websrc/cvsweb.cgi/xml-xerces/c/" onMouseOut="rolloverOff('side-ext-100');" onMouseOver="rolloverOn('side-ext-100');"><IMG alt="CVS Repository" border="0" height="12" hspace="0" name="side-ext-100" onLoad="rolloverLoad('side-ext-100','graphics/ext-100-label-2.jpg','graphics/ext-100-label-3.jpg');" src="graphics/ext-100-label-3.jpg" vspace="0" width="120"></A><BR>
|
---|
76 |
|
---|
77 |
|
---|
78 | <A href="http://marc.theaimsgroup.com/?l=xerces-c-dev" onMouseOut="rolloverOff('side-ext-102');" onMouseOver="rolloverOn('side-ext-102');"><IMG alt="Mail Archive" border="0" height="12" hspace="0" name="side-ext-102" onLoad="rolloverLoad('side-ext-102','graphics/ext-102-label-2.jpg','graphics/ext-102-label-3.jpg');" src="graphics/ext-102-label-3.jpg" vspace="0" width="120"></A><BR>
|
---|
79 |
|
---|
80 |
|
---|
81 | <IMG border="0" height="14" hspace="0" src="resources/close.gif" vspace="0" width="120"><BR></TD><TD align="left" valign="top" width="500"><TABLE border="0" cellpadding="3" cellspacing="0"><TR><TD>
|
---|
82 |
|
---|
83 | <A name="UsingSAX1API"><!--anchor--></A>
|
---|
84 | <TABLE border="0" cellpadding="0" cellspacing="0" width="494"><TR><TD bgcolor="ffffff" colspan="2" width="494"><TABLE border="0" cellpadding="0" cellspacing="0" width="494"><TR><TD bgcolor="#039acc" height="1" width="1"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD><TD bgcolor="#039acc" height="1" width="492"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="492"></TD><TD bgcolor="#0086b2" height="1" width="1"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD></TR><TR><TD bgcolor="#039acc" width="1"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD><TD bgcolor="#0086b2" width="492"><FONT color="#ffffff" face="arial,helvetica,sanserif" size="+1"><IMG border="0" height="2" hspace="0" src="resources/void.gif" vspace="0" width="2"><B>Using the SAX API</B></FONT></TD><TD bgcolor="#017299" width="1"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD></TR><TR><TD bgcolor="#0086b2" height="1" width="1"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD><TD bgcolor="#017299" height="1" width="492"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="492"></TD><TD bgcolor="#017299" height="1" width="1"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD></TR></TABLE></TD></TR><TR><TD width="10"> </TD><TD width="484"><FONT color="#000000" face="arial,helvetica,sanserif">
|
---|
85 | <P>The SAX API for XML parsers was originally developed for
|
---|
86 | Java. Please be aware that there is no standard SAX API for
|
---|
87 | C++, and that use of the Xerces-C++ SAX API does not
|
---|
88 | guarantee client code compatibility with other C++ XML
|
---|
89 | parsers.</P>
|
---|
90 |
|
---|
91 | <P>The SAX API presents a callback based API to the parser. An
|
---|
92 | application that uses SAX provides an instance of a handler
|
---|
93 | class to the parser. When the parser detects XML constructs,
|
---|
94 | it calls the methods of the handler class, passing them
|
---|
95 | information about the construct that was detected. The most
|
---|
96 | commonly used handler classes are DocumentHandler which is
|
---|
97 | called when XML constructs are recognized, and ErrorHandler
|
---|
98 | which is called when an error occurs. The header files for the
|
---|
99 | various SAX handler classes are in
|
---|
100 | '<xerces-c2_6_0>/include/xercesc/sax'</P>
|
---|
101 |
|
---|
102 | <P>As a convenience, Xerces-C++ provides the class
|
---|
103 | HandlerBase, which is a single class which is publicly derived
|
---|
104 | from all the Handler classes. HandlerBase's default
|
---|
105 | implementation of the handler callback methods is to do
|
---|
106 | nothing. A convenient way to get started with Xerces-C++ is
|
---|
107 | to derive your own handler class from HandlerBase and override
|
---|
108 | just those methods in HandlerBase which you are interested in
|
---|
109 | customizing. This simple example shows how to create a handler
|
---|
110 | which will print element names, and print fatal error
|
---|
111 | messages. The source code for the sample applications show
|
---|
112 | additional examples of how to write handler classes.</P>
|
---|
113 |
|
---|
114 | <P>This is the header file MySAXHandler.hpp:</P>
|
---|
115 | <DIV align="left"><TABLE border="0" cellpadding="0" cellspacing="4" width="464"><TR><TD bgcolor="#0086b2" height="1" width="1"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD><TD bgcolor="#0086b2" height="1" width="462"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="462"></TD><TD bgcolor="#0086b2" height="1" width="1"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD></TR><TR><TD bgcolor="#0086b2" width="1"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD><TD bgcolor="#ffffff" width="462"><FONT size="-1"><PRE>#include <xercesc/sax/HandlerBase.hpp>
|
---|
116 |
|
---|
117 | class MySAXHandler : public HandlerBase {
|
---|
118 | public:
|
---|
119 | void startElement(const XMLCh* const, AttributeList&);
|
---|
120 | void fatalError(const SAXParseException&);
|
---|
121 | };</PRE></FONT></TD><TD bgcolor="#0086b2" width="1"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD></TR><TR><TD bgcolor="#0086b2" height="1" width="1"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD><TD bgcolor="#0086b2" height="1" width="462"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="462"></TD><TD bgcolor="#0086b2" height="1" width="1"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD></TR></TABLE></DIV>
|
---|
122 |
|
---|
123 | <P>This is the implementation file MySAXHandler.cpp:</P>
|
---|
124 |
|
---|
125 | <DIV align="left"><TABLE border="0" cellpadding="0" cellspacing="4" width="464"><TR><TD bgcolor="#0086b2" height="1" width="1"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD><TD bgcolor="#0086b2" height="1" width="462"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="462"></TD><TD bgcolor="#0086b2" height="1" width="1"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD></TR><TR><TD bgcolor="#0086b2" width="1"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD><TD bgcolor="#ffffff" width="462"><FONT size="-1"><PRE>#include "MySAXHandler.hpp"
|
---|
126 | #include <iostream.h>
|
---|
127 |
|
---|
128 | MySAXHandler::MySAXHandler()
|
---|
129 | {
|
---|
130 | }
|
---|
131 |
|
---|
132 | void MySAXHandler::startElement(const XMLCh* const name,
|
---|
133 | AttributeList& attributes)
|
---|
134 | {
|
---|
135 | char* message = XMLString::transcode(name);
|
---|
136 | cout << "I saw element: "<< message << endl;
|
---|
137 | XMLString::release(&message);
|
---|
138 | }
|
---|
139 |
|
---|
140 | void MySAXHandler::fatalError(const SAXParseException& exception)
|
---|
141 | {
|
---|
142 | char* message = XMLString::transcode(exception.getMessage());
|
---|
143 | cout << "Fatal Error: " << message
|
---|
144 | << " at line: " << exception.getLineNumber()
|
---|
145 | << endl;
|
---|
146 | }</PRE></FONT></TD><TD bgcolor="#0086b2" width="1"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD></TR><TR><TD bgcolor="#0086b2" height="1" width="1"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD><TD bgcolor="#0086b2" height="1" width="462"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="462"></TD><TD bgcolor="#0086b2" height="1" width="1"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD></TR></TABLE></DIV>
|
---|
147 |
|
---|
148 | <P>The XMLCh and AttributeList types are supplied by
|
---|
149 | Xerces-C++ and are documented in the include
|
---|
150 | files. Examples of their usage appear in the source code to
|
---|
151 | the sample applications.</P>
|
---|
152 | </FONT></TD></TR></TABLE><BR>
|
---|
153 |
|
---|
154 | <A name="SAXParser"><!--anchor--></A>
|
---|
155 | <TABLE border="0" cellpadding="0" cellspacing="0" width="494"><TR><TD bgcolor="ffffff" colspan="2" width="494"><TABLE border="0" cellpadding="0" cellspacing="0" width="494"><TR><TD bgcolor="#039acc" height="1" width="1"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD><TD bgcolor="#039acc" height="1" width="492"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="492"></TD><TD bgcolor="#0086b2" height="1" width="1"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD></TR><TR><TD bgcolor="#039acc" width="1"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD><TD bgcolor="#0086b2" width="492"><FONT color="#ffffff" face="arial,helvetica,sanserif" size="+1"><IMG border="0" height="2" hspace="0" src="resources/void.gif" vspace="0" width="2"><B>SAXParser</B></FONT></TD><TD bgcolor="#017299" width="1"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD></TR><TR><TD bgcolor="#0086b2" height="1" width="1"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD><TD bgcolor="#017299" height="1" width="492"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="492"></TD><TD bgcolor="#017299" height="1" width="1"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD></TR></TABLE></TD></TR><TR><TD width="10"> </TD><TD width="484"><FONT color="#000000" face="arial,helvetica,sanserif">
|
---|
156 | <A name="ConstructParser"><!--anchor--></A>
|
---|
157 | <TABLE border="0" cellpadding="0" cellspacing="0" width="484"><TR><TD bgcolor="ffffff" colspan="2" width="484"><TABLE border="0" cellpadding="0" cellspacing="0" width="484"><TR><TD bgcolor="#039acc" height="1" width="1"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD><TD bgcolor="#039acc" height="1" width="482"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="482"></TD><TD bgcolor="#0086b2" height="1" width="1"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD></TR><TR><TD bgcolor="#039acc" width="1"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD><TD bgcolor="#0086b2" width="482"><FONT color="#ffffff" face="arial,helvetica,sanserif"><IMG border="0" height="2" hspace="0" src="resources/void.gif" vspace="0" width="2"><B>Constructing a SAXParser</B></FONT></TD><TD bgcolor="#017299" width="1"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD></TR><TR><TD bgcolor="#0086b2" height="1" width="1"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD><TD bgcolor="#017299" height="1" width="482"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="482"></TD><TD bgcolor="#017299" height="1" width="1"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD></TR></TABLE></TD></TR><TR><TD width="10"> </TD><TD width="474"><FONT color="#000000" face="arial,helvetica,sanserif" size="-1">
|
---|
158 | <P>In order to use Xerces-C++ to parse XML files, you will
|
---|
159 | need to create an instance of the SAXParser class. The example
|
---|
160 | below shows the code you need in order to create an instance
|
---|
161 | of SAXParser. The DocumentHandler and ErrorHandler instances
|
---|
162 | required by the SAX API are provided using the HandlerBase
|
---|
163 | class supplied with Xerces-C++.</P>
|
---|
164 |
|
---|
165 | <DIV align="left"><TABLE border="0" cellpadding="0" cellspacing="4" width="464"><TR><TD bgcolor="#0086b2" height="1" width="1"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD><TD bgcolor="#0086b2" height="1" width="462"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="462"></TD><TD bgcolor="#0086b2" height="1" width="1"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD></TR><TR><TD bgcolor="#0086b2" width="1"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD><TD bgcolor="#ffffff" width="462"><FONT size="-1"><PRE>
|
---|
166 | #include <xercesc/parsers/SAXParser.hpp>
|
---|
167 | #include <xercesc/sax/HandlerBase.hpp>
|
---|
168 | #include <xercesc/util/XMLString.hpp>
|
---|
169 |
|
---|
170 | #if defined(XERCES_NEW_IOSTREAMS)
|
---|
171 | #include <iostream>
|
---|
172 | #else
|
---|
173 | #include <iostream.h>
|
---|
174 | #endif
|
---|
175 |
|
---|
176 | XERCES_CPP_NAMESPACE_USE
|
---|
177 |
|
---|
178 | int main (int argc, char* args[]) {
|
---|
179 |
|
---|
180 | try {
|
---|
181 | XMLPlatformUtils::Initialize();
|
---|
182 | }
|
---|
183 | catch (const XMLException& toCatch) {
|
---|
184 | char* message = XMLString::transcode(toCatch.getMessage());
|
---|
185 | cout << "Error during initialization! :\n"
|
---|
186 | << message << "\n";
|
---|
187 | XMLString::release(&message);
|
---|
188 | return 1;
|
---|
189 | }
|
---|
190 |
|
---|
191 | char* xmlFile = "x1.xml";
|
---|
192 | SAXParser* parser = new SAXParser();
|
---|
193 | parser->setDoValidation(true); // optional.
|
---|
194 | parser->setDoNamespaces(true); // optional
|
---|
195 |
|
---|
196 | DocumentHandler* docHandler = new HandlerBase();
|
---|
197 | ErrorHandler* errHandler = (ErrorHandler*) docHandler;
|
---|
198 | parser->setDocumentHandler(docHandler);
|
---|
199 | parser->setErrorHandler(errHandler);
|
---|
200 |
|
---|
201 | try {
|
---|
202 | parser->parse(xmlFile);
|
---|
203 | }
|
---|
204 | catch (const XMLException& toCatch) {
|
---|
205 | char* message = XMLString::transcode(toCatch.getMessage());
|
---|
206 | cout << "Exception message is: \n"
|
---|
207 | << message << "\n";
|
---|
208 | XMLString::release(&message);
|
---|
209 | return -1;
|
---|
210 | }
|
---|
211 | catch (const SAXParseException& toCatch) {
|
---|
212 | char* message = XMLString::transcode(toCatch.getMessage());
|
---|
213 | cout << "Exception message is: \n"
|
---|
214 | << message << "\n";
|
---|
215 | XMLString::release(&message);
|
---|
216 | return -1;
|
---|
217 | }
|
---|
218 | catch (...) {
|
---|
219 | cout << "Unexpected Exception \n" ;
|
---|
220 | return -1;
|
---|
221 | }
|
---|
222 |
|
---|
223 | delete parser;
|
---|
224 | delete docHandler;
|
---|
225 | return 0;
|
---|
226 | }</PRE></FONT></TD><TD bgcolor="#0086b2" width="1"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD></TR><TR><TD bgcolor="#0086b2" height="1" width="1"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD><TD bgcolor="#0086b2" height="1" width="462"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="462"></TD><TD bgcolor="#0086b2" height="1" width="1"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD></TR></TABLE></DIV>
|
---|
227 | </FONT></TD></TR></TABLE><BR>
|
---|
228 |
|
---|
229 | <A name="SAXFeatures"><!--anchor--></A>
|
---|
230 | <TABLE border="0" cellpadding="0" cellspacing="0" width="484"><TR><TD bgcolor="ffffff" colspan="2" width="484"><TABLE border="0" cellpadding="0" cellspacing="0" width="484"><TR><TD bgcolor="#039acc" height="1" width="1"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD><TD bgcolor="#039acc" height="1" width="482"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="482"></TD><TD bgcolor="#0086b2" height="1" width="1"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD></TR><TR><TD bgcolor="#039acc" width="1"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD><TD bgcolor="#0086b2" width="482"><FONT color="#ffffff" face="arial,helvetica,sanserif"><IMG border="0" height="2" hspace="0" src="resources/void.gif" vspace="0" width="2"><B>SAXParser Supported Features</B></FONT></TD><TD bgcolor="#017299" width="1"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD></TR><TR><TD bgcolor="#0086b2" height="1" width="1"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD><TD bgcolor="#017299" height="1" width="482"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="482"></TD><TD bgcolor="#017299" height="1" width="1"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD></TR></TABLE></TD></TR><TR><TD width="10"> </TD><TD width="474"><FONT color="#000000" face="arial,helvetica,sanserif" size="-1">
|
---|
231 |
|
---|
232 | <P>The behavior of the SAXParser is dependant on the values of the following features. All
|
---|
233 | of the features below are set using the "setter" methods (e.g. <CODE><FONT face="courier, monospaced">setDoNamespaces</FONT></CODE>),
|
---|
234 | and are queried using the corresponding "getter" methods (e.g. <CODE><FONT face="courier, monospaced">getDoNamespaces</FONT></CODE>).
|
---|
235 | The following only gives you a quick summary of supported features. Please
|
---|
236 | refer to <A href="api.html">API Documentation</A> for complete detail.
|
---|
237 | </P>
|
---|
238 | <P>None of these features can be modified in the middle of a parse, or an exception will be thrown.</P>
|
---|
239 |
|
---|
240 |
|
---|
241 | <A name="namespaces"><!--anchor--></A>
|
---|
242 | <TABLE border="0" cellpadding="2" cellspacing="2" width="100%">
|
---|
243 | <TR><TD align="center" bgcolor="#039acc" colspan="2" rowspan="1" valign="center"><FONT color="#ffffff" face="arial,helvetica,sanserif" size="-1"><B><B>void setDoNamespaces(const bool)</B></B>
|
---|
244 | </FONT></TD></TR>
|
---|
245 | <TR><TD align="center" bgcolor="#039acc" colspan="1" rowspan="1" valign="center"><FONT color="#ffffff" face="arial,helvetica,sanserif" size="-1"><B><B>true:</B></B>
|
---|
246 | </FONT></TD><TD align="" bgcolor="#a0ddf0" colspan="1" rowspan="1" valign="top"><FONT color="#000000" face="arial,helvetica,sanserif" size="-1"> Perform Namespace processing.
|
---|
247 | </FONT></TD></TR>
|
---|
248 | <TR><TD align="center" bgcolor="#039acc" colspan="1" rowspan="1" valign="center"><FONT color="#ffffff" face="arial,helvetica,sanserif" size="-1"><B><B>false:</B></B>
|
---|
249 | </FONT></TD><TD align="" bgcolor="#a0ddf0" colspan="1" rowspan="1" valign="top"><FONT color="#000000" face="arial,helvetica,sanserif" size="-1"> Do not perform Namespace processing.
|
---|
250 | </FONT></TD></TR>
|
---|
251 | <TR><TD align="center" bgcolor="#039acc" colspan="1" rowspan="1" valign="center"><FONT color="#ffffff" face="arial,helvetica,sanserif" size="-1"><B><B>default:</B></B>
|
---|
252 | </FONT></TD><TD align="" bgcolor="#a0ddf0" colspan="1" rowspan="1" valign="top"><FONT color="#000000" face="arial,helvetica,sanserif" size="-1"> false
|
---|
253 | </FONT></TD></TR>
|
---|
254 | <TR><TD align="center" bgcolor="#039acc" colspan="1" rowspan="1" valign="center"><FONT color="#ffffff" face="arial,helvetica,sanserif" size="-1"><B><B>note:</B></B>
|
---|
255 | </FONT></TD><TD align="" bgcolor="#a0ddf0" colspan="1" rowspan="1" valign="top"><FONT color="#000000" face="arial,helvetica,sanserif" size="-1"> If the validation scheme is set to Val_Always or Val_Auto, then the
|
---|
256 | document must contain a grammar that supports the use of namespaces.
|
---|
257 | </FONT></TD></TR>
|
---|
258 | <TR><TD align="center" bgcolor="#039acc" colspan="1" rowspan="1" valign="center"><FONT color="#ffffff" face="arial,helvetica,sanserif" size="-1"><B><B>see:</B></B>
|
---|
259 | </FONT></TD><TD align="" bgcolor="#a0ddf0" colspan="1" rowspan="1" valign="top"><FONT color="#000000" face="arial,helvetica,sanserif" size="-1">
|
---|
260 | <A href="#validation-dynamic">setValidationScheme</A>
|
---|
261 |
|
---|
262 | </FONT></TD></TR>
|
---|
263 | </TABLE>
|
---|
264 | <P></P>
|
---|
265 |
|
---|
266 | <A name="validation"><!--anchor--></A>
|
---|
267 | <TABLE border="0" cellpadding="2" cellspacing="2" width="100%">
|
---|
268 | <TR><TD align="center" bgcolor="#039acc" colspan="2" rowspan="1" valign="center"><FONT color="#ffffff" face="arial,helvetica,sanserif" size="-1"><B><B>void setDoValidation(const bool)</B> (deprecated) <BR>
|
---|
269 | please use <A href="#validation-dynamic">setValidationScheme</A>.
|
---|
270 | </B>
|
---|
271 | </FONT></TD></TR>
|
---|
272 | <TR><TD align="center" bgcolor="#039acc" colspan="1" rowspan="1" valign="center"><FONT color="#ffffff" face="arial,helvetica,sanserif" size="-1"><B><B>true:</B></B>
|
---|
273 | </FONT></TD><TD align="" bgcolor="#a0ddf0" colspan="1" rowspan="1" valign="top"><FONT color="#000000" face="arial,helvetica,sanserif" size="-1"> Report all validation errors.
|
---|
274 | </FONT></TD></TR>
|
---|
275 | <TR><TD align="center" bgcolor="#039acc" colspan="1" rowspan="1" valign="center"><FONT color="#ffffff" face="arial,helvetica,sanserif" size="-1"><B><B>false:</B></B>
|
---|
276 | </FONT></TD><TD align="" bgcolor="#a0ddf0" colspan="1" rowspan="1" valign="top"><FONT color="#000000" face="arial,helvetica,sanserif" size="-1"> Do not report validation errors.
|
---|
277 | </FONT></TD></TR>
|
---|
278 | <TR><TD align="center" bgcolor="#039acc" colspan="1" rowspan="1" valign="center"><FONT color="#ffffff" face="arial,helvetica,sanserif" size="-1"><B><B>default:</B></B>
|
---|
279 | </FONT></TD><TD align="" bgcolor="#a0ddf0" colspan="1" rowspan="1" valign="top"><FONT color="#000000" face="arial,helvetica,sanserif" size="-1"> see the default of
|
---|
280 | <A href="#validation-dynamic">setValidationScheme</A>.
|
---|
281 |
|
---|
282 | </FONT></TD></TR>
|
---|
283 | <TR><TD align="center" bgcolor="#039acc" colspan="1" rowspan="1" valign="center"><FONT color="#ffffff" face="arial,helvetica,sanserif" size="-1"><B><B>see:</B></B>
|
---|
284 | </FONT></TD><TD align="" bgcolor="#a0ddf0" colspan="1" rowspan="1" valign="top"><FONT color="#000000" face="arial,helvetica,sanserif" size="-1">
|
---|
285 | <A href="#validation-dynamic">setValidationScheme</A>
|
---|
286 |
|
---|
287 | </FONT></TD></TR>
|
---|
288 | </TABLE>
|
---|
289 |
|
---|
290 | <P></P>
|
---|
291 |
|
---|
292 | <A name="validation-dynamic"><!--anchor--></A>
|
---|
293 | <TABLE border="0" cellpadding="2" cellspacing="2" width="100%">
|
---|
294 | <TR><TD align="center" bgcolor="#039acc" colspan="2" rowspan="1" valign="center"><FONT color="#ffffff" face="arial,helvetica,sanserif" size="-1"><B><B>void setValidationScheme(const ValSchemes)</B></B>
|
---|
295 | </FONT></TD></TR>
|
---|
296 | <TR><TD align="center" bgcolor="#039acc" colspan="1" rowspan="1" valign="center"><FONT color="#ffffff" face="arial,helvetica,sanserif" size="-1"><B><B>Val_Auto:</B></B>
|
---|
297 | </FONT></TD><TD align="" bgcolor="#a0ddf0" colspan="1" rowspan="1" valign="top"><FONT color="#000000" face="arial,helvetica,sanserif" size="-1"> The parser will report validation errors only if a grammar is specified.
|
---|
298 | </FONT></TD></TR>
|
---|
299 | <TR><TD align="center" bgcolor="#039acc" colspan="1" rowspan="1" valign="center"><FONT color="#ffffff" face="arial,helvetica,sanserif" size="-1"><B><B>Val_Always:</B></B>
|
---|
300 | </FONT></TD><TD align="" bgcolor="#a0ddf0" colspan="1" rowspan="1" valign="top"><FONT color="#000000" face="arial,helvetica,sanserif" size="-1"> The parser will always report validation errors.
|
---|
301 | </FONT></TD></TR>
|
---|
302 | <TR><TD align="center" bgcolor="#039acc" colspan="1" rowspan="1" valign="center"><FONT color="#ffffff" face="arial,helvetica,sanserif" size="-1"><B><B>Val_Never:</B></B>
|
---|
303 | </FONT></TD><TD align="" bgcolor="#a0ddf0" colspan="1" rowspan="1" valign="top"><FONT color="#000000" face="arial,helvetica,sanserif" size="-1"> Do not report validation errors.
|
---|
304 | </FONT></TD></TR>
|
---|
305 | <TR><TD align="center" bgcolor="#039acc" colspan="1" rowspan="1" valign="center"><FONT color="#ffffff" face="arial,helvetica,sanserif" size="-1"><B><B>default:</B></B>
|
---|
306 | </FONT></TD><TD align="" bgcolor="#a0ddf0" colspan="1" rowspan="1" valign="top"><FONT color="#000000" face="arial,helvetica,sanserif" size="-1"> Val_Auto
|
---|
307 | </FONT></TD></TR>
|
---|
308 | <TR><TD align="center" bgcolor="#039acc" colspan="1" rowspan="1" valign="center"><FONT color="#ffffff" face="arial,helvetica,sanserif" size="-1"><B><B>note:</B></B>
|
---|
309 | </FONT></TD><TD align="" bgcolor="#a0ddf0" colspan="1" rowspan="1" valign="top"><FONT color="#000000" face="arial,helvetica,sanserif" size="-1"> If set to Val_Always, the document must
|
---|
310 | specify a grammar. If this feature is set to Val_Never and document specifies a grammar,
|
---|
311 | that grammar might be parsed but no validation of the document contents will be
|
---|
312 | performed.
|
---|
313 | </FONT></TD></TR>
|
---|
314 | <TR><TD align="center" bgcolor="#039acc" colspan="1" rowspan="1" valign="center"><FONT color="#ffffff" face="arial,helvetica,sanserif" size="-1"><B><B>see:</B></B>
|
---|
315 | </FONT></TD><TD align="" bgcolor="#a0ddf0" colspan="1" rowspan="1" valign="top"><FONT color="#000000" face="arial,helvetica,sanserif" size="-1">
|
---|
316 | <A href="#load-external-dtd">setLoadExternalDTD</A>
|
---|
317 |
|
---|
318 | </FONT></TD></TR>
|
---|
319 | </TABLE>
|
---|
320 |
|
---|
321 | <P></P>
|
---|
322 |
|
---|
323 | <A name="schema"><!--anchor--></A>
|
---|
324 | <TABLE border="0" cellpadding="2" cellspacing="2" width="100%">
|
---|
325 | <TR><TD align="center" bgcolor="#039acc" colspan="2" rowspan="1" valign="center"><FONT color="#ffffff" face="arial,helvetica,sanserif" size="-1"><B><B>void setDoSchema(const bool)</B></B>
|
---|
326 | </FONT></TD></TR>
|
---|
327 | <TR><TD align="center" bgcolor="#039acc" colspan="1" rowspan="1" valign="center"><FONT color="#ffffff" face="arial,helvetica,sanserif" size="-1"><B><B>true:</B></B>
|
---|
328 | </FONT></TD><TD align="" bgcolor="#a0ddf0" colspan="1" rowspan="1" valign="top"><FONT color="#000000" face="arial,helvetica,sanserif" size="-1"> Enable the parser's schema support.
|
---|
329 | </FONT></TD></TR>
|
---|
330 | <TR><TD align="center" bgcolor="#039acc" colspan="1" rowspan="1" valign="center"><FONT color="#ffffff" face="arial,helvetica,sanserif" size="-1"><B><B>false:</B></B>
|
---|
331 | </FONT></TD><TD align="" bgcolor="#a0ddf0" colspan="1" rowspan="1" valign="top"><FONT color="#000000" face="arial,helvetica,sanserif" size="-1"> Disable the parser's schema support.
|
---|
332 | </FONT></TD></TR>
|
---|
333 | <TR><TD align="center" bgcolor="#039acc" colspan="1" rowspan="1" valign="center"><FONT color="#ffffff" face="arial,helvetica,sanserif" size="-1"><B><B>default:</B></B>
|
---|
334 | </FONT></TD><TD align="" bgcolor="#a0ddf0" colspan="1" rowspan="1" valign="top"><FONT color="#000000" face="arial,helvetica,sanserif" size="-1"> false
|
---|
335 | </FONT></TD></TR>
|
---|
336 | <TR><TD align="center" bgcolor="#039acc" colspan="1" rowspan="1" valign="center"><FONT color="#ffffff" face="arial,helvetica,sanserif" size="-1"><B><B>note</B></B>
|
---|
337 | </FONT></TD><TD align="" bgcolor="#a0ddf0" colspan="1" rowspan="1" valign="top"><FONT color="#000000" face="arial,helvetica,sanserif" size="-1"> If set to true, namespace processing must also be turned on.
|
---|
338 | </FONT></TD></TR>
|
---|
339 | <TR><TD align="center" bgcolor="#039acc" colspan="1" rowspan="1" valign="center"><FONT color="#ffffff" face="arial,helvetica,sanserif" size="-1"><B><B>see:</B></B>
|
---|
340 | </FONT></TD><TD align="" bgcolor="#a0ddf0" colspan="1" rowspan="1" valign="top"><FONT color="#000000" face="arial,helvetica,sanserif" size="-1">
|
---|
341 | <A href="#namespaces">setDoNamespaces</A>
|
---|
342 |
|
---|
343 | </FONT></TD></TR>
|
---|
344 | </TABLE>
|
---|
345 |
|
---|
346 | <P></P>
|
---|
347 |
|
---|
348 | <TABLE border="0" cellpadding="2" cellspacing="2" width="100%">
|
---|
349 | <TR><TD align="center" bgcolor="#039acc" colspan="2" rowspan="1" valign="center"><FONT color="#ffffff" face="arial,helvetica,sanserif" size="-1"><B><B>void setValidationSchemaFullChecking(const bool)</B></B>
|
---|
350 | </FONT></TD></TR>
|
---|
351 | <TR><TD align="center" bgcolor="#039acc" colspan="1" rowspan="1" valign="center"><FONT color="#ffffff" face="arial,helvetica,sanserif" size="-1"><B><B>true:</B></B>
|
---|
352 | </FONT></TD><TD align="" bgcolor="#a0ddf0" colspan="1" rowspan="1" valign="top"><FONT color="#000000" face="arial,helvetica,sanserif" size="-1"> Enable full schema constraint checking, including checking
|
---|
353 | which may be time-consuming or memory intensive. Currently, particle unique
|
---|
354 | attribution constraint checking and particle derivation restriction checking
|
---|
355 | are controlled by this option.
|
---|
356 | </FONT></TD></TR>
|
---|
357 | <TR><TD align="center" bgcolor="#039acc" colspan="1" rowspan="1" valign="center"><FONT color="#ffffff" face="arial,helvetica,sanserif" size="-1"><B><B>false:</B></B>
|
---|
358 | </FONT></TD><TD align="" bgcolor="#a0ddf0" colspan="1" rowspan="1" valign="top"><FONT color="#000000" face="arial,helvetica,sanserif" size="-1"> Disable full schema constraint checking.
|
---|
359 | </FONT></TD></TR>
|
---|
360 | <TR><TD align="center" bgcolor="#039acc" colspan="1" rowspan="1" valign="center"><FONT color="#ffffff" face="arial,helvetica,sanserif" size="-1"><B><B>default:</B></B>
|
---|
361 | </FONT></TD><TD align="" bgcolor="#a0ddf0" colspan="1" rowspan="1" valign="top"><FONT color="#000000" face="arial,helvetica,sanserif" size="-1"> false
|
---|
362 | </FONT></TD></TR>
|
---|
363 | <TR><TD align="center" bgcolor="#039acc" colspan="1" rowspan="1" valign="center"><FONT color="#ffffff" face="arial,helvetica,sanserif" size="-1"><B><B>note:</B></B>
|
---|
364 | </FONT></TD><TD align="" bgcolor="#a0ddf0" colspan="1" rowspan="1" valign="top"><FONT color="#000000" face="arial,helvetica,sanserif" size="-1"> This feature checks the Schema grammar itself for
|
---|
365 | additional errors that are time-consuming or memory intensive. It does <B>not</B> affect the
|
---|
366 | level of checking performed on document instances that use Schema grammars.
|
---|
367 | </FONT></TD></TR>
|
---|
368 | <TR><TD align="center" bgcolor="#039acc" colspan="1" rowspan="1" valign="center"><FONT color="#ffffff" face="arial,helvetica,sanserif" size="-1"><B><B>see:</B></B>
|
---|
369 | </FONT></TD><TD align="" bgcolor="#a0ddf0" colspan="1" rowspan="1" valign="top"><FONT color="#000000" face="arial,helvetica,sanserif" size="-1">
|
---|
370 | <A href="#schema">setDoSchema</A>
|
---|
371 |
|
---|
372 | </FONT></TD></TR>
|
---|
373 | </TABLE>
|
---|
374 |
|
---|
375 | <P></P>
|
---|
376 |
|
---|
377 | <A name="load-external-dtd"><!--anchor--></A>
|
---|
378 | <TABLE border="0" cellpadding="2" cellspacing="2" width="100%">
|
---|
379 | <TR><TD align="center" bgcolor="#039acc" colspan="2" rowspan="1" valign="center"><FONT color="#ffffff" face="arial,helvetica,sanserif" size="-1"><B><B>void setLoadExternalDTD(const bool)</B></B>
|
---|
380 | </FONT></TD></TR>
|
---|
381 | <TR><TD align="center" bgcolor="#039acc" colspan="1" rowspan="1" valign="center"><FONT color="#ffffff" face="arial,helvetica,sanserif" size="-1"><B><B>true:</B></B>
|
---|
382 | </FONT></TD><TD align="" bgcolor="#a0ddf0" colspan="1" rowspan="1" valign="top"><FONT color="#000000" face="arial,helvetica,sanserif" size="-1"> Load the External DTD.
|
---|
383 | </FONT></TD></TR>
|
---|
384 | <TR><TD align="center" bgcolor="#039acc" colspan="1" rowspan="1" valign="center"><FONT color="#ffffff" face="arial,helvetica,sanserif" size="-1"><B><B>false:</B></B>
|
---|
385 | </FONT></TD><TD align="" bgcolor="#a0ddf0" colspan="1" rowspan="1" valign="top"><FONT color="#000000" face="arial,helvetica,sanserif" size="-1"> Ignore the external DTD completely.
|
---|
386 | </FONT></TD></TR>
|
---|
387 | <TR><TD align="center" bgcolor="#039acc" colspan="1" rowspan="1" valign="center"><FONT color="#ffffff" face="arial,helvetica,sanserif" size="-1"><B><B>default:</B></B>
|
---|
388 | </FONT></TD><TD align="" bgcolor="#a0ddf0" colspan="1" rowspan="1" valign="top"><FONT color="#000000" face="arial,helvetica,sanserif" size="-1"> true
|
---|
389 | </FONT></TD></TR>
|
---|
390 | <TR><TD align="center" bgcolor="#039acc" colspan="1" rowspan="1" valign="center"><FONT color="#ffffff" face="arial,helvetica,sanserif" size="-1"><B><B>note</B></B>
|
---|
391 | </FONT></TD><TD align="" bgcolor="#a0ddf0" colspan="1" rowspan="1" valign="top"><FONT color="#000000" face="arial,helvetica,sanserif" size="-1"> This feature is ignored and DTD is always loaded
|
---|
392 | if the validation scheme is set to Val_Always or Val_Auto.
|
---|
393 | </FONT></TD></TR>
|
---|
394 | <TR><TD align="center" bgcolor="#039acc" colspan="1" rowspan="1" valign="center"><FONT color="#ffffff" face="arial,helvetica,sanserif" size="-1"><B><B>see:</B></B>
|
---|
395 | </FONT></TD><TD align="" bgcolor="#a0ddf0" colspan="1" rowspan="1" valign="top"><FONT color="#000000" face="arial,helvetica,sanserif" size="-1">
|
---|
396 | <A href="#validation-dynamic">setValidationScheme</A>
|
---|
397 |
|
---|
398 | </FONT></TD></TR>
|
---|
399 | </TABLE>
|
---|
400 |
|
---|
401 | <P></P>
|
---|
402 |
|
---|
403 | <A name="continue-after-fatal"><!--anchor--></A>
|
---|
404 | <TABLE border="0" cellpadding="2" cellspacing="2" width="100%">
|
---|
405 | <TR><TD align="center" bgcolor="#039acc" colspan="2" rowspan="1" valign="center"><FONT color="#ffffff" face="arial,helvetica,sanserif" size="-1"><B><B>void setExitOnFirstFatalError(const bool)</B></B>
|
---|
406 | </FONT></TD></TR>
|
---|
407 | <TR><TD align="center" bgcolor="#039acc" colspan="1" rowspan="1" valign="center"><FONT color="#ffffff" face="arial,helvetica,sanserif" size="-1"><B><B>true:</B></B>
|
---|
408 | </FONT></TD><TD align="" bgcolor="#a0ddf0" colspan="1" rowspan="1" valign="top"><FONT color="#000000" face="arial,helvetica,sanserif" size="-1"> Stops parse on first fatal error.
|
---|
409 | </FONT></TD></TR>
|
---|
410 | <TR><TD align="center" bgcolor="#039acc" colspan="1" rowspan="1" valign="center"><FONT color="#ffffff" face="arial,helvetica,sanserif" size="-1"><B><B>false:</B></B>
|
---|
411 | </FONT></TD><TD align="" bgcolor="#a0ddf0" colspan="1" rowspan="1" valign="top"><FONT color="#000000" face="arial,helvetica,sanserif" size="-1"> Attempt to continue parsing after a fatal error.
|
---|
412 | </FONT></TD></TR>
|
---|
413 | <TR><TD align="center" bgcolor="#039acc" colspan="1" rowspan="1" valign="center"><FONT color="#ffffff" face="arial,helvetica,sanserif" size="-1"><B><B>default:</B></B>
|
---|
414 | </FONT></TD><TD align="" bgcolor="#a0ddf0" colspan="1" rowspan="1" valign="top"><FONT color="#000000" face="arial,helvetica,sanserif" size="-1"> true
|
---|
415 | </FONT></TD></TR>
|
---|
416 | <TR><TD align="center" bgcolor="#039acc" colspan="1" rowspan="1" valign="center"><FONT color="#ffffff" face="arial,helvetica,sanserif" size="-1"><B><B>note:</B></B>
|
---|
417 | </FONT></TD><TD align="" bgcolor="#a0ddf0" colspan="1" rowspan="1" valign="top"><FONT color="#000000" face="arial,helvetica,sanserif" size="-1"> The behavior of the parser when this feature is set to
|
---|
418 | false is <B>undetermined</B>! Therefore use this feature with extreme caution because
|
---|
419 | the parser may get stuck in an infinite loop or worse.
|
---|
420 | </FONT></TD></TR>
|
---|
421 | </TABLE>
|
---|
422 |
|
---|
423 | <P></P>
|
---|
424 |
|
---|
425 | <TABLE border="0" cellpadding="2" cellspacing="2" width="100%">
|
---|
426 | <TR><TD align="center" bgcolor="#039acc" colspan="2" rowspan="1" valign="center"><FONT color="#ffffff" face="arial,helvetica,sanserif" size="-1"><B><B>void setValidationConstraintFatal(const bool)</B></B>
|
---|
427 | </FONT></TD></TR>
|
---|
428 | <TR><TD align="center" bgcolor="#039acc" colspan="1" rowspan="1" valign="center"><FONT color="#ffffff" face="arial,helvetica,sanserif" size="-1"><B><B>true:</B></B>
|
---|
429 | </FONT></TD><TD align="" bgcolor="#a0ddf0" colspan="1" rowspan="1" valign="top"><FONT color="#000000" face="arial,helvetica,sanserif" size="-1"> The parser will treat validation error as fatal and will
|
---|
430 | exit depends on the state of
|
---|
431 | <A href="#continue-after-fatal">setExitOnFirstFatalError</A>.
|
---|
432 |
|
---|
433 | </FONT></TD></TR>
|
---|
434 | <TR><TD align="center" bgcolor="#039acc" colspan="1" rowspan="1" valign="center"><FONT color="#ffffff" face="arial,helvetica,sanserif" size="-1"><B><B>false:</B></B>
|
---|
435 | </FONT></TD><TD align="" bgcolor="#a0ddf0" colspan="1" rowspan="1" valign="top"><FONT color="#000000" face="arial,helvetica,sanserif" size="-1"> The parser will report the error and continue processing.
|
---|
436 | </FONT></TD></TR>
|
---|
437 | <TR><TD align="center" bgcolor="#039acc" colspan="1" rowspan="1" valign="center"><FONT color="#ffffff" face="arial,helvetica,sanserif" size="-1"><B><B>default:</B></B>
|
---|
438 | </FONT></TD><TD align="" bgcolor="#a0ddf0" colspan="1" rowspan="1" valign="top"><FONT color="#000000" face="arial,helvetica,sanserif" size="-1"> false
|
---|
439 | </FONT></TD></TR>
|
---|
440 | <TR><TD align="center" bgcolor="#039acc" colspan="1" rowspan="1" valign="center"><FONT color="#ffffff" face="arial,helvetica,sanserif" size="-1"><B><B>note:</B></B>
|
---|
441 | </FONT></TD><TD align="" bgcolor="#a0ddf0" colspan="1" rowspan="1" valign="top"><FONT color="#000000" face="arial,helvetica,sanserif" size="-1"> Setting this true does not mean the validation error will
|
---|
442 | be printed with the word "Fatal Error". It is still printed as "Error", but the parser
|
---|
443 | will exit if
|
---|
444 | <A href="#continue-after-fatal">setExitOnFirstFatalError</A>
|
---|
445 | is set to true.
|
---|
446 | </FONT></TD></TR>
|
---|
447 | <TR><TD align="center" bgcolor="#039acc" colspan="1" rowspan="1" valign="center"><FONT color="#ffffff" face="arial,helvetica,sanserif" size="-1"><B><B>see:</B></B>
|
---|
448 | </FONT></TD><TD align="" bgcolor="#a0ddf0" colspan="1" rowspan="1" valign="top"><FONT color="#000000" face="arial,helvetica,sanserif" size="-1">
|
---|
449 | <A href="#continue-after-fatal">setExitOnFirstFatalError</A>
|
---|
450 |
|
---|
451 | </FONT></TD></TR>
|
---|
452 | </TABLE>
|
---|
453 |
|
---|
454 | <P></P>
|
---|
455 |
|
---|
456 | <A name="use-cached"><!--anchor--></A>
|
---|
457 | <TABLE border="0" cellpadding="2" cellspacing="2" width="100%">
|
---|
458 | <TR><TD align="center" bgcolor="#039acc" colspan="2" rowspan="1" valign="center"><FONT color="#ffffff" face="arial,helvetica,sanserif" size="-1"><B><B>void useCachedGrammarInParse(const bool)</B></B>
|
---|
459 | </FONT></TD></TR>
|
---|
460 | <TR><TD align="center" bgcolor="#039acc" colspan="1" rowspan="1" valign="center"><FONT color="#ffffff" face="arial,helvetica,sanserif" size="-1"><B><B>true:</B></B>
|
---|
461 | </FONT></TD><TD align="" bgcolor="#a0ddf0" colspan="1" rowspan="1" valign="top"><FONT color="#000000" face="arial,helvetica,sanserif" size="-1">Use cached grammar if it exists in the pool.
|
---|
462 | </FONT></TD></TR>
|
---|
463 | <TR><TD align="center" bgcolor="#039acc" colspan="1" rowspan="1" valign="center"><FONT color="#ffffff" face="arial,helvetica,sanserif" size="-1"><B><B>false:</B></B>
|
---|
464 | </FONT></TD><TD align="" bgcolor="#a0ddf0" colspan="1" rowspan="1" valign="top"><FONT color="#000000" face="arial,helvetica,sanserif" size="-1">Parse the schema grammar.
|
---|
465 | </FONT></TD></TR>
|
---|
466 | <TR><TD align="center" bgcolor="#039acc" colspan="1" rowspan="1" valign="center"><FONT color="#ffffff" face="arial,helvetica,sanserif" size="-1"><B><B>default:</B></B>
|
---|
467 | </FONT></TD><TD align="" bgcolor="#a0ddf0" colspan="1" rowspan="1" valign="top"><FONT color="#000000" face="arial,helvetica,sanserif" size="-1"> false
|
---|
468 | </FONT></TD></TR>
|
---|
469 | <TR><TD align="center" bgcolor="#039acc" colspan="1" rowspan="1" valign="center"><FONT color="#ffffff" face="arial,helvetica,sanserif" size="-1"><B><B>note:</B></B>
|
---|
470 | </FONT></TD><TD align="" bgcolor="#a0ddf0" colspan="1" rowspan="1" valign="top"><FONT color="#000000" face="arial,helvetica,sanserif" size="-1">The getter function for this method is called isUsingCachedGrammarInParse.
|
---|
471 | </FONT></TD></TR>
|
---|
472 | <TR><TD align="center" bgcolor="#039acc" colspan="1" rowspan="1" valign="center"><FONT color="#ffffff" face="arial,helvetica,sanserif" size="-1"><B><B>note:</B></B>
|
---|
473 | </FONT></TD><TD align="" bgcolor="#a0ddf0" colspan="1" rowspan="1" valign="top"><FONT color="#000000" face="arial,helvetica,sanserif" size="-1">If the grammar caching option is enabled, this option is set to true automatically.
|
---|
474 | Any setting to this option by the users is a no-op.
|
---|
475 | </FONT></TD></TR>
|
---|
476 | <TR><TD align="center" bgcolor="#039acc" colspan="1" rowspan="1" valign="center"><FONT color="#ffffff" face="arial,helvetica,sanserif" size="-1"><B><B>see:</B></B>
|
---|
477 | </FONT></TD><TD align="" bgcolor="#a0ddf0" colspan="1" rowspan="1" valign="top"><FONT color="#000000" face="arial,helvetica,sanserif" size="-1">
|
---|
478 | <A href="#cache-grammar">cacheGrammarFromParse</A>
|
---|
479 |
|
---|
480 | </FONT></TD></TR>
|
---|
481 | </TABLE>
|
---|
482 |
|
---|
483 | <P></P>
|
---|
484 |
|
---|
485 | <A name="cache-grammar"><!--anchor--></A>
|
---|
486 | <TABLE border="0" cellpadding="2" cellspacing="2" width="100%">
|
---|
487 | <TR><TD align="center" bgcolor="#039acc" colspan="2" rowspan="1" valign="center"><FONT color="#ffffff" face="arial,helvetica,sanserif" size="-1"><B><B>void cacheGrammarFromParse(const bool)</B></B>
|
---|
488 | </FONT></TD></TR>
|
---|
489 | <TR><TD align="center" bgcolor="#039acc" colspan="1" rowspan="1" valign="center"><FONT color="#ffffff" face="arial,helvetica,sanserif" size="-1"><B><B>true:</B></B>
|
---|
490 | </FONT></TD><TD align="" bgcolor="#a0ddf0" colspan="1" rowspan="1" valign="top"><FONT color="#000000" face="arial,helvetica,sanserif" size="-1">Cache the grammar in the pool for re-use in subsequent parses.
|
---|
491 | </FONT></TD></TR>
|
---|
492 | <TR><TD align="center" bgcolor="#039acc" colspan="1" rowspan="1" valign="center"><FONT color="#ffffff" face="arial,helvetica,sanserif" size="-1"><B><B>false:</B></B>
|
---|
493 | </FONT></TD><TD align="" bgcolor="#a0ddf0" colspan="1" rowspan="1" valign="top"><FONT color="#000000" face="arial,helvetica,sanserif" size="-1">Do not cache the grammar in the pool
|
---|
494 | </FONT></TD></TR>
|
---|
495 | <TR><TD align="center" bgcolor="#039acc" colspan="1" rowspan="1" valign="center"><FONT color="#ffffff" face="arial,helvetica,sanserif" size="-1"><B><B>default:</B></B>
|
---|
496 | </FONT></TD><TD align="" bgcolor="#a0ddf0" colspan="1" rowspan="1" valign="top"><FONT color="#000000" face="arial,helvetica,sanserif" size="-1"> false
|
---|
497 | </FONT></TD></TR>
|
---|
498 | <TR><TD align="center" bgcolor="#039acc" colspan="1" rowspan="1" valign="center"><FONT color="#ffffff" face="arial,helvetica,sanserif" size="-1"><B><B>note:</B></B>
|
---|
499 | </FONT></TD><TD align="" bgcolor="#a0ddf0" colspan="1" rowspan="1" valign="top"><FONT color="#000000" face="arial,helvetica,sanserif" size="-1">The getter function for this method is called isCachingGrammarFromParse
|
---|
500 | </FONT></TD></TR>
|
---|
501 | <TR><TD align="center" bgcolor="#039acc" colspan="1" rowspan="1" valign="center"><FONT color="#ffffff" face="arial,helvetica,sanserif" size="-1"><B><B>note:</B></B>
|
---|
502 | </FONT></TD><TD align="" bgcolor="#a0ddf0" colspan="1" rowspan="1" valign="top"><FONT color="#000000" face="arial,helvetica,sanserif" size="-1"> If set to true, the useCachedGrammarInParse
|
---|
503 | is also set to true automatically.
|
---|
504 | </FONT></TD></TR>
|
---|
505 | <TR><TD align="center" bgcolor="#039acc" colspan="1" rowspan="1" valign="center"><FONT color="#ffffff" face="arial,helvetica,sanserif" size="-1"><B><B>see:</B></B>
|
---|
506 | </FONT></TD><TD align="" bgcolor="#a0ddf0" colspan="1" rowspan="1" valign="top"><FONT color="#000000" face="arial,helvetica,sanserif" size="-1">
|
---|
507 | <A href="#use-cached">useCachedGrammarInParse</A>
|
---|
508 |
|
---|
509 | </FONT></TD></TR>
|
---|
510 | </TABLE>
|
---|
511 |
|
---|
512 | <P></P>
|
---|
513 |
|
---|
514 | <A name="StandardUriConformant"><!--anchor--></A>
|
---|
515 | <TABLE border="0" cellpadding="2" cellspacing="2" width="100%">
|
---|
516 | <TR><TD align="center" bgcolor="#039acc" colspan="2" rowspan="1" valign="center"><FONT color="#ffffff" face="arial,helvetica,sanserif" size="-1"><B><B>void setStandardUriConformant(const bool)</B></B>
|
---|
517 | </FONT></TD></TR>
|
---|
518 | <TR><TD align="center" bgcolor="#039acc" colspan="1" rowspan="1" valign="center"><FONT color="#ffffff" face="arial,helvetica,sanserif" size="-1"><B><B>true:</B></B>
|
---|
519 | </FONT></TD><TD align="" bgcolor="#a0ddf0" colspan="1" rowspan="1" valign="top"><FONT color="#000000" face="arial,helvetica,sanserif" size="-1"> Force standard uri conformance.
|
---|
520 | </FONT></TD></TR>
|
---|
521 | <TR><TD align="center" bgcolor="#039acc" colspan="1" rowspan="1" valign="center"><FONT color="#ffffff" face="arial,helvetica,sanserif" size="-1"><B><B>false:</B></B>
|
---|
522 | </FONT></TD><TD align="" bgcolor="#a0ddf0" colspan="1" rowspan="1" valign="top"><FONT color="#000000" face="arial,helvetica,sanserif" size="-1"> Do not force standard uri conformance.
|
---|
523 | </FONT></TD></TR>
|
---|
524 | <TR><TD align="center" bgcolor="#039acc" colspan="1" rowspan="1" valign="center"><FONT color="#ffffff" face="arial,helvetica,sanserif" size="-1"><B><B>default:</B></B>
|
---|
525 | </FONT></TD><TD align="" bgcolor="#a0ddf0" colspan="1" rowspan="1" valign="top"><FONT color="#000000" face="arial,helvetica,sanserif" size="-1"> false
|
---|
526 | </FONT></TD></TR>
|
---|
527 | <TR><TD align="center" bgcolor="#039acc" colspan="1" rowspan="1" valign="center"><FONT color="#ffffff" face="arial,helvetica,sanserif" size="-1"><B><B>note:</B></B>
|
---|
528 | </FONT></TD><TD align="" bgcolor="#a0ddf0" colspan="1" rowspan="1" valign="top"><FONT color="#000000" face="arial,helvetica,sanserif" size="-1"> If set to true, malformed uri will be rejected
|
---|
529 | and fatal error will be issued.
|
---|
530 | </FONT></TD></TR>
|
---|
531 | </TABLE>
|
---|
532 | <P></P>
|
---|
533 |
|
---|
534 | <A name="CalculateSrcOffset"><!--anchor--></A>
|
---|
535 | <TABLE border="0" cellpadding="2" cellspacing="2" width="100%">
|
---|
536 | <TR><TD align="center" bgcolor="#039acc" colspan="2" rowspan="1" valign="center"><FONT color="#ffffff" face="arial,helvetica,sanserif" size="-1"><B><B>void setCalculateSrcOfs(const bool)</B></B>
|
---|
537 | </FONT></TD></TR>
|
---|
538 | <TR><TD align="center" bgcolor="#039acc" colspan="1" rowspan="1" valign="center"><FONT color="#ffffff" face="arial,helvetica,sanserif" size="-1"><B><B>true:</B></B>
|
---|
539 | </FONT></TD><TD align="" bgcolor="#a0ddf0" colspan="1" rowspan="1" valign="top"><FONT color="#000000" face="arial,helvetica,sanserif" size="-1"> Enable src offset calculation.
|
---|
540 | </FONT></TD></TR>
|
---|
541 | <TR><TD align="center" bgcolor="#039acc" colspan="1" rowspan="1" valign="center"><FONT color="#ffffff" face="arial,helvetica,sanserif" size="-1"><B><B>false:</B></B>
|
---|
542 | </FONT></TD><TD align="" bgcolor="#a0ddf0" colspan="1" rowspan="1" valign="top"><FONT color="#000000" face="arial,helvetica,sanserif" size="-1"> Disable src offset calculation.
|
---|
543 | </FONT></TD></TR>
|
---|
544 | <TR><TD align="center" bgcolor="#039acc" colspan="1" rowspan="1" valign="center"><FONT color="#ffffff" face="arial,helvetica,sanserif" size="-1"><B><B>default:</B></B>
|
---|
545 | </FONT></TD><TD align="" bgcolor="#a0ddf0" colspan="1" rowspan="1" valign="top"><FONT color="#000000" face="arial,helvetica,sanserif" size="-1"> false
|
---|
546 | </FONT></TD></TR>
|
---|
547 | <TR><TD align="center" bgcolor="#039acc" colspan="1" rowspan="1" valign="center"><FONT color="#ffffff" face="arial,helvetica,sanserif" size="-1"><B><B>note:</B></B>
|
---|
548 | </FONT></TD><TD align="" bgcolor="#a0ddf0" colspan="1" rowspan="1" valign="top"><FONT color="#000000" face="arial,helvetica,sanserif" size="-1"> If set to true, the user can inquire about
|
---|
549 | the current src offset within the input source. Setting it to false (default)
|
---|
550 | improves the performance.
|
---|
551 | </FONT></TD></TR>
|
---|
552 | </TABLE>
|
---|
553 | <P></P>
|
---|
554 |
|
---|
555 | <A name="IdentityConstraintChecking"><!--anchor--></A>
|
---|
556 | <TABLE border="0" cellpadding="2" cellspacing="2" width="100%">
|
---|
557 | <TR><TD align="center" bgcolor="#039acc" colspan="2" rowspan="1" valign="center"><FONT color="#ffffff" face="arial,helvetica,sanserif" size="-1"><B><B>void setIdentityConstraintChecking(const bool);</B></B>
|
---|
558 | </FONT></TD></TR>
|
---|
559 | <TR><TD align="center" bgcolor="#039acc" colspan="1" rowspan="1" valign="center"><FONT color="#ffffff" face="arial,helvetica,sanserif" size="-1"><B><B>true:</B></B>
|
---|
560 | </FONT></TD><TD align="" bgcolor="#a0ddf0" colspan="1" rowspan="1" valign="top"><FONT color="#000000" face="arial,helvetica,sanserif" size="-1"> Enable identity constraint checking.
|
---|
561 | </FONT></TD></TR>
|
---|
562 | <TR><TD align="center" bgcolor="#039acc" colspan="1" rowspan="1" valign="center"><FONT color="#ffffff" face="arial,helvetica,sanserif" size="-1"><B><B>false:</B></B>
|
---|
563 | </FONT></TD><TD align="" bgcolor="#a0ddf0" colspan="1" rowspan="1" valign="top"><FONT color="#000000" face="arial,helvetica,sanserif" size="-1"> Disable identity constraint checking.
|
---|
564 | </FONT></TD></TR>
|
---|
565 | <TR><TD align="center" bgcolor="#039acc" colspan="1" rowspan="1" valign="center"><FONT color="#ffffff" face="arial,helvetica,sanserif" size="-1"><B><B>default:</B></B>
|
---|
566 | </FONT></TD><TD align="" bgcolor="#a0ddf0" colspan="1" rowspan="1" valign="top"><FONT color="#000000" face="arial,helvetica,sanserif" size="-1"> true
|
---|
567 | </FONT></TD></TR>
|
---|
568 | </TABLE>
|
---|
569 | <P></P>
|
---|
570 |
|
---|
571 | <A name="GenerateSyntheticAnnotations"><!--anchor--></A>
|
---|
572 | <TABLE border="0" cellpadding="2" cellspacing="2" width="100%">
|
---|
573 | <TR><TD align="center" bgcolor="#039acc" colspan="2" rowspan="1" valign="center"><FONT color="#ffffff" face="arial,helvetica,sanserif" size="-1"><B><B>void setGenerateSyntheticAnnotations(const bool);</B></B>
|
---|
574 | </FONT></TD></TR>
|
---|
575 | <TR><TD align="center" bgcolor="#039acc" colspan="1" rowspan="1" valign="center"><FONT color="#ffffff" face="arial,helvetica,sanserif" size="-1"><B><B>true:</B></B>
|
---|
576 | </FONT></TD><TD align="" bgcolor="#a0ddf0" colspan="1" rowspan="1" valign="top"><FONT color="#000000" face="arial,helvetica,sanserif" size="-1"> Enable generation of synthetic annotations. A synthetic annotation will be
|
---|
577 | generated when a schema component has non-schema attributes but no child annotation.
|
---|
578 | </FONT></TD></TR>
|
---|
579 | <TR><TD align="center" bgcolor="#039acc" colspan="1" rowspan="1" valign="center"><FONT color="#ffffff" face="arial,helvetica,sanserif" size="-1"><B><B>false:</B></B>
|
---|
580 | </FONT></TD><TD align="" bgcolor="#a0ddf0" colspan="1" rowspan="1" valign="top"><FONT color="#000000" face="arial,helvetica,sanserif" size="-1"> Disable generation of synthetic annotations.
|
---|
581 | </FONT></TD></TR>
|
---|
582 | <TR><TD align="center" bgcolor="#039acc" colspan="1" rowspan="1" valign="center"><FONT color="#ffffff" face="arial,helvetica,sanserif" size="-1"><B><B>default:</B></B>
|
---|
583 | </FONT></TD><TD align="" bgcolor="#a0ddf0" colspan="1" rowspan="1" valign="top"><FONT color="#000000" face="arial,helvetica,sanserif" size="-1"> false
|
---|
584 | </FONT></TD></TR>
|
---|
585 | </TABLE>
|
---|
586 | <P></P>
|
---|
587 |
|
---|
588 | <A name="XercesValidateAnnotations"><!--anchor--></A>
|
---|
589 | <TABLE border="0" cellpadding="2" cellspacing="2" width="100%">
|
---|
590 | <TR><TD align="center" bgcolor="#039acc" colspan="2" rowspan="1" valign="center"><FONT color="#ffffff" face="arial,helvetica,sanserif" size="-1"><B><B>setValidateAnnotation</B></B>
|
---|
591 | </FONT></TD></TR>
|
---|
592 | <TR><TD align="center" bgcolor="#039acc" colspan="1" rowspan="1" valign="center"><FONT color="#ffffff" face="arial,helvetica,sanserif" size="-1"><B><B>true:</B></B>
|
---|
593 | </FONT></TD><TD align="" bgcolor="#a0ddf0" colspan="1" rowspan="1" valign="top"><FONT color="#000000" face="arial,helvetica,sanserif" size="-1"> Enable validation of annotations.
|
---|
594 | </FONT></TD></TR>
|
---|
595 | <TR><TD align="center" bgcolor="#039acc" colspan="1" rowspan="1" valign="center"><FONT color="#ffffff" face="arial,helvetica,sanserif" size="-1"><B><B>false:</B></B>
|
---|
596 | </FONT></TD><TD align="" bgcolor="#a0ddf0" colspan="1" rowspan="1" valign="top"><FONT color="#000000" face="arial,helvetica,sanserif" size="-1"> Disable validation of annotations.
|
---|
597 | </FONT></TD></TR>
|
---|
598 | <TR><TD align="center" bgcolor="#039acc" colspan="1" rowspan="1" valign="center"><FONT color="#ffffff" face="arial,helvetica,sanserif" size="-1"><B><B>default:</B></B>
|
---|
599 | </FONT></TD><TD align="" bgcolor="#a0ddf0" colspan="1" rowspan="1" valign="top"><FONT color="#000000" face="arial,helvetica,sanserif" size="-1"> false
|
---|
600 | </FONT></TD></TR>
|
---|
601 | </TABLE>
|
---|
602 | <P></P>
|
---|
603 |
|
---|
604 | <TABLE border="0" cellpadding="2" cellspacing="2" width="100%">
|
---|
605 | <TR><TD align="center" bgcolor="#039acc" colspan="2" rowspan="1" valign="center"><FONT color="#ffffff" face="arial,helvetica,sanserif" size="-1"><B><B>void setExternalSchemaLocation(const XMLCh* const)</B></B>
|
---|
606 | </FONT></TD></TR>
|
---|
607 | <TR><TD align="center" bgcolor="#039acc" colspan="1" rowspan="1" valign="center"><FONT color="#ffffff" face="arial,helvetica,sanserif" size="-1"><B><B>Description</B></B>
|
---|
608 | </FONT></TD><TD align="" bgcolor="#a0ddf0" colspan="1" rowspan="1" valign="top"><FONT color="#000000" face="arial,helvetica,sanserif" size="-1"> The XML Schema Recommendation explicitly states that
|
---|
609 | the inclusion of schemaLocation/ noNamespaceSchemaLocation attributes in the
|
---|
610 | instance document is only a hint; it does not mandate that these attributes
|
---|
611 | must be used to locate schemas. Similar situation happens to <import>
|
---|
612 | element in schema documents. This property allows the user to specify a list
|
---|
613 | of schemas to use. If the targetNamespace of a schema specified using this
|
---|
614 | method matches the targetNamespace of a schema occurring in the instance
|
---|
615 | document in schemaLocation attribute, or
|
---|
616 | if the targetNamespace matches the namespace attribute of <import>
|
---|
617 | element, the schema specified by the user using this property will
|
---|
618 | be used (i.e., the schemaLocation attribute in the instance document
|
---|
619 | or on the <import> element will be effectively ignored).
|
---|
620 | </FONT></TD></TR>
|
---|
621 | <TR><TD align="center" bgcolor="#039acc" colspan="1" rowspan="1" valign="center"><FONT color="#ffffff" face="arial,helvetica,sanserif" size="-1"><B><B>Value</B></B>
|
---|
622 | </FONT></TD><TD align="" bgcolor="#a0ddf0" colspan="1" rowspan="1" valign="top"><FONT color="#000000" face="arial,helvetica,sanserif" size="-1"> The syntax is the same as for schemaLocation attributes
|
---|
623 | in instance documents: e.g, "http://www.example.com file_name.xsd".
|
---|
624 | The user can specify more than one XML Schema in the list.
|
---|
625 | </FONT></TD></TR>
|
---|
626 | <TR><TD align="center" bgcolor="#039acc" colspan="1" rowspan="1" valign="center"><FONT color="#ffffff" face="arial,helvetica,sanserif" size="-1"><B><B>Value Type</B></B>
|
---|
627 | </FONT></TD><TD align="" bgcolor="#a0ddf0" colspan="1" rowspan="1" valign="top"><FONT color="#000000" face="arial,helvetica,sanserif" size="-1"> XMLCh*
|
---|
628 | </FONT></TD></TR>
|
---|
629 | </TABLE>
|
---|
630 |
|
---|
631 | <P></P>
|
---|
632 | <TABLE border="0" cellpadding="2" cellspacing="2" width="100%">
|
---|
633 | <TR><TD align="center" bgcolor="#039acc" colspan="2" rowspan="1" valign="center"><FONT color="#ffffff" face="arial,helvetica,sanserif" size="-1"><B><B>void setExternalNoNamespaceSchemaLocation(const XMLCh* const)</B></B>
|
---|
634 | </FONT></TD></TR>
|
---|
635 | <TR><TD align="center" bgcolor="#039acc" colspan="1" rowspan="1" valign="center"><FONT color="#ffffff" face="arial,helvetica,sanserif" size="-1"><B><B>Description</B></B>
|
---|
636 | </FONT></TD><TD align="" bgcolor="#a0ddf0" colspan="1" rowspan="1" valign="top"><FONT color="#000000" face="arial,helvetica,sanserif" size="-1"> The XML Schema Recommendation explicitly states that
|
---|
637 | the inclusion of schemaLocation/ noNamespaceSchemaLocation attributes in the
|
---|
638 | instance document is only a hint; it does not mandate that these attributes
|
---|
639 | must be used to locate schemas. This property allows the user to specify the
|
---|
640 | no target namespace XML Schema Location externally. If specified, the instance
|
---|
641 | document's noNamespaceSchemaLocation attribute will be effectively ignored.
|
---|
642 | </FONT></TD></TR>
|
---|
643 | <TR><TD align="center" bgcolor="#039acc" colspan="1" rowspan="1" valign="center"><FONT color="#ffffff" face="arial,helvetica,sanserif" size="-1"><B><B>Value</B></B>
|
---|
644 | </FONT></TD><TD align="" bgcolor="#a0ddf0" colspan="1" rowspan="1" valign="top"><FONT color="#000000" face="arial,helvetica,sanserif" size="-1"> The syntax is the same as for the noNamespaceSchemaLocation
|
---|
645 | attribute that may occur in an instance document: e.g."file_name.xsd".
|
---|
646 | </FONT></TD></TR>
|
---|
647 | <TR><TD align="center" bgcolor="#039acc" colspan="1" rowspan="1" valign="center"><FONT color="#ffffff" face="arial,helvetica,sanserif" size="-1"><B><B>Value Type</B></B>
|
---|
648 | </FONT></TD><TD align="" bgcolor="#a0ddf0" colspan="1" rowspan="1" valign="top"><FONT color="#000000" face="arial,helvetica,sanserif" size="-1"> XMLCh*
|
---|
649 | </FONT></TD></TR>
|
---|
650 | </TABLE>
|
---|
651 |
|
---|
652 | <P></P>
|
---|
653 |
|
---|
654 | <TABLE border="0" cellpadding="2" cellspacing="2" width="100%">
|
---|
655 | <TR><TD align="center" bgcolor="#039acc" colspan="2" rowspan="1" valign="center"><FONT color="#ffffff" face="arial,helvetica,sanserif" size="-1"><B><B>void useScanner(const XMLCh* const)</B></B>
|
---|
656 | </FONT></TD></TR>
|
---|
657 | <TR><TD align="center" bgcolor="#039acc" colspan="1" rowspan="1" valign="center"><FONT color="#ffffff" face="arial,helvetica,sanserif" size="-1"><B><B>Description</B></B>
|
---|
658 | </FONT></TD><TD align="" bgcolor="#a0ddf0" colspan="1" rowspan="1" valign="top"><FONT color="#000000" face="arial,helvetica,sanserif" size="-1"> This property allows the user to specify the name of
|
---|
659 | the XMLScanner to use for scanning XML documents. If not specified, the default
|
---|
660 | scanner "IGXMLScanner" is used.
|
---|
661 | </FONT></TD></TR>
|
---|
662 | <TR><TD align="center" bgcolor="#039acc" colspan="1" rowspan="1" valign="center"><FONT color="#ffffff" face="arial,helvetica,sanserif" size="-1"><B><B>Value</B></B>
|
---|
663 | </FONT></TD><TD align="" bgcolor="#a0ddf0" colspan="1" rowspan="1" valign="top"><FONT color="#000000" face="arial,helvetica,sanserif" size="-1"> The recognized scanner names are: <BR>
|
---|
664 | 1."WFXMLScanner" - scanner that performs well-formedness checking only.<BR>
|
---|
665 | 2. "DGXMLScanner" - scanner that handles XML documents with DTD grammar information.<BR>
|
---|
666 | 3. "SGXMLScanner" - scanner that handles XML documents with XML schema grammar information.<BR>
|
---|
667 | 4. "IGXMLScanner" - scanner that handles XML documents with DTD or/and XML schema grammar information.<BR>
|
---|
668 | Users can use the predefined constants defined in XMLUni directly (fgWFXMLScanner, fgDGXMLScanner,
|
---|
669 | fgSGXMLScanner, or fgIGXMLScanner) or a string that matches the value of one of those constants.
|
---|
670 | </FONT></TD></TR>
|
---|
671 | <TR><TD align="center" bgcolor="#039acc" colspan="1" rowspan="1" valign="center"><FONT color="#ffffff" face="arial,helvetica,sanserif" size="-1"><B><B>Value Type</B></B>
|
---|
672 | </FONT></TD><TD align="" bgcolor="#a0ddf0" colspan="1" rowspan="1" valign="top"><FONT color="#000000" face="arial,helvetica,sanserif" size="-1"> XMLCh*
|
---|
673 | </FONT></TD></TR>
|
---|
674 | <TR><TD align="center" bgcolor="#039acc" colspan="1" rowspan="1" valign="center"><FONT color="#ffffff" face="arial,helvetica,sanserif" size="-1"><B><B>note: </B></B>
|
---|
675 | </FONT></TD><TD align="" bgcolor="#a0ddf0" colspan="1" rowspan="1" valign="top"><FONT color="#000000" face="arial,helvetica,sanserif" size="-1"> See <A href="program-others.html#UseSpecificScanner">Use Specific Scanner</A>
|
---|
676 | for more programming details.
|
---|
677 | </FONT></TD></TR>
|
---|
678 | </TABLE>
|
---|
679 |
|
---|
680 | <P></P>
|
---|
681 |
|
---|
682 | <TABLE border="0" cellpadding="2" cellspacing="2" width="100%">
|
---|
683 | <TR><TD align="center" bgcolor="#039acc" colspan="2" rowspan="1" valign="center"><FONT color="#ffffff" face="arial,helvetica,sanserif" size="-1"><B><B>setSecurityManager(Security Manager * const)</B></B>
|
---|
684 | </FONT></TD></TR>
|
---|
685 | <TR><TD align="center" bgcolor="#039acc" colspan="1" rowspan="1" valign="center"><FONT color="#ffffff" face="arial,helvetica,sanserif" size="-1"><B><B>Description</B></B>
|
---|
686 | </FONT></TD>
|
---|
687 | <TD align="" bgcolor="#a0ddf0" colspan="1" rowspan="1" valign="top"><FONT color="#000000" face="arial,helvetica,sanserif" size="-1">
|
---|
688 | Certain valid XML and XML Schema constructs can force a
|
---|
689 | processor to consume more system resources than an
|
---|
690 | application may wish. In fact, certain features could
|
---|
691 | be exploited by malicious document writers to produce a
|
---|
692 | denial-of-service attack. This property allows
|
---|
693 | applications to impose limits on the amount of
|
---|
694 | resources the processor will consume while processing
|
---|
695 | these constructs.
|
---|
696 |
|
---|
697 | </FONT></TD></TR>
|
---|
698 | <TR><TD align="center" bgcolor="#039acc" colspan="1" rowspan="1" valign="center"><FONT color="#ffffff" face="arial,helvetica,sanserif" size="-1"><B><B>Value</B></B>
|
---|
699 | </FONT></TD>
|
---|
700 | <TD align="" bgcolor="#a0ddf0" colspan="1" rowspan="1" valign="top"><FONT color="#000000" face="arial,helvetica,sanserif" size="-1">
|
---|
701 | An instance of the SecurityManager class (see
|
---|
702 | <CODE><FONT face="courier, monospaced">xercesc/util/SecurityManager</FONT></CODE>). This
|
---|
703 | class's documentation describes the particular limits
|
---|
704 | that may be set. Note that, when instantiated, default
|
---|
705 | values for limits that should be appropriate in most
|
---|
706 | settings are provided. The default implementation is
|
---|
707 | not thread-safe; if thread-safety is required, the
|
---|
708 | application should extend this class, overriding
|
---|
709 | methods appropriately. The parser will not adopt the
|
---|
710 | SecurityManager instance; the application is
|
---|
711 | responsible for deleting it when it is finished with
|
---|
712 | it. If no SecurityManager instance has been provided to
|
---|
713 | the parser (the default) then processing strictly
|
---|
714 | conforming to the relevant specifications will be
|
---|
715 | performed.
|
---|
716 |
|
---|
717 | </FONT></TD></TR>
|
---|
718 | <TR><TD align="center" bgcolor="#039acc" colspan="1" rowspan="1" valign="center"><FONT color="#ffffff" face="arial,helvetica,sanserif" size="-1"><B><B>Value Type</B></B>
|
---|
719 | </FONT></TD><TD align="" bgcolor="#a0ddf0" colspan="1" rowspan="1" valign="top"><FONT color="#000000" face="arial,helvetica,sanserif" size="-1"> SecurityManager*
|
---|
720 | </FONT></TD></TR>
|
---|
721 | </TABLE>
|
---|
722 |
|
---|
723 | <P></P>
|
---|
724 |
|
---|
725 | <TABLE border="0" cellpadding="2" cellspacing="2" width="100%">
|
---|
726 | <TR><TD align="center" bgcolor="#039acc" colspan="2" rowspan="1" valign="center"><FONT color="#ffffff" face="arial,helvetica,sanserif" size="-1"><B><B>setInputBufferSize(const size_t bufferSize)</B></B>
|
---|
727 | </FONT></TD></TR>
|
---|
728 | <TR><TD align="center" bgcolor="#039acc" colspan="1" rowspan="1" valign="center"><FONT color="#ffffff" face="arial,helvetica,sanserif" size="-1"><B><B>Description</B></B>
|
---|
729 | </FONT></TD>
|
---|
730 | <TD align="" bgcolor="#a0ddf0" colspan="1" rowspan="1" valign="top"><FONT color="#000000" face="arial,helvetica,sanserif" size="-1">
|
---|
731 | Set maximum input buffer size.
|
---|
732 | This method allows users to limit the size of buffers used in parsing
|
---|
733 | XML character data. The effect of setting this size is to limit the
|
---|
734 | size of a ContentHandler::characters() call.
|
---|
735 | The parser's default input buffer size is 1 megabyte.
|
---|
736 |
|
---|
737 | </FONT></TD></TR>
|
---|
738 | <TR><TD align="center" bgcolor="#039acc" colspan="1" rowspan="1" valign="center"><FONT color="#ffffff" face="arial,helvetica,sanserif" size="-1"><B><B>Value</B></B>
|
---|
739 | </FONT></TD>
|
---|
740 | <TD align="" bgcolor="#a0ddf0" colspan="1" rowspan="1" valign="top"><FONT color="#000000" face="arial,helvetica,sanserif" size="-1">
|
---|
741 | The maximum input buffer size
|
---|
742 |
|
---|
743 | </FONT></TD></TR>
|
---|
744 | <TR><TD align="center" bgcolor="#039acc" colspan="1" rowspan="1" valign="center"><FONT color="#ffffff" face="arial,helvetica,sanserif" size="-1"><B><B>Value Type</B></B>
|
---|
745 | </FONT></TD><TD align="" bgcolor="#a0ddf0" colspan="1" rowspan="1" valign="top"><FONT color="#000000" face="arial,helvetica,sanserif" size="-1"> XMLCh*
|
---|
746 | </FONT></TD></TR>
|
---|
747 | </TABLE>
|
---|
748 | <P></P>
|
---|
749 | </FONT></TD></TR></TABLE><BR>
|
---|
750 | </FONT></TD></TR></TABLE><BR>
|
---|
751 |
|
---|
752 | </TD></TR></TABLE></TD></TR></TABLE><BR><TABLE border="0" cellpadding="0" cellspacing="0" width="620"><TR><TD bgcolor="#0086b2"><IMG height="1" src="images/dot.gif" width="1"></TD></TR><TR><TD align="center"><FONT color="#0086b2" size="-1"><I>
|
---|
753 | Copyright © 1999-2004 The Apache Software Foundation.
|
---|
754 | All Rights Reserved.
|
---|
755 | </I></FONT></TD></TR></TABLE></BODY></HTML> |
---|