diff options
author | William R. Otte <wotte@dre.vanderbilt.edu> | 2006-07-24 15:50:30 +0000 |
---|---|---|
committer | William R. Otte <wotte@dre.vanderbilt.edu> | 2006-07-24 15:50:30 +0000 |
commit | c44379cc7d9c7aa113989237ab0f56db12aa5219 (patch) | |
tree | 66a84b20d47f2269d8bdc6e0323f338763424d3a /ACE/ACEXML/examples/SAXPrint | |
parent | 3aff90f4a822fcf5d902bbfbcc9fa931d6191a8c (diff) | |
download | ATCD-c44379cc7d9c7aa113989237ab0f56db12aa5219.tar.gz |
Repo restructuring
Diffstat (limited to 'ACE/ACEXML/examples/SAXPrint')
-rw-r--r-- | ACE/ACEXML/examples/SAXPrint/Makefile.am | 48 | ||||
-rw-r--r-- | ACE/ACEXML/examples/SAXPrint/Print_Handler.cpp | 254 | ||||
-rw-r--r-- | ACE/ACEXML/examples/SAXPrint/Print_Handler.h | 187 | ||||
-rw-r--r-- | ACE/ACEXML/examples/SAXPrint/SAXPrint.mpc | 6 | ||||
-rw-r--r-- | ACE/ACEXML/examples/SAXPrint/SAXPrint_Handler.cpp | 244 | ||||
-rw-r--r-- | ACE/ACEXML/examples/SAXPrint/SAXPrint_Handler.h | 195 | ||||
-rw-r--r-- | ACE/ACEXML/examples/SAXPrint/SAXPrint_Handler.i | 13 | ||||
-rw-r--r-- | ACE/ACEXML/examples/SAXPrint/broken.xml | 5 | ||||
-rw-r--r-- | ACE/ACEXML/examples/SAXPrint/main.cpp | 206 | ||||
-rw-r--r-- | ACE/ACEXML/examples/SAXPrint/namespaces.xml | 95 | ||||
-rw-r--r-- | ACE/ACEXML/examples/SAXPrint/ns.svc.conf.xml | 46 | ||||
-rw-r--r-- | ACE/ACEXML/examples/SAXPrint/simple.svcconf.xml | 38 | ||||
-rw-r--r-- | ACE/ACEXML/examples/SAXPrint/svc.conf.xml | 58 |
13 files changed, 1395 insertions, 0 deletions
diff --git a/ACE/ACEXML/examples/SAXPrint/Makefile.am b/ACE/ACEXML/examples/SAXPrint/Makefile.am new file mode 100644 index 00000000000..075d3b6fca8 --- /dev/null +++ b/ACE/ACEXML/examples/SAXPrint/Makefile.am @@ -0,0 +1,48 @@ +## Process this file with automake to create Makefile.in +## +## $Id$ +## +## This file was generated by MPC. Any changes made directly to +## this file will be lost the next time it is generated. +## +## MPC Command: +## /acebuilds/ACE_wrappers-repository/bin/mwc.pl -include /acebuilds/MPC/config -include /acebuilds/MPC/templates -feature_file /acebuilds/ACE_wrappers-repository/local.features -noreldefs -type automake -exclude build,Kokyu + +ACE_BUILDDIR = $(top_builddir) +ACE_ROOT = $(top_srcdir) + + +## Makefile.SAXPrint.am + +if BUILD_ACEXML +if !BUILD_ACE_FOR_TAO +noinst_PROGRAMS = SAXPrint + +SAXPrint_CPPFLAGS = \ + -I$(ACE_ROOT) \ + -I$(ACE_BUILDDIR) \ + -I$(ACE_ROOT)/ACEXML/common + +SAXPrint_SOURCES = \ + Print_Handler.cpp \ + SAXPrint_Handler.cpp \ + main.cpp \ + Print_Handler.h \ + SAXPrint_Handler.h \ + SAXPrint_Handler.i + +SAXPrint_LDADD = \ + $(ACE_BUILDDIR)/ACEXML/parser/parser/libACEXML_Parser.la \ + $(ACE_BUILDDIR)/ACEXML/common/libACEXML.la \ + $(ACE_BUILDDIR)/ace/libACE.la + +endif !BUILD_ACE_FOR_TAO +endif BUILD_ACEXML + +## Clean up template repositories, etc. +clean-local: + -rm -f *~ *.bak *.rpo *.sym lib*.*_pure_* core core.* + -rm -f gcctemp.c gcctemp so_locations *.ics + -rm -rf cxx_repository ptrepository ti_files + -rm -rf templateregistry ir.out + -rm -rf ptrepository SunWS_cache Templates.DB diff --git a/ACE/ACEXML/examples/SAXPrint/Print_Handler.cpp b/ACE/ACEXML/examples/SAXPrint/Print_Handler.cpp new file mode 100644 index 00000000000..34434cafc7a --- /dev/null +++ b/ACE/ACEXML/examples/SAXPrint/Print_Handler.cpp @@ -0,0 +1,254 @@ +// -*- C++ -*- $Id$ + +#include "Print_Handler.h" +#include "ace/ACE.h" +#include "ace/Log_Msg.h" + +ACEXML_Print_Handler::ACEXML_Print_Handler (ACEXML_Char* fileName) + : fileName_(ACE::strnew (fileName)) +{ + +} + +ACEXML_Print_Handler::~ACEXML_Print_Handler (void) +{ + delete[] this->fileName_; +} + +void +ACEXML_Print_Handler::characters (const ACEXML_Char *cdata, + int start, + int length ACEXML_ENV_ARG_DECL_NOT_USED) + ACE_THROW_SPEC ((ACEXML_SAXException)) +{ + + + ACE_DEBUG ((LM_DEBUG, + ACE_TEXT ("* Event characters () ** start: %d end: %d ***************\n%s\n- End event characters () ---------------\n"), + start, length, cdata)); +} + +void +ACEXML_Print_Handler::endDocument (ACEXML_ENV_SINGLE_ARG_DECL_NOT_USED) + ACE_THROW_SPEC ((ACEXML_SAXException)) +{ + + + ACE_DEBUG ((LM_DEBUG, + ACE_TEXT ("* Event endDocument () ***************\n"))); +} + +void +ACEXML_Print_Handler::endElement (const ACEXML_Char *uri, + const ACEXML_Char *name, + const ACEXML_Char *qName + ACEXML_ENV_ARG_DECL_NOT_USED) + ACE_THROW_SPEC ((ACEXML_SAXException)) +{ + + + ACE_DEBUG ((LM_DEBUG, + ACE_TEXT ("* Event endElement (%s, %s, %s) ***************\n"), + uri, name, qName)); +} + +void +ACEXML_Print_Handler::endPrefixMapping (const ACEXML_Char *prefix + ACEXML_ENV_ARG_DECL_NOT_USED) + ACE_THROW_SPEC ((ACEXML_SAXException)) +{ + + + ACE_DEBUG ((LM_DEBUG, + ACE_TEXT ("* Event endPrefixMapping (%s) ***************\n"), + prefix)); +} + +void +ACEXML_Print_Handler::ignorableWhitespace (const ACEXML_Char *, + int, + int + ACEXML_ENV_ARG_DECL_NOT_USED) + ACE_THROW_SPEC ((ACEXML_SAXException)) +{ + // ACE_DEBUG ((LM_DEBUG, + // ACE_TEXT ("* Event ignorableWhitespace () ***************\n"))); +} + +void +ACEXML_Print_Handler::processingInstruction (const ACEXML_Char *target, + const ACEXML_Char *data + ACEXML_ENV_ARG_DECL_NOT_USED) + ACE_THROW_SPEC ((ACEXML_SAXException)) +{ + + + ACE_DEBUG ((LM_DEBUG, + ACE_TEXT ("* Event processingInstruction (%s, %s) ***************\n"), + target, data)); +} + +void +ACEXML_Print_Handler::setDocumentLocator (ACEXML_Locator * locator) +{ + + this->locator_ = locator; + // ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("* Event setDocumentLocator () ***************\n"))); +} + +void +ACEXML_Print_Handler::skippedEntity (const ACEXML_Char *name + ACEXML_ENV_ARG_DECL_NOT_USED) + ACE_THROW_SPEC ((ACEXML_SAXException)) +{ + + + ACE_DEBUG ((LM_DEBUG, + ACE_TEXT ("* Event skippedEntity (%s) ***************\n"), + name)); +} + +void +ACEXML_Print_Handler::startDocument (ACEXML_ENV_SINGLE_ARG_DECL_NOT_USED) + ACE_THROW_SPEC ((ACEXML_SAXException)) +{ + + + ACE_DEBUG ((LM_DEBUG, + ACE_TEXT ("* Event startDocument () ***************\n"))); +} + +void +ACEXML_Print_Handler::startElement (const ACEXML_Char *uri, + const ACEXML_Char *name, + const ACEXML_Char *qName, + ACEXML_Attributes *alist + ACEXML_ENV_ARG_DECL_NOT_USED) + ACE_THROW_SPEC ((ACEXML_SAXException)) +{ + + + ACE_DEBUG ((LM_DEBUG, + ACE_TEXT ("* Event startElement (%s, %s, %s) ***************\n"), + uri, name, qName)); + + if (alist != 0) + for (size_t i = 0; i < alist->getLength (); ++i) + { + ACE_DEBUG ((LM_DEBUG, + ACE_TEXT (" %s = \"%s\"\n"), + alist->getQName (i), alist->getValue (i))); + } +} + +void +ACEXML_Print_Handler::startPrefixMapping (const ACEXML_Char * prefix, + const ACEXML_Char * uri ACEXML_ENV_ARG_DECL_NOT_USED) + ACE_THROW_SPEC ((ACEXML_SAXException)) +{ + ACE_DEBUG ((LM_DEBUG, + ACE_TEXT ("* Event startPrefixMapping () ***************\n"))); + ACE_DEBUG ((LM_DEBUG, + ACE_TEXT ("Prefix = %s, URI = %s\n"), prefix, uri)); +} + +// *** Methods inherit from ACEXML_DTDHandler. + +void +ACEXML_Print_Handler::notationDecl (const ACEXML_Char *name, + const ACEXML_Char *publicID, + const ACEXML_Char *systemID ACEXML_ENV_ARG_DECL_NOT_USED) + ACE_THROW_SPEC ((ACEXML_SAXException)) +{ + ACE_DEBUG ((LM_DEBUG, + ACE_TEXT ("* Event notationDecl: (%s) "), + name)); + + if (publicID == 0) + ACE_DEBUG ((LM_DEBUG, + ACE_TEXT ("SYSTEM %s\n"), + systemID)); + else if (systemID == 0) + ACE_DEBUG ((LM_DEBUG, + ACE_TEXT ("PUBLIC %s\n"), + publicID)); + else + ACE_DEBUG ((LM_DEBUG, + ACE_TEXT ("PUBLIC %s %s\n"), + publicID, systemID)); +} + +void +ACEXML_Print_Handler::unparsedEntityDecl (const ACEXML_Char *name, + const ACEXML_Char *publicID, + const ACEXML_Char *systemID, + const ACEXML_Char *notationName ACEXML_ENV_ARG_DECL_NOT_USED) + ACE_THROW_SPEC ((ACEXML_SAXException)) +{ + ACE_DEBUG ((LM_DEBUG, + ACE_TEXT ("* Unparsed Entity: %s"), + name)); + + if (publicID == 0) + ACE_DEBUG ((LM_DEBUG, + ACE_TEXT (" SYSTEM %s"), + systemID)); + else + ACE_DEBUG ((LM_DEBUG, + ACE_TEXT (" PUBLIC %s %s"), + publicID, systemID)); + + ACE_DEBUG ((LM_DEBUG, + ACE_TEXT (" NDATA %s\n"), + notationName)); +} + +// Methods inherit from ACEXML_EnitityResolver. + +ACEXML_InputSource * +ACEXML_Print_Handler::resolveEntity (const ACEXML_Char *, + const ACEXML_Char * ACEXML_ENV_ARG_DECL_NOT_USED) + ACE_THROW_SPEC ((ACEXML_SAXException)) +{ + // No-op. + return 0; +} + +// Methods inherit from ACEXML_ErrorHandler. + +/* + * Receive notification of a recoverable error. + */ +void +ACEXML_Print_Handler::error (ACEXML_SAXParseException & ex ACEXML_ENV_ARG_DECL_NOT_USED) + ACE_THROW_SPEC ((ACEXML_SAXException)) +{ + ACE_DEBUG ((LM_DEBUG, "%s: line: %d col: %d ", + (this->locator_->getSystemId() == 0 ? this->fileName_ : this->locator_->getSystemId()), + this->locator_->getLineNumber(), + this->locator_->getColumnNumber())); + ex.print(); +} + +void +ACEXML_Print_Handler::fatalError (ACEXML_SAXParseException& ex ACEXML_ENV_ARG_DECL_NOT_USED) + ACE_THROW_SPEC ((ACEXML_SAXException)) +{ + ACE_DEBUG ((LM_DEBUG, "%s: line: %d col: %d ", + (this->locator_->getSystemId() == 0 ? this->fileName_ : this->locator_->getSystemId()), + this->locator_->getLineNumber(), + this->locator_->getColumnNumber())); + ex.print(); + +} + +void +ACEXML_Print_Handler::warning (ACEXML_SAXParseException & ex ACEXML_ENV_ARG_DECL_NOT_USED) + ACE_THROW_SPEC ((ACEXML_SAXException)) +{ + ACE_DEBUG ((LM_DEBUG, "%s: line: %d col: %d ", + (this->locator_->getSystemId() == 0 ? this->fileName_ : this->locator_->getSystemId()), + this->locator_->getLineNumber(), + this->locator_->getColumnNumber())); + ex.print(); +} diff --git a/ACE/ACEXML/examples/SAXPrint/Print_Handler.h b/ACE/ACEXML/examples/SAXPrint/Print_Handler.h new file mode 100644 index 00000000000..3f28e6d9165 --- /dev/null +++ b/ACE/ACEXML/examples/SAXPrint/Print_Handler.h @@ -0,0 +1,187 @@ +// $Id$ + +//============================================================================= +/** + * @file Print_Handler.h + * + * $Id$ + * + * @author Nanbor Wang <nanbor@cs.wustl.edu> + */ +//============================================================================= + +#ifndef ACEXML_PRINT_HANDLER_H +#define ACEXML_PRINT_HANDLER_H + +#include "ACEXML/common/DefaultHandler.h" + +/** + * @class ACEXML_Print_Handler + * + * @brief ACEXML_Print_Handler is an example SAX event handler. + * + * This SAX event handler prints out a detailed event report + * on every event it receives. + */ +class ACEXML_Print_Handler : public ACEXML_DefaultHandler +{ +public: + /* + * Default constructor. + */ + ACEXML_Print_Handler (ACEXML_Char* fileName); + + /* + * Default destructor. + */ + virtual ~ACEXML_Print_Handler (void); + + // Methods inherited from ACEXML_ContentHandler. + + /* + * Receive notification of character data. + */ + virtual void characters (const ACEXML_Char *ch, + int start, + int length ACEXML_ENV_ARG_DECL) + ACE_THROW_SPEC ((ACEXML_SAXException)) + ; + + /* + * Receive notification of the end of a document. + */ + virtual void endDocument (ACEXML_ENV_SINGLE_ARG_DECL) + ACE_THROW_SPEC ((ACEXML_SAXException)) + ; + + /* + * Receive notification of the end of an element. + */ + virtual void endElement (const ACEXML_Char *namespaceURI, + const ACEXML_Char *localName, + const ACEXML_Char *qName ACEXML_ENV_ARG_DECL) + ACE_THROW_SPEC ((ACEXML_SAXException)) + ; + + /* + * End the scope of a prefix-URI mapping. + */ + virtual void endPrefixMapping (const ACEXML_Char *prefix ACEXML_ENV_ARG_DECL) + ACE_THROW_SPEC ((ACEXML_SAXException)) + ; + + /* + * Receive notification of ignorable whitespace in element content. + */ + virtual void ignorableWhitespace (const ACEXML_Char *ch, + int start, + int length ACEXML_ENV_ARG_DECL) + ACE_THROW_SPEC ((ACEXML_SAXException)) + ; + + /* + * Receive notification of a processing instruction. + */ + virtual void processingInstruction (const ACEXML_Char *target, + const ACEXML_Char *data ACEXML_ENV_ARG_DECL) + ACE_THROW_SPEC ((ACEXML_SAXException)) + ; + + /* + * Receive an object for locating the origin of SAX document events. + */ + virtual void setDocumentLocator (ACEXML_Locator *locator) ; + + /* + * Receive notification of a skipped entity. + */ + virtual void skippedEntity (const ACEXML_Char *name ACEXML_ENV_ARG_DECL) + ACE_THROW_SPEC ((ACEXML_SAXException)) + ; + + /* + * Receive notification of the beginning of a document. + */ + virtual void startDocument (ACEXML_ENV_SINGLE_ARG_DECL) + ACE_THROW_SPEC ((ACEXML_SAXException)) + ; + + /* + * Receive notification of the beginning of an element. + */ + virtual void startElement (const ACEXML_Char *namespaceURI, + const ACEXML_Char *localName, + const ACEXML_Char *qName, + ACEXML_Attributes *atts ACEXML_ENV_ARG_DECL) + ACE_THROW_SPEC ((ACEXML_SAXException)) + ; + + /* + * Begin the scope of a prefix-URI Namespace mapping. + */ + virtual void startPrefixMapping (const ACEXML_Char *prefix, + const ACEXML_Char *uri ACEXML_ENV_ARG_DECL) + ACE_THROW_SPEC ((ACEXML_SAXException)) + ; + + // *** Methods inherit from ACEXML_DTDHandler. + + /* + * Receive notification of a notation declaration event. + */ + virtual void notationDecl (const ACEXML_Char *name, + const ACEXML_Char *publicId, + const ACEXML_Char *systemId ACEXML_ENV_ARG_DECL) + ACE_THROW_SPEC ((ACEXML_SAXException)) + ; + + /* + * Receive notification of an unparsed entity declaration event. + */ + virtual void unparsedEntityDecl (const ACEXML_Char *name, + const ACEXML_Char *publicId, + const ACEXML_Char *systemId, + const ACEXML_Char *notationName ACEXML_ENV_ARG_DECL) + ACE_THROW_SPEC ((ACEXML_SAXException)) + ; + + // Methods inherit from ACEXML_EnitityResolver. + + /* + * Allow the application to resolve external entities. + */ + virtual ACEXML_InputSource *resolveEntity (const ACEXML_Char *publicId, + const ACEXML_Char *systemId ACEXML_ENV_ARG_DECL) + ACE_THROW_SPEC ((ACEXML_SAXException)) + ; + + // Methods inherit from ACEXML_ErrorHandler. + + /* + * Receive notification of a recoverable error. + */ + virtual void error (ACEXML_SAXParseException &exception ACEXML_ENV_ARG_DECL) + ACE_THROW_SPEC ((ACEXML_SAXException)) + ; + + /* + * Receive notification of a non-recoverable error. + */ + virtual void fatalError (ACEXML_SAXParseException &exception ACEXML_ENV_ARG_DECL) + ACE_THROW_SPEC ((ACEXML_SAXException)) + ; + + /* + * Receive notification of a warning. + */ + virtual void warning (ACEXML_SAXParseException &exception ACEXML_ENV_ARG_DECL) + ACE_THROW_SPEC ((ACEXML_SAXException)) + ; +private: + + ACEXML_Char* fileName_; + ACEXML_Locator* locator_; + +}; + +#endif /* ACEXML_PRINT_HANDLER_H */ diff --git a/ACE/ACEXML/examples/SAXPrint/SAXPrint.mpc b/ACE/ACEXML/examples/SAXPrint/SAXPrint.mpc new file mode 100644 index 00000000000..4fea0873337 --- /dev/null +++ b/ACE/ACEXML/examples/SAXPrint/SAXPrint.mpc @@ -0,0 +1,6 @@ +// -*- MPC -*- +// $Id$ + +project(SAXPrint): aceexe, acexml { + exename = SAXPrint +} diff --git a/ACE/ACEXML/examples/SAXPrint/SAXPrint_Handler.cpp b/ACE/ACEXML/examples/SAXPrint/SAXPrint_Handler.cpp new file mode 100644 index 00000000000..3dfeb5a182a --- /dev/null +++ b/ACE/ACEXML/examples/SAXPrint/SAXPrint_Handler.cpp @@ -0,0 +1,244 @@ +// -*- C++ -*- $Id$ + +#include "SAXPrint_Handler.h" +#include "ace/ACE.h" +#include "ace/Log_Msg.h" + +#if !defined (__ACEXML_INLINE__) +# include "SAXPrint_Handler.i" +#endif /* __ACEXML_INLINE__ */ + +ACEXML_SAXPrint_Handler::ACEXML_SAXPrint_Handler (const ACEXML_Char* filename) + : indent_ (0), fileName_(ACE::strnew (filename)), locator_ (0) +{ + // no-op +} + +ACEXML_SAXPrint_Handler::~ACEXML_SAXPrint_Handler (void) +{ + delete [] this->fileName_; +} + +void +ACEXML_SAXPrint_Handler::characters (const ACEXML_Char *cdata, + int start, + int length ACEXML_ENV_ARG_DECL_NOT_USED) + ACE_THROW_SPEC ((ACEXML_SAXException)) +{ + + ACE_UNUSED_ARG (start); + ACE_UNUSED_ARG (length); + ACE_DEBUG ((LM_DEBUG, + ACE_TEXT ("%s"), + cdata)); +} + +void +ACEXML_SAXPrint_Handler::endDocument (ACEXML_ENV_SINGLE_ARG_DECL_NOT_USED) + ACE_THROW_SPEC ((ACEXML_SAXException)) +{ + + + ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("\n"))); +} + +void +ACEXML_SAXPrint_Handler::endElement (const ACEXML_Char *, + const ACEXML_Char *, + const ACEXML_Char *qName + ACEXML_ENV_ARG_DECL_NOT_USED) + ACE_THROW_SPEC ((ACEXML_SAXException)) +{ + + + this->dec_indent (); + this->print_indent (); + ACE_DEBUG ((LM_DEBUG, + ACE_TEXT ("</%s>"), + qName)); +} + +void +ACEXML_SAXPrint_Handler::endPrefixMapping (const ACEXML_Char * + ACEXML_ENV_ARG_DECL_NOT_USED) + ACE_THROW_SPEC ((ACEXML_SAXException)) +{ +// ACE_DEBUG ((LM_DEBUG, +// ACE_TEXT ("* Event endPrefixMapping (%s) ***************\n"), +// prefix)); +} + +void +ACEXML_SAXPrint_Handler::ignorableWhitespace (const ACEXML_Char * cdata, + int, + int ACEXML_ENV_ARG_DECL_NOT_USED) + ACE_THROW_SPEC ((ACEXML_SAXException)) +{ + ACE_DEBUG ((LM_DEBUG, + ACE_TEXT ("%s"), + cdata)); +// ACE_DEBUG ((LM_DEBUG, + // ACE_TEXT ("* Event ignorableWhitespace () ***************\n"))); +} + +void +ACEXML_SAXPrint_Handler::processingInstruction (const ACEXML_Char *target, + const ACEXML_Char *data + ACEXML_ENV_ARG_DECL_NOT_USED) + ACE_THROW_SPEC ((ACEXML_SAXException)) +{ + + + this->print_indent (); + ACE_DEBUG ((LM_DEBUG, + ACE_TEXT ("<?%s %s>\n"), + target, data)); +} + +void +ACEXML_SAXPrint_Handler::setDocumentLocator (ACEXML_Locator * locator) +{ + + this->locator_ = locator; + //ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("* Event setDocumentLocator () ***************\n"))); +} + +void +ACEXML_SAXPrint_Handler::skippedEntity (const ACEXML_Char *name + ACEXML_ENV_ARG_DECL_NOT_USED) + ACE_THROW_SPEC ((ACEXML_SAXException)) +{ + + + ACE_DEBUG ((LM_DEBUG, + ACE_TEXT ("* Event skippedEntity (%s) ***************\n"), + name)); +} + +void +ACEXML_SAXPrint_Handler::startDocument (ACEXML_ENV_SINGLE_ARG_DECL_NOT_USED) + ACE_THROW_SPEC ((ACEXML_SAXException)) +{ + + + ACE_DEBUG ((LM_DEBUG, + ACE_TEXT ("* Event startDocument () ***************\n"))); +} + +void +ACEXML_SAXPrint_Handler::startElement (const ACEXML_Char *, + const ACEXML_Char *, + const ACEXML_Char *qName, + ACEXML_Attributes *alist + ACEXML_ENV_ARG_DECL_NOT_USED) + ACE_THROW_SPEC ((ACEXML_SAXException)) +{ + + + this->print_indent (); + + ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("<%s"), + qName)); + if (alist != 0) + for (size_t i = 0; i < alist->getLength (); ++i) + { + ACE_DEBUG ((LM_DEBUG, + ACE_TEXT (" %s = \"%s\""), + alist->getQName (i), alist->getValue (i))); + } + ACE_DEBUG ((LM_DEBUG, ACE_TEXT (">"))); + this->inc_indent (); +} + +void +ACEXML_SAXPrint_Handler::startPrefixMapping (const ACEXML_Char * , + const ACEXML_Char * ACEXML_ENV_ARG_DECL_NOT_USED) + ACE_THROW_SPEC ((ACEXML_SAXException)) +{ +// ACE_DEBUG ((LM_DEBUG, +// ACE_TEXT ("* Event startPrefixMapping () ***************\n"))); +// ACE_DEBUG ((LM_DEBUG, +// ACE_TEXT ("Prefix = %s, URI = %s\n"), prefix, uri)); + +} + +// *** Methods inherited from ACEXML_DTDHandler. + +void +ACEXML_SAXPrint_Handler::notationDecl (const ACEXML_Char *, + const ACEXML_Char *, + const ACEXML_Char * ACEXML_ENV_ARG_DECL_NOT_USED) + ACE_THROW_SPEC ((ACEXML_SAXException)) +{ + // No-op. +} + +void +ACEXML_SAXPrint_Handler::unparsedEntityDecl (const ACEXML_Char *, + const ACEXML_Char *, + const ACEXML_Char *, + const ACEXML_Char * ACEXML_ENV_ARG_DECL_NOT_USED) + ACE_THROW_SPEC ((ACEXML_SAXException)) +{ + // No-op. +} + +// Methods inherited from ACEXML_EnitityResolver. + +ACEXML_InputSource * +ACEXML_SAXPrint_Handler::resolveEntity (const ACEXML_Char *, + const ACEXML_Char * ACEXML_ENV_ARG_DECL_NOT_USED) + ACE_THROW_SPEC ((ACEXML_SAXException)) +{ + // No-op. + return 0; +} + +// Methods inherited from ACEXML_ErrorHandler. + +/* + * Receive notification of a recoverable error. + */ +void +ACEXML_SAXPrint_Handler::error (ACEXML_SAXParseException & ex + ACEXML_ENV_ARG_DECL_NOT_USED) + ACE_THROW_SPEC ((ACEXML_SAXException)) +{ + ACE_DEBUG ((LM_DEBUG, "%s: line: %d col: %d ", + (this->locator_->getSystemId() == 0 ? this->fileName_ : this->locator_->getSystemId()), + this->locator_->getLineNumber(), + this->locator_->getColumnNumber())); + ex.print(); +} + +void +ACEXML_SAXPrint_Handler::fatalError (ACEXML_SAXParseException & ex + ACEXML_ENV_ARG_DECL_NOT_USED) + ACE_THROW_SPEC ((ACEXML_SAXException)) +{ + ACE_DEBUG ((LM_DEBUG, "%s: line: %d col: %d ", + (this->locator_->getSystemId() == 0 ? this->fileName_ : this->locator_->getSystemId()), + this->locator_->getLineNumber(), + this->locator_->getColumnNumber())); + ex.print(); +} + +void +ACEXML_SAXPrint_Handler::warning (ACEXML_SAXParseException & ex + ACEXML_ENV_ARG_DECL_NOT_USED) + ACE_THROW_SPEC ((ACEXML_SAXException)) +{ + ACE_DEBUG ((LM_DEBUG, "%s: line: %d col: %d ", + (this->locator_->getSystemId() == 0 ? this->fileName_ : this->locator_->getSystemId()), + this->locator_->getLineNumber(), + this->locator_->getColumnNumber())); + ex.print(); +} + +void +ACEXML_SAXPrint_Handler::print_indent (void) +{ + ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("\n"))); + for (size_t i = 0; i < this->indent_; ++i) + ACE_DEBUG ((LM_DEBUG, ACE_TEXT (" "))); +} diff --git a/ACE/ACEXML/examples/SAXPrint/SAXPrint_Handler.h b/ACE/ACEXML/examples/SAXPrint/SAXPrint_Handler.h new file mode 100644 index 00000000000..612dd406c06 --- /dev/null +++ b/ACE/ACEXML/examples/SAXPrint/SAXPrint_Handler.h @@ -0,0 +1,195 @@ +// $Id$ + +//============================================================================= +/** + * @file SAXPrint_Handler.h + * + * $Id$ + * + * @author Nanbor Wang <nanbor@cs.wustl.edu> + */ +//============================================================================= + +#ifndef ACEXML_SAXPRINT_HANDLER_H +#define ACEXML_SAXPRINT_HANDLER_H + +#include "ACEXML/common/DefaultHandler.h" + +/** + * @class ACEXML_SAXPrint_Handler + * + * @brief ACEXML_SAXPrint_Handler is an example SAX event handler. + * + * This SAX event handler try to regenerate the XML document it + * reads with correct indentation. + */ +class ACEXML_SAXPrint_Handler : public ACEXML_DefaultHandler +{ +public: + /* + * Default constructor. + */ + ACEXML_SAXPrint_Handler (const ACEXML_Char* name); + + /* + * Default destructor. + */ + virtual ~ACEXML_SAXPrint_Handler (void); + + // Methods inherit from ACEXML_ContentHandler. + + /* + * Receive notification of character data. + */ + virtual void characters (const ACEXML_Char *ch, + int start, + int length ACEXML_ENV_ARG_DECL) + ACE_THROW_SPEC ((ACEXML_SAXException)) + ; + + /* + * Receive notification of the end of a document. + */ + virtual void endDocument (ACEXML_ENV_SINGLE_ARG_DECL) + ACE_THROW_SPEC ((ACEXML_SAXException)) + ; + + /* + * Receive notification of the end of an element. + */ + virtual void endElement (const ACEXML_Char *namespaceURI, + const ACEXML_Char *localName, + const ACEXML_Char *qName ACEXML_ENV_ARG_DECL) + ACE_THROW_SPEC ((ACEXML_SAXException)) + ; + + /* + * End the scope of a prefix-URI mapping. + */ + virtual void endPrefixMapping (const ACEXML_Char *prefix ACEXML_ENV_ARG_DECL) + ACE_THROW_SPEC ((ACEXML_SAXException)) + ; + + /* + * Receive notification of ignorable whitespace in element content. + */ + virtual void ignorableWhitespace (const ACEXML_Char *ch, + int start, + int length ACEXML_ENV_ARG_DECL) + ACE_THROW_SPEC ((ACEXML_SAXException)) + ; + + /* + * Receive notification of a processing instruction. + */ + virtual void processingInstruction (const ACEXML_Char *target, + const ACEXML_Char *data ACEXML_ENV_ARG_DECL) + ACE_THROW_SPEC ((ACEXML_SAXException)) + ; + + /* + * Receive an object for locating the origin of SAX document events. + */ + virtual void setDocumentLocator (ACEXML_Locator *locator) ; + + /* + * Receive notification of a skipped entity. + */ + virtual void skippedEntity (const ACEXML_Char *name ACEXML_ENV_ARG_DECL) + ACE_THROW_SPEC ((ACEXML_SAXException)) + ; + + /* + * Receive notification of the beginning of a document. + */ + virtual void startDocument (ACEXML_ENV_SINGLE_ARG_DECL) + ACE_THROW_SPEC ((ACEXML_SAXException)) + ; + + /* + * Receive notification of the beginning of an element. + */ + virtual void startElement (const ACEXML_Char *namespaceURI, + const ACEXML_Char *localName, + const ACEXML_Char *qName, + ACEXML_Attributes *atts ACEXML_ENV_ARG_DECL) + ACE_THROW_SPEC ((ACEXML_SAXException)) + ; + + /* + * Begin the scope of a prefix-URI Namespace mapping. + */ + virtual void startPrefixMapping (const ACEXML_Char *prefix, + const ACEXML_Char *uri ACEXML_ENV_ARG_DECL) + ACE_THROW_SPEC ((ACEXML_SAXException)) + ; + + // *** Methods inherit from ACEXML_DTDHandler. + + /* + * Receive notification of a notation declaration event. + */ + virtual void notationDecl (const ACEXML_Char *name, + const ACEXML_Char *publicId, + const ACEXML_Char *systemId ACEXML_ENV_ARG_DECL) + ACE_THROW_SPEC ((ACEXML_SAXException)) + ; + + /* + * Receive notification of an unparsed entity declaration event. + */ + virtual void unparsedEntityDecl (const ACEXML_Char *name, + const ACEXML_Char *publicId, + const ACEXML_Char *systemId, + const ACEXML_Char *notationName ACEXML_ENV_ARG_DECL) + ACE_THROW_SPEC ((ACEXML_SAXException)) + ; + + // Methods inherit from ACEXML_EnitityResolver. + + /* + * Allow the application to resolve external entities. + */ + virtual ACEXML_InputSource *resolveEntity (const ACEXML_Char *publicId, + const ACEXML_Char *systemId ACEXML_ENV_ARG_DECL) + ACE_THROW_SPEC ((ACEXML_SAXException)) + ; + + // Methods inherit from ACEXML_ErrorHandler. + + /* + * Receive notification of a recoverable error. + */ + virtual void error (ACEXML_SAXParseException &exception ACEXML_ENV_ARG_DECL) + ACE_THROW_SPEC ((ACEXML_SAXException)) + ; + + /* + * Receive notification of a non-recoverable error. + */ + virtual void fatalError (ACEXML_SAXParseException &exception ACEXML_ENV_ARG_DECL) + ACE_THROW_SPEC ((ACEXML_SAXException)) + ; + + /* + * Receive notification of a warning. + */ + virtual void warning (ACEXML_SAXParseException &exception ACEXML_ENV_ARG_DECL) + ACE_THROW_SPEC ((ACEXML_SAXException)) + ; + + void inc_indent (); + void dec_indent (); + void print_indent (); + +private: + + size_t indent_; + ACEXML_Char* fileName_; + ACEXML_Locator* locator_; +}; + +#if defined (__ACEXML_INLINE__) +# include "SAXPrint_Handler.i" +#endif /* __ACEXML_INLINE__ */ +#endif /* ACEXML_SAXPRINT_HANDLER_H */ diff --git a/ACE/ACEXML/examples/SAXPrint/SAXPrint_Handler.i b/ACE/ACEXML/examples/SAXPrint/SAXPrint_Handler.i new file mode 100644 index 00000000000..2102291ea68 --- /dev/null +++ b/ACE/ACEXML/examples/SAXPrint/SAXPrint_Handler.i @@ -0,0 +1,13 @@ +// -*- C++ -*- $Id$ + +ACEXML_INLINE void +ACEXML_SAXPrint_Handler::inc_indent (void) +{ + this->indent_ += 1; +} + +ACEXML_INLINE void +ACEXML_SAXPrint_Handler::dec_indent (void) +{ + this->indent_ -= 1; +} diff --git a/ACE/ACEXML/examples/SAXPrint/broken.xml b/ACE/ACEXML/examples/SAXPrint/broken.xml new file mode 100644 index 00000000000..8c350cc24fe --- /dev/null +++ b/ACE/ACEXML/examples/SAXPrint/broken.xml @@ -0,0 +1,5 @@ +<?xml version="1.0"?> +<!-- This is a broken XML file. Most of the stuff here don't make any sense at all --> + +<root> + <child> kid diff --git a/ACE/ACEXML/examples/SAXPrint/main.cpp b/ACE/ACEXML/examples/SAXPrint/main.cpp new file mode 100644 index 00000000000..f6f334cee0e --- /dev/null +++ b/ACE/ACEXML/examples/SAXPrint/main.cpp @@ -0,0 +1,206 @@ +// $Id$ + +#include "ACEXML/common/FileCharStream.h" +#include "ACEXML/common/HttpCharStream.h" +#include "ACEXML/common/StrCharStream.h" +#include "ACEXML/common/ZipCharStream.h" +#include "ACEXML/parser/parser/Parser.h" +#include "Print_Handler.h" +#include "SAXPrint_Handler.h" +#include "ace/Get_Opt.h" +#include "ace/Auto_Ptr.h" +#include "ace/Log_Msg.h" +#include "ace/OS_main.h" + +static const ACEXML_Char *test_string = +ACE_TEXT ("<?xml version='1.0'?> <ACE_Svc_Conf> <static id=\"ACE_Service_Manager\" params='-d -p 4911'/> <dynamic id=\"Test_Task\" type=\"service_object\"> A " <initializer path=\"CCM_App\" init='_make_Test_Task' params='-p 3000'/> </dynamic> </ACE_Svc_Conf>"); + +static void +usage (const ACE_TCHAR* program) +{ + ACE_ERROR ((LM_ERROR, + ACE_TEXT ("Usage: %s [-sl] [-f <filename> | -u <url> | -z <ZIP Archive>]\n") + ACE_TEXT (" -s: Use SAXPrint_Handler (Default is Print_Handler)\n") + ACE_TEXT (" -l: Parse the internal strings (test the StrCharStream class)\n") + ACE_TEXT (" -f: Specify the filename when -l is not specified\n") + ACE_TEXT (" -z: Specify that the file is inside a ZIP archive\n") + ACE_TEXT (" -u: URL specifying the path to the file\n"), + program)); +} + +int +ACE_TMAIN (int argc, ACE_TCHAR *argv[]) +{ + ACEXML_Char* filename = 0; + int sax = 0; // Use SAXPrint handler or not. + int str = 0; + int zip = 0; + ACEXML_Char* url = 0; + + ACE_Get_Opt get_opt (argc, argv, ACE_TEXT ("sf:lu:z")); + int c; + + while ((c = get_opt ()) != EOF) + { + switch (c) + { + case 's': + sax = 1; + break; + case 'l': + str = 1; + break; + case 'f': + filename = get_opt.opt_arg (); + break; + case 'u': + url = get_opt.opt_arg(); + break; + case 'z': + zip = 1; +#ifndef USE_ZZIP + ACE_ERROR ((LM_ERROR, ACE_TEXT ("ZZIPLIB support has not been") + ACE_TEXT (" compiled in. Refer to ") + ACE_TEXT ("$ACE_ROOT/ACEXML/README for more ") + ACE_TEXT ("information. \n"))); + return -1; +#endif /* USE_ZZIP */ + break; + default: + usage(argv[0]); + return -1; + } + } + + if (str == 0 && filename == 0 && url == 0) { + usage(argv[0]); + return -1; + } + + ACEXML_DefaultHandler *handler = 0; + ACEXML_CharStream *stm = 0; + ACEXML_FileCharStream *fstm = 0; + ACEXML_HttpCharStream *ustm = 0; + ACEXML_StrCharStream* sstm = 0; +#ifdef USE_ZZIP + ACEXML_ZipCharStream* zstm = 0; +#endif /* USE_ZZIP */ + if (filename != 0) + { +#ifdef USE_ZZIP + if (zip) + { + ACE_NEW_RETURN (zstm, ACEXML_ZipCharStream(), -1); + if (zstm->open (filename) != 0) + ACE_ERROR_RETURN ((LM_ERROR, + ACE_TEXT ("Failed to open XML file: %s\n"), + filename), + -1); + stm = zstm; + } + else + { +#endif /* USE_ZZIP */ + ACE_NEW_RETURN (fstm, ACEXML_FileCharStream (), -1); + if (fstm->open (filename) != 0) + ACE_ERROR_RETURN ((LM_ERROR, + ACE_TEXT ("Failed to open XML file: %s\n"), + filename), + -1); + stm = fstm; +#ifdef USE_ZZIP + } +#endif /* USE_ZZIP */ + } + else if (url != 0) + { + + ACE_NEW_RETURN (ustm, ACEXML_HttpCharStream (), -1); + if (ustm->open (url) != 0) + ACE_ERROR_RETURN ((LM_ERROR, + ACE_TEXT ("Failed to open URL : %s\n"), + url), + -1); + stm = ustm; + } + else + { + ACE_NEW_RETURN (sstm, ACEXML_StrCharStream, -1); + if (sstm->open (test_string, ACE_TEXT ("test_string")) < 0) + ACE_ERROR_RETURN ((LM_ERROR, + ACE_TEXT ("Failed to open string : %s\n"), + test_string), + -1); + stm = sstm; + } + + ACEXML_Char* name = (filename == 0) ? url : filename; + if (sax == 0) + ACE_NEW_RETURN (handler, + ACEXML_Print_Handler (name), + -1); + else + ACE_NEW_RETURN (handler, + ACEXML_SAXPrint_Handler (name), + -1); + auto_ptr<ACEXML_DefaultHandler> cleanup_handler (handler); + + ACEXML_Parser parser; + ACEXML_InputSource input (stm); + + parser.setContentHandler (handler); + parser.setDTDHandler (handler); + parser.setErrorHandler (handler); + parser.setEntityResolver (handler); + ACEXML_DECLARE_NEW_ENV; + + ACEXML_TRY_EX (FIRST) + { + parser.parse (&input ACEXML_ENV_ARG_PARAMETER); + ACEXML_TRY_CHECK_EX (FIRST); + } + ACEXML_CATCH (ACEXML_Exception, ex) + { + ex.print(); + ACE_DEBUG ((LM_ERROR, ACE_TEXT ("Exception occurred. Exiting...\n"))); + } + ACEXML_ENDTRY; + ACEXML_TRY_EX (SECOND) + { + parser.parse (&input ACEXML_ENV_ARG_PARAMETER); + ACEXML_TRY_CHECK_EX (SECOND); + } + ACEXML_CATCH (ACEXML_SAXException, ex) + { + ex.print(); + ACE_DEBUG ((LM_ERROR, ACE_TEXT ("Exception occurred. Exiting...\n"))); + return 1; + } + ACEXML_ENDTRY; +// ACEXML_TRY_EX (THIRD) +// { +// parser.parse (&input ACEXML_ENV_ARG_PARAMETER); +// ACEXML_TRY_CHECK_EX (THIRD); +// } +// ACEXML_CATCH (ACEXML_SAXException, ex) +// { +// ex.print(); +// ACE_DEBUG ((LM_ERROR, ACE_TEXT ("Exception occurred. Exiting...\n"))); +// return 1; +// } +// ACEXML_ENDTRY; +// ACEXML_TRY_EX (FOURTH) +// { +// parser.parse (&input ACEXML_ENV_ARG_PARAMETER); +// ACEXML_TRY_CHECK_EX (FOURTH); +// } +// ACEXML_CATCH (ACEXML_SAXException, ex) +// { +// ex.print(); +// ACE_DEBUG ((LM_ERROR, ACE_TEXT ("Exception occurred. Exiting...\n"))); +// return 1; +// } +// ACEXML_ENDTRY; + return 0; +} + diff --git a/ACE/ACEXML/examples/SAXPrint/namespaces.xml b/ACE/ACEXML/examples/SAXPrint/namespaces.xml new file mode 100644 index 00000000000..f2418848929 --- /dev/null +++ b/ACE/ACEXML/examples/SAXPrint/namespaces.xml @@ -0,0 +1,95 @@ +<?xml version="1.0" encoding="iso8859-1"?> + +<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:sy="http://purl.org/rss/1.0/modules/syndication/" xmlns:admin="http://webns.net/mvcb/" xmlns="http://purl.org/rss/1.0/"> + +<channel rdf:about="http://primates.ximian.com/~ravi/BoozeLog/"> +<title>Vignesh Blogs Here</title> +<link>http://primates.ximian.com/~ravi/BoozeLog/</link> +<description></description> +<language>en-us</language> +<webMaster></webMaster> +<lastBuildDate>2002-10-11T00:50:42-06:00</lastBuildDate> +<pubDate>2002-10-12T20:19:57-06:00</pubDate> +<admin:generatorAgent rdf:resource="http://www.movabletype.org/?v=2.21" /> + +<items> +<rdf:Seq><rdf:li rdf:resource="http://primates.ximian.com/~ravi/BoozeLog/archives/000025.html" /> +<rdf:li rdf:resource="http://primates.ximian.com/~ravi/BoozeLog/archives/000024.html" /> +<rdf:li rdf:resource="http://primates.ximian.com/~ravi/BoozeLog/archives/000023.html" /> +<rdf:li rdf:resource="http://primates.ximian.com/~ravi/BoozeLog/archives/000020.html" /> +<rdf:li rdf:resource="http://primates.ximian.com/~ravi/BoozeLog/archives/000013.html" /> +<rdf:li rdf:resource="http://primates.ximian.com/~ravi/BoozeLog/archives/000012.html" /> +<rdf:li rdf:resource="http://primates.ximian.com/~ravi/BoozeLog/archives/000011.html" /> +<rdf:li rdf:resource="http://primates.ximian.com/~ravi/BoozeLog/archives/000008.html" /> +</rdf:Seq> +</items> + +</channel> + +<item rdf:about="http://primates.ximian.com/~ravi/BoozeLog/archives/000025.html"> +<title>Happy Birthday Vidya</title> +<description>Today is Vidya's birthday ! Happy Birthday Vidya! We had a midnight party,as usual, at Swapna's place, though I dont...</description> +<link>http://primates.ximian.com/~ravi/BoozeLog/archives/000025.html</link> +<dc:subject>Blog entry</dc:subject> +<dc:creator>Booze</dc:creator> +<dc:date>2002-10-11T00:50:42-06:00</dc:date> +</item> +<item rdf:about="http://primates.ximian.com/~ravi/BoozeLog/archives/000024.html"> +<title>Way to go, Shaastra!</title> +<description>On Flash Back mode now: Shaastra is the technical festival at my alma mater, IIT Madras, that replaced the old,...</description> +<link>http://primates.ximian.com/~ravi/BoozeLog/archives/000024.html</link> +<dc:subject>Blog entry</dc:subject> +<dc:creator>Booze</dc:creator> +<dc:date>2002-10-10T11:52:02-06:00</dc:date> +</item> +<item rdf:about="http://primates.ximian.com/~ravi/BoozeLog/archives/000023.html"> +<title>Back and Forth in Time</title> +<description>The blog is going to be a little skewed in time for the next coupla days.. Inspite of my laziness,...</description> +<link>http://primates.ximian.com/~ravi/BoozeLog/archives/000023.html</link> +<dc:subject>Blog entry</dc:subject> +<dc:creator>Booze</dc:creator> +<dc:date>2002-10-09T23:47:19-06:00</dc:date> +</item> +<item rdf:about="http://primates.ximian.com/~ravi/BoozeLog/archives/000020.html"> +<title>Frisco Rocks!</title> +<description>If there be any reason the blog hasnt been updated,it is simply because I am enjoying my trip to San...</description> +<link>http://primates.ximian.com/~ravi/BoozeLog/archives/000020.html</link> +<dc:subject>Blog entry</dc:subject> +<dc:creator>Booze</dc:creator> +<dc:date>2002-10-03T23:53:16-06:00</dc:date> +</item> +<item rdf:about="http://primates.ximian.com/~ravi/BoozeLog/archives/000013.html"> +<title>Think but not make thoughts your aim</title> +<description>A line from Rudyard Kipling's IF : would sum up my feelings for today, a lot of thinking from morning...</description> +<link>http://primates.ximian.com/~ravi/BoozeLog/archives/000013.html</link> +<dc:subject>Blog entry</dc:subject> +<dc:creator>Booze</dc:creator> +<dc:date>2002-09-28T22:48:09-06:00</dc:date> +</item> +<item rdf:about="http://primates.ximian.com/~ravi/BoozeLog/archives/000012.html"> +<title>New ARM but...</title> +<description>ARM stands for Advanced Recording Model, a simulation software that I use for my work, and I have been tinkering...</description> +<link>http://primates.ximian.com/~ravi/BoozeLog/archives/000012.html</link> +<dc:subject>Blog entry</dc:subject> +<dc:creator>Booze</dc:creator> +<dc:date>2002-09-27T22:36:28-06:00</dc:date> +</item> +<item rdf:about="http://primates.ximian.com/~ravi/BoozeLog/archives/000011.html"> +<title>A much needed break</title> +<description>Slowly got over the hangover of Sandhya's departure and moved to more mundane things in life : assignments, submissions and...</description> +<link>http://primates.ximian.com/~ravi/BoozeLog/archives/000011.html</link> +<dc:subject>Blog entry</dc:subject> +<dc:creator>Booze</dc:creator> +<dc:date>2002-09-26T23:05:46-06:00</dc:date> +</item> +<item rdf:about="http://primates.ximian.com/~ravi/BoozeLog/archives/000008.html"> +<title>Here we go !</title> +<description>My first attempts at Blogging, the idea was introduced to me by Ravi Pratap. MoveableType really makes it easy and...</description> +<link>http://primates.ximian.com/~ravi/BoozeLog/archives/000008.html</link> +<dc:subject>Blog entry</dc:subject> +<dc:creator>Booze</dc:creator> +<dc:date>2002-09-25T19:27:22-06:00</dc:date> +</item> + + +</rdf:RDF> diff --git a/ACE/ACEXML/examples/SAXPrint/ns.svc.conf.xml b/ACE/ACEXML/examples/SAXPrint/ns.svc.conf.xml new file mode 100644 index 00000000000..980ef21de92 --- /dev/null +++ b/ACE/ACEXML/examples/SAXPrint/ns.svc.conf.xml @@ -0,0 +1,46 @@ +<?xml version="1.0"?> +<ace:ACE_Svc_Conf xmlns="http://ace.doc.wustl.edu/svcconf" xmlns:ace="http://ace.doc.wustl.edu/svcconf"> +<static id="ACE_Service_Manager"> + <params>-d</params> + <params>-p 4911</params> +</static> + +<dynamic id="Test_Task" type="service_object"> A &lt; + <initializer path="CCM_App" init="_make_Test_Task"> + <params>-p 3000</params> + </initializer> +</dynamic> + +<ace:streamdef> + <dynamic id="CCM_App" type="stream" status="active"> + <initializer path="CCM_App" init="make_stream"/> + </dynamic> + <module> + <dynamic id="Device_Adapter" type="module"> + <initializer path="CCM_App" init="make_da"/> + </dynamic> + <dynamic id="Event_Analyzer" type="module"> + <initializer path="CCM_App" init="make_ea"/> + </dynamic> + <dynamic id="Multicast_Router" type="module"> + <initializer path="CCM_App" init="make_mr"> + <params>-p</params> + <params>3001</params> + </initializer> + </dynamic> + </module> +</ace:streamdef> + +<stream id="CCM_App"> + <module> + <remove id="Device_Adapter"/> + <!-- <remove id="Event_Analyzer"/> --> + <!-- <remove id="Multicast_Router"/> --> + <![CDATA[Only a text string. +Do you &expect something more?]]> + </module> +</stream> + +<!-- remove CCM_App --> +<remove id="Test_&Taskebc"/> +</ace:ACE_Svc_Conf> diff --git a/ACE/ACEXML/examples/SAXPrint/simple.svcconf.xml b/ACE/ACEXML/examples/SAXPrint/simple.svcconf.xml new file mode 100644 index 00000000000..32afe359fdb --- /dev/null +++ b/ACE/ACEXML/examples/SAXPrint/simple.svcconf.xml @@ -0,0 +1,38 @@ +<ACE_Svc_Conf> +<static id="ACE_Service_Manager" params="-d -p 4911"/> + +<dynamic id="Test_Task" type="service_object"> A & + <initializer path="CCM_App" init="_make_Test_Task" params="-p 3000" /> +</dynamic> + +<streamdef> + <dynamic id="CCM_App" type="stream" status="active"> + <initializer path="CCM_App" init="make_stream"/> + </dynamic> + <module> + <dynamic id="Device_Adapter" type="module"> + <initializer path="CCM_App" init="make_da"/> + </dynamic> + <dynamic id="Event_Analyzer" type="module"> + <initializer path="CCM_App" init="make_ea"/> + </dynamic> + <dynamic id="Multicast_Router" type="module"> + <initializer path="CCM_App" init="make_mr" params="-p 3001"/> + </dynamic> + </module> +</streamdef> + +<stream id="&ccm;"> + <module> + <remove id="Device_Adapter"/> + <!-- <remove id="Event_Analyzer"/> --> + <!-- <remove id="Multicast_Router"/> --> + <![CDATA[Only a text string. +Do you &expect something more? A]]> +<!-- Noticed that the "&" in the above CDATA section can not be escaped. --> + </module> +</stream> + +<!-- remove CCM_App --> +<remove id="Test_&Taskabc"/> +</ACE_Svc_Conf> diff --git a/ACE/ACEXML/examples/SAXPrint/svc.conf.xml b/ACE/ACEXML/examples/SAXPrint/svc.conf.xml new file mode 100644 index 00000000000..5296e5cac35 --- /dev/null +++ b/ACE/ACEXML/examples/SAXPrint/svc.conf.xml @@ -0,0 +1,58 @@ +<?xml version="1.0"?> +<!-- This is a test XML file. Most of the stuff here don't make any sense at all --> +<!DOCTYPE ACE_Svc_Conf PUBLIC 'GOODSAM' '../../apps/svcconf/svcconf.dtd' + [ + <!NOTATION goody PUBLIC 'NBC' 'http://hardcoreace.com/'> + <!NOTATION frodo PUBLIC 'ABC'> + <!NOTATION bilbo SYSTEM "C:/ACE-GUIDELINE"> + <!ENTITY ccm 'CCM_App'> + <!ENTITY pippin PUBLIC 'GOTO' 'http://taozen.com/' NDATA goody> + <!ENTITY sam PUBLIC 'SHIRE' 'http://taozen.com/'> + <!ENTITY gandolf SYSTEM 'D:/RINGS.DOT'> + <!ELEMENT GOOBEGONE EMPTY> + <!ELEMENT POOPOO ANY> + <!ELEMENT HOHOHO ((BOOBOO, GOOBEGONE)?, (GOOBEGONE|POOPOO)*)+> + <!ELEMENT BOOBOO (#PCDATA | BOOBOO)*> + <!ATTLIST GOOBEGONE + ohmy CDATA #REQUIRED + testing IDREF #IMPLIED> + ]> + +<ACE_Svc_Conf> +<static id="ACE_Service_Manager" params="-d -p 4911"/> + +<dynamic id="Test_Task" type="service_object"> A & + <initializer path="CCM_App" init="_make_Test_Task" params="-p 3000" /> +</dynamic> + +<streamdef> + <dynamic id="CCM_App" type="stream" status="active"> + <initializer path="CCM_App" init="make_stream"/> + </dynamic> + <module> + <dynamic id="Device_Adapter" type="module"> + <initializer path="CCM_App" init="make_da"/> + </dynamic> + <dynamic id="Event_Analyzer" type="module"> + <initializer path="CCM_App" init="make_ea"/> + </dynamic> + <dynamic id="Multicast_Router" type="module"> + <initializer path="CCM_App" init="make_mr" params="-p 3001"/> + </dynamic> + </module> +</streamdef> + +<stream id="&ccm;"> + <module> + <remove id="Device_Adapter"/> + <!-- <remove id="Event_Analyzer"/> --> + <!-- <remove id="Multicast_Router"/> --> + <![CDATA[Only a text string. +Do you &expect something more? A]]> +<!-- Noticed that the "&" in the above CDATA section can not be escaped. --> + </module> +</stream> + +<!-- remove CCM_App --> +<remove id="Test_&Taskabc"/> +</ACE_Svc_Conf> |