#include <xmlDocument.hpp>

Public Member Functions | |
| XMLDocument (const std::string &schemaURI) | |
| void | load (const std::string &fileName) throw (Error) |
| void | save (const std::string &fileName) throw (Error) |
| void | fromString (const std::string &string) throw (Error) |
| void | fromInputSource (InputSource &inputSource) throw (Error) |
| const XalanDocument * | getDocument (void) const |
| XMLReference < XalanElement > | getDocumentElement (void) |
| XalanSourceTreeDOMSupport * | getDOMSupport (void) |
| XPathEnvSupportDefault * | getEnvSupport (void) |
| XPathFactoryDefault * | getXPathFactory (void) |
| XPathExecutionContextDefault * | getExecutionContext (void) |
Protected Attributes | |
| XMLErrorHandler | xmlErrorHandler |
| Error handler for catching parse errors. | |
| const XalanDocument * | document |
| The XML DOM. | |
Xalan classes for parsing and maintaining the XML DOM | |
| XalanSourceTreeDOMSupport | theDOMSupport |
| XalanSourceTreeParserLiaison | theLiaison |
Xalan classes for making XPath queries | |
| XPathEnvSupportDefault | theEnvSupport |
| XObjectFactoryDefault | theXObjectFactory |
| XPathFactoryDefault | theXPathFactory |
| XPathExecutionContextDefault | theExecutionContext |
XMLPlatformUtils::Initialize();
XPathInit oTheXPathInit;
XMLPlatformUtils::Terminate();
Definition at line 68 of file xmlDocument.hpp.
| XMLDocument::XMLDocument | ( | const std::string & | schemaURI | ) |
Constructor. Create empty XML-document and configure verification.
| schemaURI | (Namespace-URI and) XSD-filename of XML schema. Specify "", if you don't want verification. |
Definition at line 39 of file xmlDocument.cpp.
References theDOMSupport, theLiaison, and xmlErrorHandler.
00039 : 00040 theLiaison( theDOMSupport ) 00041 #ifndef SIMPLEXPATH 00042 , theExecutionContext( theEnvSupport, theDOMSupport, theXObjectFactory ) 00043 #endif 00044 { 00045 theDOMSupport.setParserLiaison( &theLiaison ); 00046 theLiaison.setErrorHandler( &xmlErrorHandler ); 00047 if ( !schemaURI.empty() ) { 00048 #ifndef NDEBUG 00049 cerr << "Specifying schema \"" << schemaURI << "\"." << endl; 00050 #endif 00051 if ( schemaURI.find( ' ' ) < schemaURI.size() ) 00052 theLiaison.setExternalSchemaLocation 00053 ( StrX<XMLCh,char>( schemaURI.c_str() ).getBuffer() ); 00054 else 00055 theLiaison.setExternalNoNamespaceSchemaLocation 00056 ( StrX<XMLCh,char>( schemaURI.c_str() ).getBuffer() ); 00057 theLiaison.setUseValidation( true ); 00058 }; 00059 theLiaison.setDoNamespaces( true ); 00060 };
| void XMLDocument::load | ( | const std::string & | fileName | ) | throw (Error) |
Definition at line 62 of file xmlDocument.cpp.
References ERRORMACRO, and fromInputSource().
00063 { 00064 // XALAN_USING_XERCES(LocalFileInputSource) 00065 try { 00066 LocalFileInputSource 00067 localFileInputSource( StrX<XMLCh,char>( fileName.c_str() ).getBuffer() ); 00068 fromInputSource( localFileInputSource ); 00069 } catch ( XMLException &exc ) { 00070 ERRORMACRO( false, Error, , 00071 "Could not load XML file \"" << fileName << "\": " 00072 << ( StrX<char,XMLCh>( exc.getMessage() ).getBuffer() ) ); 00073 }; 00074 };
| void XMLDocument::save | ( | const std::string & | fileName | ) | throw (Error) |
Definition at line 76 of file xmlDocument.cpp.
References ERRORMACRO.
00077 { 00078 ERRORMACRO( false, Error, , 00079 "Saving of xml-documents not implemented yet." ); 00080 }
| void XMLDocument::fromString | ( | const std::string & | string | ) | throw (Error) |
Referenced by CookBook::getVersion().
| void XMLDocument::fromInputSource | ( | InputSource & | inputSource | ) | throw (Error) |
Definition at line 91 of file xmlDocument.cpp.
References document, ERRORMACRO, XMLErrorHandler::getErrorMessage(), XMLErrorHandler::getErrorOccurred(), theLiaison, and xmlErrorHandler.
Referenced by load().
00092 { 00093 document = theLiaison.parseXMLStream( inputSource ); 00094 if ( xmlErrorHandler.getErrorOccurred() ) { 00095 ERRORMACRO( false, Error, , 00096 "Parse error in XML file: " 00097 << xmlErrorHandler.getErrorMessage() ); 00098 }; 00099 assert( document != NULL ); 00100 }
| const XalanDocument* XMLDocument::getDocument | ( | void | ) | const [inline] |
| XMLReference< XalanElement > XMLDocument::getDocumentElement | ( | void | ) | [inline] |
Definition at line 88 of file xmlDocument.hpp.
References document.
Referenced by CookBook::getVersion().
00089 { return XMLReference< XalanElement > 00090 ( document->getDocumentElement(), this ); }
| XalanSourceTreeDOMSupport* XMLDocument::getDOMSupport | ( | void | ) | [inline] |
Definition at line 93 of file xmlDocument.hpp.
References theDOMSupport.
00094 { return &theDOMSupport; }
| XPathEnvSupportDefault* XMLDocument::getEnvSupport | ( | void | ) | [inline] |
Definition at line 96 of file xmlDocument.hpp.
References theEnvSupport.
00096 { return &theEnvSupport; }
| XPathFactoryDefault* XMLDocument::getXPathFactory | ( | void | ) | [inline] |
| XPathExecutionContextDefault* XMLDocument::getExecutionContext | ( | void | ) | [inline] |
Definition at line 105 of file xmlDocument.hpp.
References theExecutionContext.
00106 { return &theExecutionContext; }
XalanSourceTreeDOMSupport XMLDocument::theDOMSupport [protected] |
XalanSourceTreeParserLiaison XMLDocument::theLiaison [protected] |
XMLErrorHandler XMLDocument::xmlErrorHandler [protected] |
Error handler for catching parse errors.
Definition at line 117 of file xmlDocument.hpp.
Referenced by fromInputSource(), and XMLDocument().
const XalanDocument* XMLDocument::document [protected] |
The XML DOM.
Definition at line 119 of file xmlDocument.hpp.
Referenced by fromInputSource(), getDocument(), and getDocumentElement().
XPathEnvSupportDefault XMLDocument::theEnvSupport [protected] |
XObjectFactoryDefault XMLDocument::theXObjectFactory [protected] |
Definition at line 127 of file xmlDocument.hpp.
XPathFactoryDefault XMLDocument::theXPathFactory [protected] |
Definition at line 134 of file xmlDocument.hpp.
XPathExecutionContextDefault XMLDocument::theExecutionContext [protected] |