Xalan-C++ API Documentation

The Xalan C++ XSLT Processor Version 1.11


XalanSourceTreeParserLiaison.hpp
Go to the documentation of this file.
1 /*
2  * Licensed to the Apache Software Foundation (ASF) under one
3  * or more contributor license agreements. See the NOTICE file
4  * distributed with this work for additional information
5  * regarding copyright ownership. The ASF licenses this file
6  * to you under the Apache License, Version 2.0 (the "License");
7  * you may not use this file except in compliance with the License.
8  * You may obtain a copy of the License at
9  *
10  * http://www.apache.org/licenses/LICENSE-2.0
11  *
12  * Unless required by applicable law or agreed to in writing, software
13  * distributed under the License is distributed on an "AS IS" BASIS,
14  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15  * See the License for the specific language governing permissions and
16  * limitations under the License.
17  */
18 #if !defined(XALANSOURCETREEPARSERLIAISON_HEADER_GUARD_1357924680)
19 #define XALANSOURCETREEPARSERLIAISON_HEADER_GUARD_1357924680
20 
21 
22 // Base include file. Must be first.
24 
25 
26 
28 
29 
30 
33 
34 
35 
36 XALAN_DECLARE_XERCES_CLASS(ContentHandler)
37 XALAN_DECLARE_XERCES_CLASS(DTDHandler)
38 XALAN_DECLARE_XERCES_CLASS(LexicalHandler)
39 XALAN_DECLARE_XERCES_CLASS(SAX2XMLReaderImpl)
40 
41 
42 
43 XALAN_CPP_NAMESPACE_BEGIN
44 
45 
46 
49 
50 
51 
52 /*
53 typedef XERCES_CPP_NAMESPACE_QUALIFIER ContentHandler ContentHandlerType;
54 typedef XERCES_CPP_NAMESPACE_QUALIFIER DTDHandler DTDHandlerType;
55 typedef XERCES_CPP_NAMESPACE_QUALIFIER LexicalHandler LexicalHandlerType;
56 typedef XERCES_CPP_NAMESPACE_QUALIFIER SAX2XMLReader SAX2XMLReaderType;
57 */
58 
59 XALAN_USING_XERCES(ContentHandler)
60 XALAN_USING_XERCES(DTDHandler)
61 XALAN_USING_XERCES(LexicalHandler)
62 XALAN_USING_XERCES(SAX2XMLReaderImpl)
63 
64 
66 {
67 
68 public:
69 
70  /**
71  * Construct a XalanSourceTreeParserLiaison instance.
72  *
73  * @param theSupport instance of DOMSupport object
74  *
75  * @deprecated This constructor is deprecated. Use the next constructor instead.
76  */
78  XalanSourceTreeDOMSupport& theSupport,
79  MemoryManager& theManager XALAN_DEFAULT_MEMMGR);
80 
81  /**
82  * Construct a XalanSourceTreeParserLiaison instance.
83  */
85 
86  MemoryManager&
88  {
89  return m_documentMap.getMemoryManager();
90  }
91 
92  virtual
94 
95  /**
96  * Get the value of the flag which determines if the data of all
97  * text nodes are pooled, or just whitespace text nodes.
98  *
99  * @return true if the data of all text nodes are pooled, false otherwise.
100  */
101  bool
103  {
104  return m_poolAllText;
105  }
106 
107  /**
108  * Set the value of the flag which determines if the data of all
109  * text nodes are pooled, or just whitespace text nodes.
110  *
111  * @param fValue The new value for the flag.
112  */
113  void
114  setPoolAllText(bool fValue)
115  {
116  m_poolAllText = fValue;
117  }
118 
119  // These interfaces are inherited from XMLParserLiaison...
120 
121  virtual void
122  reset();
123 
124  virtual ExecutionContext*
126 
127  virtual void
129 
130  virtual XalanDocument*
132  const InputSource& reader,
134 
135  virtual void
137  const InputSource& inputSource,
138  DocumentHandler& handler,
140 
141  virtual void
143 
144  virtual int
145  getIndent() const;
146 
147  virtual void
148  setIndent(int i);
149 
150  virtual bool
152 
153  virtual void
155 
156  virtual const XalanDOMString&
158 
159  virtual EntityResolver*
161 
162  virtual void
163  setEntityResolver(EntityResolver* resolver);
164 
165  virtual XMLEntityResolver*
167 
168  virtual void
169  setXMLEntityResolver(XMLEntityResolver* resolver);
170 
171  virtual ErrorHandler*
173 
174  virtual void
175  setErrorHandler(ErrorHandler* handler);
176 
177 
178  // These interfaces are new to XalanSourceTreeParserLiaison...
179 
180  /**
181  * Parse using a SAX2 ContentHandler, DTDHandler, and LexicalHandler.
182  *
183  * @param theInputSource The input source for the parser
184  * @param theContentHandler The ContentHandler to use
185  * @param theDTDHandler The DTDHandler to use. May be null.
186  * @param theLexicalHandler The LexicalHandler to use. May be null.
187  * @param identifier Used for error reporting only.
188  */
189  virtual void
191  const InputSource& theInputSource,
192  ContentHandler& theContentHandler,
193  const XalanDOMString& theIdentifier,
194  DTDHandler* theDTDHandler = 0,
195  LexicalHandler* theLexicalHandler = 0);
196 
197  virtual DOMDocument_Type*
199 
200  virtual void
202 
203  /** Get the 'include ignorable whitespace' flag.
204  *
205  * This method returns the state of the parser's include ignorable
206  * whitespace flag.
207  *
208  * @return 'true' if the include ignorable whitespace flag is set on
209  * the parser, 'false' otherwise.
210  *
211  * @see #setIncludeIgnorableWhitespace
212  */
213  virtual bool
215 
216  /** Set the 'include ignorable whitespace' flag
217  *
218  * This method allows the user to specify whether a validating parser
219  * should include ignorable whitespaces as text nodes. It has no effect
220  * on non-validating parsers which always include non-markup text.
221  * <p>When set to true (also the default), ignorable whitespaces will be
222  * added to the DOM tree as text nodes. The method
223  * DOM_Text::isWhitespace() will return true for those text
224  * nodes only.
225  * <p>When set to false, all ignorable whitespace will be discarded and
226  * no text node is added to the DOM tree. Note: applications intended
227  * to process the "xml:space" attribute should not set this flag to false.
228  *
229  * @param include The new state of the include ignorable whitespace
230  * flag.
231  *
232  * @see #getIncludeIgnorableWhitespace
233  */
234  virtual void
236 
237  /**
238  * This method returns the state of the parser's namespace
239  * handling capability.
240  *
241  * @return true, if the parser is currently configured to
242  * understand namespaces, false otherwise.
243  *
244  * @see #setDoNamespaces
245  */
246  virtual bool
248 
249  /**
250  * This method allows users to enable or disable the parser's
251  * namespace processing. When set to true, parser starts enforcing
252  * all the constraints / rules specified by the NameSpace
253  * specification.
254  *
255  * <p>The parser's default state is: false.</p>
256  *
257  * <p>This flag is ignored by the underlying scanner if the installed
258  * validator indicates that namespace constraints should be
259  * enforced.</p>
260  *
261  * @param newState The value specifying whether NameSpace rules should
262  * be enforced or not.
263  *
264  * @see #getDoNamespaces
265  */
266  virtual void
267  setDoNamespaces(bool newState);
268 
269  /**
270  * This method returns the state of the parser's
271  * exit-on-First-Fatal-Error flag.
272  *
273  * @return true, if the parser is currently configured to
274  * exit on the first fatal error, false otherwise.
275  *
276  * @see #setExitOnFirstFatalError
277  */
278  virtual bool
280 
281  /**
282  * This method allows users to set the parser's behaviour when it
283  * encounters the first fatal error. If set to true, the parser
284  * will exit at the first fatal error. If false, then it will
285  * report the error and continue processing.
286  *
287  * <p>The default value is 'true' and the parser exits on the
288  * first fatal error.</p>
289  *
290  * @param newState The value specifying whether the parser should
291  * continue or exit when it encounters the first
292  * fatal error.
293  *
294  * @see #getExitOnFirstFatalError
295  */
296  virtual void
297  setExitOnFirstFatalError(bool newState);
298 
299  /**
300  * This method returns the location for an external schema document
301  * for parsing.
302  *
303  * @return A string representing the location of the external schema document
304  */
305  virtual const XalanDOMChar*
307 
308  /**
309  * This method sets the location for an external schema document
310  * for parsing.
311  *
312  * @param location A string representing the location of the external schema document
313  */
314  virtual void
315  setExternalSchemaLocation(const XalanDOMChar* location);
316 
317  /**
318  * This method returns the location for an external schema document
319  * for parsing.
320  *
321  * @return A string representing the location of the external schema document
322  */
323  virtual const XalanDOMChar*
325 
326  /**
327  * This method sets the location for an external schema document
328  * for parsing.
329  *
330  * @param location A string representing the location of the external schema document
331  */
332  virtual void
333  setExternalNoNamespaceSchemaLocation(const XalanDOMChar* location);
334 
335  /**
336  * Map a pointer to a XalanDocument instance to its implementation
337  * class pointer. Normally, you should have no reason for doing
338  * this. The liaison will return a null pointer if it did not
339  * create the instance passed.
340  *
341  * @param theDocument A pointer to a XalanDocument instance.
342  * @return A pointer to the XalanSourceTreeDocument instance.
343  */
345  mapDocument(const XalanDocument* theDocument) const;
346 
347  /**
348  * Create a XalanSourceTreeDocument instance.
349  *
350  * @return A pointer to the XalanSourceTreeDocument instance.
351  */
354 
355  typedef XalanMap<const XalanDocument*,
357 
358 
359 protected:
360 
361  virtual SAX2XMLReaderImpl*
363 
364 private:
365 
366  void
367  ensureReader();
368 
369 
370  // Not implemented...
372 
374  operator=(const XalanSourceTreeParserLiaison&);
375 
376 
377  // Data members...
378  XercesParserLiaison m_xercesParserLiaison;
379 
380  DocumentMapType m_documentMap;
381 
382  bool m_poolAllText;
383 
384  SAX2XMLReaderImpl* m_xmlReader;
385 };
386 
387 
388 
389 XALAN_CPP_NAMESPACE_END
390 
391 
392 
393 #endif // XALANSOURCETREEPARSERLIAISON_HEADER_GUARD_1357924680
ExecutionContext
Definition: ExecutionContext.hpp:58
XalanSourceTreeParserLiaison::setExternalSchemaLocation
virtual void setExternalSchemaLocation(const XalanDOMChar *location)
This method sets the location for an external schema document for parsing.
XalanSourceTreeParserLiaison::XalanSourceTreeParserLiaison
XalanSourceTreeParserLiaison(XalanSourceTreeDOMSupport &theSupport, MemoryManager &theManager XALAN_DEFAULT_MEMMGR)
Construct a XalanSourceTreeParserLiaison instance.
XalanSourceTreeParserLiaison::getParserDescription
virtual const XalanDOMString & getParserDescription(XalanDOMString &theResult) const
Return a string suitable for telling the user what parser is being used.
XalanSourceTreeParserLiaison
Definition: XalanSourceTreeParserLiaison.hpp:66
XalanDocument
Definition: XalanDocument.hpp:37
XalanSourceTreeParserLiaison::getDoNamespaces
virtual bool getDoNamespaces() const
This method returns the state of the parser's namespace handling capability.
XalanSourceTreeParserLiaison::parseXMLStream
virtual void parseXMLStream(const InputSource &theInputSource, ContentHandler &theContentHandler, const XalanDOMString &theIdentifier, DTDHandler *theDTDHandler=0, LexicalHandler *theLexicalHandler=0)
Parse using a SAX2 ContentHandler, DTDHandler, and LexicalHandler.
XalanSourceTreeParserLiaison::createReader
virtual SAX2XMLReaderImpl * createReader()
XalanSourceTreeParserLiaison::createDOMFactory
virtual DOMDocument_Type * createDOMFactory()
XalanSourceTreeParserLiaison::getEntityResolver
virtual EntityResolver * getEntityResolver() const
This method returns the installed EntityResolver.
XalanSourceTreeParserLiaison::getExternalNoNamespaceSchemaLocation
virtual const XalanDOMChar * getExternalNoNamespaceSchemaLocation() const
This method returns the location for an external schema document for parsing.
XalanSourceTreeParserLiaison::setIndent
virtual void setIndent(int i)
Set the amount to indent when indent-result="yes".
XalanSourceTreeParserLiaison::getExitOnFirstFatalError
virtual bool getExitOnFirstFatalError() const
This method returns the state of the parser's exit-on-First-Fatal-Error flag.
XalanSourceTreeParserLiaison::getIncludeIgnorableWhitespace
virtual bool getIncludeIgnorableWhitespace() const
Get the 'include ignorable whitespace' flag.
XalanSourceTreeParserLiaison::getErrorHandler
virtual ErrorHandler * getErrorHandler() const
This method returns the installed error handler.
XMLParserLiaison
Definition: XMLParserLiaison.hpp:66
XalanSourceTreeParserLiaison::parseXMLStream
virtual XalanDocument * parseXMLStream(const InputSource &reader, const XalanDOMString &identifier=XalanDOMString(XalanMemMgrs::getDummyMemMgr()))
Parse the text pointed at by the reader as XML, and return a DOM Document interface.
XALAN_DEFAULT_MEMMGR
#define XALAN_DEFAULT_MEMMGR
Definition: XalanMemoryManagement.hpp:524
XalanSourceTreeParserLiaison::setErrorHandler
virtual void setErrorHandler(ErrorHandler *handler)
This method installs the user-specified error handler.
XalanSourceTreeParserLiaison::setUseValidation
virtual void setUseValidation(bool b)
If set to true, validation will be performed.
XercesDOMSupport.hpp
XalanSourceTreeParserLiaison::parseXMLStream
virtual void parseXMLStream(const InputSource &inputSource, DocumentHandler &handler, const XalanDOMString &identifier=XalanDOMString(XalanMemMgrs::getDummyMemMgr()))
Parse the text pointed at by the reader as XML.
XalanSourceTreeParserLiaison::~XalanSourceTreeParserLiaison
virtual ~XalanSourceTreeParserLiaison()
XalanMap
Xalan implementation of a hashtable.
Definition: XalanMap.hpp:187
XalanSourceTreeParserLiaison::getUseValidation
virtual bool getUseValidation() const
Get whether or not validation will be performed.
XalanSourceTreeParserLiaison::destroyDocument
virtual void destroyDocument(DOMDocument_Type *theDocument)
XalanSourceTreeParserLiaison::DocumentMapType
XalanMap< const XalanDocument *, XalanSourceTreeDocument * > DocumentMapType
Definition: XalanSourceTreeParserLiaison.hpp:356
XalanSourceTreeParserLiaison::setEntityResolver
virtual void setEntityResolver(EntityResolver *resolver)
This method installs the user-specified EntityResolver on the parser.
XalanSourceTreeParserLiaison::setXMLEntityResolver
virtual void setXMLEntityResolver(XMLEntityResolver *resolver)
This method installs the user-specified XMLEntityResolver on the parser.
XalanSourceTreeParserLiaison::setExecutionContext
virtual void setExecutionContext(ExecutionContext &theContext)
Set the current ExecutionContext instance.
XalanSourceTreeParserLiaison::mapDocument
XalanSourceTreeDocument * mapDocument(const XalanDocument *theDocument) const
Map a pointer to a XalanDocument instance to its implementation class pointer.
XalanSourceTreeDocument
Definition: XalanSourceTreeDocument.hpp:76
XalanSourceTreeParserLiaison::getIndent
virtual int getIndent() const
Get the amount to indent when indent-result="yes".
XalanSourceTreeParserLiaison::setExitOnFirstFatalError
virtual void setExitOnFirstFatalError(bool newState)
This method allows users to set the parser's behaviour when it encounters the first fatal error.
XalanSourceTreeParserLiaison::getExecutionContext
virtual ExecutionContext * getExecutionContext() const
Get a pointer to the current ExecutionContext instance, which may be null.
XalanSourceTreeDefinitions.hpp
XalanDOMString
Definition: XalanDOMString.hpp:46
DOMDocument_Type
XERCES_CPP_NAMESPACE_QUALIFIER DOMDocument DOMDocument_Type
Definition: XercesDOMWrapperParsedSource.hpp:46
XALAN_USING_XERCES
XALAN_CPP_NAMESPACE_BEGIN XALAN_USING_XERCES(Locator)
XalanSourceTreeParserLiaison::getMemoryManager
MemoryManager & getMemoryManager()
Get a reference to the current MemoryManager instance.
Definition: XalanSourceTreeParserLiaison.hpp:87
XalanSourceTreeParserLiaison::setDoNamespaces
virtual void setDoNamespaces(bool newState)
This method allows users to enable or disable the parser's namespace processing.
XalanMemMgrs::getDummyMemMgr
static MemoryManager & getDummyMemMgr()
XercesParserLiaison.hpp
XalanSourceTreeParserLiaison::createXalanSourceTreeDocument
XalanSourceTreeDocument * createXalanSourceTreeDocument()
Create a XalanSourceTreeDocument instance.
XalanSourceTreeParserLiaison::destroyDocument
virtual void destroyDocument(XalanDocument *theDocument)
Destroy the supplied XalanDocument instance.
XalanMap.hpp
XalanSourceTreeParserLiaison::setPoolAllText
void setPoolAllText(bool fValue)
Set the value of the flag which determines if the data of all text nodes are pooled,...
Definition: XalanSourceTreeParserLiaison.hpp:114
XalanSourceTreeParserLiaison::setIncludeIgnorableWhitespace
virtual void setIncludeIgnorableWhitespace(bool include)
Set the 'include ignorable whitespace' flag.
XalanSourceTreeParserLiaison::getPoolAllText
bool getPoolAllText() const
Get the value of the flag which determines if the data of all text nodes are pooled,...
Definition: XalanSourceTreeParserLiaison.hpp:102
XalanSourceTreeParserLiaison::getXMLEntityResolver
virtual XMLEntityResolver * getXMLEntityResolver() const
This method returns the installed XMLEntityResolver.
XALAN_XALANSOURCETREE_EXPORT
#define XALAN_XALANSOURCETREE_EXPORT
Definition: XalanSourceTreeDefinitions.hpp:35
XalanSourceTreeParserLiaison::reset
virtual void reset()
Reset the instance, freeing any XalanDocument instances created through parseXMLStream().
XalanSourceTreeParserLiaison::setExternalNoNamespaceSchemaLocation
virtual void setExternalNoNamespaceSchemaLocation(const XalanDOMChar *location)
This method sets the location for an external schema document for parsing.
XercesParserLiaison
Definition: XercesParserLiaison.hpp:75
XalanSourceTreeParserLiaison::getExternalSchemaLocation
virtual const XalanDOMChar * getExternalSchemaLocation() const
This method returns the location for an external schema document for parsing.
XalanSourceTreeParserLiaison::XalanSourceTreeParserLiaison
XalanSourceTreeParserLiaison(MemoryManager &theManager XALAN_DEFAULT_MEMMGR)
Construct a XalanSourceTreeParserLiaison instance.
XalanSourceTreeDOMSupport
Definition: XalanSourceTreeDOMSupport.hpp:41

Interpreting class diagrams

Doxygen and GraphViz are used to generate this API documentation from the Xalan-C header files.

Xalan-C++ XSLT Processor Version 1.11
Copyright © 1999-2012 The Apache Software Foundation.
All Rights Reserved.

Apache Logo