Changeset 2774 for icXML


Ignore:
Timestamp:
Dec 12, 2012, 6:10:33 PM (6 years ago)
Author:
cameron
Message:

Various fixes

Location:
icXML/icXML-devel
Files:
4 added
29 edited

Legend:

Unmodified
Added
Removed
  • icXML/icXML-devel/Makefile.in

    r2752 r2774  
    4141        $(top_srcdir)/src/xercesc/util/MsgLoaders/MsgCatalog/Makefile.in \
    4242        $(top_srcdir)/src/xercesc/util/Xerces_autoconf_config.hpp.in \
    43         COPYING INSTALL config/compile config/config.guess \
    44         config/config.sub config/depcomp config/install-sh \
    45         config/ltmain.sh config/missing
     43        config/compile config/config.guess config/config.sub \
     44        config/depcomp config/install-sh config/ltmain.sh \
     45        config/missing
    4646ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
    4747am__aclocal_m4_deps = $(top_srcdir)/m4/acx_pthread.m4 \
  • icXML/icXML-devel/src/Makefile.am

    r2750 r2774  
    354354        xercesc/dom/impl/DOMLSInputImpl.hpp \
    355355        xercesc/dom/impl/DOMLSOutputImpl.hpp \
    356         xercesc/dom/impl/DOMXPathExpressionImpl.hpp \
     356        icxercesc/dom/impl/DOMXPathExpressionImpl.hpp \
    357357        xercesc/dom/impl/DOMXPathNSResolverImpl.hpp \
    358         xercesc/dom/impl/DOMXPathResultImpl.hpp \
     358        icxercesc/dom/impl/DOMXPathResultImpl.hpp \
    359359        xercesc/dom/impl/XSDElementNSImpl.hpp
    360360
     
    400400        xercesc/dom/impl/DOMLSInputImpl.cpp \
    401401        xercesc/dom/impl/DOMLSOutputImpl.cpp \
    402         xercesc/dom/impl/DOMXPathExpressionImpl.cpp \
     402        icxercesc/dom/impl/DOMXPathExpressionImpl.cpp \
    403403        xercesc/dom/impl/DOMXPathNSResolverImpl.cpp \
    404404        xercesc/dom/impl/DOMXPathResultImpl.cpp \
     
    941941        xercesc/validators/schema/XercesGroupInfo.hpp \
    942942        xercesc/validators/schema/XMLSchemaDescriptionImpl.hpp \
    943         xercesc/validators/schema/XSDDOMParser.hpp \
     943        icxercesc/validators/schema/XSDDOMParser.hpp \
    944944        xercesc/validators/schema/XSDErrorReporter.hpp \
    945945        xercesc/validators/schema/XSDLocator.hpp \
     
    10311031        xercesc/validators/schema/XercesGroupInfo.cpp \
    10321032        xercesc/validators/schema/XMLSchemaDescriptionImpl.cpp \
    1033         xercesc/validators/schema/XSDDOMParser.cpp \
     1033        icxercesc/validators/schema/XSDDOMParser.cpp \
    10341034        xercesc/validators/schema/XSDErrorReporter.cpp \
    10351035        xercesc/validators/schema/XSDLocator.cpp \
  • icXML/icXML-devel/src/Makefile.in

    r2751 r2774  
    275275        xercesc/dom/impl/DOMLSInputImpl.cpp \
    276276        xercesc/dom/impl/DOMLSOutputImpl.cpp \
    277         xercesc/dom/impl/DOMXPathExpressionImpl.cpp \
     277        icxercesc/dom/impl/DOMXPathExpressionImpl.cpp \
    278278        xercesc/dom/impl/DOMXPathNSResolverImpl.cpp \
    279279        xercesc/dom/impl/DOMXPathResultImpl.cpp \
     
    443443        xercesc/validators/schema/XercesGroupInfo.cpp \
    444444        xercesc/validators/schema/XMLSchemaDescriptionImpl.cpp \
    445         xercesc/validators/schema/XSDDOMParser.cpp \
     445        icxercesc/validators/schema/XSDDOMParser.cpp \
    446446        xercesc/validators/schema/XSDErrorReporter.cpp \
    447447        xercesc/validators/schema/XSDLocator.cpp \
     
    570570        xercesc/dom/impl/DOMLSInputImpl.lo \
    571571        xercesc/dom/impl/DOMLSOutputImpl.lo \
    572         xercesc/dom/impl/DOMXPathExpressionImpl.lo \
     572        icxercesc/dom/impl/DOMXPathExpressionImpl.lo \
    573573        xercesc/dom/impl/DOMXPathNSResolverImpl.lo \
    574574        xercesc/dom/impl/DOMXPathResultImpl.lo \
     
    739739        xercesc/validators/schema/XercesGroupInfo.lo \
    740740        xercesc/validators/schema/XMLSchemaDescriptionImpl.lo \
    741         xercesc/validators/schema/XSDDOMParser.lo \
     741        icxercesc/validators/schema/XSDDOMParser.lo \
    742742        xercesc/validators/schema/XSDErrorReporter.lo \
    743743        xercesc/validators/schema/XSDLocator.lo \
     
    10221022        xercesc/dom/impl/DOMLSInputImpl.hpp \
    10231023        xercesc/dom/impl/DOMLSOutputImpl.hpp \
    1024         xercesc/dom/impl/DOMXPathExpressionImpl.hpp \
     1024        icxercesc/dom/impl/DOMXPathExpressionImpl.hpp \
    10251025        xercesc/dom/impl/DOMXPathNSResolverImpl.hpp \
    1026         xercesc/dom/impl/DOMXPathResultImpl.hpp \
     1026        icxercesc/dom/impl/DOMXPathResultImpl.hpp \
    10271027        xercesc/dom/impl/XSDElementNSImpl.hpp \
    10281028        xercesc/framework/BinOutputStream.hpp \
     
    12261226        xercesc/validators/schema/XercesGroupInfo.hpp \
    12271227        xercesc/validators/schema/XMLSchemaDescriptionImpl.hpp \
    1228         xercesc/validators/schema/XSDDOMParser.hpp \
     1228        icxercesc/validators/schema/XSDDOMParser.hpp \
    12291229        xercesc/validators/schema/XSDErrorReporter.hpp \
    12301230        xercesc/validators/schema/XSDLocator.hpp \
     
    16751675        xercesc/dom/impl/DOMLSInputImpl.hpp \
    16761676        xercesc/dom/impl/DOMLSOutputImpl.hpp \
    1677         xercesc/dom/impl/DOMXPathExpressionImpl.hpp \
     1677        icxercesc/dom/impl/DOMXPathExpressionImpl.hpp \
    16781678        xercesc/dom/impl/DOMXPathNSResolverImpl.hpp \
    1679         xercesc/dom/impl/DOMXPathResultImpl.hpp \
     1679        icxercesc/dom/impl/DOMXPathResultImpl.hpp \
    16801680        xercesc/dom/impl/XSDElementNSImpl.hpp
    16811681
     
    17211721        xercesc/dom/impl/DOMLSInputImpl.cpp \
    17221722        xercesc/dom/impl/DOMLSOutputImpl.cpp \
    1723         xercesc/dom/impl/DOMXPathExpressionImpl.cpp \
     1723        icxercesc/dom/impl/DOMXPathExpressionImpl.cpp \
    17241724        xercesc/dom/impl/DOMXPathNSResolverImpl.cpp \
    17251725        xercesc/dom/impl/DOMXPathResultImpl.cpp \
     
    22562256        xercesc/validators/schema/XercesGroupInfo.hpp \
    22572257        xercesc/validators/schema/XMLSchemaDescriptionImpl.hpp \
    2258         xercesc/validators/schema/XSDDOMParser.hpp \
     2258        icxercesc/validators/schema/XSDDOMParser.hpp \
    22592259        xercesc/validators/schema/XSDErrorReporter.hpp \
    22602260        xercesc/validators/schema/XSDLocator.hpp \
     
    23462346        xercesc/validators/schema/XercesGroupInfo.cpp \
    23472347        xercesc/validators/schema/XMLSchemaDescriptionImpl.cpp \
    2348         xercesc/validators/schema/XSDDOMParser.cpp \
     2348        icxercesc/validators/schema/XSDDOMParser.cpp \
    23492349        xercesc/validators/schema/XSDErrorReporter.cpp \
    23502350        xercesc/validators/schema/XSDLocator.cpp \
     
    28572857xercesc/dom/impl/DOMLSOutputImpl.lo: xercesc/dom/impl/$(am__dirstamp) \
    28582858        xercesc/dom/impl/$(DEPDIR)/$(am__dirstamp)
    2859 xercesc/dom/impl/DOMXPathExpressionImpl.lo:  \
    2860         xercesc/dom/impl/$(am__dirstamp) \
    2861         xercesc/dom/impl/$(DEPDIR)/$(am__dirstamp)
     2859icxercesc/dom/impl/$(am__dirstamp):
     2860        @$(MKDIR_P) icxercesc/dom/impl
     2861        @: > icxercesc/dom/impl/$(am__dirstamp)
     2862icxercesc/dom/impl/$(DEPDIR)/$(am__dirstamp):
     2863        @$(MKDIR_P) icxercesc/dom/impl/$(DEPDIR)
     2864        @: > icxercesc/dom/impl/$(DEPDIR)/$(am__dirstamp)
     2865icxercesc/dom/impl/DOMXPathExpressionImpl.lo:  \
     2866        icxercesc/dom/impl/$(am__dirstamp) \
     2867        icxercesc/dom/impl/$(DEPDIR)/$(am__dirstamp)
    28622868xercesc/dom/impl/DOMXPathNSResolverImpl.lo:  \
    28632869        xercesc/dom/impl/$(am__dirstamp) \
     
    34523458        xercesc/validators/schema/$(am__dirstamp) \
    34533459        xercesc/validators/schema/$(DEPDIR)/$(am__dirstamp)
    3454 xercesc/validators/schema/XSDDOMParser.lo:  \
    3455         xercesc/validators/schema/$(am__dirstamp) \
    3456         xercesc/validators/schema/$(DEPDIR)/$(am__dirstamp)
     3460icxercesc/validators/schema/XSDDOMParser.lo:  \
     3461        icxercesc/validators/schema/$(am__dirstamp) \
     3462        icxercesc/validators/schema/$(DEPDIR)/$(am__dirstamp)
    34573463xercesc/validators/schema/XSDErrorReporter.lo:  \
    34583464        xercesc/validators/schema/$(am__dirstamp) \
     
    36523658mostlyclean-compile:
    36533659        -rm -f *.$(OBJEXT)
     3660        -rm -f icxercesc/dom/impl/DOMXPathExpressionImpl.$(OBJEXT)
     3661        -rm -f icxercesc/dom/impl/DOMXPathExpressionImpl.lo
    36543662        -rm -f icxercesc/framework/XMLAttDef.$(OBJEXT)
    36553663        -rm -f icxercesc/framework/XMLAttDef.lo
     
    37483756        -rm -f icxercesc/validators/schema/SubstitutionGroupComparator.$(OBJEXT)
    37493757        -rm -f icxercesc/validators/schema/SubstitutionGroupComparator.lo
     3758        -rm -f icxercesc/validators/schema/XSDDOMParser.$(OBJEXT)
     3759        -rm -f icxercesc/validators/schema/XSDDOMParser.lo
    37503760        -rm -f icxmlc/XMLDefaultCharacterSetAdapter.$(OBJEXT)
    37513761        -rm -f icxmlc/XMLDefaultCharacterSetAdapter.lo
     
    38443854        -rm -f xercesc/dom/impl/DOMTypeInfoImpl.$(OBJEXT)
    38453855        -rm -f xercesc/dom/impl/DOMTypeInfoImpl.lo
    3846         -rm -f xercesc/dom/impl/DOMXPathExpressionImpl.$(OBJEXT)
    3847         -rm -f xercesc/dom/impl/DOMXPathExpressionImpl.lo
    38483856        -rm -f xercesc/dom/impl/DOMXPathNSResolverImpl.$(OBJEXT)
    38493857        -rm -f xercesc/dom/impl/DOMXPathNSResolverImpl.lo
     
    42384246        -rm -f xercesc/validators/schema/XMLSchemaDescriptionImpl.$(OBJEXT)
    42394247        -rm -f xercesc/validators/schema/XMLSchemaDescriptionImpl.lo
    4240         -rm -f xercesc/validators/schema/XSDDOMParser.$(OBJEXT)
    4241         -rm -f xercesc/validators/schema/XSDDOMParser.lo
    42424248        -rm -f xercesc/validators/schema/XSDErrorReporter.$(OBJEXT)
    42434249        -rm -f xercesc/validators/schema/XSDErrorReporter.lo
     
    42984304@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/root_res.Plo@am__quote@
    42994305@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xercesc_messages.Plo@am__quote@
     4306@AMDEP_TRUE@@am__include@ @am__quote@icxercesc/dom/impl/$(DEPDIR)/DOMXPathExpressionImpl.Plo@am__quote@
    43004307@AMDEP_TRUE@@am__include@ @am__quote@icxercesc/framework/$(DEPDIR)/XMLAttDef.Plo@am__quote@
    43014308@AMDEP_TRUE@@am__include@ @am__quote@icxercesc/framework/$(DEPDIR)/XMLAttr.Plo@am__quote@
     
    43464353@AMDEP_TRUE@@am__include@ @am__quote@icxercesc/validators/schema/$(DEPDIR)/SchemaValidator.Plo@am__quote@
    43474354@AMDEP_TRUE@@am__include@ @am__quote@icxercesc/validators/schema/$(DEPDIR)/SubstitutionGroupComparator.Plo@am__quote@
     4355@AMDEP_TRUE@@am__include@ @am__quote@icxercesc/validators/schema/$(DEPDIR)/XSDDOMParser.Plo@am__quote@
    43484356@AMDEP_TRUE@@am__include@ @am__quote@icxmlc/$(DEPDIR)/XMLDefaultCharacterSetAdapter.Plo@am__quote@
    43494357@AMDEP_TRUE@@am__include@ @am__quote@icxmlc/$(DEPDIR)/XMLSymbolTable.Plo@am__quote@
     
    43944402@AMDEP_TRUE@@am__include@ @am__quote@xercesc/dom/impl/$(DEPDIR)/DOMTreeWalkerImpl.Plo@am__quote@
    43954403@AMDEP_TRUE@@am__include@ @am__quote@xercesc/dom/impl/$(DEPDIR)/DOMTypeInfoImpl.Plo@am__quote@
    4396 @AMDEP_TRUE@@am__include@ @am__quote@xercesc/dom/impl/$(DEPDIR)/DOMXPathExpressionImpl.Plo@am__quote@
    43974404@AMDEP_TRUE@@am__include@ @am__quote@xercesc/dom/impl/$(DEPDIR)/DOMXPathNSResolverImpl.Plo@am__quote@
    43984405@AMDEP_TRUE@@am__include@ @am__quote@xercesc/dom/impl/$(DEPDIR)/DOMXPathResultImpl.Plo@am__quote@
     
    45914598@AMDEP_TRUE@@am__include@ @am__quote@xercesc/validators/schema/$(DEPDIR)/TraverseSchema.Plo@am__quote@
    45924599@AMDEP_TRUE@@am__include@ @am__quote@xercesc/validators/schema/$(DEPDIR)/XMLSchemaDescriptionImpl.Plo@am__quote@
    4593 @AMDEP_TRUE@@am__include@ @am__quote@xercesc/validators/schema/$(DEPDIR)/XSDDOMParser.Plo@am__quote@
    45944600@AMDEP_TRUE@@am__include@ @am__quote@xercesc/validators/schema/$(DEPDIR)/XSDErrorReporter.Plo@am__quote@
    45954601@AMDEP_TRUE@@am__include@ @am__quote@xercesc/validators/schema/$(DEPDIR)/XSDLocator.Plo@am__quote@
     
    46704676clean-libtool:
    46714677        -rm -rf .libs _libs
     4678        -rm -rf icxercesc/dom/impl/.libs icxercesc/dom/impl/_libs
    46724679        -rm -rf icxercesc/framework/.libs icxercesc/framework/_libs
    46734680        -rm -rf icxercesc/internal/.libs icxercesc/internal/_libs
     
    49814988        -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
    49824989        -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
     4990        -rm -f icxercesc/dom/impl/$(DEPDIR)/$(am__dirstamp)
     4991        -rm -f icxercesc/dom/impl/$(am__dirstamp)
    49834992        -rm -f icxercesc/framework/$(DEPDIR)/$(am__dirstamp)
    49844993        -rm -f icxercesc/framework/$(am__dirstamp)
     
    50745083
    50755084distclean: distclean-recursive
    5076         -rm -rf $(DEPDIR) ./$(DEPDIR) icxercesc/framework/$(DEPDIR) icxercesc/internal/$(DEPDIR) icxercesc/parsers/$(DEPDIR) icxercesc/util/$(DEPDIR) icxercesc/util/Transcoders/IconvGNU/$(DEPDIR) icxercesc/util/regx/$(DEPDIR) icxercesc/validators/DTD/$(DEPDIR) icxercesc/validators/common/$(DEPDIR) icxercesc/validators/datatype/$(DEPDIR) icxercesc/validators/schema/$(DEPDIR) icxmlc/$(DEPDIR) xercesc/dom/$(DEPDIR) xercesc/dom/impl/$(DEPDIR) xercesc/framework/$(DEPDIR) xercesc/framework/psvi/$(DEPDIR) xercesc/internal/$(DEPDIR) xercesc/parsers/$(DEPDIR) xercesc/sax/$(DEPDIR) xercesc/sax2/$(DEPDIR) xercesc/util/$(DEPDIR) xercesc/util/FileManagers/$(DEPDIR) xercesc/util/MsgLoaders/ICU/$(DEPDIR) xercesc/util/MsgLoaders/InMemory/$(DEPDIR) xercesc/util/MsgLoaders/MsgCatalog/$(DEPDIR) xercesc/util/MutexManagers/$(DEPDIR) xercesc/util/NetAccessors/$(DEPDIR) xercesc/util/NetAccessors/Curl/$(DEPDIR) xercesc/util/NetAccessors/MacOSURLAccessCF/$(DEPDIR) xercesc/util/NetAccessors/Socket/$(DEPDIR) xercesc/util/NetAccessors/WinSock/$(DEPDIR) xercesc/util/Transcoders/ICU/$(DEPDIR) xercesc/util/Transcoders/Iconv/$(DEPDIR) xercesc/util/Transcoders/MacOSUnicodeConverter/$(DEPDIR) xercesc/util/Transcoders/Win32/$(DEPDIR) xercesc/util/regx/$(DEPDIR) xercesc/validators/DTD/$(DEPDIR) xercesc/validators/common/$(DEPDIR) xercesc/validators/datatype/$(DEPDIR) xercesc/validators/schema/$(DEPDIR) xercesc/validators/schema/identity/$(DEPDIR) xercesc/xinclude/$(DEPDIR)
     5085        -rm -rf $(DEPDIR) ./$(DEPDIR) icxercesc/dom/impl/$(DEPDIR) icxercesc/framework/$(DEPDIR) icxercesc/internal/$(DEPDIR) icxercesc/parsers/$(DEPDIR) icxercesc/util/$(DEPDIR) icxercesc/util/Transcoders/IconvGNU/$(DEPDIR) icxercesc/util/regx/$(DEPDIR) icxercesc/validators/DTD/$(DEPDIR) icxercesc/validators/common/$(DEPDIR) icxercesc/validators/datatype/$(DEPDIR) icxercesc/validators/schema/$(DEPDIR) icxmlc/$(DEPDIR) xercesc/dom/$(DEPDIR) xercesc/dom/impl/$(DEPDIR) xercesc/framework/$(DEPDIR) xercesc/framework/psvi/$(DEPDIR) xercesc/internal/$(DEPDIR) xercesc/parsers/$(DEPDIR) xercesc/sax/$(DEPDIR) xercesc/sax2/$(DEPDIR) xercesc/util/$(DEPDIR) xercesc/util/FileManagers/$(DEPDIR) xercesc/util/MsgLoaders/ICU/$(DEPDIR) xercesc/util/MsgLoaders/InMemory/$(DEPDIR) xercesc/util/MsgLoaders/MsgCatalog/$(DEPDIR) xercesc/util/MutexManagers/$(DEPDIR) xercesc/util/NetAccessors/$(DEPDIR) xercesc/util/NetAccessors/Curl/$(DEPDIR) xercesc/util/NetAccessors/MacOSURLAccessCF/$(DEPDIR) xercesc/util/NetAccessors/Socket/$(DEPDIR) xercesc/util/NetAccessors/WinSock/$(DEPDIR) xercesc/util/Transcoders/ICU/$(DEPDIR) xercesc/util/Transcoders/Iconv/$(DEPDIR) xercesc/util/Transcoders/MacOSUnicodeConverter/$(DEPDIR) xercesc/util/Transcoders/Win32/$(DEPDIR) xercesc/util/regx/$(DEPDIR) xercesc/validators/DTD/$(DEPDIR) xercesc/validators/common/$(DEPDIR) xercesc/validators/datatype/$(DEPDIR) xercesc/validators/schema/$(DEPDIR) xercesc/validators/schema/identity/$(DEPDIR) xercesc/xinclude/$(DEPDIR)
    50775086        -rm -f Makefile
    50785087distclean-am: clean-am distclean-compile distclean-generic \
     
    51215130
    51225131maintainer-clean: maintainer-clean-recursive
    5123         -rm -rf $(DEPDIR) ./$(DEPDIR) icxercesc/framework/$(DEPDIR) icxercesc/internal/$(DEPDIR) icxercesc/parsers/$(DEPDIR) icxercesc/util/$(DEPDIR) icxercesc/util/Transcoders/IconvGNU/$(DEPDIR) icxercesc/util/regx/$(DEPDIR) icxercesc/validators/DTD/$(DEPDIR) icxercesc/validators/common/$(DEPDIR) icxercesc/validators/datatype/$(DEPDIR) icxercesc/validators/schema/$(DEPDIR) icxmlc/$(DEPDIR) xercesc/dom/$(DEPDIR) xercesc/dom/impl/$(DEPDIR) xercesc/framework/$(DEPDIR) xercesc/framework/psvi/$(DEPDIR) xercesc/internal/$(DEPDIR) xercesc/parsers/$(DEPDIR) xercesc/sax/$(DEPDIR) xercesc/sax2/$(DEPDIR) xercesc/util/$(DEPDIR) xercesc/util/FileManagers/$(DEPDIR) xercesc/util/MsgLoaders/ICU/$(DEPDIR) xercesc/util/MsgLoaders/InMemory/$(DEPDIR) xercesc/util/MsgLoaders/MsgCatalog/$(DEPDIR) xercesc/util/MutexManagers/$(DEPDIR) xercesc/util/NetAccessors/$(DEPDIR) xercesc/util/NetAccessors/Curl/$(DEPDIR) xercesc/util/NetAccessors/MacOSURLAccessCF/$(DEPDIR) xercesc/util/NetAccessors/Socket/$(DEPDIR) xercesc/util/NetAccessors/WinSock/$(DEPDIR) xercesc/util/Transcoders/ICU/$(DEPDIR) xercesc/util/Transcoders/Iconv/$(DEPDIR) xercesc/util/Transcoders/MacOSUnicodeConverter/$(DEPDIR) xercesc/util/Transcoders/Win32/$(DEPDIR) xercesc/util/regx/$(DEPDIR) xercesc/validators/DTD/$(DEPDIR) xercesc/validators/common/$(DEPDIR) xercesc/validators/datatype/$(DEPDIR) xercesc/validators/schema/$(DEPDIR) xercesc/validators/schema/identity/$(DEPDIR) xercesc/xinclude/$(DEPDIR)
     5132        -rm -rf $(DEPDIR) ./$(DEPDIR) icxercesc/dom/impl/$(DEPDIR) icxercesc/framework/$(DEPDIR) icxercesc/internal/$(DEPDIR) icxercesc/parsers/$(DEPDIR) icxercesc/util/$(DEPDIR) icxercesc/util/Transcoders/IconvGNU/$(DEPDIR) icxercesc/util/regx/$(DEPDIR) icxercesc/validators/DTD/$(DEPDIR) icxercesc/validators/common/$(DEPDIR) icxercesc/validators/datatype/$(DEPDIR) icxercesc/validators/schema/$(DEPDIR) icxmlc/$(DEPDIR) xercesc/dom/$(DEPDIR) xercesc/dom/impl/$(DEPDIR) xercesc/framework/$(DEPDIR) xercesc/framework/psvi/$(DEPDIR) xercesc/internal/$(DEPDIR) xercesc/parsers/$(DEPDIR) xercesc/sax/$(DEPDIR) xercesc/sax2/$(DEPDIR) xercesc/util/$(DEPDIR) xercesc/util/FileManagers/$(DEPDIR) xercesc/util/MsgLoaders/ICU/$(DEPDIR) xercesc/util/MsgLoaders/InMemory/$(DEPDIR) xercesc/util/MsgLoaders/MsgCatalog/$(DEPDIR) xercesc/util/MutexManagers/$(DEPDIR) xercesc/util/NetAccessors/$(DEPDIR) xercesc/util/NetAccessors/Curl/$(DEPDIR) xercesc/util/NetAccessors/MacOSURLAccessCF/$(DEPDIR) xercesc/util/NetAccessors/Socket/$(DEPDIR) xercesc/util/NetAccessors/WinSock/$(DEPDIR) xercesc/util/Transcoders/ICU/$(DEPDIR) xercesc/util/Transcoders/Iconv/$(DEPDIR) xercesc/util/Transcoders/MacOSUnicodeConverter/$(DEPDIR) xercesc/util/Transcoders/Win32/$(DEPDIR) xercesc/util/regx/$(DEPDIR) xercesc/validators/DTD/$(DEPDIR) xercesc/validators/common/$(DEPDIR) xercesc/validators/datatype/$(DEPDIR) xercesc/validators/schema/$(DEPDIR) xercesc/validators/schema/identity/$(DEPDIR) xercesc/xinclude/$(DEPDIR)
    51245133        -rm -f Makefile
    51255134maintainer-clean-am: distclean-am maintainer-clean-generic
  • icXML/icXML-devel/src/icxercesc/framework/XMLAttr.cpp

    r2721 r2774  
    2727#include <xercesc/framework/MemoryManager.hpp>
    2828#include <xercesc/util/OutOfMemoryException.hpp>
     29#include <icxmlc/XMLStringU.hpp>
     30#include <icxmlc/XMLNamespaceResolver.hpp>
     31#include <icxmlc/XMLConfig.hpp>
    2932
    3033XERCES_CPP_NAMESPACE_BEGIN
     
    127130}
    128131
     132bool XMLAttr::isXMLNS() const
     133{
     134    return (getURIId() == XMLNamespaceResolver::fEmptyUriId && XMLStringU::isXML(getQName())) || (getURIId() == XMLNamespaceResolver::fXMLNSUriId);
     135}
    129136
    130137// ---------------------------------------------------------------------------
     
    156163}
    157164
     165
    158166// ---------------------------------------------------------------------------
    159167//  XMLAttr: Private, helper methods
  • icXML/icXML-devel/src/icxercesc/framework/XMLAttr.hpp

    r2721 r2774  
    2424class XMLScanner;
    2525class IGXMLScanner;
     26class DOMXPathExpressionImpl;
    2627
    2728/**
     
    5051    friend class XMLScanner;
    5152    friend class IGXMLScanner;
     53    friend class DOMXPathExpressionImpl;
    5254
    5355public:
     
    518520        //@}
    519521
    520 private :
     522
     523    /**
     524     * Returns whether this is an xmlns or xmlns: attribute.
     525     */
     526    bool isXMLNS() const;
     527
     528private:
    521529        // -----------------------------------------------------------------------
    522530        //  Unimplemented constructors and operators
  • icXML/icXML-devel/src/icxercesc/framework/XMLContentModel.hpp

    r2721 r2774  
    2828class SubstitutionGroupComparator;
    2929class XMLNamespaceResolver;
    30 // class XMLElementDecl;
    3130
    3231/**
  • icXML/icXML-devel/src/icxercesc/internal/IGXMLScanner.cpp

    r2734 r2774  
    698698                                                                if (tempElemDecl && tempElemDecl->getCreateReason() != XMLElementDecl::JustFaultIn && fValidate)
    699699                                                                {
    700                                                                         fValidator->emitError
    701                                                                         (
    702                                                                                 XMLValid::ElementNotUnQualified, element->getName()
    703                                                                         );
     700                                                                        fValidator->emitError(XMLValid::ElementNotUnQualified, element->getName());
    704701                                                                        elemDecl = tempElemDecl;
    705702                                                                }
     
    12521249                                        attDef = ((DTDElementDecl*)elemDecl)->getAttDef(qName->getRawName());
    12531250                                }
    1254 
    1255                 DEBUG_TRANSITION_MESSAGE(qName << ":attDef=" << attDef)
    12561251
    12571252                                if (attDef)
     
    18151810                {
    18161811                        QName * eName = elemDecl->getElementName();
     1812
    18171813                        fPSVIHandler->handleAttributesPSVI
    18181814                        (
  • icXML/icXML-devel/src/icxercesc/internal/IGXMLScanner2.cpp

    r2734 r2774  
    4646#include <xercesc/validators/schema/TraverseSchema.hpp>
    4747#include <icxercesc/validators/schema/SubstitutionGroupComparator.hpp>
    48 #include <xercesc/validators/schema/XSDDOMParser.hpp>
     48#include <icxercesc/validators/schema/XSDDOMParser.hpp>
    4949#include <xercesc/validators/schema/identity/IdentityConstraintHandler.hpp>
    5050#include <xercesc/validators/schema/identity/ValueStore.hpp>
  • icXML/icXML-devel/src/icxercesc/internal/SGXMLScanner.cpp

    r2734 r2774  
    4343#include <icxercesc/validators/schema/SchemaValidator.hpp>
    4444#include <xercesc/validators/schema/TraverseSchema.hpp>
    45 #include <xercesc/validators/schema/XSDDOMParser.hpp>
     45#include <icxercesc/validators/schema/XSDDOMParser.hpp>
    4646#include <icxercesc/validators/schema/SubstitutionGroupComparator.hpp>
    4747#include <xercesc/validators/schema/XMLSchemaDescriptionImpl.hpp>
  • icXML/icXML-devel/src/icxercesc/internal/XMLScanner.cpp

    r2721 r2774  
    944944void XMLScanner::handlePI
    945945(
    946         const XMLSymbol   * const target
     946    const XMLCh   * const    target
    947947        , const XMLCh     *       data
    948948        , const XMLSize_t
     
    952952        if (fDocHandler)
    953953        {
    954                 fDocHandler->docPI(target->getName(), data);
     954        fDocHandler->docPI(target, data);
    955955        }
    956956
  • icXML/icXML-devel/src/icxercesc/internal/XMLScanner.hpp

    r2721 r2774  
    367367        const XMLCh* getURIText(const unsigned int uriId) const;
    368368
     369    unsigned int getNamespaceURIId(const unsigned int namespaceId) const;
     370
     371    const XMLCh* getPrefixForNamespaceId(const unsigned int namespaceId) const;
     372
    369373        const XMLCh* getURIForPrefix(const XMLCh* prefix) const;
     374
     375    BindingSetIterator getNamespaceIterator() const;
    370376
    371377        bool isPrefixKnown(const XMLCh* prefix) const;
     
    517523        void handlePI
    518524        (
    519                  const XMLSymbol   * const              target
     525         const XMLCh   * const          target
    520526                 , const XMLCh     *                    data
    521527                 , const XMLSize_t                              length
     
    16431649}
    16441650
     1651inline unsigned int XMLScanner::getNamespaceURIId(const unsigned int namespaceId) const
     1652{
     1653    return fUriResolver->getNamespaceUriId(namespaceId);
     1654}
     1655
     1656inline const XMLCh* XMLScanner::getPrefixForNamespaceId(const unsigned int namespaceId) const
     1657{
     1658    return fUriResolver->getPrefixForNamespaceId(namespaceId);
     1659}
     1660
    16451661inline const XMLCh* XMLScanner::getURIText(const unsigned int uriId) const
    16461662{
     
    16581674}
    16591675
     1676inline BindingSetIterator XMLScanner::getNamespaceIterator() const
     1677{
     1678    return fUriResolver->getNamespaceIterator(fContextId);
     1679}
     1680
    16601681inline void XMLScanner::setUriResolver(XMLNamespaceResolver * uriResolver)
    16611682{
     
    16771698    return fContextId;
    16781699}
    1679 
    16801700
    16811701// ---------------------------------------------------------------------------
  • icXML/icXML-devel/src/icxercesc/parsers/AbstractDOMParser.cpp

    r2732 r2774  
    973973                                                         , const bool                    isRoot)
    974974{
    975     DEBUG_MESSAGE("AbstractDOMParser::startElement(" << elemDecl << ',' << urlId << ',' << elemPrefix << ',' << attrList << ',' << attrCount << ',' << isEmpty << ',' << isRoot << ')');
    976 
    977975        DOMElement     *elem;
    978976        DOMElementImpl *elemImpl;
    979977        const XMLCh* namespaceURI = 0;
    980         bool doNamespaces = fScanner->getDoNamespaces();
     978    const bool doNamespaces = fScanner->getDoNamespaces();
    981979
    982980        // Create the element name. Here we are going to bypass the
     
    995993                        namespaceURI = fScanner->getURIText(urlId); //get namespaceURI
    996994
    997                         //                      if (elemPrefix && *elemPrefix)
    998                         //                      {
    999                         //                              XMLBufBid elemQName(&fBufMgr);
    1000 
    1001                         //                              elemQName.set(elemPrefix);
    1002                         //                              elemQName.append(chColon);
    1003                         //                              elemQName.append(localName);
    1004 
    1005                         //                              elem = createElementNS (
    1006                         //                                namespaceURI, elemPrefix, localName, elemQName.getRawBuffer());
    1007                         //                      }
    1008                         //                      else
    1009                         //                        elem = createElementNS (namespaceURI, 0, localName, localName);
    1010 
    1011995                        elem = createElementNS (namespaceURI, 0, localName, elemDecl.getFullName());
    1012996                }
     
    10251009        if (attrCount)
    10261010        {
    1027                 const unsigned int xmlnsNSId = XMLNamespaceResolver::fXMLNSUriId;
    1028                 const unsigned int emptyNSId = XMLNamespaceResolver::fEmptyUriId;
    1029 
    10301011                DOMAttrMapImpl* map = elemImpl->fAttributes;
    10311012                map->reserve (attrCount);
     
    10421023                                unsigned int attrURIId = attribute->getURIId();
    10431024                                const XMLCh* localName = attribute->getName();
    1044                                 const XMLCh* prefix = attribute->getPrefix();
    1045                                 namespaceURI = 0;
    1046 
    1047                                 if ((prefix==0 || *prefix==0) && XMLString::equals(localName, XMLUni::fgXMLNSString))
     1025                                const XMLCh* prefix = attribute->getPrefix();                           
     1026
     1027                if (attrURIId == XMLNamespaceResolver::fEmptyUriId)
     1028                {
     1029                    namespaceURI = 0;
     1030                    if (XMLString::equals(localName, XMLUni::fgXMLNSString))
     1031                    {
     1032                        // xmlns=...
     1033                        namespaceURI = fScanner->getURIText(XMLNamespaceResolver::fXMLNSUriId);
     1034                    }
     1035                }
     1036                else // if (attrURIId != XMLNamespaceResolver::fEmptyUriId)
    10481037                                {
    1049                                         // xmlns=...
    1050                                         attrURIId = xmlnsNSId;
    1051                                 }
    1052 
    1053                                 if (attrURIId != emptyNSId)
    1054                                 {
    1055                                         //TagName has a prefix
    10561038                                        namespaceURI = fScanner->getURIText(attrURIId);
    10571039                                }
    10581040
    1059                                 attr = (DOMAttrImpl*) createAttrNS (namespaceURI,
    1060                                                                                                         prefix,
    1061                                                                                                         localName,
    1062                                                                                                         attribute->getQName());
     1041                attr = (DOMAttrImpl*) createAttrNS (namespaceURI, prefix, localName, attribute->getQName());
    10631042
    10641043                                map->setNamedItemNSFast(attr);
     
    10781057                        {
    10791058                                if (fDocument->fNodeIDMap == 0)
     1059                {
    10801060                                        fDocument->fNodeIDMap = new (fDocument) DOMNodeIDMap(500, fDocument);
     1061                }
    10811062                                fDocument->fNodeIDMap->add(attr);
    10821063                                attr->fNode.isIdAttr(true);
     
    10861067
    10871068                        // store DTD validation information
    1088                         if(fCreateSchemaInfo)
     1069            if (fCreateSchemaInfo)
    10891070                        {
    10901071                                switch(attribute->getType())
     
    11271108                                        // So as long as the XML parser doesn't do it, it needs to
    11281109                                        // be done here.
    1129                                         const XMLCh* qualifiedName = attr->getFullName();
    1130                                         XMLBufBid bbPrefixQName(&fBufMgr);
    1131                                         XMLBuffer& prefixBuf = bbPrefixQName.getBuffer();
    1132                                         int colonPos = -1;
    1133                                         unsigned int uriId = fScanner->resolveQName(qualifiedName, prefixBuf, ElemStack::Mode_Attribute, colonPos);
    1134 
    1135                                         const XMLCh* namespaceURI = 0;
    1136                                         if (XMLString::equals(qualifiedName, XMLUni::fgXMLNSString))    //for xmlns=...
    1137                                                 uriId = fScanner->getXMLNSNamespaceId();
    1138                                         if (uriId != fScanner->getEmptyNamespaceId()) {  //TagName has a prefix
    1139                                                 namespaceURI = fScanner->getURIText(uriId);
    1140                                         }
    1141 
    1142                                         insertAttr = (DOMAttrImpl *) fDocument->createAttributeNS(namespaceURI,     // NameSpaceURI
    1143                                                                                                                                                           qualifiedName);   // qualified name
     1110                    const XMLCh * qualifiedName = attr->getFullName();
     1111
     1112                    // int colonPos = -1;
     1113                    unsigned int attrURIId = fScanner->getUriResolver()->resolveUriId(qualifiedName); // fScanner->resolveQName(qualifiedName, prefixBuf, ElemStack::Mode_Attribute, colonPos);
     1114
     1115                    if (attrURIId == XMLNamespaceResolver::fEmptyUriId)
     1116                    {
     1117                        namespaceURI = 0;
     1118                        if (XMLString::equals(qualifiedName, XMLUni::fgXMLNSString))
     1119                        {
     1120                            // xmlns=...
     1121                            namespaceURI = fScanner->getURIText(XMLNamespaceResolver::fXMLNSUriId);
     1122                        }
     1123                    }
     1124                    else // if (attrURIId != XMLNamespaceResolver::fEmptyUriId)
     1125                    {
     1126                        namespaceURI = fScanner->getURIText(attrURIId);
     1127                    }
     1128
     1129                    insertAttr = (DOMAttrImpl *) fDocument->createAttributeNS(namespaceURI, qualifiedName);
    11441130
    11451131                                        DOMAttr* remAttr = elemImpl->setDefaultAttributeNodeNS(insertAttr);
     
    11681154                                        switch(attr->getType())
    11691155                                        {
    1170                                         case XMLAttDef::CData:          insertAttr->setSchemaTypeInfo(&DOMTypeInfoImpl::g_DtdValidatedCDATAAttribute); break;
    1171                                         case XMLAttDef::ID:             insertAttr->setSchemaTypeInfo(&DOMTypeInfoImpl::g_DtdValidatedIDAttribute); break;
    1172                                         case XMLAttDef::IDRef:          insertAttr->setSchemaTypeInfo(&DOMTypeInfoImpl::g_DtdValidatedIDREFAttribute); break;
    1173                                         case XMLAttDef::IDRefs:         insertAttr->setSchemaTypeInfo(&DOMTypeInfoImpl::g_DtdValidatedIDREFSAttribute); break;
    1174                                         case XMLAttDef::Entity:         insertAttr->setSchemaTypeInfo(&DOMTypeInfoImpl::g_DtdValidatedENTITYAttribute); break;
    1175                                         case XMLAttDef::Entities:       insertAttr->setSchemaTypeInfo(&DOMTypeInfoImpl::g_DtdValidatedENTITIESAttribute); break;
    1176                                         case XMLAttDef::NmToken:        insertAttr->setSchemaTypeInfo(&DOMTypeInfoImpl::g_DtdValidatedNMTOKENAttribute); break;
    1177                                         case XMLAttDef::NmTokens:       insertAttr->setSchemaTypeInfo(&DOMTypeInfoImpl::g_DtdValidatedNMTOKENSAttribute); break;
    1178                                         case XMLAttDef::Notation:       insertAttr->setSchemaTypeInfo(&DOMTypeInfoImpl::g_DtdValidatedNOTATIONAttribute); break;
    1179                                         case XMLAttDef::Enumeration:    insertAttr->setSchemaTypeInfo(&DOMTypeInfoImpl::g_DtdValidatedENUMERATIONAttribute); break;
    1180                                         default:                        insertAttr->setSchemaTypeInfo(&DOMTypeInfoImpl::g_DtdNotValidatedAttribute); break;
     1156                        case XMLAttDef::CData:          insertAttr->setSchemaTypeInfo(&DOMTypeInfoImpl::g_DtdValidatedCDATAAttribute); break;
     1157                        case XMLAttDef::ID:             insertAttr->setSchemaTypeInfo(&DOMTypeInfoImpl::g_DtdValidatedIDAttribute); break;
     1158                        case XMLAttDef::IDRef:          insertAttr->setSchemaTypeInfo(&DOMTypeInfoImpl::g_DtdValidatedIDREFAttribute); break;
     1159                        case XMLAttDef::IDRefs:         insertAttr->setSchemaTypeInfo(&DOMTypeInfoImpl::g_DtdValidatedIDREFSAttribute); break;
     1160                        case XMLAttDef::Entity:         insertAttr->setSchemaTypeInfo(&DOMTypeInfoImpl::g_DtdValidatedENTITYAttribute); break;
     1161                        case XMLAttDef::Entities:       insertAttr->setSchemaTypeInfo(&DOMTypeInfoImpl::g_DtdValidatedENTITIESAttribute); break;
     1162                        case XMLAttDef::NmToken:        insertAttr->setSchemaTypeInfo(&DOMTypeInfoImpl::g_DtdValidatedNMTOKENAttribute); break;
     1163                        case XMLAttDef::NmTokens:       insertAttr->setSchemaTypeInfo(&DOMTypeInfoImpl::g_DtdValidatedNMTOKENSAttribute); break;
     1164                        case XMLAttDef::Notation:       insertAttr->setSchemaTypeInfo(&DOMTypeInfoImpl::g_DtdValidatedNOTATIONAttribute); break;
     1165                        case XMLAttDef::Enumeration:    insertAttr->setSchemaTypeInfo(&DOMTypeInfoImpl::g_DtdValidatedENUMERATIONAttribute); break;
     1166                        default:                        insertAttr->setSchemaTypeInfo(&DOMTypeInfoImpl::g_DtdNotValidatedAttribute); break;
    11811167                                        }
    11821168                                }
  • icXML/icXML-devel/src/icxercesc/validators/common/DFAContentModel.cpp

    r2734 r2774  
    167167) const
    168168{
    169         DEBUG_MESSAGE("DFAContentModel::validateContent(<children>," << childCount << ')');
    170 
    171169        //
    172170        //  If there are no children, then either we fail on the 0th element
     
    622620{
    623621        unsigned int index;
    624 
    625         DEBUG_MESSAGE("DFAContentModel::buildDFA(" << curNode << ')');
    626 
    627622        //
    628623        //  The first step we need to take is to rewrite the content model using
  • icXML/icXML-devel/src/icxercesc/validators/schema/ComplexTypeInfo.cpp

    r2750 r2774  
    332332XMLContentModel* ComplexTypeInfo::makeContentModel(bool checkUPA)
    333333{
    334         DEBUG_MESSAGE("ComplexTypeInfo::makeContentModel(checkUPA=" << checkUPA << ")");
    335         DEBUG_MESSAGE("- fContentType=" << fContentType);
    336         DEBUG_MESSAGE("- fContentSpec=" << fContentSpec);
    337 
    338334        ContentSpecNode* aSpecNode = new (fMemoryManager) ContentSpecNode(*fContentSpec);
    339335
     
    506502                if (!cmRet)
    507503                {
    508                         DEBUG_MESSAGE("* defaulting to DFA");
    509504                        cmRet = new (fMemoryManager) DFAContentModel(false, aSpecNode, (fContentType == SchemaElementDecl::Mixed_Complex), fMemoryManager);
    510505                }
  • icXML/icXML-devel/src/icxercesc/validators/schema/SchemaValidator.cpp

    r2740 r2774  
    100100)
    101101{
    102         DEBUG_MESSAGE
    103         (
    104                 "SchemaValidator::checkContent("
    105                 << elemDecl
    106                 << ",{";
    107                 for (unsigned int i = 0; i < childCount; i++)
    108                 {
    109                         if (i > 0) std::clog << ',';
    110                         std::clog << children[i];
    111                 }
    112                 std::clog << "},"
    113                 << childCount
    114                 << ')'
    115         );
    116 
    117 
    118102        fErrorOccurred = false;
    119103        fElemIsSpecified = false;
     
    135119        ComplexTypeInfo* currType = fTypeStack.pop();
    136120
    137         DEBUG_MESSAGE(" - currType=" << currType);
    138 
    139121        const SchemaElementDecl::ModelTypes modelType = (currType)
    140122                        ? (SchemaElementDecl::ModelTypes)(currType->getContentType())
     
    143125        if (modelType == SchemaElementDecl::Empty || modelType == SchemaElementDecl::ElementOnlyEmpty)
    144126        {
    145                 DEBUG_MESSAGE("modelType=(Empty|ElementOnlyEmpty)")
    146 
    147127                //
    148128                //  We can do this one here. It cannot have any children. If it does
     
    160140                 ||  (modelType == SchemaElementDecl::Children))
    161141        {
    162                 DEBUG_MESSAGE("modelType=(Mixed_Simple|Mixed_Complex|Children)")
    163 
    164142                // if nillable, it's an error to have value
    165143                // XML Schema REC: Validation Rule: Element Locally Valid (Element)
     
    177155                else
    178156                {
    179                         DEBUG_MESSAGE("currType=" << currType);
    180 
    181157                        // Get the element's content model or fault it in
    182158                        XMLContentModel* elemCM = (currType)
    183159                                        ? currType->getContentModel()
    184160                                        : ((SchemaElementDecl*)elemDecl)->getContentModel();
    185 
    186                         DEBUG_MESSAGE("elemCM=" << elemCM);
    187161
    188162                        bool result = elemCM->validateContent
     
    193167                                , getScanner()->getMemoryManager()
    194168                        );
    195 
    196                         DEBUG_MESSAGE("elemCM->validateContent=" << result);
    197169
    198170                        if (!result)
     
    204176                                                                                                          , indexOfFailingChild
    205177                                                                                                          , getScanner()->getMemoryManager());
    206 
    207                                 DEBUG_MESSAGE("elemCM->validateContentSpecial=" << result);
    208178                        }
    209179
     
    214184        else if (modelType == SchemaElementDecl::Simple || modelType == SchemaElementDecl::Any)
    215185        {
    216                 DEBUG_MESSAGE("modelType=(Simple|Any)")
    217 
    218186                // Normally for SchemaElementDecl::Any, We pass no judgement on it and anything goes
    219187                // but if there is a fXsiTypeValidator, we need to use it for validation
     
    227195                        XMLCh* value = fDatatypeBuffer.getRawBuffer();
    228196                        XMLCh* elemDefaultValue = ((SchemaElementDecl*) elemDecl)->getDefaultValue();
    229 
    230                         DEBUG_MESSAGE("fNil=" << fNil);
    231                         DEBUG_MESSAGE("fCurrentDatatypeValidator=" << (fCurrentDatatypeValidator != 0));
    232197
    233198                        if (fNil)
     
    252217                                        }
    253218
    254                                         DEBUG_MESSAGE("value=" << value);
    255 
    256                                         //  Make sure that this value maps to one of the
     219                    //  Make sure that this value maps to one of the
    257220                                        //  notation values in the enumList parameter. We don't have to
    258221                                        //  look it up in the notation pool (if a notation) because we
     
    262225
    263226                                        const XMLCh* uriText = getScanner()->getURIForPrefix(value);
    264 
    265                                         DEBUG_MESSAGE("uriText=" << uriText);
    266227
    267228                                        if (uriText && *uriText)
     
    274235                                        }
    275236                                }
    276 
    277                                 DEBUG_MESSAGE("elemDefaultValue=" << elemDefaultValue);
    278 
    279237
    280238                                if (elemDefaultValue)
     
    615573                        : ((SchemaElementDecl*)elemDef)->getDatatypeValidator();
    616574
    617         DEBUG_MESSAGE("SchemaValidator::validateElement(" << elemDef << ')')
    618 
    619575        fErrorOccurred = false;
    620576
    621577        if (fXsiType)
    622         {
    623                 DEBUG_MESSAGE("fXsiType=" << fXsiType)
    624 
     578    {
    625579                // handle "xsi:type" right here
    626580                DatatypeValidator *xsiTypeDV = 0;
     
    706660                                        aBuffer.append(localPart);
    707661
    708                                         DEBUG_MESSAGE("looking up typeInfo: " << aBuffer.getRawBuffer());
    709662
    710663                                        ComplexTypeInfo* typeInfo =
    711664                                                complexTypeRegistry->get(aBuffer.getRawBuffer());
    712 
    713                                         DEBUG_MESSAGE("typeInfo: " << typeInfo);
    714665
    715666                                        if (typeInfo)
     
    725676                                                        if (elemTypeInfo)
    726677                                                        {
    727                                                                 DEBUG_MESSAGE("searching for elemTypeInfo: " << elemTypeInfo)
    728 
    729678                                                                ComplexTypeInfo* tempType = typeInfo;
    730679                                                                while (tempType)
    731680                                                                {
    732                                                                         DEBUG_MESSAGE("checking " << tempType);
    733681                                                                        if (tempType == elemTypeInfo)
    734682                                                                        {
    735                                                                                 DEBUG_MESSAGE(" found type!")
    736683                                                                                break;
    737684                                                                        }
  • icXML/icXML-devel/src/icxmlc/XMLConfig.hpp

    r2728 r2774  
    77/*
    88 * @author Nigel Medforth, nigelm -at- interational-characters.com
    9  * @version $Id: XMLConfig.hpp 207 2012-12-02 20:38:22Z robc $
     9 * @version $Id: XMLConfig.hpp 224 2012-12-12 03:31:56Z nigelm $
    1010 *
    1111 */
     
    2828
    2929#ifndef PRINT_DEBUG_IGNORE_GRAMMAR_MESSAGES
    30 //#define PRINT_DEBUG_IGNORE_GRAMMAR_MESSAGES
     30#define PRINT_DEBUG_IGNORE_GRAMMAR_MESSAGES
    3131#endif
    3232
    3333#ifndef PRINT_DEBUG_IGNORE_NAMESPACE_MESSAGES
    34 //#define PRINT_DEBUG_IGNORE_NAMESPACE_MESSAGES
     34#define PRINT_DEBUG_IGNORE_NAMESPACE_MESSAGES
    3535#endif
    3636
  • icXML/icXML-devel/src/icxmlc/XMLNamespaceResolver.c

    r2720 r2774  
    77/*
    88 * @author Nigel Medforth, nigelm -at- interational-characters.com
    9  * @version $Id: XMLNamespaceResolver.c 207 2012-12-02 20:38:22Z robc $
     9 * @version $Id: XMLNamespaceResolver.c 224 2012-12-12 03:31:56Z nigelm $
    1010 *
    1111 */
     
    7878        else
    7979        {
    80         if (unlikely(fNamespaceToUriBindingTable[namespaceId] != globalUriId))
     80        if (unlikely(getNamespaceUriId(namespaceId) != globalUriId))
    8181                {
    8282            remapPrefixToUri(prefixId, localUriId, globalUriId);
     
    379379                count++;
    380380
    381                 if (fNamespaceToUriBindingTable[namespaceItr.pos()] == globalUriId)
     381        if (getNamespaceUriId(namespaceItr.pos()) == globalUriId)
    382382                {
    383383                        namespaceId = namespaceItr.pos();
     
    389389        namespaceId = fNextNamespaceId++;
    390390
    391         if (fCurrentlyVisibleNamespaces.capacity() <= namespaceId)
     391    if (unlikely(fCurrentlyVisibleNamespaces.capacity() <= namespaceId))
    392392        {
    393393                DEBUG_NAMESPACE_MESSAGE(" *** expanding namespace space due to namespaceId " << fNextNamespaceId);
    394394                fCurrentlyVisibleNamespaces.expand(namespaceId);
    395                 fCanonicalBindingSet.expand(namespaceId);
    396                 fNamespaceToUriBindingTable.expand(namespaceId);
     395                fCanonicalBindingSet.expand(namespaceId);               
     396        fNamespaceToUriBindingTable.expand(namespaceId);
     397        fNamespaceToPrefixBindingTable.expand(namespaceId);
    397398                fLocallyModifiedNamespaces.increaseBitCapacity(namespaceId);
    398399                fDistinctContextSet.increaseBitCapacity(namespaceId);
     
    404405        // map this prefix to the namespace
    405406        fPrefixToNamespaceBindingTable[prefixId] += namespaceId;
    406 
    407407        fNamespaceToUriBindingTable[namespaceId] = globalUriId;
     408    // and the URI back to the prefix
     409    fNamespaceToPrefixBindingTable[namespaceId] = prefixId;
    408410
    409411        if (prefixId == localUriId)
     
    505507
    506508IDISA_ALWAYS_INLINE
     509BindingSetIterator XMLNamespaceResolver::getNamespaceIterator(const unsigned int contextId) const
     510{
     511    return BindingSetIterator(fDistinctContextSet[contextId]);
     512}
     513
     514/// -----------------------------------------------------------------------------------------------
     515
     516IDISA_ALWAYS_INLINE
     517unsigned int
     518XMLNamespaceResolver::getNamespaceUriId(const unsigned int namespaceId) const
     519{
     520    return fNamespaceToUriBindingTable[namespaceId];
     521}
     522
     523/// -----------------------------------------------------------------------------------------------
     524
     525IDISA_ALWAYS_INLINE
     526const XMLCh *
     527XMLNamespaceResolver::getPrefixForNamespaceId(const unsigned int namespaceId) const
     528{
     529    return fPrefixList[fNamespaceToPrefixBindingTable[namespaceId]].getKey();
     530}
     531
     532
     533/// -----------------------------------------------------------------------------------------------
     534
     535IDISA_ALWAYS_INLINE
    507536bool
    508537XMLNamespaceResolver::isPrefixVisible(const XMLCh * prefix, const unsigned int contextId)
  • icXML/icXML-devel/src/icxmlc/XMLNamespaceResolver.hpp

    r2728 r2774  
    77/*
    88 * @author Nigel Medforth, nigelm -at- interational-characters.com
    9  * @version $Id: XMLNamespaceResolver.hpp 207 2012-12-02 20:38:22Z robc $
     9 * @version $Id: XMLNamespaceResolver.hpp 224 2012-12-12 03:31:56Z nigelm $
    1010 *
    1111 */
     
    193193                }
    194194
    195 
    196                 unsigned int getCurrentContextId();
     195        unsigned int getNamespaceUriId(const unsigned int namespaceId) const;
     196
     197        unsigned int getCurrentContextId();
     198
     199        BindingSetIterator getNamespaceIterator(const unsigned int contextId) const;
     200
     201        const XMLCh * getPrefixForNamespaceId(const unsigned int namespaceId) const;
    197202
    198203                bool isPrefixVisible(const XMLCh * prefix, const unsigned int contextId);
     
    308313                DynamicArray<unsigned int, sizeof(hash_t) * 8>                                  fNamespaceToUriBindingTable;
    309314
     315        DynamicArray<unsigned int, sizeof(hash_t) * 8>                                  fNamespaceToPrefixBindingTable;
     316
    310317                unsigned int                                                                                                    fCurrentScope;
    311318
  • icXML/icXML-devel/src/icxmlc/XMLParserImpl.c

    r2728 r2774  
    77/*
    88 * @author Nigel Medforth, nigelm -at- interational-characters.com
    9  * @version $Id: XMLParserImpl.c 207 2012-12-02 20:38:22Z robc $
     9 * @version $Id: XMLParserImpl.c 224 2012-12-12 03:31:56Z nigelm $
    1010 *
    1111 */
     
    613613                /// ------------------------------------------------------------------------ ///
    614614                case ProcessingInstruction:
     615
    615616                        if ((docStateType == XMLParser::Prolog) || (docStateType == XMLParser::Element) || (docStateType == XMLParser::Miscellaneous))
    616617                        {
    617                                 XMLSymbol * target = getSymbol(fSymbolIdx);
    618 
    619                                 DEBUG_TRANSITION_MESSAGE
    620                                 (
    621                                         " --- atProcessingInstruction="
     618                const XMLCh * target = ++fCursorPtr;
     619
     620                DEBUG_TRANSITION_MESSAGE
     621                (
     622                    " --- atProcessingInstruction="
    622623                    << target
    623                                         << " idx="
    624                                         << fSymbolIdx
    625                                 );
     624                );
     625
     626                fCursorPtr += getStringLength(fCursorPtr, fCurrentStringEndPtr);
    626627
    627628                                // When we get a pi, the pi string will read "data?"; we adjust for this and replace the
     
    633634
    634635                                // <?xml ... ?> is allowed if and only if we're in the prolog
    635                                 if (unlikely(target->isXML()))
     636                if (unlikely(XMLStringU::isXML(target)))
    636637                                {
    637638                                        fScanner->emitError(XMLErrs::NoPIStartsWithXML);
     
    642643                                }
    643644
    644                                 fSymbolIdx++;
    645645                                fCursorPtr += length + 1;
    646646                        }
     
    670670                /// ------------------------------------------------------------------------ ///
    671671                case CDATA:
    672                         if ((docStateType == XMLParser::Prolog) || (docStateType == XMLParser::Element) || (docStateType == XMLParser::Miscellaneous))
     672            if (docStateType == XMLParser::Element)
    673673                        {
    674674                                //   v
    675675                                // <![CDATA[ ... ]]>
    676 
    677                                 if (docStateType != XMLParser::Element)
    678                                 {
    679                                         fScanner->emitError(XMLErrs::ExpectedCommentOrPI);
    680                                         return XMLParser::EndOfDocumentSection;
    681                                 }
    682676
    683677                                if (unlikely(!XMLStringU::isCDATA(++fCursorPtr)))
     
    706700                                fCursorPtr += length + 1;
    707701                        }
     702            else
     703            {
     704                fScanner->emitError(XMLErrs::ExpectedCommentOrPI);
     705                return XMLParser::EndOfDocumentSection;
     706            }
    708707                        break;
    709708                default:
     
    10411040                                /// ------------------------------------------------------------------------ ///
    10421041                                case ProcessingInstruction:
    1043                                         symbolIdx++;
     1042                    stringEndPtr++;
    10441043                                case Comment:
    10451044                                case CDATA:
    1046                     #ifdef PRINT_DEBUG_MESSAGE
    1047                     DEBUG_TRANSITION_MESSAGE(" --- atCDCtPI " << cursorPtr);
    1048                                         cursorPtr = *stringEndPtr++ + 1;
    1049                                         #else
    1050                                         stringEndPtr++;
    1051                                         #endif
     1045                    DEBUG_TRANSITION_MESSAGE(" --- atCDCtPI " << cursorPtr);                                   
     1046                    stringEndPtr++;
    10521047                                        break;
    10531048                                default:
  • icXML/icXML-devel/src/icxmlc/XMLSymbolTable.cpp

    r2731 r2774  
    77/*
    88 * @author Nigel Medforth, nigelm -at- interational-characters.com
    9  * @version $Id: XMLSymbolTable.cpp 209 2012-12-02 21:17:04Z robc $
     9 * @version $Id: XMLSymbolTable.cpp 224 2012-12-12 03:31:56Z nigelm $
    1010 *
    1111 */
     
    2929)
    3030{
    31     DEBUG_SYMBOL_MESSAGE("XMLSymbolTable::add(" << key << ',' << length << ')')
    32 
    3331    XMLSymbol entry;
    3432    entry.fFlags = 0;
     
    3634    entry.fRawSymbol = fSymbolPool.insert(key, length);
    3735
     36    DEBUG_SYMBOL_MESSAGE("XMLSymbolTable::add(" << entry.fRawSymbol << ',' << length << ')')
     37
    3838    XMLBuffer symbol(length, fMemoryManager);
    3939    fTranscoder->transcodeFrom(key, length, symbol);
    4040    const XMLCh * symbolName = symbol.getRawBuffer();
    41 
    42     DEBUG_SYMBOL_MESSAGE(" -- symbolName=" << symbolName)
    4341
    4442    /// VERIFY THAT THE CHARACTERS IN THE SYMBOL ARE LEGAL ACCORDING TO XML SPECIFICATIONS
     
    4846    }
    4947
    50     /**
    51      Is this a processing instruction?
    52      **/
    53     if (unlikely(symbolName[0] == chQuestion))
     48
     49    entry.fQName = new QName(symbolName, XMLNamespaceResolver::fEmptyUriId, fMemoryManager);
     50
     51    entry.fName = entry.fQName->getRawName();
     52
     53    if (fScanner->getDoNamespaces())
    5454    {
    55         entry.fQName = NULL;
    56         entry.fName = XMLString::replicate(&symbolName[1], fMemoryManager);
    57 
    58         entry.fFlags = XMLSymbol::IS_PROCESSING_INSTRUCTION;
    59         if (likely(XMLStringU::isXML(entry.fName)))
     55        const XMLSize_t length = symbol.getLen();
     56        int colon;
     57        entry.fPrefixId = fNamespaceResolver->resolvePrefixId(symbolName, length, colon);
     58        if (entry.fPrefixId < XMLNamespaceResolver::fPredefinedCount)
    6059        {
    61             entry.fFlags |= XMLSymbol::XML;
    62         }
    63     }
    64     else
    65     {
    66         entry.fQName = new QName(symbolName, XMLNamespaceResolver::fEmptyUriId, fMemoryManager);
    67         entry.fName = entry.fQName->getRawName();       
    68         if (fScanner->getDoNamespaces())
    69         {
    70             const XMLSize_t length = symbol.getLen();
    71             int colon;
    72             entry.fPrefixId = fNamespaceResolver->resolvePrefixId(symbolName, length, colon);
    73             if (entry.fPrefixId < XMLNamespaceResolver::fPredefinedCount)
     60            switch (entry.fPrefixId)
    7461            {
    75                 switch (entry.fPrefixId)
    76                 {
    77                     case XMLNamespaceResolver::fEmptyUriId:
    78                         if (unlikely(XMLStringU::isXMLNS(symbolName)))
    79                         {
    80                             entry.fFlags |= XMLSymbol::XMLNS;
    81                         }
    82                         break;
    83                     case XMLNamespaceResolver::fXMLUriId:
    84                         entry.fFlags |= XMLSymbol::XML;
    85                         break;
    86                     case XMLNamespaceResolver::fXMLNSUriId:
     62                case XMLNamespaceResolver::fEmptyUriId:
     63                    if (unlikely(XMLStringU::isXMLNS(symbolName)))
     64                    {
    8765                        entry.fFlags |= XMLSymbol::XMLNS;
    88                         ++colon;
    89                         entry.fPrefixId = fNamespaceResolver->resolvePrefixId(&symbolName[colon], length - colon);
    90                         if (unlikely(entry.fPrefixId == XMLNamespaceResolver::fXMLNSUriId))
    91                         {
    92                             fScanner->emitError(XMLErrs::NoUseOfxmlnsAsPrefix);
    93                         }
    94                         break;
    95                 }
     66                    }
     67                    break;
     68                case XMLNamespaceResolver::fXMLUriId:
     69                    entry.fFlags |= XMLSymbol::XML;
     70                    break;
     71                case XMLNamespaceResolver::fXMLNSUriId:
     72                    entry.fFlags |= XMLSymbol::XMLNS;
     73                    ++colon;
     74                    entry.fPrefixId = fNamespaceResolver->resolvePrefixId(&symbolName[colon], length - colon);
     75                    if (unlikely(entry.fPrefixId == XMLNamespaceResolver::fXMLNSUriId))
     76                    {
     77                        fScanner->emitError(XMLErrs::NoUseOfxmlnsAsPrefix);
     78                    }
     79                    break;
    9680            }
    9781        }
     
    124108    symbolName[length] = 0;
    125109
    126     /**
    127      Is this a processing instruction?
    128      **/
    129     if (unlikely(symbolName[0] == chQuestion))
     110    entry.fQName = new QName(symbolName, XMLNamespaceResolver::fEmptyUriId, fMemoryManager);
     111
     112    entry.fName = entry.fQName->getRawName();
     113
     114    int colon;
     115    entry.fPrefixId = fNamespaceResolver->resolvePrefixId(symbolName, length, colon);
     116    if (entry.fPrefixId < XMLNamespaceResolver::fPredefinedCount)
    130117    {
    131         entry.fQName = NULL;
    132         entry.fName = XMLString::replicate(&symbolName[1], fMemoryManager);
    133 
    134         entry.fFlags = XMLSymbol::IS_PROCESSING_INSTRUCTION;
    135         if (likely(XMLStringU::isXML(entry.fName)))
     118        switch (entry.fPrefixId)
    136119        {
    137             entry.fFlags |= XMLSymbol::XML;
    138         }
    139     }
    140     else
    141     {
    142         entry.fQName = new QName(symbolName, XMLNamespaceResolver::fEmptyUriId, fMemoryManager);
    143         entry.fName = entry.fQName->getRawName();
    144 
    145         int colon;
    146         entry.fPrefixId = fNamespaceResolver->resolvePrefixId(symbolName, length, colon);
    147         if (entry.fPrefixId < XMLNamespaceResolver::fPredefinedCount)
    148         {
    149             switch (entry.fPrefixId)
    150             {
    151                 case XMLNamespaceResolver::fEmptyUriId:
    152                     if (unlikely(XMLStringU::isXMLNS(symbolName)))
    153                     {
    154                         entry.fFlags |= XMLSymbol::XMLNS;
    155                     }
    156                     break;
    157                 case XMLNamespaceResolver::fXMLUriId:
    158                     entry.fFlags |= XMLSymbol::XML;
    159                     break;
    160                 case XMLNamespaceResolver::fXMLNSUriId:
     120            case XMLNamespaceResolver::fEmptyUriId:
     121                if (unlikely(XMLStringU::isXMLNS(symbolName)))
     122                {
    161123                    entry.fFlags |= XMLSymbol::XMLNS;
    162                     ++colon;
    163                     entry.fPrefixId = fNamespaceResolver->resolvePrefixId(&symbolName[colon], length - colon);
    164                     break;
    165             }
     124                }
     125                break;
     126            case XMLNamespaceResolver::fXMLUriId:
     127                entry.fFlags |= XMLSymbol::XML;
     128                break;
     129            case XMLNamespaceResolver::fXMLNSUriId:
     130                entry.fFlags |= XMLSymbol::XMLNS;
     131                ++colon;
     132                entry.fPrefixId = fNamespaceResolver->resolvePrefixId(&symbolName[colon], length - colon);
     133                break;
    166134        }
    167135    }
  • icXML/icXML-devel/src/icxmlc/XMLUTF16CharacterSetAdapter.hpp

    r2728 r2774  
    77/*
    88 * @author Nigel Medforth, nigelm -at- interational-characters.com
    9  * @version $Id: XMLUTF16CharacterSetAdapter.hpp 217 2012-12-03 15:00:50Z robc $
     9 * @version $Id: XMLUTF16CharacterSetAdapter.hpp 224 2012-12-12 03:31:56Z nigelm $
    1010 *
    1111 */
     
    204204
    205205  struct Callouts {
    206   BitBlock CtCDPI_marks;
     206  BitBlock PI_openers;
     207  BitBlock CtCD_openers;
    207208  BitBlock CtCDPI_closers;
    208209  BitBlock CtCDPI_content_starts;
     
    382383              AttNameFollow = subcarryQ.BitBlock_scanthru_ci_co(AttNameStart, lex.NameScan, simd<1>::constant<0>(), 0);
    383384              callouts.Symbol_ends = simd_or(callouts.Symbol_ends, AttNameFollow);
    384               if ((bitblock::any(simd_and(AttNameFollow, lex.WS)) || subcarryQ.CarryTest(3, 1))) {
     385              if (bitblock::any(simd_and(AttNameFollow, lex.WS))) {
    385386                EqExpected = subcarryQ.BitBlock_scanthru_ci_co(AttNameFollow, lex.WS, simd<1>::constant<0>(), 1);
    386387              }
     
    405406              callouts.AttCloseQuotes = simd_or(callouts.AttCloseQuotes, AttValEnd);
    406407              AttValFollow = subcarryQ.BitBlock_advance_ci_co(AttValEnd, simd<1>::constant<0>(), 5);
    407               if ((bitblock::any(simd_and(AttValFollow, lex.WS)) || subcarryQ.CarryTest(8, 1))) {
     408              if (bitblock::any(simd_and(AttValFollow, lex.WS))) {
    408409                AfterWS = subcarryQ.BitBlock_scanthru_ci_co(AttValFollow, lex.WS, simd<1>::constant<0>(), 6);
    409410              }
     
    533534              AttNameFollow = subcarryQ.BitBlock_scanthru_ci_co(AttNameStart, lex.NameScan, simd<1>::constant<0>(), 0);
    534535              callouts.Symbol_ends = simd_or(callouts.Symbol_ends, AttNameFollow);
    535               if ((bitblock::any(simd_and(AttNameFollow, lex.WS)) || subcarryQ.CarryTest(3, 1))) {
     536              if (bitblock::any(simd_and(AttNameFollow, lex.WS))) {
    536537                EqExpected = subcarryQ.BitBlock_scanthru_ci_co(AttNameFollow, lex.WS, simd<1>::constant<0>(), 1);
    537538              }
     
    556557              callouts.AttCloseQuotes = simd_or(callouts.AttCloseQuotes, AttValEnd);
    557558              AttValFollow = subcarryQ.BitBlock_advance_ci_co(AttValEnd, simd<1>::constant<0>(), 5);
    558               if ((bitblock::any(simd_and(AttValFollow, lex.WS)) || subcarryQ.CarryTest(8, 1))) {
     559              if (bitblock::any(simd_and(AttValFollow, lex.WS))) {
    559560                AfterWS = subcarryQ.BitBlock_scanthru_ci_co(AttValFollow, lex.WS, simd<1>::constant<0>(), 6);
    560561              }
     
    642643 }
    643644  IDISA_ALWAYS_INLINE void do_block(Lex & lex, Marker & marker, Callouts & callouts, Errors & errors) {
    644                 BitBlock CtCDPI_starts, v, w, v1, w1, LAngle_scope, PI_opener, CtCD_opener;
    645                 BitBlock CtCDPI_opener, CD_closer, DoubleHyphen, DoubleRBracket, PI_closer;
    646                 BitBlock CtCDPI_Cursor, PI_Cursor, CD_Ct_Cursor, CD_Cursor, Ct_Cursor;
    647                 BitBlock CD_Ct_Error, PI_name_end, PI_error, Ct_error;
     645                BitBlock CtCDPI_starts, v, w, v1, w1, LAngle_scope, CtCDPI_opener, CD_closer;
     646                BitBlock DoubleHyphen, DoubleRBracket, PI_closer, CtCDPI_Cursor, PI_Cursor;
     647                BitBlock CD_Ct_Cursor, CD_Cursor, Ct_Cursor, CD_Ct_Error, PI_name_end;
     648                BitBlock PI_error, Ct_error;
    648649
    649650                BitBlock tempvar0, tempvar1, tempvar2, tempvar3, tempvar4, tempvar5;
     
    652653        callouts.Symbol_starts = simd<1>::constant<0>();
    653654        callouts.Symbol_ends = simd<1>::constant<0>();
    654         callouts.CtCDPI_marks = simd<1>::constant<0>();
    655655        callouts.CtCDPI_content_starts = simd<1>::constant<0>();
    656656        callouts.CtCDPI_closers = simd<1>::constant<0>();
     
    669669        w1 = carryQ.BitBlock_advance_ci_co(w, carryQ.get_carry_in(1), 1);
    670670        LAngle_scope = simd_andc(v1, w1);
    671         PI_opener = simd_and(LAngle_scope, lex.QMark);
    672         CtCD_opener = simd_and(LAngle_scope, lex.Exclam);
    673         CtCDPI_opener = simd_or(PI_opener, CtCD_opener);
     671        callouts.PI_openers = simd_and(LAngle_scope, lex.QMark);
     672        callouts.CtCD_openers = simd<1>::constant<0>();
     673        CtCDPI_opener = simd_or(simd_and(LAngle_scope, lex.Exclam), callouts.PI_openers);
    674674        CD_closer = simd<1>::constant<0>();
    675675        DoubleHyphen = simd_and(simd_and(v1, w1), lex.Hyphen);
     
    687687        if ((bitblock::any(CtCDPI_Cursor) || carryQ.CarryTest(5, 14))) {
    688688          CtCDPI_starts = simd_or(CtCDPI_starts, CtCDPI_Cursor);
    689           PI_Cursor = simd_and(CtCDPI_Cursor, PI_opener);
     689          PI_Cursor = simd_and(CtCDPI_Cursor, callouts.PI_openers);
    690690          CD_Ct_Cursor = carryQ.BitBlock_advance_ci_co(simd_andc(CtCDPI_Cursor, PI_Cursor), carryQ.get_carry_in(5), 5);
    691           callouts.CtCDPI_marks = simd_or(callouts.CtCDPI_marks, simd_or(PI_Cursor, CD_Ct_Cursor));
     691          callouts.CtCD_openers = simd_or(callouts.CtCD_openers, CD_Ct_Cursor);
    692692          CD_Cursor = simd_and(CD_Ct_Cursor, lex.LBracket);
    693693          Ct_Cursor = simd_and(CD_Ct_Cursor, lex.Hyphen);
     
    695695          errors.ExpectedCommentOrCDATA = simd_or(errors.ExpectedCommentOrCDATA, CD_Ct_Error);
    696696          if ((bitblock::any(PI_Cursor) || carryQ.CarryTest(6, 5))) {
    697             callouts.Symbol_starts = simd_or(callouts.Symbol_starts, PI_Cursor);
    698697            PI_Cursor = carryQ.BitBlock_advance_ci_co(PI_Cursor, carryQ.get_carry_in(6), 6);
    699698            PI_name_end = carryQ.BitBlock_scanthru_ci_co(PI_Cursor, lex.NameScan, carryQ.get_carry_in(7), 7);
     
    703702            PI_error = simd_andc(tempvar2, PI_closer);
    704703            errors.UnterminatedPI = simd_or(errors.UnterminatedPI, PI_error);
    705             callouts.Symbol_ends = simd_or(callouts.Symbol_ends, PI_name_end);
     704            callouts.CtCDPI_content_starts = simd_or(callouts.CtCDPI_content_starts, PI_Cursor);
     705            callouts.CtCDPI_closers = simd_or(callouts.CtCDPI_closers, PI_name_end);
    706706            tempvar3 = carryQ.BitBlock_scanthru_ci_co(PI_name_end, lex.WS, carryQ.get_carry_in(9), 9);
    707707            callouts.CtCDPI_content_starts = simd_or(callouts.CtCDPI_content_starts, tempvar3);
     
    751751            LocalCarryDeclare(subcarryQ, 14);
    752752            CtCDPI_starts = simd_or(CtCDPI_starts, CtCDPI_Cursor);
    753             PI_Cursor = simd_and(CtCDPI_Cursor, PI_opener);
     753            PI_Cursor = simd_and(CtCDPI_Cursor, callouts.PI_openers);
    754754            CD_Ct_Cursor = subcarryQ.BitBlock_advance_ci_co(simd_andc(CtCDPI_Cursor, PI_Cursor), simd<1>::constant<0>(), 0);
    755             callouts.CtCDPI_marks = simd_or(callouts.CtCDPI_marks, simd_or(PI_Cursor, CD_Ct_Cursor));
     755            callouts.CtCD_openers = simd_or(callouts.CtCD_openers, CD_Ct_Cursor);
    756756            CD_Cursor = simd_and(CD_Ct_Cursor, lex.LBracket);
    757757            Ct_Cursor = simd_and(CD_Ct_Cursor, lex.Hyphen);
    758758            CD_Ct_Error = simd_andc(CD_Ct_Cursor, simd_or(lex.LBracket, lex.Hyphen));
    759759            errors.ExpectedCommentOrCDATA = simd_or(errors.ExpectedCommentOrCDATA, CD_Ct_Error);
    760             if ((bitblock::any(PI_Cursor) || subcarryQ.CarryTest(6, 5))) {
    761               callouts.Symbol_starts = simd_or(callouts.Symbol_starts, PI_Cursor);
     760            if (bitblock::any(PI_Cursor)) {
    762761              PI_Cursor = subcarryQ.BitBlock_advance_ci_co(PI_Cursor, simd<1>::constant<0>(), 1);
    763762              PI_name_end = subcarryQ.BitBlock_scanthru_ci_co(PI_Cursor, lex.NameScan, simd<1>::constant<0>(), 2);
     
    767766              PI_error = simd_andc(tempvar2, PI_closer);
    768767              errors.UnterminatedPI = simd_or(errors.UnterminatedPI, PI_error);
    769               callouts.Symbol_ends = simd_or(callouts.Symbol_ends, PI_name_end);
     768              callouts.CtCDPI_content_starts = simd_or(callouts.CtCDPI_content_starts, PI_Cursor);
     769              callouts.CtCDPI_closers = simd_or(callouts.CtCDPI_closers, PI_name_end);
    770770              tempvar3 = subcarryQ.BitBlock_scanthru_ci_co(PI_name_end, lex.WS, simd<1>::constant<0>(), 4);
    771771              callouts.CtCDPI_content_starts = simd_or(callouts.CtCDPI_content_starts, tempvar3);
     
    775775              subcarryQ.CarryDequeueEnqueue(6, 5);
    776776            }
    777             if ((bitblock::any(CD_Cursor) || subcarryQ.CarryTest(11, 1))) {
     777            if (bitblock::any(CD_Cursor)) {
    778778              callouts.CtCDPI_content_starts = simd_or(callouts.CtCDPI_content_starts, CD_Cursor);
    779779              CD_Cursor = subcarryQ.BitBlock_scanthru_ci_co(CD_Cursor, simd_not(CD_closer), simd<1>::constant<0>(), 6);
     
    782782              subcarryQ.CarryDequeueEnqueue(11, 1);
    783783            }
    784             if ((bitblock::any(Ct_Cursor) || subcarryQ.CarryTest(12, 5))) {
     784            if (bitblock::any(Ct_Cursor)) {
    785785              Ct_Cursor = subcarryQ.BitBlock_advance_ci_co(Ct_Cursor, simd<1>::constant<0>(), 7);
    786786              Ct_error = simd_andc(Ct_Cursor, lex.Hyphen);
     
    826826  }
    827827  IDISA_ALWAYS_INLINE void do_final_block(Lex & lex, Marker & marker, Callouts & callouts, Errors & errors, BitBlock EOF_mask) {
    828                 BitBlock CtCDPI_starts, v, w, v1, w1, LAngle_scope, PI_opener, CtCD_opener;
    829                 BitBlock CtCDPI_opener, CD_closer, DoubleHyphen, DoubleRBracket, PI_closer;
    830                 BitBlock CtCDPI_Cursor, PI_Cursor, CD_Ct_Cursor, CD_Cursor, Ct_Cursor;
    831                 BitBlock CD_Ct_Error, PI_name_end, PI_error, Ct_error;
     828                BitBlock CtCDPI_starts, v, w, v1, w1, LAngle_scope, CtCDPI_opener, CD_closer;
     829                BitBlock DoubleHyphen, DoubleRBracket, PI_closer, CtCDPI_Cursor, PI_Cursor;
     830                BitBlock CD_Ct_Cursor, CD_Cursor, Ct_Cursor, CD_Ct_Error, PI_name_end;
     831                BitBlock PI_error, Ct_error;
    832832
    833833                BitBlock tempvar0, tempvar1, tempvar2, tempvar3, tempvar4, tempvar5;
     
    836836        callouts.Symbol_starts = simd<1>::constant<0>();
    837837        callouts.Symbol_ends = simd<1>::constant<0>();
    838         callouts.CtCDPI_marks = simd<1>::constant<0>();
    839838        callouts.CtCDPI_content_starts = simd<1>::constant<0>();
    840839        callouts.CtCDPI_closers = simd<1>::constant<0>();
     
    853852        w1 = carryQ.BitBlock_advance_ci_co(w, carryQ.get_carry_in(1), 1);
    854853        LAngle_scope = simd_andc(v1, w1);
    855         PI_opener = simd_and(LAngle_scope, lex.QMark);
    856         CtCD_opener = simd_and(LAngle_scope, lex.Exclam);
    857         CtCDPI_opener = simd_or(PI_opener, CtCD_opener);
     854        callouts.PI_openers = simd_and(LAngle_scope, lex.QMark);
     855        callouts.CtCD_openers = simd<1>::constant<0>();
     856        CtCDPI_opener = simd_or(simd_and(LAngle_scope, lex.Exclam), callouts.PI_openers);
    858857        CD_closer = simd<1>::constant<0>();
    859858        DoubleHyphen = simd_and(simd_and(v1, w1), lex.Hyphen);
     
    871870        if ((bitblock::any(simd_and(CtCDPI_Cursor, EOF_mask)) || carryQ.CarryTest(5, 14))) {
    872871          CtCDPI_starts = simd_or(CtCDPI_starts, CtCDPI_Cursor);
    873           PI_Cursor = simd_and(CtCDPI_Cursor, PI_opener);
     872          PI_Cursor = simd_and(CtCDPI_Cursor, callouts.PI_openers);
    874873          CD_Ct_Cursor = carryQ.BitBlock_advance_ci_co(simd_andc(CtCDPI_Cursor, PI_Cursor), carryQ.get_carry_in(5), 5);
    875           callouts.CtCDPI_marks = simd_or(callouts.CtCDPI_marks, simd_or(PI_Cursor, CD_Ct_Cursor));
     874          callouts.CtCD_openers = simd_or(callouts.CtCD_openers, CD_Ct_Cursor);
    876875          CD_Cursor = simd_and(CD_Ct_Cursor, lex.LBracket);
    877876          Ct_Cursor = simd_and(CD_Ct_Cursor, lex.Hyphen);
     
    879878          errors.ExpectedCommentOrCDATA = simd_or(errors.ExpectedCommentOrCDATA, CD_Ct_Error);
    880879          if ((bitblock::any(PI_Cursor) || carryQ.CarryTest(6, 5))) {
    881             callouts.Symbol_starts = simd_or(callouts.Symbol_starts, PI_Cursor);
    882880            PI_Cursor = carryQ.BitBlock_advance_ci_co(PI_Cursor, carryQ.get_carry_in(6), 6);
    883881            PI_name_end = carryQ.BitBlock_scanthru_ci_co(PI_Cursor, lex.NameScan, carryQ.get_carry_in(7), 7);
     
    887885            PI_error = simd_andc(tempvar2, PI_closer);
    888886            errors.UnterminatedPI = simd_or(errors.UnterminatedPI, PI_error);
    889             callouts.Symbol_ends = simd_or(callouts.Symbol_ends, PI_name_end);
     887            callouts.CtCDPI_content_starts = simd_or(callouts.CtCDPI_content_starts, PI_Cursor);
     888            callouts.CtCDPI_closers = simd_or(callouts.CtCDPI_closers, PI_name_end);
    890889            tempvar3 = carryQ.BitBlock_scanthru_ci_co(PI_name_end, lex.WS, carryQ.get_carry_in(9), 9);
    891890            callouts.CtCDPI_content_starts = simd_or(callouts.CtCDPI_content_starts, tempvar3);
     
    935934            LocalCarryDeclare(subcarryQ, 14);
    936935            CtCDPI_starts = simd_or(CtCDPI_starts, CtCDPI_Cursor);
    937             PI_Cursor = simd_and(CtCDPI_Cursor, PI_opener);
     936            PI_Cursor = simd_and(CtCDPI_Cursor, callouts.PI_openers);
    938937            CD_Ct_Cursor = subcarryQ.BitBlock_advance_ci_co(simd_andc(CtCDPI_Cursor, PI_Cursor), simd<1>::constant<0>(), 0);
    939             callouts.CtCDPI_marks = simd_or(callouts.CtCDPI_marks, simd_or(PI_Cursor, CD_Ct_Cursor));
     938            callouts.CtCD_openers = simd_or(callouts.CtCD_openers, CD_Ct_Cursor);
    940939            CD_Cursor = simd_and(CD_Ct_Cursor, lex.LBracket);
    941940            Ct_Cursor = simd_and(CD_Ct_Cursor, lex.Hyphen);
    942941            CD_Ct_Error = simd_andc(CD_Ct_Cursor, simd_or(lex.LBracket, lex.Hyphen));
    943942            errors.ExpectedCommentOrCDATA = simd_or(errors.ExpectedCommentOrCDATA, CD_Ct_Error);
    944             if ((bitblock::any(PI_Cursor) || subcarryQ.CarryTest(6, 5))) {
    945               callouts.Symbol_starts = simd_or(callouts.Symbol_starts, PI_Cursor);
     943            if (bitblock::any(PI_Cursor)) {
    946944              PI_Cursor = subcarryQ.BitBlock_advance_ci_co(PI_Cursor, simd<1>::constant<0>(), 1);
    947945              PI_name_end = subcarryQ.BitBlock_scanthru_ci_co(PI_Cursor, lex.NameScan, simd<1>::constant<0>(), 2);
     
    951949              PI_error = simd_andc(tempvar2, PI_closer);
    952950              errors.UnterminatedPI = simd_or(errors.UnterminatedPI, PI_error);
    953               callouts.Symbol_ends = simd_or(callouts.Symbol_ends, PI_name_end);
     951              callouts.CtCDPI_content_starts = simd_or(callouts.CtCDPI_content_starts, PI_Cursor);
     952              callouts.CtCDPI_closers = simd_or(callouts.CtCDPI_closers, PI_name_end);
    954953              tempvar3 = subcarryQ.BitBlock_scanthru_ci_co(PI_name_end, lex.WS, simd<1>::constant<0>(), 4);
    955954              callouts.CtCDPI_content_starts = simd_or(callouts.CtCDPI_content_starts, tempvar3);
     
    959958              subcarryQ.CarryDequeueEnqueue(6, 5);
    960959            }
    961             if ((bitblock::any(CD_Cursor) || subcarryQ.CarryTest(11, 1))) {
     960            if (bitblock::any(CD_Cursor)) {
    962961              callouts.CtCDPI_content_starts = simd_or(callouts.CtCDPI_content_starts, CD_Cursor);
    963962              CD_Cursor = subcarryQ.BitBlock_scanthru_ci_co(CD_Cursor, simd_andc(EOF_mask, CD_closer), simd<1>::constant<0>(), 6);
     
    966965              subcarryQ.CarryDequeueEnqueue(11, 1);
    967966            }
    968             if ((bitblock::any(Ct_Cursor) || subcarryQ.CarryTest(12, 5))) {
     967            if (bitblock::any(Ct_Cursor)) {
    969968              Ct_Cursor = subcarryQ.BitBlock_advance_ci_co(Ct_Cursor, simd<1>::constant<0>(), 7);
    970969              Ct_error = simd_andc(Ct_Cursor, lex.Hyphen);
     
    10471046 }
    10481047  IDISA_ALWAYS_INLINE void do_block(U16hi & u16hi, U16lo & u16lo, Lex & lex, Callouts & callouts, Marker & marker) {
    1049                 BitBlock transition_marks, zeromask, CtCD_marks;
     1048                BitBlock CtCDPI_openers, transition_marks, zeromask;
    10501049
    10511050                BitBlock tempvar0, tempvar1;
    10521051
    10531052
    1054         transition_marks = simd_or(simd_or(simd_or(simd_or(callouts.CtCDPI_marks, callouts.AttEq_marks), callouts.StartTag_closers), callouts.EmptyTag_closers), callouts.EndTag_marks);
     1053        CtCDPI_openers = simd_or(callouts.PI_openers, callouts.CtCD_openers);
     1054        transition_marks = simd_or(simd_or(simd_or(simd_or(CtCDPI_openers, callouts.AttEq_marks), callouts.StartTag_closers), callouts.EmptyTag_closers), callouts.EndTag_marks);
    10551055        callouts.MarkupDelimiters = simd_or(callouts.Tag_closers, callouts.CtCDPI_closers);
    10561056        callouts.StringEnds = simd_or(simd_or(callouts.CtCDPI_closers, callouts.AttCloseQuotes), marker.LAngle);
    10571057        callouts.delmask = simd_or(callouts.delmask, simd_andc(callouts.TagSpan, simd_or(simd_or(callouts.AttValSpan, transition_marks), callouts.StringEnds)));
    1058         tempvar0 = carryQ.BitBlock_exclusive_span(callouts.CtCDPI_marks, callouts.CtCDPI_content_starts, carryQ.get_carry_in(0), 0);
     1058        tempvar0 = carryQ.BitBlock_exclusive_span(CtCDPI_openers, callouts.CtCDPI_content_starts, carryQ.get_carry_in(0), 0);
    10591059        callouts.delmask = simd_or(callouts.delmask, tempvar0);
    10601060        tempvar1 = carryQ.BitBlock_advance_ci_co(marker.LAngle, carryQ.get_carry_in(1), 1);
    10611061        callouts.delmask = simd_or(callouts.delmask, simd_and(tempvar1, lex.Exclam));
    10621062        zeromask = simd_or(simd_or(callouts.delmask, callouts.StringEnds), transition_marks);
    1063         CtCD_marks = simd_andc(callouts.CtCDPI_marks, callouts.Symbol_starts);
    10641063        u16hi.bit_0 = simd_andc(u16hi.bit_0, zeromask);
    10651064        u16hi.bit_1 = simd_andc(u16hi.bit_1, zeromask);
     
    10751074        u16lo.bit_3 = simd_andc(u16lo.bit_3, zeromask);
    10761075        u16lo.bit_4 = simd_andc(u16lo.bit_4, simd_xor(zeromask, callouts.EmptyTag_closers));
    1077         u16lo.bit_5 = simd_andc(u16lo.bit_5, zeromask);
    1078         u16lo.bit_5 = simd_or(u16lo.bit_5, callouts.CtCDPI_marks);
    1079         u16lo.bit_6 = simd_andc(u16lo.bit_6, simd_xor(simd_xor(zeromask, callouts.EndTag_marks), CtCD_marks));
    1080         u16lo.bit_7 = simd_andc(u16lo.bit_7, simd_xor(simd_xor(zeromask, CtCD_marks), callouts.AttEq_marks));
     1076        u16lo.bit_5 = simd_or(simd_andc(u16lo.bit_5, zeromask), CtCDPI_openers);
     1077        u16lo.bit_6 = simd_andc(u16lo.bit_6, simd_xor(simd_xor(zeromask, callouts.EndTag_marks), callouts.CtCD_openers));
     1078        u16lo.bit_7 = simd_andc(u16lo.bit_7, simd_xor(simd_xor(zeromask, callouts.CtCD_openers), callouts.AttEq_marks));
    10811079        carryQ.CarryQ_Adjust(2);
    10821080  }
    10831081  IDISA_ALWAYS_INLINE void do_final_block(U16hi & u16hi, U16lo & u16lo, Lex & lex, Callouts & callouts, Marker & marker, BitBlock EOF_mask) {
    1084                 BitBlock transition_marks, zeromask, CtCD_marks;
     1082                BitBlock CtCDPI_openers, transition_marks, zeromask;
    10851083
    10861084                BitBlock tempvar0, tempvar1;
    10871085
    10881086
    1089         transition_marks = simd_or(simd_or(simd_or(simd_or(callouts.CtCDPI_marks, callouts.AttEq_marks), callouts.StartTag_closers), callouts.EmptyTag_closers), callouts.EndTag_marks);
     1087        CtCDPI_openers = simd_or(callouts.PI_openers, callouts.CtCD_openers);
     1088        transition_marks = simd_or(simd_or(simd_or(simd_or(CtCDPI_openers, callouts.AttEq_marks), callouts.StartTag_closers), callouts.EmptyTag_closers), callouts.EndTag_marks);
    10901089        callouts.MarkupDelimiters = simd_or(callouts.Tag_closers, callouts.CtCDPI_closers);
    10911090        callouts.StringEnds = simd_or(simd_or(callouts.CtCDPI_closers, callouts.AttCloseQuotes), marker.LAngle);
    10921091        callouts.delmask = simd_or(callouts.delmask, simd_andc(callouts.TagSpan, simd_or(simd_or(callouts.AttValSpan, transition_marks), callouts.StringEnds)));
    1093         tempvar0 = carryQ.BitBlock_exclusive_span(callouts.CtCDPI_marks, callouts.CtCDPI_content_starts, carryQ.get_carry_in(0), 0);
     1092        tempvar0 = carryQ.BitBlock_exclusive_span(CtCDPI_openers, callouts.CtCDPI_content_starts, carryQ.get_carry_in(0), 0);
    10941093        callouts.delmask = simd_or(callouts.delmask, tempvar0);
    10951094        tempvar1 = carryQ.BitBlock_advance_ci_co(marker.LAngle, carryQ.get_carry_in(1), 1);
    10961095        callouts.delmask = simd_or(callouts.delmask, simd_and(tempvar1, lex.Exclam));
    10971096        zeromask = simd_or(simd_or(callouts.delmask, callouts.StringEnds), transition_marks);
    1098         CtCD_marks = simd_andc(callouts.CtCDPI_marks, callouts.Symbol_starts);
    10991097        u16hi.bit_0 = simd_andc(u16hi.bit_0, zeromask);
    11001098        u16hi.bit_1 = simd_andc(u16hi.bit_1, zeromask);
     
    11101108        u16lo.bit_3 = simd_andc(u16lo.bit_3, zeromask);
    11111109        u16lo.bit_4 = simd_andc(u16lo.bit_4, simd_xor(zeromask, callouts.EmptyTag_closers));
    1112         u16lo.bit_5 = simd_andc(u16lo.bit_5, zeromask);
    1113         u16lo.bit_5 = simd_or(u16lo.bit_5, callouts.CtCDPI_marks);
    1114         u16lo.bit_6 = simd_andc(u16lo.bit_6, simd_xor(simd_xor(zeromask, callouts.EndTag_marks), CtCD_marks));
    1115         u16lo.bit_7 = simd_andc(u16lo.bit_7, simd_xor(simd_xor(zeromask, CtCD_marks), callouts.AttEq_marks));
     1110        u16lo.bit_5 = simd_or(simd_andc(u16lo.bit_5, zeromask), CtCDPI_openers);
     1111        u16lo.bit_6 = simd_andc(u16lo.bit_6, simd_xor(simd_xor(zeromask, callouts.EndTag_marks), callouts.CtCD_openers));
     1112        u16lo.bit_7 = simd_andc(u16lo.bit_7, simd_xor(simd_xor(zeromask, callouts.CtCD_openers), callouts.AttEq_marks));
    11161113  }
    11171114  void do_segment(U16hi u16hi[], U16lo u16lo[], Lex lex[], Callouts callouts[], Marker marker[], int segment_blocks) {
  • icXML/icXML-devel/src/icxmlc/XMLUTF8CharacterSetAdapter.hpp

    r2728 r2774  
    77/*
    88 * @author Nigel Medforth, nigelm -at- interational-characters.com
    9  * @version $Id: XMLUTF8CharacterSetAdapter.hpp 217 2012-12-03 15:00:50Z robc $
     9 * @version $Id: XMLUTF8CharacterSetAdapter.hpp 224 2012-12-12 03:31:56Z nigelm $
    1010 *
    1111 */
     
    172172
    173173  struct Callouts {
    174   BitBlock CtCDPI_marks;
     174  BitBlock PI_openers;
     175  BitBlock CtCD_openers;
    175176  BitBlock CtCDPI_closers;
    176177  BitBlock CtCDPI_content_starts;
     
    610611 }
    611612  IDISA_ALWAYS_INLINE void do_block(Lex & lex, Marker & marker, Callouts & callouts, Errors & errors) {
    612                 BitBlock CtCDPI_starts, v, w, v1, w1, LAngle_scope, PI_opener, CtCD_opener;
    613                 BitBlock CtCDPI_opener, CD_closer, DoubleHyphen, DoubleRBracket, PI_closer;
    614                 BitBlock CtCDPI_Cursor, PI_Cursor, CD_Ct_Cursor, CD_Cursor, Ct_Cursor;
    615                 BitBlock CD_Ct_Error, PI_name_end, PI_error, Ct_error;
     613                BitBlock CtCDPI_starts, v, w, v1, w1, LAngle_scope, CtCDPI_opener, CD_closer;
     614                BitBlock DoubleHyphen, DoubleRBracket, PI_closer, CtCDPI_Cursor, PI_Cursor;
     615                BitBlock CD_Ct_Cursor, CD_Cursor, Ct_Cursor, CD_Ct_Error, PI_name_end;
     616                BitBlock PI_error, Ct_error;
    616617
    617618                BitBlock tempvar0, tempvar1, tempvar2, tempvar3, tempvar4, tempvar5;
     
    620621        callouts.Symbol_starts = simd<1>::constant<0>();
    621622        callouts.Symbol_ends = simd<1>::constant<0>();
    622         callouts.CtCDPI_marks = simd<1>::constant<0>();
    623623        callouts.CtCDPI_content_starts = simd<1>::constant<0>();
    624624        callouts.CtCDPI_closers = simd<1>::constant<0>();
     
    637637        w1 = carryQ.BitBlock_advance_ci_co(w, carryQ.get_carry_in(1), 1);
    638638        LAngle_scope = simd_andc(v1, w1);
    639         PI_opener = simd_and(LAngle_scope, lex.QMark);
    640         CtCD_opener = simd_and(LAngle_scope, lex.Exclam);
    641         CtCDPI_opener = simd_or(PI_opener, CtCD_opener);
     639        callouts.PI_openers = simd_and(LAngle_scope, lex.QMark);
     640        callouts.CtCD_openers = simd<1>::constant<0>();
     641        CtCDPI_opener = simd_or(simd_and(LAngle_scope, lex.Exclam), callouts.PI_openers);
    642642        CD_closer = simd<1>::constant<0>();
    643643        DoubleHyphen = simd_and(simd_and(v1, w1), lex.Hyphen);
     
    655655        if ((bitblock::any(CtCDPI_Cursor) || carryQ.CarryTest(5, 14))) {
    656656          CtCDPI_starts = simd_or(CtCDPI_starts, CtCDPI_Cursor);
    657           PI_Cursor = simd_and(CtCDPI_Cursor, PI_opener);
     657          PI_Cursor = simd_and(CtCDPI_Cursor, callouts.PI_openers);
    658658          CD_Ct_Cursor = carryQ.BitBlock_advance_ci_co(simd_andc(CtCDPI_Cursor, PI_Cursor), carryQ.get_carry_in(5), 5);
    659           callouts.CtCDPI_marks = simd_or(callouts.CtCDPI_marks, simd_or(PI_Cursor, CD_Ct_Cursor));
     659          callouts.CtCD_openers = simd_or(callouts.CtCD_openers, CD_Ct_Cursor);
    660660          CD_Cursor = simd_and(CD_Ct_Cursor, lex.LBracket);
    661661          Ct_Cursor = simd_and(CD_Ct_Cursor, lex.Hyphen);
     
    663663          errors.ExpectedCommentOrCDATA = simd_or(errors.ExpectedCommentOrCDATA, CD_Ct_Error);
    664664          if ((bitblock::any(PI_Cursor) || carryQ.CarryTest(6, 5))) {
    665             callouts.Symbol_starts = simd_or(callouts.Symbol_starts, PI_Cursor);
    666665            PI_Cursor = carryQ.BitBlock_advance_ci_co(PI_Cursor, carryQ.get_carry_in(6), 6);
    667666            PI_name_end = carryQ.BitBlock_scanthru_ci_co(PI_Cursor, lex.NameScan, carryQ.get_carry_in(7), 7);
     
    671670            PI_error = simd_andc(tempvar2, PI_closer);
    672671            errors.UnterminatedPI = simd_or(errors.UnterminatedPI, PI_error);
    673             callouts.Symbol_ends = simd_or(callouts.Symbol_ends, PI_name_end);
     672            callouts.CtCDPI_content_starts = simd_or(callouts.CtCDPI_content_starts, PI_Cursor);
     673            callouts.CtCDPI_closers = simd_or(callouts.CtCDPI_closers, PI_name_end);
    674674            tempvar3 = carryQ.BitBlock_scanthru_ci_co(PI_name_end, lex.WS, carryQ.get_carry_in(9), 9);
    675675            callouts.CtCDPI_content_starts = simd_or(callouts.CtCDPI_content_starts, tempvar3);
     
    719719            LocalCarryDeclare(subcarryQ, 14);
    720720            CtCDPI_starts = simd_or(CtCDPI_starts, CtCDPI_Cursor);
    721             PI_Cursor = simd_and(CtCDPI_Cursor, PI_opener);
     721            PI_Cursor = simd_and(CtCDPI_Cursor, callouts.PI_openers);
    722722            CD_Ct_Cursor = subcarryQ.BitBlock_advance_ci_co(simd_andc(CtCDPI_Cursor, PI_Cursor), simd<1>::constant<0>(), 0);
    723             callouts.CtCDPI_marks = simd_or(callouts.CtCDPI_marks, simd_or(PI_Cursor, CD_Ct_Cursor));
     723            callouts.CtCD_openers = simd_or(callouts.CtCD_openers, CD_Ct_Cursor);
    724724            CD_Cursor = simd_and(CD_Ct_Cursor, lex.LBracket);
    725725            Ct_Cursor = simd_and(CD_Ct_Cursor, lex.Hyphen);
     
    727727            errors.ExpectedCommentOrCDATA = simd_or(errors.ExpectedCommentOrCDATA, CD_Ct_Error);
    728728            if (bitblock::any(PI_Cursor)) {
    729               callouts.Symbol_starts = simd_or(callouts.Symbol_starts, PI_Cursor);
    730729              PI_Cursor = subcarryQ.BitBlock_advance_ci_co(PI_Cursor, simd<1>::constant<0>(), 1);
    731730              PI_name_end = subcarryQ.BitBlock_scanthru_ci_co(PI_Cursor, lex.NameScan, simd<1>::constant<0>(), 2);
     
    735734              PI_error = simd_andc(tempvar2, PI_closer);
    736735              errors.UnterminatedPI = simd_or(errors.UnterminatedPI, PI_error);
    737               callouts.Symbol_ends = simd_or(callouts.Symbol_ends, PI_name_end);
     736              callouts.CtCDPI_content_starts = simd_or(callouts.CtCDPI_content_starts, PI_Cursor);
     737              callouts.CtCDPI_closers = simd_or(callouts.CtCDPI_closers, PI_name_end);
    738738              tempvar3 = subcarryQ.BitBlock_scanthru_ci_co(PI_name_end, lex.WS, simd<1>::constant<0>(), 4);
    739739              callouts.CtCDPI_content_starts = simd_or(callouts.CtCDPI_content_starts, tempvar3);
     
    794794  }
    795795  IDISA_ALWAYS_INLINE void do_final_block(Lex & lex, Marker & marker, Callouts & callouts, Errors & errors, BitBlock EOF_mask) {
    796                 BitBlock CtCDPI_starts, v, w, v1, w1, LAngle_scope, PI_opener, CtCD_opener;
    797                 BitBlock CtCDPI_opener, CD_closer, DoubleHyphen, DoubleRBracket, PI_closer;
    798                 BitBlock CtCDPI_Cursor, PI_Cursor, CD_Ct_Cursor, CD_Cursor, Ct_Cursor;
    799                 BitBlock CD_Ct_Error, PI_name_end, PI_error, Ct_error;
     796                BitBlock CtCDPI_starts, v, w, v1, w1, LAngle_scope, CtCDPI_opener, CD_closer;
     797                BitBlock DoubleHyphen, DoubleRBracket, PI_closer, CtCDPI_Cursor, PI_Cursor;
     798                BitBlock CD_Ct_Cursor, CD_Cursor, Ct_Cursor, CD_Ct_Error, PI_name_end;
     799                BitBlock PI_error, Ct_error;
    800800
    801801                BitBlock tempvar0, tempvar1, tempvar2, tempvar3, tempvar4, tempvar5;
     
    804804        callouts.Symbol_starts = simd<1>::constant<0>();
    805805        callouts.Symbol_ends = simd<1>::constant<0>();
    806         callouts.CtCDPI_marks = simd<1>::constant<0>();
    807806        callouts.CtCDPI_content_starts = simd<1>::constant<0>();
    808807        callouts.CtCDPI_closers = simd<1>::constant<0>();
     
    821820        w1 = carryQ.BitBlock_advance_ci_co(w, carryQ.get_carry_in(1), 1);
    822821        LAngle_scope = simd_andc(v1, w1);
    823         PI_opener = simd_and(LAngle_scope, lex.QMark);
    824         CtCD_opener = simd_and(LAngle_scope, lex.Exclam);
    825         CtCDPI_opener = simd_or(PI_opener, CtCD_opener);
     822        callouts.PI_openers = simd_and(LAngle_scope, lex.QMark);
     823        callouts.CtCD_openers = simd<1>::constant<0>();
     824        CtCDPI_opener = simd_or(simd_and(LAngle_scope, lex.Exclam), callouts.PI_openers);
    826825        CD_closer = simd<1>::constant<0>();
    827826        DoubleHyphen = simd_and(simd_and(v1, w1), lex.Hyphen);
     
    839838        if ((bitblock::any(simd_and(CtCDPI_Cursor, EOF_mask)) || carryQ.CarryTest(5, 14))) {
    840839          CtCDPI_starts = simd_or(CtCDPI_starts, CtCDPI_Cursor);
    841           PI_Cursor = simd_and(CtCDPI_Cursor, PI_opener);
     840          PI_Cursor = simd_and(CtCDPI_Cursor, callouts.PI_openers);
    842841          CD_Ct_Cursor = carryQ.BitBlock_advance_ci_co(simd_andc(CtCDPI_Cursor, PI_Cursor), carryQ.get_carry_in(5), 5);
    843           callouts.CtCDPI_marks = simd_or(callouts.CtCDPI_marks, simd_or(PI_Cursor, CD_Ct_Cursor));
     842          callouts.CtCD_openers = simd_or(callouts.CtCD_openers, CD_Ct_Cursor);
    844843          CD_Cursor = simd_and(CD_Ct_Cursor, lex.LBracket);
    845844          Ct_Cursor = simd_and(CD_Ct_Cursor, lex.Hyphen);
     
    847846          errors.ExpectedCommentOrCDATA = simd_or(errors.ExpectedCommentOrCDATA, CD_Ct_Error);
    848847          if ((bitblock::any(PI_Cursor) || carryQ.CarryTest(6, 5))) {
    849             callouts.Symbol_starts = simd_or(callouts.Symbol_starts, PI_Cursor);
    850848            PI_Cursor = carryQ.BitBlock_advance_ci_co(PI_Cursor, carryQ.get_carry_in(6), 6);
    851849            PI_name_end = carryQ.BitBlock_scanthru_ci_co(PI_Cursor, lex.NameScan, carryQ.get_carry_in(7), 7);
     
    855853            PI_error = simd_andc(tempvar2, PI_closer);
    856854            errors.UnterminatedPI = simd_or(errors.UnterminatedPI, PI_error);
    857             callouts.Symbol_ends = simd_or(callouts.Symbol_ends, PI_name_end);
     855            callouts.CtCDPI_content_starts = simd_or(callouts.CtCDPI_content_starts, PI_Cursor);
     856            callouts.CtCDPI_closers = simd_or(callouts.CtCDPI_closers, PI_name_end);
    858857            tempvar3 = carryQ.BitBlock_scanthru_ci_co(PI_name_end, lex.WS, carryQ.get_carry_in(9), 9);
    859858            callouts.CtCDPI_content_starts = simd_or(callouts.CtCDPI_content_starts, tempvar3);
     
    903902            LocalCarryDeclare(subcarryQ, 14);
    904903            CtCDPI_starts = simd_or(CtCDPI_starts, CtCDPI_Cursor);
    905             PI_Cursor = simd_and(CtCDPI_Cursor, PI_opener);
     904            PI_Cursor = simd_and(CtCDPI_Cursor, callouts.PI_openers);
    906905            CD_Ct_Cursor = subcarryQ.BitBlock_advance_ci_co(simd_andc(CtCDPI_Cursor, PI_Cursor), simd<1>::constant<0>(), 0);
    907             callouts.CtCDPI_marks = simd_or(callouts.CtCDPI_marks, simd_or(PI_Cursor, CD_Ct_Cursor));
     906            callouts.CtCD_openers = simd_or(callouts.CtCD_openers, CD_Ct_Cursor);
    908907            CD_Cursor = simd_and(CD_Ct_Cursor, lex.LBracket);
    909908            Ct_Cursor = simd_and(CD_Ct_Cursor, lex.Hyphen);
     
    911910            errors.ExpectedCommentOrCDATA = simd_or(errors.ExpectedCommentOrCDATA, CD_Ct_Error);
    912911            if (bitblock::any(PI_Cursor)) {
    913               callouts.Symbol_starts = simd_or(callouts.Symbol_starts, PI_Cursor);
    914912              PI_Cursor = subcarryQ.BitBlock_advance_ci_co(PI_Cursor, simd<1>::constant<0>(), 1);
    915913              PI_name_end = subcarryQ.BitBlock_scanthru_ci_co(PI_Cursor, lex.NameScan, simd<1>::constant<0>(), 2);
     
    919917              PI_error = simd_andc(tempvar2, PI_closer);
    920918              errors.UnterminatedPI = simd_or(errors.UnterminatedPI, PI_error);
    921               callouts.Symbol_ends = simd_or(callouts.Symbol_ends, PI_name_end);
     919              callouts.CtCDPI_content_starts = simd_or(callouts.CtCDPI_content_starts, PI_Cursor);
     920              callouts.CtCDPI_closers = simd_or(callouts.CtCDPI_closers, PI_name_end);
    922921              tempvar3 = subcarryQ.BitBlock_scanthru_ci_co(PI_name_end, lex.WS, simd<1>::constant<0>(), 4);
    923922              callouts.CtCDPI_content_starts = simd_or(callouts.CtCDPI_content_starts, tempvar3);
     
    10151014 }
    10161015  IDISA_ALWAYS_INLINE void do_block(U16hi & u16hi, U16lo & u16lo, Lex & lex, Callouts & callouts, Marker & marker) {
    1017                 BitBlock transition_marks, zeromask, CtCD_marks;
     1016                BitBlock CtCDPI_openers, transition_marks, zeromask;
    10181017
    10191018                BitBlock tempvar0, tempvar1;
    10201019
    10211020
    1022         transition_marks = simd_or(simd_or(simd_or(simd_or(callouts.CtCDPI_marks, callouts.AttEq_marks), callouts.StartTag_closers), callouts.EmptyTag_closers), callouts.EndTag_marks);
     1021        CtCDPI_openers = simd_or(callouts.PI_openers, callouts.CtCD_openers);
     1022        transition_marks = simd_or(simd_or(simd_or(simd_or(CtCDPI_openers, callouts.AttEq_marks), callouts.StartTag_closers), callouts.EmptyTag_closers), callouts.EndTag_marks);
    10231023        callouts.MarkupDelimiters = simd_or(callouts.Tag_closers, callouts.CtCDPI_closers);
    10241024        callouts.StringEnds = simd_or(simd_or(callouts.CtCDPI_closers, callouts.AttCloseQuotes), marker.LAngle);
    10251025        callouts.delmask = simd_or(callouts.delmask, simd_andc(callouts.TagSpan, simd_or(simd_or(callouts.AttValSpan, transition_marks), callouts.StringEnds)));
    1026         tempvar0 = carryQ.BitBlock_exclusive_span(callouts.CtCDPI_marks, callouts.CtCDPI_content_starts, carryQ.get_carry_in(0), 0);
     1026        tempvar0 = carryQ.BitBlock_exclusive_span(CtCDPI_openers, callouts.CtCDPI_content_starts, carryQ.get_carry_in(0), 0);
    10271027        callouts.delmask = simd_or(callouts.delmask, tempvar0);
    10281028        tempvar1 = carryQ.BitBlock_advance_ci_co(marker.LAngle, carryQ.get_carry_in(1), 1);
    10291029        callouts.delmask = simd_or(callouts.delmask, simd_and(tempvar1, lex.Exclam));
    10301030        zeromask = simd_or(simd_or(callouts.delmask, callouts.StringEnds), transition_marks);
    1031         CtCD_marks = simd_andc(callouts.CtCDPI_marks, callouts.Symbol_starts);
    10321031        u16hi.bit_0 = simd_andc(u16hi.bit_0, zeromask);
    10331032        u16hi.bit_1 = simd_andc(u16hi.bit_1, zeromask);
     
    10431042        u16lo.bit_3 = simd_andc(u16lo.bit_3, zeromask);
    10441043        u16lo.bit_4 = simd_andc(u16lo.bit_4, simd_xor(zeromask, callouts.EmptyTag_closers));
    1045         u16lo.bit_5 = simd_andc(u16lo.bit_5, zeromask);
    1046         u16lo.bit_5 = simd_or(u16lo.bit_5, callouts.CtCDPI_marks);
    1047         u16lo.bit_6 = simd_andc(u16lo.bit_6, simd_xor(simd_xor(zeromask, callouts.EndTag_marks), CtCD_marks));
    1048         u16lo.bit_7 = simd_andc(u16lo.bit_7, simd_xor(simd_xor(zeromask, CtCD_marks), callouts.AttEq_marks));
     1044        u16lo.bit_5 = simd_or(simd_andc(u16lo.bit_5, zeromask), CtCDPI_openers);
     1045        u16lo.bit_6 = simd_andc(u16lo.bit_6, simd_xor(simd_xor(zeromask, callouts.EndTag_marks), callouts.CtCD_openers));
     1046        u16lo.bit_7 = simd_andc(u16lo.bit_7, simd_xor(simd_xor(zeromask, callouts.CtCD_openers), callouts.AttEq_marks));
    10491047        carryQ.CarryQ_Adjust(2);
    10501048  }
    10511049  IDISA_ALWAYS_INLINE void do_final_block(U16hi & u16hi, U16lo & u16lo, Lex & lex, Callouts & callouts, Marker & marker, BitBlock EOF_mask) {
    1052                 BitBlock transition_marks, zeromask, CtCD_marks;
     1050                BitBlock CtCDPI_openers, transition_marks, zeromask;
    10531051
    10541052                BitBlock tempvar0, tempvar1;
    10551053
    10561054
    1057         transition_marks = simd_or(simd_or(simd_or(simd_or(callouts.CtCDPI_marks, callouts.AttEq_marks), callouts.StartTag_closers), callouts.EmptyTag_closers), callouts.EndTag_marks);
     1055        CtCDPI_openers = simd_or(callouts.PI_openers, callouts.CtCD_openers);
     1056        transition_marks = simd_or(simd_or(simd_or(simd_or(CtCDPI_openers, callouts.AttEq_marks), callouts.StartTag_closers), callouts.EmptyTag_closers), callouts.EndTag_marks);
    10581057        callouts.MarkupDelimiters = simd_or(callouts.Tag_closers, callouts.CtCDPI_closers);
    10591058        callouts.StringEnds = simd_or(simd_or(callouts.CtCDPI_closers, callouts.AttCloseQuotes), marker.LAngle);
    10601059        callouts.delmask = simd_or(callouts.delmask, simd_andc(callouts.TagSpan, simd_or(simd_or(callouts.AttValSpan, transition_marks), callouts.StringEnds)));
    1061         tempvar0 = carryQ.BitBlock_exclusive_span(callouts.CtCDPI_marks, callouts.CtCDPI_content_starts, carryQ.get_carry_in(0), 0);
     1060        tempvar0 = carryQ.BitBlock_exclusive_span(CtCDPI_openers, callouts.CtCDPI_content_starts, carryQ.get_carry_in(0), 0);
    10621061        callouts.delmask = simd_or(callouts.delmask, tempvar0);
    10631062        tempvar1 = carryQ.BitBlock_advance_ci_co(marker.LAngle, carryQ.get_carry_in(1), 1);
    10641063        callouts.delmask = simd_or(callouts.delmask, simd_and(tempvar1, lex.Exclam));
    10651064        zeromask = simd_or(simd_or(callouts.delmask, callouts.StringEnds), transition_marks);
    1066         CtCD_marks = simd_andc(callouts.CtCDPI_marks, callouts.Symbol_starts);
    10671065        u16hi.bit_0 = simd_andc(u16hi.bit_0, zeromask);
    10681066        u16hi.bit_1 = simd_andc(u16hi.bit_1, zeromask);
     
    10781076        u16lo.bit_3 = simd_andc(u16lo.bit_3, zeromask);
    10791077        u16lo.bit_4 = simd_andc(u16lo.bit_4, simd_xor(zeromask, callouts.EmptyTag_closers));
    1080         u16lo.bit_5 = simd_andc(u16lo.bit_5, zeromask);
    1081         u16lo.bit_5 = simd_or(u16lo.bit_5, callouts.CtCDPI_marks);
    1082         u16lo.bit_6 = simd_andc(u16lo.bit_6, simd_xor(simd_xor(zeromask, callouts.EndTag_marks), CtCD_marks));
    1083         u16lo.bit_7 = simd_andc(u16lo.bit_7, simd_xor(simd_xor(zeromask, CtCD_marks), callouts.AttEq_marks));
     1078        u16lo.bit_5 = simd_or(simd_andc(u16lo.bit_5, zeromask), CtCDPI_openers);
     1079        u16lo.bit_6 = simd_andc(u16lo.bit_6, simd_xor(simd_xor(zeromask, callouts.EndTag_marks), callouts.CtCD_openers));
     1080        u16lo.bit_7 = simd_andc(u16lo.bit_7, simd_xor(simd_xor(zeromask, callouts.CtCD_openers), callouts.AttEq_marks));
    10841081  }
    10851082  void do_segment(U16hi u16hi[], U16lo u16lo[], Lex lex[], Callouts callouts[], Marker marker[], int segment_blocks) {
  • icXML/icXML-devel/src/xercesc/dom/impl/DOMXPathExpressionImpl.cpp

    r2722 r2774  
    1 /*
    2  * Licensed to the Apache Software Foundation (ASF) under one or more
    3  * contributor license agreements.  See the NOTICE file distributed with
    4  * this work for additional information regarding copyright ownership.
    5  * The ASF licenses this file to You under the Apache License, Version 2.0
    6  * (the "License"); you may not use this file except in compliance with
    7  * the License.  You may obtain a copy of the License at
    8  *
    9  *      http://www.apache.org/licenses/LICENSE-2.0
    10  *
    11  * Unless required by applicable law or agreed to in writing, software
    12  * distributed under the License is distributed on an "AS IS" BASIS,
    13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    14  * See the License for the specific language governing permissions and
    15  * limitations under the License.
    16  */
    17 
    18 #include "DOMXPathExpressionImpl.hpp"
    19 #include "DOMXPathResultImpl.hpp"
    20 #include <xercesc/validators/schema/identity/XercesXPath.hpp>
    21 #include <xercesc/validators/schema/identity/XPathMatcher.hpp>
    22 #include <xercesc/validators/schema/identity/XPathException.hpp>
    23 #include <xercesc/validators/schema/SchemaElementDecl.hpp>
    24 #include <xercesc/util/StringPool.hpp>
    25 #include <xercesc/util/OutOfMemoryException.hpp>
    26 #include <xercesc/dom/DOMXPathException.hpp>
    27 #include <xercesc/dom/DOM.hpp>
    28 
    29 XERCES_CPP_NAMESPACE_BEGIN
    30 
    31 class WrapperForXPathNSResolver : public XercesNamespaceResolver
    32 {
    33 public:
    34     WrapperForXPathNSResolver(XMLStringPool* pool, const DOMXPathNSResolver *resolver, MemoryManager* const manager) :
    35       fStringPool(pool),
    36       fResolver(resolver),
    37       fMemoryManager(manager)
    38     {
    39     }
    40 
    41     virtual unsigned int getNamespaceForPrefix(const XMLCh* const prefix) const
    42     {
    43         if(fResolver==NULL)
    44             throw DOMException(DOMException::NAMESPACE_ERR, 0, fMemoryManager);
    45         const XMLCh* nsUri=fResolver->lookupNamespaceURI(prefix);
    46         if(nsUri==NULL)
    47             throw DOMException(DOMException::NAMESPACE_ERR, 0, fMemoryManager);
    48         return fStringPool->addOrFind(nsUri);
    49     }
    50 
    51 protected:
    52     XMLStringPool*              fStringPool;
    53     const DOMXPathNSResolver *  fResolver;
    54     MemoryManager* const        fMemoryManager;
    55 };
    56 
    57 
    58 typedef JanitorMemFunCall<DOMXPathExpressionImpl>     CleanupType;
    59 
    60 DOMXPathExpressionImpl::DOMXPathExpressionImpl(const XMLCh *expression, const DOMXPathNSResolver *resolver, MemoryManager* const manager) :
    61  fStringPool(NULL),
    62  fParsedExpression(NULL),
    63  fExpression(NULL),
    64  fMoveToRoot(false),
    65  fMemoryManager(manager)
    66 {
    67     if(expression==NULL || *expression==0)
    68         throw DOMXPathException(DOMXPathException::INVALID_EXPRESSION_ERR, 0, fMemoryManager);
    69 
    70     CleanupType cleanup(this, &DOMXPathExpressionImpl::cleanUp);
    71     fStringPool = new (fMemoryManager) XMLStringPool(109, fMemoryManager);
    72     // XercesPath will complain if the expression starts with '/', add a "." in front of it and start from the document root
    73     if(*expression==chForwardSlash)
    74     {
    75         fExpression=(XMLCh*)fMemoryManager->allocate((XMLString::stringLen(expression)+2)*sizeof(XMLCh));
    76         *fExpression = chPeriod;
    77         *(fExpression+1) = chNull;
    78         XMLString::catString(fExpression, expression);
    79         fMoveToRoot=true;
    80     }
    81     else
    82         fExpression=XMLString::replicate(expression);
    83 
    84     try
    85     {
    86         WrapperForXPathNSResolver wrappedResolver(fStringPool, resolver, fMemoryManager);
    87         fParsedExpression = new (fMemoryManager) XercesXPath(fExpression, fStringPool, &wrappedResolver, 0, true, fMemoryManager);
    88     }
    89     catch(const XPathException& )
    90     {
    91         throw DOMXPathException(DOMXPathException::INVALID_EXPRESSION_ERR, 0, fMemoryManager);
    92     }
    93     catch(const OutOfMemoryException&)
    94     {
    95         cleanup.release();
    96 
    97         throw;
    98     }
    99 
    100     cleanup.release();
    101 }
    102 
    103 DOMXPathExpressionImpl::~DOMXPathExpressionImpl()
    104 {
    105     cleanUp();
    106 }
    107 
    108 void DOMXPathExpressionImpl::cleanUp()
    109 {
    110     XMLString::release(&fExpression, fMemoryManager);
    111     delete fParsedExpression;
    112     delete fStringPool;
    113 }
    114 
    115 DOMXPathResult* DOMXPathExpressionImpl::evaluate(const DOMNode *contextNode,
    116                                                  DOMXPathResult::ResultType type,
    117                                                  DOMXPathResult* result) const
    118 {
    119     if(type!=DOMXPathResult::FIRST_ORDERED_NODE_TYPE && type!=DOMXPathResult::ORDERED_NODE_SNAPSHOT_TYPE &&
    120        type!=DOMXPathResult::ANY_UNORDERED_NODE_TYPE && type!=DOMXPathResult::UNORDERED_NODE_SNAPSHOT_TYPE)
    121         throw DOMXPathException(DOMXPathException::TYPE_ERR, 0, fMemoryManager);
    122 
    123     if(contextNode==NULL || contextNode->getNodeType()!=DOMNode::ELEMENT_NODE)
    124         throw DOMException(DOMException::NOT_SUPPORTED_ERR, 0, fMemoryManager);
    125 
    126     JanitorMemFunCall<DOMXPathResultImpl> r_cleanup (
    127       0, &DOMXPathResultImpl::release);
    128     DOMXPathResultImpl* r=(DOMXPathResultImpl*)result;
    129     if(r==NULL)
    130     {
    131       r=new (fMemoryManager) DOMXPathResultImpl(type, fMemoryManager);
    132       r_cleanup.reset (r);
    133     }
    134     else
    135         r->reset(type);
    136 
    137     XPathMatcher matcher(fParsedExpression, fMemoryManager);
    138     matcher.startDocumentFragment();
    139 
    140     if(fMoveToRoot)
    141     {
    142         contextNode=contextNode->getOwnerDocument();
    143         if(contextNode==NULL)
    144             throw DOMException(DOMException::NOT_SUPPORTED_ERR, 0, fMemoryManager);
    145 
    146         QName qName(contextNode->getNodeName(), 0, fMemoryManager);
    147         SchemaElementDecl elemDecl(&qName);
    148         RefVectorOf<XMLAttr> attrList(0, true, fMemoryManager);
    149         matcher.startElement(elemDecl, 0, XMLUni::fgZeroLenString, attrList, 0);
    150         DOMNode* child=contextNode->getFirstChild();
    151         while(child)
    152         {
    153             if(child->getNodeType()==DOMNode::ELEMENT_NODE)
    154                 testNode(&matcher, r, (DOMElement*)child);
    155             child=child->getNextSibling();
    156         }
    157         matcher.endElement(elemDecl, XMLUni::fgZeroLenString);
    158     }
    159     else
    160         testNode(&matcher, r, (DOMElement*)contextNode);
    161 
    162     r_cleanup.release ();
    163     return r;
    164 }
    165 
    166 bool DOMXPathExpressionImpl::testNode(XPathMatcher* matcher, DOMXPathResultImpl* result, DOMElement *node) const
    167 {
    168     int uriId=fStringPool->addOrFind(node->getNamespaceURI());
    169     QName qName(node->getNodeName(), uriId, fMemoryManager);
    170     SchemaElementDecl elemDecl(&qName);
    171     DOMNamedNodeMap* attrMap=node->getAttributes();
    172     XMLSize_t attrCount = attrMap->getLength();
    173     RefVectorOf<XMLAttr> attrList(attrCount, true, fMemoryManager);
    174     for(XMLSize_t i=0;i<attrCount;i++)
    175     {
    176         DOMAttr* attr=(DOMAttr*)attrMap->item(i);
    177         attrList.addElement(new (fMemoryManager) XMLAttr(fStringPool->addOrFind(attr->getNamespaceURI()),
    178                                                          attr->getNodeName(),
    179                                                          attr->getNodeValue(),
    180                                                          XMLAttDef::CData,
    181                                                          attr->getSpecified(),
    182                                                          fMemoryManager,
    183                                                          NULL,
    184                                                          true));
    185     }
    186     matcher->startElement(elemDecl, uriId, node->getPrefix(), attrList, attrCount);
    187     unsigned char nMatch=matcher->isMatched();
    188     if(nMatch!=0 && nMatch!=XPathMatcher::XP_MATCHED_DP)
    189     {
    190         result->addResult(node);
    191         if(result->getResultType()==DOMXPathResult::ANY_UNORDERED_NODE_TYPE || result->getResultType()==DOMXPathResult::FIRST_ORDERED_NODE_TYPE)
    192             return true;    // abort navigation, we found one result
    193     }
    194 
    195     if(nMatch==0 || nMatch==XPathMatcher::XP_MATCHED_D || nMatch==XPathMatcher::XP_MATCHED_DP)
    196     {
    197         DOMNode* child=node->getFirstChild();
    198         while(child)
    199         {
    200             if(child->getNodeType()==DOMNode::ELEMENT_NODE)
    201                 if(testNode(matcher, result, (DOMElement*)child))
    202                     return true;
    203             child=child->getNextSibling();
    204         }
    205     }
    206     matcher->endElement(elemDecl, XMLUni::fgZeroLenString);
    207     return false;
    208 }
    209 
    210 void DOMXPathExpressionImpl::release()
    211 {
    212     DOMXPathExpressionImpl* me = this;
    213     delete me;
    214 }
    215 
    216 XERCES_CPP_NAMESPACE_END
     1#include <icxercesc/dom/impl/DOMXPathExpressionImpl.cpp>
  • icXML/icXML-devel/src/xercesc/dom/impl/DOMXPathExpressionImpl.hpp

    r2722 r2774  
    1 /*
    2  * Licensed to the Apache Software Foundation (ASF) under one or more
    3  * contributor license agreements.  See the NOTICE file distributed with
    4  * this work for additional information regarding copyright ownership.
    5  * The ASF licenses this file to You under the Apache License, Version 2.0
    6  * (the "License"); you may not use this file except in compliance with
    7  * the License.  You may obtain a copy of the License at
    8  *
    9  *      http://www.apache.org/licenses/LICENSE-2.0
    10  *
    11  * Unless required by applicable law or agreed to in writing, software
    12  * distributed under the License is distributed on an "AS IS" BASIS,
    13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    14  * See the License for the specific language governing permissions and
    15  * limitations under the License.
    16  */
    17 
    18 /*
    19  * $Id: DOMXPathExpressionImpl.hpp 671894 2008-06-26 13:29:21Z borisk $
    20  */
    21 
    22 #if !defined(XERCESC_INCLUDE_GUARD_DOMXPATHEXPRESSIONIMPL_HPP)
    23 #define XERCESC_INCLUDE_GUARD_DOMXPATHEXPRESSIONIMPL_HPP
    24 
    25 #include <xercesc/util/XMemory.hpp>
    26 #include <icxercesc/util/PlatformUtils.hpp>
    27 #include <xercesc/dom/DOMXPathExpression.hpp>
    28 
    29 XERCES_CPP_NAMESPACE_BEGIN
    30 
    31 class DOMElement;
    32 class XercesXPath;
    33 class XPathMatcher;
    34 class DOMXPathResultImpl;
    35 class DOMXPathNSResolver;
    36 class XMLStringPool;
    37 
    38 class CDOM_EXPORT DOMXPathExpressionImpl :  public XMemory,
    39                                             public DOMXPathExpression
    40 {
    41 public:
    42     DOMXPathExpressionImpl(const XMLCh *expression,
    43                            const DOMXPathNSResolver *resolver,
    44                            MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager);
    45     virtual ~DOMXPathExpressionImpl();
    46 
    47     virtual DOMXPathResult* evaluate(const DOMNode *contextNode,
    48                                      DOMXPathResult::ResultType type,
    49                                      DOMXPathResult* result) const;
    50 
    51     virtual void release();
    52 
    53 protected:
    54     bool testNode(XPathMatcher* matcher,
    55                   DOMXPathResultImpl* result,
    56                   DOMElement *node) const;
    57     void cleanUp();
    58 
    59     XMLStringPool*              fStringPool;
    60     XercesXPath*                fParsedExpression;
    61     XMLCh*                      fExpression;
    62     bool                        fMoveToRoot;
    63 
    64     MemoryManager* const        fMemoryManager;
    65 };
    66 
    67 XERCES_CPP_NAMESPACE_END
    68 
    69 #endif
     1#include <icxercesc/dom/impl/DOMXPathExpressionImpl.hpp>
  • icXML/icXML-devel/src/xercesc/dom/impl/DOMXPathResultImpl.hpp

    r2722 r2774  
    1 /*
    2  * Licensed to the Apache Software Foundation (ASF) under one or more
    3  * contributor license agreements.  See the NOTICE file distributed with
    4  * this work for additional information regarding copyright ownership.
    5  * The ASF licenses this file to You under the Apache License, Version 2.0
    6  * (the "License"); you may not use this file except in compliance with
    7  * the License.  You may obtain a copy of the License at
    8  *
    9  *      http://www.apache.org/licenses/LICENSE-2.0
    10  *
    11  * Unless required by applicable law or agreed to in writing, software
    12  * distributed under the License is distributed on an "AS IS" BASIS,
    13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    14  * See the License for the specific language governing permissions and
    15  * limitations under the License.
    16  */
    17 
    18 /*
    19  * $Id: DOMXPathResultImpl.hpp 671894 2008-06-26 13:29:21Z borisk $
    20  */
    21 
    22 #if !defined(XERCESC_INCLUDE_GUARD_DOMXPATHRESULTIMPL_HPP)
    23 #define XERCESC_INCLUDE_GUARD_DOMXPATHRESULTIMPL_HPP
    24 
    25 #include <xercesc/util/XMemory.hpp>
    26 #include <xercesc/dom/DOMXPathResult.hpp>
    27 #include <xercesc/util/RefVectorOf.hpp>
    28 
    29 XERCES_CPP_NAMESPACE_BEGIN
    30 
    31 class CDOM_EXPORT DOMXPathResultImpl :  public XMemory,
    32                                         public DOMXPathResult
    33 {
    34 public:
    35     DOMXPathResultImpl(ResultType type, MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager);
    36     ~DOMXPathResultImpl();
    37 
    38     virtual ResultType getResultType() const;
    39     virtual const DOMTypeInfo *getTypeInfo() const;
    40     virtual bool isNode() const;
    41     virtual bool getBooleanValue() const;
    42     virtual int getIntegerValue() const;
    43     virtual double getNumberValue() const;
    44     virtual const XMLCh* getStringValue() const;
    45     virtual DOMNode* getNodeValue() const;
    46     virtual bool iterateNext();
    47     virtual bool getInvalidIteratorState() const;
    48     virtual bool snapshotItem(XMLSize_t);
    49     virtual XMLSize_t getSnapshotLength() const;
    50 
    51     virtual void release();
    52 
    53 public:
    54     void reset(ResultType type);
    55     void addResult(DOMNode* node);
    56 
    57 protected:
    58     ResultType              fType;
    59     MemoryManager* const    fMemoryManager;
    60     RefVectorOf<DOMNode>*   fSnapshot;
    61     XMLSize_t               fIndex;
    62 };
    63 
    64 XERCES_CPP_NAMESPACE_END
    65 
    66 #endif
     1#include <icxercesc/dom/impl/DOMXPathResultImpl.hpp>
  • icXML/icXML-devel/src/xercesc/validators/schema/ComplexTypeInfo.cpp

    r2736 r2774  
    1 /*
    2  * Licensed to the Apache Software Foundation (ASF) under one or more
    3  * contributor license agreements.  See the NOTICE file distributed with
    4  * this work for additional information regarding copyright ownership.
    5  * The ASF licenses this file to You under the Apache License, Version 2.0
    6  * (the "License"); you may not use this file except in compliance with
    7  * the License.  You may obtain a copy of the License at
    8  *
    9  *      http://www.apache.org/licenses/LICENSE-2.0
    10  *
    11  * Unless required by applicable law or agreed to in writing, software
    12  * distributed under the License is distributed on an "AS IS" BASIS,
    13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    14  * See the License for the specific language governing permissions and
    15  * limitations under the License.
    16  */
    17 
    18 /*
    19  * $Id: ComplexTypeInfo.cpp 901107 2010-01-20 08:45:02Z borisk $
    20  */
    21 
    22 // ---------------------------------------------------------------------------
    23 //  Includes
    24 // ---------------------------------------------------------------------------
    25 #include <icxercesc/framework/XMLBuffer.hpp>
    26 #include <icxercesc/validators/schema/ComplexTypeInfo.hpp>
    27 #include <xercesc/validators/schema/SchemaAttDefList.hpp>
    28 #include <icxercesc/validators/common/AllContentModel.hpp>
    29 #include <xercesc/validators/common/ContentSpecNode.hpp>
    30 #include <icxercesc/validators/common/DFAContentModel.hpp>
    31 #include <icxercesc/validators/common/MixedContentModel.hpp>
    32 #include <icxercesc/validators/common/SimpleContentModel.hpp>
    33 #include <xercesc/validators/schema/XSDLocator.hpp>
    34 #include <xercesc/internal/XTemplateSerializer.hpp>
    35 #include <xercesc/util/XMLInitializer.hpp>
    36 
    37 XERCES_CPP_NAMESPACE_BEGIN
    38 
    39 // ---------------------------------------------------------------------------
    40 //  ComplexTypeInfo: Static member data
    41 // ---------------------------------------------------------------------------
    42 ComplexTypeInfo* ComplexTypeInfo::fAnyType = 0;
    43 
    44 void XMLInitializer::initializeComplexTypeInfo()
    45 {
    46   // create type name
    47   XMLCh typeName[128];
    48   XMLSize_t nsLen = XMLString::stringLen(SchemaSymbols::fgURI_SCHEMAFORSCHEMA);
    49 
    50   XMLString::copyString(typeName, SchemaSymbols::fgURI_SCHEMAFORSCHEMA);
    51   typeName[nsLen] = chComma;
    52   XMLString::copyString(typeName + nsLen + 1, SchemaSymbols::fgATTVAL_ANYTYPE);
    53 
    54   // Create and initialize 'anyType'
    55   ComplexTypeInfo::fAnyType = new ComplexTypeInfo();
    56 
    57   ContentSpecNode* term = new ContentSpecNode
    58     (
    59       new QName
    60       (
    61         XMLUni::fgZeroLenString
    62         , XMLUni::fgZeroLenString
    63         , 1
    64       )
    65       , false
    66     );
    67   term->setType(ContentSpecNode::Any_Lax);
    68   term->setMinOccurs(0);
    69   term->setMaxOccurs(SchemaSymbols::XSD_UNBOUNDED);
    70 
    71   ContentSpecNode* particle = new ContentSpecNode
    72     (
    73       ContentSpecNode::ModelGroupSequence
    74       , term
    75       , 0
    76     );
    77 
    78   SchemaAttDef* attWildCard = new SchemaAttDef
    79     (
    80       XMLUni::fgZeroLenString
    81       , XMLUni::fgZeroLenString
    82       , 1
    83       , XMLAttDef::Any_Any
    84       , XMLAttDef::ProcessContents_Lax
    85     );
    86 
    87   ComplexTypeInfo::fAnyType->setTypeName(typeName);
    88   ComplexTypeInfo::fAnyType->setBaseComplexTypeInfo(ComplexTypeInfo::fAnyType);
    89   ComplexTypeInfo::fAnyType->setDerivedBy(SchemaSymbols::XSD_RESTRICTION);
    90   ComplexTypeInfo::fAnyType->setContentType(SchemaElementDecl::Mixed_Complex);
    91   ComplexTypeInfo::fAnyType->setContentSpec(particle);
    92   ComplexTypeInfo::fAnyType->setAttWildCard(attWildCard);
    93 }
    94 
    95 void XMLInitializer::terminateComplexTypeInfo()
    96 {
    97   delete ComplexTypeInfo::fAnyType;
    98   ComplexTypeInfo::fAnyType = 0;
    99 }
    100 
    101 ComplexTypeInfo* ComplexTypeInfo::getAnyType(unsigned int /*emptyNSId*/)
    102 {
    103     return fAnyType;
    104 }
    105 
    106 
    107 // ---------------------------------------------------------------------------
    108 //  ComplexTypeInfo: Constructors and Destructor
    109 // ---------------------------------------------------------------------------
    110 ComplexTypeInfo::ComplexTypeInfo(MemoryManager* const manager)
    111     : fAnonymous(false)
    112     , fAbstract(false)
    113     , fAdoptContentSpec(true)
    114     , fAttWithTypeId(false)
    115     , fPreprocessed(false)
    116     , fDerivedBy(0)
    117     , fBlockSet(0)
    118     , fFinalSet(0)
    119     , fScopeDefined(Grammar::TOP_LEVEL_SCOPE)
    120     , fContentType(SchemaElementDecl::Empty)
    121     , fElementId(XMLElementDecl::fgInvalidElemId)
    122     , fUniqueURI(0)
    123     , fContentSpecOrgURISize(16)
    124     , fTypeName(0)
    125     , fTypeLocalName(0)
    126     , fTypeUri(0)
    127     , fBaseDatatypeValidator(0)
    128     , fDatatypeValidator(0)
    129     , fBaseComplexTypeInfo(0)
    130     , fContentSpec(0)
    131     , fAttWildCard(0)
    132     , fAttList(0)
    133     , fElements(0)
    134     , fAttDefs(0)
    135     , fContentModel(0)
    136     , fFormattedModel(0)
    137     , fContentSpecOrgURI(0)
    138     , fLocator(0)
    139     , fMemoryManager(manager)
    140 {
    141     fAttDefs = new (fMemoryManager) RefHash2KeysTableOf<SchemaAttDef>(29, true, fMemoryManager);
    142     fAttList = new (fMemoryManager) SchemaAttDefList(fAttDefs,fMemoryManager);
    143 }
    144 
    145 
    146 ComplexTypeInfo::~ComplexTypeInfo()
    147 {
    148     fMemoryManager->deallocate(fTypeName); //delete [] fTypeName;
    149     fMemoryManager->deallocate(fTypeLocalName); //delete [] fTypeLocalName;
    150     fMemoryManager->deallocate(fTypeUri); //delete [] fTypeUri;
    151 
    152     if (fAdoptContentSpec) {
    153         delete fContentSpec;
    154     }
    155 
    156     delete fAttWildCard;
    157     delete fAttDefs;
    158     delete fAttList;
    159     delete fElements;
    160     delete fLocator;
    161 
    162     delete fContentModel;
    163     fMemoryManager->deallocate(fFormattedModel); //delete [] fFormattedModel;
    164     fMemoryManager->deallocate(fContentSpecOrgURI); //delete [] fContentSpecOrgURI;
    165 
    166 }
    167 
    168 // ---------------------------------------------------------------------------
    169 //  ComplexTypeInfo: Setter methods
    170 // ---------------------------------------------------------------------------
    171 void ComplexTypeInfo::addAttDef(SchemaAttDef* const toAdd) {
    172 
    173     // Tell this guy the element id of its parent (us)
    174     toAdd->setElemId(getElementId());
    175 
    176     fAttDefs->put((void*)(toAdd->getAttName()->getLocalPart()),
    177                           toAdd->getAttName()->getURI(), toAdd);
    178     // update and/or create fAttList
    179     fAttList->addAttDef(toAdd);
    180 }
    181 
    182 void ComplexTypeInfo::setContentSpec(ContentSpecNode* const toAdopt) {
    183 
    184     if (fContentSpec && fAdoptContentSpec) {
    185         delete fContentSpec;
    186     }
    187 
    188     fContentSpec = toAdopt;
    189 }
    190 
    191 void ComplexTypeInfo::setLocator(XSDLocator* const aLocator) {
    192 
    193     if (fLocator)
    194         delete fLocator;
    195 
    196     fLocator = aLocator;
    197 }
    198 
    199 // ---------------------------------------------------------------------------
    200 //  ComplexTypeInfo: Getter methods
    201 // ---------------------------------------------------------------------------
    202 XMLAttDefList& ComplexTypeInfo::getAttDefList() const
    203 {
    204     // NOTE: if users plan on using nextElement() to access attributes
    205     //       they need to call Reset() explicitly (i.e attList.Reset()).
    206     //       It's better to get the attribute count and use an index to
    207     //       access attributes (especially if same grammar is used in
    208     //       multiple threads).
    209     return *fAttList;
    210 }
    211 
    212 const XMLCh*
    213 ComplexTypeInfo::getFormattedContentModel() const
    214 {
    215     //
    216     //  If its not already built, then call the protected virtual method
    217     //  to allow the derived class to build it (since only it knows.)
    218     //  Otherwise, just return the previously formatted methods.
    219     //
    220     //  Since we are faulting this in, within a const getter, we have to
    221     //  cast off the const-ness.
    222     //
    223     if (!fFormattedModel)
    224         ((ComplexTypeInfo*)this)->fFormattedModel = formatContentModel();
    225 
    226     return fFormattedModel;
    227 }
    228 
    229 // ---------------------------------------------------------------------------
    230 //  ComplexTypeInfo: Helper methods
    231 // ---------------------------------------------------------------------------
    232 void ComplexTypeInfo::checkUniqueParticleAttribution (SchemaGrammar*    const pGrammar,
    233                                                       GrammarResolver*  const pGrammarResolver,
    234                                                       XMLStringPool*    const pStringPool,
    235                                                       XMLValidator*     const pValidator)
    236 {
    237     if (fContentSpec && !fContentModel)
    238     {
    239         fContentModel = makeContentModel(true);
    240         if (fContentModel) {
    241             fContentModel->checkUniqueParticleAttribution(pGrammar, pGrammarResolver, pStringPool, pValidator, fContentSpecOrgURI, fTypeLocalName);
    242         }
    243     }
    244 }
    245 
    246 // ---------------------------------------------------------------------------
    247 //  ComplexTypeInfo: Private Helper methods
    248 // ---------------------------------------------------------------------------
    249 void ComplexTypeInfo::faultInAttDefList() const
    250 {
    251     // Use a hash modulus of 29 and tell it owns its elements
    252     ((ComplexTypeInfo*)this)->fAttDefs =
    253         new (fMemoryManager) RefHash2KeysTableOf<SchemaAttDef>(29, true, fMemoryManager);
    254 }
    255 
    256 XMLCh* ComplexTypeInfo::formatContentModel() const
    257 {
    258     XMLCh* newValue = 0;
    259     if (fContentType == SchemaElementDecl::Any)
    260     {
    261         newValue = XMLString::replicate(XMLUni::fgAnyString, fMemoryManager);
    262     }
    263     else if (fContentType == SchemaElementDecl::Empty ||
    264              fContentType == SchemaElementDecl::ElementOnlyEmpty)
    265     {
    266         newValue = XMLString::replicate(XMLUni::fgEmptyString, fMemoryManager);
    267     }
    268     else
    269     {
    270         //
    271         //  Use a temp XML buffer to format into. Content models could be
    272         //  pretty long, but very few will be longer than one K. The buffer
    273         //  will expand to handle the more pathological ones.
    274         //
    275         const ContentSpecNode* specNode = fContentSpec;
    276 
    277         if (specNode) {
    278             XMLBuffer bufFmt(1023, fMemoryManager);
    279 
    280             specNode->formatSpec(bufFmt);
    281             newValue = XMLString::replicate
    282             (
    283                 bufFmt.getRawBuffer()
    284                 , fMemoryManager
    285             );
    286         }
    287     }
    288     return newValue;
    289 }
    290 
    291 bool ComplexTypeInfo::useRepeatingLeafNodes(ContentSpecNode* particle)
    292 {
    293     int maxOccurs = particle->getMaxOccurs();
    294     int minOccurs = particle->getMinOccurs();
    295     ContentSpecNode::NodeTypes type = particle->getType();
    296 
    297     if (((type & 0x0f) == ContentSpecNode::Choice) ||  ((type & 0x0f) == ContentSpecNode::Sequence))
    298     {
    299         if (minOccurs != 1 || maxOccurs != 1) {
    300             if(particle->getFirst()!=0 && particle->getSecond()==0)
    301             {
    302                 ContentSpecNode* particle2 = particle->getFirst();
    303                 ContentSpecNode::NodeTypes type2 = particle2->getType();
    304                 return (((type2 == ContentSpecNode::Leaf) ||
    305                         ((type2 & 0x0f) == ContentSpecNode::Any) ||
    306                         ((type2 & 0x0f) == ContentSpecNode::Any_Other) ||
    307                         ((type2 & 0x0f) == ContentSpecNode::Any_NS)) &&
    308                         particle2->getMinOccurs() == 1 &&
    309                         particle2->getMaxOccurs() == 1);
    310             }
    311             return (particle->getFirst()==0 && particle->getSecond()==0);
    312         }
    313         if(particle->getFirst()!=0 && !useRepeatingLeafNodes(particle->getFirst()))
    314             return false;
    315         if(particle->getSecond()!=0 && !useRepeatingLeafNodes(particle->getSecond()))
    316             return false;
    317     }
    318     return true;
    319 }
    320 
    321 XMLContentModel* ComplexTypeInfo::makeContentModel(bool checkUPA)
    322 {
    323     ContentSpecNode* aSpecNode = new (fMemoryManager) ContentSpecNode(*fContentSpec);
    324 
    325     if (checkUPA) {
    326         fContentSpecOrgURI = (unsigned int*) fMemoryManager->allocate
    327         (
    328             fContentSpecOrgURISize * sizeof(unsigned int)
    329         ); //new unsigned int[fContentSpecOrgURISize];
    330     }
    331 
    332     aSpecNode = convertContentSpecTree(aSpecNode, checkUPA, useRepeatingLeafNodes(aSpecNode));
    333 
    334     Janitor<ContentSpecNode> janSpecNode(aSpecNode);
    335 
    336     XMLContentModel* cmRet = 0;
    337     if (fContentType == SchemaElementDecl::Simple ||
    338         fContentType == SchemaElementDecl::ElementOnlyEmpty) {
    339        // just return nothing
    340     }
    341     else if (fContentType == SchemaElementDecl::Mixed_Simple)
    342     {
    343         //
    344         //  Just create a mixel content model object. This type of
    345         //  content model is optimized for mixed content validation.
    346         //
    347         cmRet = new (fMemoryManager) MixedContentModel(false, aSpecNode, false, fMemoryManager);
    348     }
    349     else if (fContentType == SchemaElementDecl::Mixed_Complex ||
    350              fContentType == SchemaElementDecl::Children)
    351     {
    352         bool isMixed = (fContentType == SchemaElementDecl::Mixed_Complex);
    353 
    354         //
    355         //  This method will create an optimal model for the complexity
    356         //  of the element's defined model. If its simple, it will create
    357         //  a SimpleContentModel object. If its a simple list, it will
    358         //  create a SimpleListContentModel object. If its complex, it
    359         //  will create a DFAContentModel object.
    360         //
    361         if(!aSpecNode)
    362             ThrowXMLwithMemMgr(RuntimeException, XMLExcepts::CM_UnknownCMSpecType, fMemoryManager);
    363 
    364         ContentSpecNode::NodeTypes specType = aSpecNode->getType();
    365         //
    366         //  Do a sanity check that the node is does not have a PCDATA id. Since,
    367         //  if it was, it should have already gotten taken by the Mixed model.
    368         //
    369         if (aSpecNode->getElement() && aSpecNode->getElement()->getURI() == XMLElementDecl::fgPCDataElemId)
    370             ThrowXMLwithMemMgr(RuntimeException, XMLExcepts::CM_NoPCDATAHere, fMemoryManager);
    371 
    372         //
    373         //  According to the type of node, we will create the correct type of
    374         //  content model.
    375         //
    376         if (((specType & 0x0f) == ContentSpecNode::Any) ||
    377            ((specType & 0x0f) == ContentSpecNode::Any_Other) ||
    378            ((specType & 0x0f) == ContentSpecNode::Any_NS) ||
    379            specType == ContentSpecNode::Loop) {
    380            // let fall through to build a DFAContentModel
    381         }
    382         else if (isMixed)
    383         {
    384             if (specType == ContentSpecNode::All) {
    385                 // All the nodes under an ALL must be additional ALL nodes and
    386                 // ELEMENTs (or ELEMENTs under ZERO_OR_ONE nodes.)
    387                 // We collapse the ELEMENTs into a single vector.
    388                 cmRet = new (fMemoryManager) AllContentModel(aSpecNode, true, fMemoryManager);
    389             }
    390             else if (specType == ContentSpecNode::ZeroOrOne) {
    391                 // An ALL node can appear under a ZERO_OR_ONE node.
    392                 if (aSpecNode->getFirst()->getType() == ContentSpecNode::All) {
    393                     cmRet = new (fMemoryManager) AllContentModel(aSpecNode->getFirst(), true, fMemoryManager);
    394                 }
    395             }
    396 
    397             // otherwise, let fall through to build a DFAContentModel
    398         }
    399          else if (specType == ContentSpecNode::Leaf)
    400         {
    401             // Create a simple content model
    402             cmRet = new (fMemoryManager) SimpleContentModel
    403             (
    404                 false
    405                 , aSpecNode->getElement()
    406                 , 0
    407                 , ContentSpecNode::Leaf
    408                 , fMemoryManager
    409             );
    410         }
    411          else if (((specType & 0x0f) == ContentSpecNode::Choice)
    412               ||  ((specType & 0x0f) == ContentSpecNode::Sequence))
    413         {
    414             //
    415             //  Lets see if both of the children are leafs. If so, then it has to
    416             //  be a simple content model
    417             //
    418             if ((aSpecNode->getFirst()->getType() == ContentSpecNode::Leaf)
    419             &&  (aSpecNode->getSecond())
    420             &&  (aSpecNode->getSecond()->getType() == ContentSpecNode::Leaf))
    421             {
    422                 cmRet = new (fMemoryManager) SimpleContentModel
    423                 (
    424                     false
    425                     , aSpecNode->getFirst()->getElement()
    426                     , aSpecNode->getSecond()->getElement()
    427                     , specType
    428                     , fMemoryManager
    429                 );
    430             }
    431         }
    432          else if ((specType == ContentSpecNode::OneOrMore)
    433               ||  (specType == ContentSpecNode::ZeroOrMore)
    434               ||  (specType == ContentSpecNode::ZeroOrOne))
    435         {
    436             //
    437             //  Its a repetition, so see if its one child is a leaf. If so its a
    438             //  repetition of a single element, so we can do a simple content
    439             //  model for that.
    440             //
    441             if (aSpecNode->getFirst()->getType() == ContentSpecNode::Leaf)
    442             {
    443                 cmRet = new (fMemoryManager) SimpleContentModel
    444                 (
    445                     false
    446                     , aSpecNode->getFirst()->getElement()
    447                     , 0
    448                     , specType
    449                     , fMemoryManager
    450                 );
    451             }
    452             else if (aSpecNode->getFirst()->getType() == ContentSpecNode::All)
    453                 cmRet = new (fMemoryManager) AllContentModel(aSpecNode->getFirst(), false, fMemoryManager);
    454 
    455         }
    456         else if (specType == ContentSpecNode::All)
    457             cmRet = new (fMemoryManager) AllContentModel(aSpecNode, false, fMemoryManager);
    458         else
    459         {
    460             ThrowXMLwithMemMgr(RuntimeException, XMLExcepts::CM_UnknownCMSpecType, fMemoryManager);
    461         }
    462 
    463         // Its not any simple type of content, so create a DFA based content model
    464         if(cmRet==0)
    465             cmRet = new (fMemoryManager) DFAContentModel(false, aSpecNode, isMixed, fMemoryManager);
    466     }
    467      else
    468     {
    469         ThrowXMLwithMemMgr(RuntimeException, XMLExcepts::CM_MustBeMixedOrChildren, fMemoryManager);
    470     }
    471 
    472     return cmRet;
    473 }
    474 
    475 // ---------------------------------------------------------------------------
    476 //  SchemaElementDecl: Private helper methods
    477 // ---------------------------------------------------------------------------
    478 
    479 ContentSpecNode*
    480 ComplexTypeInfo::convertContentSpecTree(ContentSpecNode* const curNode,
    481                                         bool checkUPA,
    482                                         bool bAllowCompactSyntax) {
    483 
    484     if (!curNode)
    485         return 0;
    486 
    487     const ContentSpecNode::NodeTypes curType = curNode->getType();
    488 
    489     // When checking Unique Particle Attribution, rename leaf elements
    490     if (checkUPA) {
    491         if (curNode->getElement()) {
    492             if (fUniqueURI == fContentSpecOrgURISize) {
    493                 resizeContentSpecOrgURI();
    494             }
    495 
    496             fContentSpecOrgURI[fUniqueURI] = curNode->getElement()->getURI();
    497             curNode->getElement()->setURI(fUniqueURI);
    498             fUniqueURI++;
    499         }
    500     }
    501 
    502     // Get the spec type of the passed node
    503     int minOccurs = curNode->getMinOccurs();
    504     int maxOccurs = curNode->getMaxOccurs();
    505     ContentSpecNode* retNode = curNode;
    506 
    507     if ((curType & 0x0f) == ContentSpecNode::Any
    508         || (curType & 0x0f) == ContentSpecNode::Any_Other
    509         || (curType & 0x0f) == ContentSpecNode::Any_NS
    510         || curType == ContentSpecNode::Leaf)
    511     {
    512         retNode =  expandContentModel(curNode, minOccurs, maxOccurs, bAllowCompactSyntax);
    513     }
    514     else if (((curType & 0x0f) == ContentSpecNode::Choice)
    515         ||   (curType == ContentSpecNode::All)
    516         ||   ((curType & 0x0f) == ContentSpecNode::Sequence))
    517     {
    518         ContentSpecNode* childNode = curNode->getFirst();
    519         ContentSpecNode* leftNode = convertContentSpecTree(childNode, checkUPA, bAllowCompactSyntax);
    520         ContentSpecNode* rightNode = curNode->getSecond();
    521 
    522         if (!rightNode) {
    523 
    524             retNode = expandContentModel(leftNode, minOccurs, maxOccurs, bAllowCompactSyntax);
    525             curNode->setAdoptFirst(false);
    526             delete curNode;
    527             return retNode;
    528         }
    529 
    530         if (leftNode != childNode) {
    531 
    532             curNode->setAdoptFirst(false);
    533             curNode->setFirst(leftNode);
    534             curNode->setAdoptFirst(true);
    535         }
    536 
    537         childNode = rightNode;
    538         rightNode =  convertContentSpecTree(childNode, checkUPA, bAllowCompactSyntax);
    539 
    540         if (rightNode != childNode) {
    541 
    542             curNode->setAdoptSecond(false);
    543             curNode->setSecond(rightNode);
    544             curNode->setAdoptSecond(true);
    545         }
    546 
    547         retNode =  expandContentModel(curNode, minOccurs, maxOccurs, bAllowCompactSyntax);
    548     }
    549 
    550     return retNode;
    551 }
    552 
    553 ContentSpecNode* ComplexTypeInfo::expandContentModel(ContentSpecNode* const specNode,
    554                                                      int minOccurs,
    555                                                      int maxOccurs,
    556                                                      bool bAllowCompactSyntax)
    557 {
    558     if (!specNode) {
    559         return 0;
    560     }
    561 
    562     ContentSpecNode* saveNode = specNode;
    563     ContentSpecNode* retNode = specNode;
    564 
    565     if (minOccurs == 1 && maxOccurs == 1) {
    566     }
    567     else if (minOccurs == 0 && maxOccurs == 1) {
    568 
    569         retNode = new (fMemoryManager) ContentSpecNode
    570         (
    571             ContentSpecNode::ZeroOrOne
    572             , retNode
    573             , 0
    574             , true
    575             , true
    576             , fMemoryManager
    577         );
    578     }
    579     else if (minOccurs == 0 && maxOccurs == -1) {
    580         retNode = new (fMemoryManager) ContentSpecNode
    581         (
    582             ContentSpecNode::ZeroOrMore
    583             , retNode
    584             , 0
    585             , true
    586             , true
    587             , fMemoryManager
    588         );
    589     }
    590     else if (minOccurs == 1 && maxOccurs == -1) {
    591         retNode = new (fMemoryManager) ContentSpecNode
    592         (
    593             ContentSpecNode::OneOrMore
    594             , retNode
    595             , 0
    596             , true
    597             , true
    598             , fMemoryManager
    599         );
    600     }
    601     // if what is being repeated is a leaf avoid expanding the tree
    602     else if(bAllowCompactSyntax &&
    603         (saveNode->getType()==ContentSpecNode::Leaf ||
    604         (saveNode->getType() & 0x0f)==ContentSpecNode::Any ||
    605         (saveNode->getType() & 0x0f)==ContentSpecNode::Any_Other ||
    606         (saveNode->getType() & 0x0f)==ContentSpecNode::Any_NS))
    607     {
    608         retNode = new (fMemoryManager) ContentSpecNode
    609         (
    610             ContentSpecNode::Loop
    611             , retNode
    612             , 0
    613             , true
    614             , true
    615             , fMemoryManager
    616         );
    617         retNode->setMinOccurs(minOccurs);
    618         retNode->setMaxOccurs(maxOccurs);
    619 
    620         if(minOccurs==0)
    621             retNode = new (fMemoryManager) ContentSpecNode
    622             (
    623                 ContentSpecNode::ZeroOrMore
    624                 , retNode
    625                 , 0
    626                 , true
    627                 , true
    628                 , fMemoryManager
    629             );
    630         else
    631             retNode = new (fMemoryManager) ContentSpecNode
    632             (
    633                 ContentSpecNode::OneOrMore
    634                 , retNode
    635                 , 0
    636                 , true
    637                 , true
    638                 , fMemoryManager
    639             );
    640 
    641     }
    642     else if (maxOccurs == -1) {
    643 
    644         retNode = new (fMemoryManager) ContentSpecNode
    645         (
    646             ContentSpecNode::OneOrMore
    647             , retNode
    648             , 0
    649             , true
    650             , true
    651             , fMemoryManager
    652         );
    653 
    654         for (int i=0; i < (minOccurs-1); i++) {
    655             retNode = new (fMemoryManager) ContentSpecNode
    656             (
    657                 ContentSpecNode::Sequence
    658                 , saveNode
    659                 , retNode
    660                 , false
    661                 , true
    662                 , fMemoryManager
    663             );
    664         }
    665     }
    666     else {
    667 
    668         if (minOccurs == 0) {
    669 
    670             ContentSpecNode* optional = new (fMemoryManager) ContentSpecNode
    671             (
    672                 ContentSpecNode::ZeroOrOne
    673                 , saveNode
    674                 , 0
    675                 , true
    676                 , true
    677                 , fMemoryManager
    678             );
    679 
    680             retNode = optional;
    681 
    682             for (int i=0; i < (maxOccurs-1); i++) {
    683                 retNode = new (fMemoryManager) ContentSpecNode
    684                 (
    685                     ContentSpecNode::Sequence
    686                     , retNode
    687                     , optional
    688                     , true
    689                     , false
    690                     , fMemoryManager
    691                 );
    692             }
    693         }
    694         else {
    695 
    696             if (minOccurs > 1) {
    697 
    698                 retNode = new (fMemoryManager) ContentSpecNode
    699                 (
    700                     ContentSpecNode::Sequence
    701                     , retNode
    702                     , saveNode
    703                     , true
    704                     , false
    705                     , fMemoryManager
    706                 );
    707 
    708                 for (int i=1; i < (minOccurs-1); i++) {
    709                     retNode = new (fMemoryManager) ContentSpecNode
    710                     (
    711                         ContentSpecNode::Sequence
    712                         , retNode
    713                         , saveNode
    714                         , true
    715                         , false
    716                         , fMemoryManager
    717                     );
    718                 }
    719             }
    720 
    721             int counter = maxOccurs-minOccurs;
    722 
    723             if (counter > 0) {
    724 
    725                 ContentSpecNode* optional = new (fMemoryManager) ContentSpecNode
    726                 (
    727                     ContentSpecNode::ZeroOrOne
    728                     , saveNode
    729                     , 0
    730                     , false
    731                     , true
    732                     , fMemoryManager
    733                 );
    734 
    735                 retNode = new (fMemoryManager) ContentSpecNode
    736                 (
    737                     ContentSpecNode::Sequence
    738                     , retNode
    739                     , optional
    740                     , true
    741                     , true
    742                     , fMemoryManager
    743                 );
    744 
    745                 for (int j=1; j < counter; j++) {
    746 
    747                     retNode = new (fMemoryManager) ContentSpecNode
    748                     (
    749                         ContentSpecNode::Sequence
    750                         , retNode
    751                         , optional
    752                         , true
    753                         , false
    754                         , fMemoryManager
    755                     );
    756                 }
    757             }
    758         }
    759     }
    760 
    761     return retNode;
    762 }
    763 
    764 void ComplexTypeInfo::resizeContentSpecOrgURI() {
    765 
    766     unsigned int newSize = fContentSpecOrgURISize * 2;
    767     unsigned int* newContentSpecOrgURI = (unsigned int*) fMemoryManager->allocate
    768     (
    769         newSize * sizeof(unsigned int)
    770     ); //new unsigned int[newSize];
    771 
    772     // Copy the existing values
    773     unsigned int index = 0;
    774     for (; index < fContentSpecOrgURISize; index++)
    775         newContentSpecOrgURI[index] = fContentSpecOrgURI[index];
    776 
    777     for (; index < newSize; index++)
    778         newContentSpecOrgURI[index] = 0;
    779 
    780     // Delete the old array and udpate our members
    781     fMemoryManager->deallocate(fContentSpecOrgURI); //delete [] fContentSpecOrgURI;
    782     fContentSpecOrgURI = newContentSpecOrgURI;
    783     fContentSpecOrgURISize = newSize;
    784 }
    785 
    786 /***
    787  * Support for Serialization/De-serialization
    788  ***/
    789 
    790 IMPL_XSERIALIZABLE_TOCREATE(ComplexTypeInfo)
    791 
    792 void ComplexTypeInfo::serialize(XSerializeEngine& serEng)
    793 {
    794 
    795     if (serEng.isStoring())
    796     {
    797         serEng<<fAnonymous;
    798         serEng<<fAbstract;
    799         serEng<<fAdoptContentSpec;
    800         serEng<<fAttWithTypeId;
    801         serEng<<fPreprocessed;
    802         serEng<<fDerivedBy;
    803         serEng<<fBlockSet;
    804         serEng<<fFinalSet;
    805         serEng<<fScopeDefined;
    806         serEng<<fContentType;
    807 
    808         serEng<<fElementId;
    809 
    810         serEng.writeString(fTypeName);
    811         serEng.writeString(fTypeLocalName);
    812         serEng.writeString(fTypeUri);
    813 
    814         DatatypeValidator::storeDV(serEng, fBaseDatatypeValidator);
    815         DatatypeValidator::storeDV(serEng, fDatatypeValidator);
    816 
    817         serEng<<fBaseComplexTypeInfo;
    818         serEng<<fContentSpec;
    819         serEng<<fAttWildCard;
    820         serEng<<fAttList;
    821 
    822         /***
    823          *
    824          * Serialize RefVectorOf<SchemaElementDecl>*    fElements;
    825          * Serialize RefHash2KeysTableOf<SchemaAttDef>* fAttDefs;
    826          ***/
    827         XTemplateSerializer::storeObject(fElements, serEng);
    828         XTemplateSerializer::storeObject(fAttDefs, serEng);
    829 
    830          /***
    831           *   Don't serialize
    832           *
    833           *   fContentModel;
    834           *   fFormattedModel;
    835           *   fLocator;
    836           *
    837           *   fContentSpecOrgURI:     start of the array
    838           *   fContentSpecOrgURISize: size of the array
    839           *   fUniqueURI:             the current last element in the array
    840           ***/
    841     }
    842     else
    843     {
    844         serEng>>fAnonymous;
    845         serEng>>fAbstract;
    846         serEng>>fAdoptContentSpec;
    847         serEng>>fAttWithTypeId;
    848         serEng>>fPreprocessed;
    849         serEng>>fDerivedBy;
    850         serEng>>fBlockSet;
    851         serEng>>fFinalSet;
    852         serEng>>fScopeDefined;
    853         serEng>>fContentType;
    854 
    855         serEng>>fElementId;
    856 
    857         serEng.readString(fTypeName);
    858         serEng.readString(fTypeLocalName);
    859         serEng.readString(fTypeUri);
    860 
    861         fBaseDatatypeValidator = DatatypeValidator::loadDV(serEng);
    862         fDatatypeValidator     = DatatypeValidator::loadDV(serEng);
    863 
    864         serEng>>fBaseComplexTypeInfo;
    865         serEng>>fContentSpec;
    866         serEng>>fAttWildCard;
    867         delete fAttList; // will recreate it next...
    868         serEng>>fAttList;
    869 
    870         /***
    871          *
    872          * Deserialize RefVectorOf<SchemaElementDecl>*    fElements;
    873          * Deserialize RefHash2KeysTableOf<SchemaAttDef>* fAttDefs;
    874          ***/
    875         XTemplateSerializer::loadObject(&fElements, 8, false, serEng);
    876         delete fAttDefs; // will recreate it next...
    877         XTemplateSerializer::loadObject(&fAttDefs, 29, true, serEng);
    878 
    879          /***
    880           *   Don't deserialize
    881           *
    882           *   fFormattedModel;
    883           *   fLocator;
    884           *
    885           *   fContentSpecOrgURI:     start of the array
    886           *   fContentSpecOrgURISize: size of the array
    887           *   fUniqueURI:             the current last element in the array
    888           ***/
    889 
    890          fFormattedModel = 0;
    891          fLocator = 0;
    892          fContentSpecOrgURI = 0;
    893          fContentSpecOrgURISize = 0;
    894          fUniqueURI = 0;
    895 
    896          // Create the content model by calling getContentModel().  This
    897          // will ensure the grammar can be used concurrently by multiple
    898          // parsers.
    899          // Don't bother to do check unique particle attribution, since
    900          // this will already have been done when the grammar was first
    901          // created (if full schema checking was enabled).
    902          getContentModel(false);
    903     }
    904 }
    905 
    906 
    907 XERCES_CPP_NAMESPACE_END
    908 
    909 /**
    910   * End of file ComplexTypeInfo.cpp
    911   */
     1#include <icxercesc/validators/schema/ComplexTypeInfo.cpp>
  • icXML/icXML-devel/src/xercesc/validators/schema/TraverseSchema.cpp

    r2736 r2774  
    4949#include <xercesc/validators/schema/XercesAttGroupInfo.hpp>
    5050#include <xercesc/validators/schema/XSDLocator.hpp>
    51 #include <xercesc/validators/schema/XSDDOMParser.hpp>
     51#include <icxercesc/validators/schema/XSDDOMParser.hpp>
    5252#include <xercesc/dom/DOMNamedNodeMap.hpp>
    5353#include <xercesc/dom/DOMText.hpp>
  • icXML/icXML-devel/src/xercesc/validators/schema/XSDDOMParser.cpp

    r2732 r2774  
    1 /*
    2  * Licensed to the Apache Software Foundation (ASF) under one or more
    3  * contributor license agreements.  See the NOTICE file distributed with
    4  * this work for additional information regarding copyright ownership.
    5  * The ASF licenses this file to You under the Apache License, Version 2.0
    6  * (the "License"); you may not use this file except in compliance with
    7  * the License.  You may obtain a copy of the License at
    8  *
    9  *      http://www.apache.org/licenses/LICENSE-2.0
    10  *
    11  * Unless required by applicable law or agreed to in writing, software
    12  * distributed under the License is distributed on an "AS IS" BASIS,
    13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    14  * See the License for the specific language governing permissions and
    15  * limitations under the License.
    16  */
    17 
    18 /**
    19   * $Id: XSDDOMParser.cpp 729944 2008-12-29 17:03:32Z amassari $
    20   */
    21 
    22 
    23 
    24 // ---------------------------------------------------------------------------
    25 //  Includes
    26 // ---------------------------------------------------------------------------
    27 #include <xercesc/validators/schema/XSDDOMParser.hpp>
    28 #include <icxercesc/validators/schema/SchemaSymbols.hpp>
    29 #include <icxercesc/internal/XMLScanner.hpp>
    30 #include <icxercesc/internal/ElemStack.hpp>
    31 #include <xercesc/dom/DOMDocument.hpp>
    32 #include <xercesc/dom/impl/DOMElementImpl.hpp>
    33 #include <xercesc/dom/impl/DOMAttrImpl.hpp>
    34 #include <xercesc/dom/impl/DOMTextImpl.hpp>
    35 #include <xercesc/framework/XMLValidityCodes.hpp>
    36 
    37 XERCES_CPP_NAMESPACE_BEGIN
    38 
    39 // ---------------------------------------------------------------------------
    40 //  XSDDOMParser: Constructors and Destructor
    41 // ---------------------------------------------------------------------------
    42 XSDDOMParser::XSDDOMParser( XMLValidator* const   valToAdopt
    43                           , MemoryManager* const  manager
    44                           , XMLGrammarPool* const gramPool):
    45     XercesDOMParser(valToAdopt, manager, gramPool)
    46     , fSawFatal(false)
    47     , fAnnotationDepth(-1)
    48     , fInnerAnnotationDepth(-1)
    49     , fDepth(-1)
    50     , fUserErrorReporter(0)
    51     , fUserEntityHandler(0)
    52     , fURIs(0)
    53     , fAnnotationBuf(1023, manager)
    54 
    55 {
    56     fURIs = new (manager) ValueVectorOf<unsigned int>(16, manager);
    57     fXSDErrorReporter.setErrorReporter(this);
    58     setValidationScheme(XercesDOMParser::Val_Never);
    59     setDoNamespaces(true);
    60 }
    61 
    62 
    63 XSDDOMParser::~XSDDOMParser()
    64 {
    65     delete fURIs;
    66 }
    67 
    68 
    69 // ---------------------------------------------------------------------------
    70 //  XSDDOMParser: Helper methods
    71 // ---------------------------------------------------------------------------
    72 DOMElement* XSDDOMParser::createElementNSNode(const XMLCh *namespaceURI,
    73                                               const XMLCh *qualifiedName)
    74 {
    75     ReaderMgr::LastExtEntityInfo lastInfo;
    76     ((ReaderMgr*) fScanner->getLocator())->getLastExtEntityInfo(lastInfo);
    77 
    78     return getDocument()->createElementNS(namespaceURI, qualifiedName,
    79                                           lastInfo.lineNumber, lastInfo.colNumber);
    80 }
    81 
    82 
    83 void XSDDOMParser::startAnnotation( const XMLElementDecl&       elemDecl
    84                                   , const RefVectorOf<XMLAttr>& attrList
    85                                   , const XMLSize_t             attrCount)
    86 {
    87     fAnnotationBuf.append(chOpenAngle);
    88         fAnnotationBuf.append(elemDecl.getFullName());
    89     fAnnotationBuf.append(chSpace);
    90 
    91     // attributes are a bit of a pain.  To get this right, we have to keep track
    92     // of the namespaces we've seen declared, then examine the namespace context
    93     // for other namespaces so that we can also include them.
    94     // optimized for simplicity and the case that not many
    95     // namespaces are declared on this annotation...
    96     fURIs->removeAllElements();
    97     for (XMLSize_t i=0; i < attrCount; i++) {
    98 
    99         const XMLAttr* oneAttrib = attrList.elementAt(i);
    100         const XMLCh* attrValue = oneAttrib->getValue();
    101 
    102         if (XMLString::equals(oneAttrib->getName(), XMLUni::fgXMLNSString))
    103             fURIs->addElement(fScanner->getPrefixId(XMLUni::fgZeroLenString));
    104         else  if (!XMLString::compareNString(oneAttrib->getQName(), XMLUni::fgXMLNSColonString, 6))
    105             fURIs->addElement(fScanner->getPrefixId(oneAttrib->getName()));
    106 
    107         fAnnotationBuf.append(oneAttrib->getQName());
    108         fAnnotationBuf.append(chEqual);
    109         fAnnotationBuf.append(chDoubleQuote);
    110         fAnnotationBuf.append(attrValue);
    111         fAnnotationBuf.append(chDoubleQuote);
    112         fAnnotationBuf.append(chSpace);
    113     }
    114 
    115     // now we have to look through currently in-scope namespaces to see what
    116     // wasn't declared here
    117     ValueVectorOf<PrefMapElem*>* namespaceContext = fScanner->getNamespaceContext();
    118     for (XMLSize_t j=0; j < namespaceContext->size(); j++)
    119     {
    120         unsigned int prefId = namespaceContext->elementAt(j)->fPrefId;
    121 
    122         if (!fURIs->containsElement(prefId)) {
    123 
    124             const XMLCh* prefix = fScanner->getPrefixForId(prefId);
    125 
    126             if (XMLString::equals(prefix, XMLUni::fgZeroLenString)) {
    127                 fAnnotationBuf.append(XMLUni::fgXMLNSString);
    128             }
    129             else  {
    130                 fAnnotationBuf.append(XMLUni::fgXMLNSColonString);
    131                 fAnnotationBuf.append(prefix);
    132             }
    133 
    134             fAnnotationBuf.append(chEqual);
    135             fAnnotationBuf.append(chDoubleQuote);
    136             fAnnotationBuf.append(fScanner->getURIText(namespaceContext->elementAt(j)->fURIId));
    137             fAnnotationBuf.append(chDoubleQuote);
    138             fAnnotationBuf.append(chSpace);
    139 
    140             fURIs->addElement(prefId);
    141         }
    142     }
    143 
    144     fAnnotationBuf.append(chCloseAngle);
    145     fAnnotationBuf.append(chLF);
    146 }
    147 
    148 void XSDDOMParser::startAnnotationElement( const XMLElementDecl&       elemDecl
    149                                          , const RefVectorOf<XMLAttr>& attrList
    150                                          , const XMLSize_t             attrCount)
    151 {
    152     fAnnotationBuf.append(chOpenAngle);
    153     fAnnotationBuf.append(elemDecl.getFullName());
    154     //fAnnotationBuf.append(chSpace);
    155 
    156     for(XMLSize_t i=0; i < attrCount; i++) {
    157 
    158         const XMLAttr* oneAttr = attrList.elementAt(i);
    159         fAnnotationBuf.append(chSpace);
    160         fAnnotationBuf.append(oneAttr ->getQName());
    161         fAnnotationBuf.append(chEqual);
    162         fAnnotationBuf.append(chDoubleQuote);
    163         fAnnotationBuf.append(oneAttr->getValue());
    164         fAnnotationBuf.append(chDoubleQuote);
    165     }
    166 
    167     fAnnotationBuf.append(chCloseAngle);
    168 }
    169 
    170 void XSDDOMParser::endAnnotationElement( const XMLElementDecl& elemDecl
    171                                        , bool complete)
    172 {
    173     if (complete)
    174     {
    175         fAnnotationBuf.append(chLF);
    176         fAnnotationBuf.append(chOpenAngle);
    177         fAnnotationBuf.append(chForwardSlash);
    178         fAnnotationBuf.append(elemDecl.getFullName());
    179         fAnnotationBuf.append(chCloseAngle);
    180 
    181         // note that this is always called after endElement on <annotation>'s
    182         // child and before endElement on annotation.
    183         // hence, we must make this the child of the current
    184         // parent's only child.
    185         DOMTextImpl *node = (DOMTextImpl *)fDocument->createTextNode(fAnnotationBuf.getRawBuffer());
    186         fCurrentNode->appendChild(node);
    187         fAnnotationBuf.reset();
    188     }
    189     else      //capturing character calls
    190     {
    191         fAnnotationBuf.append(chOpenAngle);
    192         fAnnotationBuf.append(chForwardSlash);
    193         fAnnotationBuf.append(elemDecl.getFullName());
    194         fAnnotationBuf.append(chCloseAngle);
    195     }
    196 }
    197 
    198 
    199 // ---------------------------------------------------------------------------
    200 //  XSDDOMParser: Setter methods
    201 // ---------------------------------------------------------------------------
    202 void XSDDOMParser::setUserErrorReporter(XMLErrorReporter* const errorReporter)
    203 {
    204     fUserErrorReporter = errorReporter;
    205     fScanner->setErrorReporter(this);
    206 }
    207 
    208 void XSDDOMParser::setUserEntityHandler(XMLEntityHandler* const entityHandler)
    209 {
    210     fUserEntityHandler = entityHandler;
    211     fScanner->setEntityHandler(this);
    212 }
    213 
    214 
    215 // ---------------------------------------------------------------------------
    216 //  XSDDOMParser: Implementation of the XMLDocumentHandler interface
    217 // ---------------------------------------------------------------------------
    218 void XSDDOMParser::startElement( const XMLElementDecl&       elemDecl
    219                                , const unsigned int          urlId
    220                                , const XMLCh* const          elemPrefix
    221                                , const RefVectorOf<XMLAttr>& attrList
    222                                , const XMLSize_t             attrCount
    223                                , const bool                  isEmpty
    224                                , const bool                  isRoot)
    225 {
    226     fDepth++;
    227 
    228     // while it is true that non-whitespace character data
    229     // may only occur in appInfo or documentation
    230     // elements, it's certainly legal for comments and PI's to
    231     // occur as children of annotation; we need
    232     // to account for these here.
    233     if (fAnnotationDepth == -1)
    234     {
    235         if (XMLString::equals(elemDecl.getBaseName(), SchemaSymbols::fgELT_ANNOTATION) &&
    236             XMLString::equals(getURIText(urlId), SchemaSymbols::fgURI_SCHEMAFORSCHEMA))
    237         {
    238 
    239             fAnnotationDepth = fDepth;
    240             startAnnotation(elemDecl, attrList, attrCount);
    241         }
    242     }
    243     else if (fDepth == fAnnotationDepth+1)
    244     {
    245         fInnerAnnotationDepth = fDepth;
    246         startAnnotationElement(elemDecl, attrList, attrCount);
    247     }
    248     else
    249     {
    250         startAnnotationElement(elemDecl, attrList, attrCount);
    251         if(isEmpty)
    252             endElement(elemDecl, urlId, isRoot, elemPrefix);
    253         // avoid falling through; don't call startElement in this case
    254         return;
    255     }
    256 
    257     DOMElement *elem;
    258     if (urlId != fScanner->getEmptyNamespaceId())  //TagName has a prefix
    259     {
    260         if (elemPrefix && *elemPrefix)
    261         {
    262             XMLBufBid elemQName(&fBufMgr);
    263             elemQName.set(elemPrefix);
    264             elemQName.append(chColon);
    265             elemQName.append(elemDecl.getBaseName());
    266             elem = createElementNSNode(
    267                 fScanner->getURIText(urlId), elemQName.getRawBuffer());
    268         }
    269         else {
    270             elem = createElementNSNode(
    271                 fScanner->getURIText(urlId), elemDecl.getBaseName());
    272         }
    273     }
    274     else {
    275         elem = createElementNSNode(0, elemDecl.getBaseName());
    276     }
    277 
    278     DOMElementImpl *elemImpl = (DOMElementImpl *) elem;
    279     for (XMLSize_t index = 0; index < attrCount; ++index)
    280     {
    281         const XMLAttr* oneAttrib = attrList.elementAt(index);
    282         unsigned int attrURIId = oneAttrib->getURIId();
    283         const XMLCh* namespaceURI = 0;
    284 
    285         //for xmlns=...
    286         if (XMLString::equals(oneAttrib->getName(), XMLUni::fgXMLNSString))
    287             attrURIId = fScanner->getXMLNSNamespaceId();
    288 
    289         //TagName has a prefix
    290         if (attrURIId != fScanner->getEmptyNamespaceId())
    291             namespaceURI = fScanner->getURIText(attrURIId); //get namespaceURI
    292 
    293         //  revisit.  Optimize to init the named node map to the
    294         //            right size up front.
    295         DOMAttrImpl *attr = (DOMAttrImpl *)
    296             fDocument->createAttributeNS(namespaceURI, oneAttrib->getQName());
    297         attr->setValue(oneAttrib -> getValue());
    298         DOMNode* remAttr = elemImpl->setAttributeNodeNS(attr);
    299         if (remAttr)
    300             remAttr->release();
    301 
    302         // Attributes of type ID.  If this is one, add it to the hashtable of IDs
    303         //   that is constructed for use by GetElementByID().
    304         if (oneAttrib->getType()==XMLAttDef::ID)
    305         {
    306             if (fDocument->fNodeIDMap == 0)
    307                 fDocument->fNodeIDMap = new (fDocument) DOMNodeIDMap(500, fDocument);
    308             fDocument->fNodeIDMap->add(attr);
    309             attr->fNode.isIdAttr(true);
    310         }
    311 
    312         attr->setSpecified(oneAttrib->getSpecified());
    313     }
    314 
    315     // set up the default attributes
    316     if (elemDecl.hasAttDefs())
    317         {
    318         XMLAttDefList* defAttrs = &elemDecl.getAttDefList();
    319         XMLAttDef* attr = 0;
    320         DOMAttrImpl * insertAttr = 0;
    321 
    322         for (XMLSize_t i=0; i<defAttrs->getAttDefCount(); i++)
    323         {
    324             attr = &defAttrs->getAttDef(i);
    325 
    326             const XMLAttDef::DefAttTypes defType = attr->getDefaultType();
    327             if ((defType == XMLAttDef::Default)
    328             ||  (defType == XMLAttDef::Fixed))
    329             {
    330                 // DOM Level 2 wants all namespace declaration attributes
    331                 // to be bound to "http://www.w3.org/2000/xmlns/"
    332                 // So as long as the XML parser doesn't do it, it needs to
    333                 // done here.
    334                 const XMLCh* qualifiedName = attr->getFullName();
    335                 XMLBufBid bbPrefixQName(&fBufMgr);
    336                 XMLBuffer& prefixBuf = bbPrefixQName.getBuffer();
    337                 int colonPos = -1;
    338                 unsigned int uriId = fScanner->resolveQName(qualifiedName, prefixBuf, ElemStack::Mode_Attribute, colonPos);
    339 
    340                 const XMLCh* namespaceURI = 0;
    341                 if (XMLString::equals(qualifiedName, XMLUni::fgXMLNSString))
    342                     uriId = fScanner->getXMLNSNamespaceId();
    343 
    344                 //TagName has a prefix
    345                 if (uriId != fScanner->getEmptyNamespaceId())
    346                     namespaceURI = fScanner->getURIText(uriId);
    347 
    348                 insertAttr = (DOMAttrImpl *) fDocument->createAttributeNS(
    349                     namespaceURI, qualifiedName);
    350 
    351                 DOMAttr* remAttr = elemImpl->setDefaultAttributeNodeNS(insertAttr);
    352                 if (remAttr)
    353                     remAttr->release();
    354 
    355                 if (attr->getValue() != 0)
    356                 {
    357                     insertAttr->setValue(attr->getValue());
    358                     insertAttr->setSpecified(false);
    359                 }
    360             }
    361 
    362             insertAttr = 0;
    363             attr->reset();
    364         }
    365     }
    366 
    367     fCurrentParent->appendChild(elem);
    368     fCurrentParent = elem;
    369     fCurrentNode = elem;
    370     fWithinElement = true;
    371 
    372     // If an empty element, do end right now (no endElement() will be called)
    373     if (isEmpty)
    374         endElement(elemDecl, urlId, isRoot, elemPrefix);
    375 }
    376 
    377 
    378 
    379 void XSDDOMParser::endElement( const XMLElementDecl& elemDecl
    380                              , const unsigned int
    381                              , const bool
    382                              , const XMLCh* const)
    383 {
    384     if(fAnnotationDepth > -1)
    385     {
    386         if (fInnerAnnotationDepth == fDepth)
    387         {
    388             fInnerAnnotationDepth = -1;
    389             endAnnotationElement(elemDecl, false);
    390             }
    391         else if (fAnnotationDepth == fDepth)
    392         {
    393             fAnnotationDepth = -1;
    394             endAnnotationElement(elemDecl, true);
    395         }
    396         else
    397         {   // inside a child of annotation
    398             endAnnotationElement(elemDecl, false);
    399             fDepth--;
    400             return;
    401         }
    402     }
    403 
    404     fDepth--;
    405     fCurrentNode   = fCurrentParent;
    406     fCurrentParent = fCurrentNode->getParentNode ();
    407 
    408     // If we've hit the end of content, clear the flag.
    409     //
    410     if (fCurrentParent == fDocument)
    411         fWithinElement = false;
    412 }
    413 
    414 void XSDDOMParser::docCharacters(  const   XMLCh* const    chars
    415                               , const XMLSize_t       length
    416                               , const bool            cdataSection)
    417 {
    418     // Ignore chars outside of content
    419     if (!fWithinElement)
    420         return;
    421 
    422     if (fInnerAnnotationDepth == -1)
    423     {
    424         if (!((ReaderMgr*) fScanner->getReaderMgr())->getCurrentReader()->isAllSpaces(chars, length))
    425         {
    426             ReaderMgr::LastExtEntityInfo lastInfo;
    427             fScanner->getReaderMgr()->getLastExtEntityInfo(lastInfo);
    428             fXSLocator.setValues(lastInfo.systemId, lastInfo.publicId, lastInfo.lineNumber, lastInfo.colNumber);
    429             fXSDErrorReporter.emitError(XMLValid::NonWSContent, XMLUni::fgValidityDomain, &fXSLocator);
    430         }
    431     }
    432     // when it's within either of the 2 annotation subelements, characters are
    433     // allowed and we need to store them.
    434     else if (cdataSection == true)
    435     {
    436         fAnnotationBuf.append(XMLUni::fgCDataStart);
    437         fAnnotationBuf.append(chars, length);
    438         fAnnotationBuf.append(XMLUni::fgCDataEnd);
    439     }
    440     else
    441     {
    442         for(unsigned int i = 0; i < length; i++ )
    443         {
    444             if(chars[i] == chAmpersand)
    445             {
    446                 fAnnotationBuf.append(chAmpersand);
    447                 fAnnotationBuf.append(XMLUni::fgAmp);
    448                 fAnnotationBuf.append(chSemiColon);
    449             }
    450             else if (chars[i] == chOpenAngle)
    451             {
    452                 fAnnotationBuf.append(chAmpersand);
    453                 fAnnotationBuf.append(XMLUni::fgLT);
    454                 fAnnotationBuf.append(chSemiColon);
    455             }
    456             else {
    457                 fAnnotationBuf.append(chars[i]);
    458             }
    459         }
    460     }
    461 }
    462 
    463 void XSDDOMParser::docComment(const XMLCh* const comment)
    464 {
    465     if (fAnnotationDepth > -1)
    466     {
    467         fAnnotationBuf.append(XMLUni::fgCommentString);
    468         fAnnotationBuf.append(comment);
    469         fAnnotationBuf.append(chDash);
    470         fAnnotationBuf.append(chDash);
    471         fAnnotationBuf.append(chCloseAngle);
    472     }
    473 }
    474 
    475 void XSDDOMParser::startEntityReference(const XMLEntityDecl&)
    476 {
    477 }
    478 
    479 void XSDDOMParser::endEntityReference(const XMLEntityDecl&)
    480 {
    481 }
    482 
    483 void XSDDOMParser::ignorableWhitespace( const XMLCh* const chars
    484                                       , const XMLSize_t    length
    485                                       , const bool)
    486 {
    487     // Ignore chars before the root element
    488     if (!fWithinElement || !fIncludeIgnorableWhitespace)
    489         return;
    490 
    491     if (fAnnotationDepth > -1)
    492         fAnnotationBuf.append(chars, length);
    493 }
    494 
    495 // ---------------------------------------------------------------------------
    496 //  XSDDOMParser: Implementation of the XMLErrorReporter interface
    497 // ---------------------------------------------------------------------------
    498 void XSDDOMParser::error(const   unsigned int                code
    499                          , const XMLCh* const                msgDomain
    500                          , const XMLErrorReporter::ErrTypes  errType
    501                          , const XMLCh* const                errorText
    502                          , const XMLCh* const                systemId
    503                          , const XMLCh* const                publicId
    504                          , const XMLFileLoc                  lineNum
    505                          , const XMLFileLoc                  colNum)
    506 {
    507     if (errType >= XMLErrorReporter::ErrType_Fatal)
    508         fSawFatal = true;
    509 
    510     if (fUserErrorReporter)
    511         fUserErrorReporter->error(code, msgDomain, errType, errorText,
    512                                   systemId, publicId, lineNum, colNum);
    513 }
    514 
    515 InputSource*
    516 XSDDOMParser::resolveEntity(XMLResourceIdentifier* resourceIdentifier)
    517 {
    518     if (fUserEntityHandler)
    519         return fUserEntityHandler->resolveEntity(resourceIdentifier);
    520 
    521     return 0;
    522 }
    523 
    524 XERCES_CPP_NAMESPACE_END
     1#include <icxercesc/validators/schema/XSDDOMParser.cpp>
  • icXML/icXML-devel/src/xercesc/validators/schema/XSDDOMParser.hpp

    r2722 r2774  
    1 /*
    2  * Licensed to the Apache Software Foundation (ASF) under one or more
    3  * contributor license agreements.  See the NOTICE file distributed with
    4  * this work for additional information regarding copyright ownership.
    5  * The ASF licenses this file to You under the Apache License, Version 2.0
    6  * (the "License"); you may not use this file except in compliance with
    7  * the License.  You may obtain a copy of the License at
    8  *
    9  *      http://www.apache.org/licenses/LICENSE-2.0
    10  *
    11  * Unless required by applicable law or agreed to in writing, software
    12  * distributed under the License is distributed on an "AS IS" BASIS,
    13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    14  * See the License for the specific language governing permissions and
    15  * limitations under the License.
    16  */
    17 
    18 /*
    19  * $Id: XSDDOMParser.hpp 932887 2010-04-11 13:04:59Z borisk $
    20  */
    21 
    22 #if !defined(XERCESC_INCLUDE_GUARD_XSDDOMPARSER_HPP)
    23 #define XERCESC_INCLUDE_GUARD_XSDDOMPARSER_HPP
    24 
    25 
    26 #include <xercesc/parsers/XercesDOMParser.hpp>
    27 #include <xercesc/validators/schema/XSDErrorReporter.hpp>
    28 #include <xercesc/validators/schema/XSDLocator.hpp>
    29 
    30 XERCES_CPP_NAMESPACE_BEGIN
    31 
    32 class DOMElement;
    33 class XMLValidator;
    34 
    35 
    36 /**
    37   * This class is used to parse schema documents into DOM trees
    38   */
    39 class PARSERS_EXPORT XSDDOMParser : public XercesDOMParser
    40 {
    41 public :
    42 
    43     // -----------------------------------------------------------------------
    44     //  Constructors and Destructor
    45     // -----------------------------------------------------------------------
    46 
    47     /** @name Constructors and Destructor */
    48     //@{
    49     /** Construct a XSDDOMParser, with an optional validator
    50       *
    51       * Constructor with an instance of validator class to use for
    52       * validation. If you don't provide a validator, a default one will
    53       * be created for you in the scanner.
    54       *
    55       * @param gramPool   Pointer to the grammar pool instance from
    56       *                   external application.
    57       *                   The parser does NOT own it.
    58       *
    59       * @param valToAdopt Pointer to the validator instance to use. The
    60       *                   parser is responsible for freeing the memory.
    61       */
    62     XSDDOMParser
    63     (
    64           XMLValidator* const   valToAdopt = 0
    65         , MemoryManager* const  manager = XMLPlatformUtils::fgMemoryManager
    66         , XMLGrammarPool* const gramPool = 0
    67     );
    68 
    69     /**
    70       * Destructor
    71       */
    72     ~XSDDOMParser();
    73 
    74     //@}
    75 
    76     // -----------------------------------------------------------------------
    77     //  Implementation of the XMLDocumentHandler interface.
    78     // -----------------------------------------------------------------------
    79 
    80     /** @name Implementation of the XMLDocumentHandler interface. */
    81     //@{
    82 
    83     /** Handle a start element event
    84       *
    85       * This method is used to report the start of an element. It is
    86       * called at the end of the element, by which time all attributes
    87       * specified are also parsed. A new DOM Element node is created
    88       * along with as many attribute nodes as required. This new element
    89       * is added appended as a child of the current node in the tree, and
    90       * then replaces it as the current node (if the isEmpty flag is false.)
    91       *
    92       * @param elemDecl A const reference to the object containing element
    93       *                 declaration information.
    94       * @param urlId    An id referring to the namespace prefix, if
    95       *                 namespaces setting is switched on.
    96       * @param elemPrefix A const pointer to a Unicode string containing
    97       *                 the namespace prefix for this element. Applicable
    98       *                 only when namespace processing is enabled.
    99       * @param attrList A const reference to the object containing the
    100       *                 list of attributes just scanned for this element.
    101       * @param attrCount A count of number of attributes in the list
    102       *                 specified by the parameter 'attrList'.
    103       * @param isEmpty  A flag indicating whether this is an empty element
    104       *                 or not. If empty, then no endElement() call will
    105       *                 be made.
    106       * @param isRoot   A flag indicating whether this element was the
    107       *                 root element.
    108       * @see DocumentHandler#startElement
    109       */
    110     virtual void startElement
    111     (
    112         const   XMLElementDecl&         elemDecl
    113         , const unsigned int            urlId
    114         , const XMLCh* const            elemPrefix
    115         , const RefVectorOf<XMLAttr>&   attrList
    116         , const XMLSize_t               attrCount
    117         , const bool                    isEmpty
    118         , const bool                    isRoot
    119     );
    120 
    121     /** Handle and end of element event
    122       *
    123       * This method is used to indicate the end tag of an element. The
    124       * DOM parser pops the current element off the top of the element
    125       * stack, and make it the new current element.
    126       *
    127       * @param elemDecl A const reference to the object containing element
    128       *                 declaration information.
    129       * @param urlId    An id referring to the namespace prefix, if
    130       *                 namespaces setting is switched on.
    131       * @param isRoot   A flag indicating whether this element was the
    132       *                 root element.
    133       * @param elemPrefix A const pointer to a Unicode string containing
    134       *                 the namespace prefix for this element. Applicable
    135       *                 only when namespace processing is enabled.
    136       */
    137     virtual void endElement
    138     (
    139         const   XMLElementDecl& elemDecl
    140         , const unsigned int    urlId
    141         , const bool            isRoot
    142         , const XMLCh* const    elemPrefix
    143     );
    144 
    145     /** Handle document character events
    146       *
    147       * This method is used to report all the characters scanned by the
    148       * parser. This DOM implementation stores this data in the appropriate
    149       * DOM node, creating one if necessary.
    150       *
    151       * @param chars   A const pointer to a Unicode string representing the
    152       *                character data.
    153       * @param length  The length of the Unicode string returned in 'chars'.
    154       * @param cdataSection  A flag indicating if the characters represent
    155       *                      content from the CDATA section.
    156       */
    157     virtual void docCharacters
    158     (
    159         const   XMLCh* const    chars
    160         , const XMLSize_t       length
    161         , const bool            cdataSection
    162     );
    163 
    164     /** Handle a document comment event
    165       *
    166       * This method is used to report any comments scanned by the parser.
    167       * A new comment node is created which stores this data.
    168       *
    169       * @param comment A const pointer to a null terminated Unicode
    170       *                string representing the comment text.
    171       */
    172     virtual void docComment
    173     (
    174         const   XMLCh* const    comment
    175     );
    176 
    177     /** Handle a start entity reference event
    178       *
    179       * This method is used to indicate the start of an entity reference.
    180       * If the expand entity reference flag is true, then a new
    181       * DOM Entity reference node is created.
    182       *
    183       * @param entDecl A const reference to the object containing the
    184       *                entity declaration information.
    185       */
    186     virtual void startEntityReference
    187     (
    188         const   XMLEntityDecl&  entDecl
    189     );
    190 
    191     /** Handle and end of entity reference event
    192       *
    193       * This method is used to indicate that an end of an entity reference
    194       * was just scanned.
    195       *
    196       * @param entDecl A const reference to the object containing the
    197       *                entity declaration information.
    198       */
    199     virtual void endEntityReference
    200     (
    201         const   XMLEntityDecl&  entDecl
    202     );
    203 
    204     /** Handle an ignorable whitespace vent
    205       *
    206       * This method is used to report all the whitespace characters, which
    207       * are determined to be 'ignorable'. This distinction between characters
    208       * is only made, if validation is enabled.
    209       *
    210       * Any whitespace before content is ignored. If the current node is
    211       * already of type DOMNode::TEXT_NODE, then these whitespaces are
    212       * appended, otherwise a new Text node is created which stores this
    213       * data. Essentially all contiguous ignorable characters are collected
    214       * in one node.
    215       *
    216       * @param chars   A const pointer to a Unicode string representing the
    217       *                ignorable whitespace character data.
    218       * @param length  The length of the Unicode string 'chars'.
    219       * @param cdataSection  A flag indicating if the characters represent
    220       *                      content from the CDATA section.
    221       */
    222     virtual void ignorableWhitespace
    223     (
    224         const   XMLCh* const    chars
    225         , const XMLSize_t       length
    226         , const bool            cdataSection
    227     );
    228 
    229     //@}
    230 
    231     // -----------------------------------------------------------------------
    232     //  Get methods
    233     // -----------------------------------------------------------------------
    234     bool getSawFatal() const;
    235 
    236 
    237     // -----------------------------------------------------------------------
    238     //  Set methods
    239     // -----------------------------------------------------------------------
    240     void setUserErrorReporter(XMLErrorReporter* const errorReporter);
    241     void setUserEntityHandler(XMLEntityHandler* const entityHandler);
    242 
    243 
    244     // -----------------------------------------------------------------------
    245     //  XMLErrorReporter interface
    246     // -----------------------------------------------------------------------
    247     virtual void error
    248     (
    249         const   unsigned int        errCode
    250         , const XMLCh* const        errDomain
    251         , const ErrTypes            type
    252         , const XMLCh* const        errorText
    253         , const XMLCh* const        systemId
    254         , const XMLCh* const        publicId
    255         , const XMLFileLoc          lineNum
    256         , const XMLFileLoc          colNum
    257     );
    258 
    259     // -----------------------------------------------------------------------
    260     //  XMLEntityHandler interface
    261     // -----------------------------------------------------------------------
    262     virtual InputSource* resolveEntity(XMLResourceIdentifier* resourceIdentifier);
    263 
    264 protected :
    265     // -----------------------------------------------------------------------
    266     //  Protected Helper methods
    267     // -----------------------------------------------------------------------
    268     virtual DOMElement* createElementNSNode(const XMLCh *fNamespaceURI,
    269                                             const XMLCh *qualifiedName);
    270 
    271 private:
    272     // -----------------------------------------------------------------------
    273     //  Unimplemented constructors and operators
    274     // -----------------------------------------------------------------------
    275     XSDDOMParser(const XSDDOMParser&);
    276     XSDDOMParser& operator=(const XSDDOMParser&);
    277 
    278     // -----------------------------------------------------------------------
    279     //  Private Helper methods
    280     // -----------------------------------------------------------------------
    281     void startAnnotation
    282     (
    283         const   XMLElementDecl&         elemDecl
    284         , const RefVectorOf<XMLAttr>&   attrList
    285         , const XMLSize_t               attrCount
    286     );
    287     void startAnnotationElement
    288     (
    289         const   XMLElementDecl&         elemDecl
    290         , const RefVectorOf<XMLAttr>&   attrList
    291         , const XMLSize_t               attrCount
    292     );
    293     void endAnnotationElement
    294     (
    295         const XMLElementDecl& elemDecl
    296         ,     bool            complete
    297     );
    298 
    299     // -----------------------------------------------------------------------
    300     //  Private data members
    301     // -----------------------------------------------------------------------
    302     bool                         fSawFatal;
    303     int                          fAnnotationDepth;
    304     int                          fInnerAnnotationDepth;
    305     int                          fDepth;
    306     XMLErrorReporter*            fUserErrorReporter;
    307     XMLEntityHandler*            fUserEntityHandler;
    308     ValueVectorOf<unsigned int>* fURIs;
    309     XMLBuffer                    fAnnotationBuf;
    310     XSDErrorReporter             fXSDErrorReporter;
    311     XSDLocator                   fXSLocator;
    312 };
    313 
    314 
    315 inline bool XSDDOMParser::getSawFatal() const
    316 {
    317     return fSawFatal;
    318 }
    319 
    320 XERCES_CPP_NAMESPACE_END
    321 
    322 #endif
     1#include <icxercesc/validators/schema/XSDDOMParser.hpp>
Note: See TracChangeset for help on using the changeset viewer.