You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@xerces.apache.org by ca...@apache.org on 2005/04/26 19:37:50 UTC

cvs commit: xml-xerces/c/src/xercesc/internal ElemStack.hpp IGXMLScanner.cpp SGXMLScanner.cpp XSAXMLScanner.cpp

cargilld    2005/04/26 10:37:50

  Modified:    c/src/xercesc/internal ElemStack.hpp IGXMLScanner.cpp
                        SGXMLScanner.cpp XSAXMLScanner.cpp
  Log:
  Prefix mapping update to handle schema correctly.
  
  Revision  Changes    Path
  1.12      +17 -0     xml-xerces/c/src/xercesc/internal/ElemStack.hpp
  
  Index: ElemStack.hpp
  ===================================================================
  RCS file: /home/cvs/xml-xerces/c/src/xercesc/internal/ElemStack.hpp,v
  retrieving revision 1.11
  retrieving revision 1.12
  diff -u -r1.11 -r1.12
  --- ElemStack.hpp	8 Sep 2004 13:56:13 -0000	1.11
  +++ ElemStack.hpp	26 Apr 2005 17:37:50 -0000	1.12
  @@ -16,6 +16,9 @@
   
   /*
    * $Log$
  + * Revision 1.12  2005/04/26 17:37:50  cargilld
  + * Prefix mapping update to handle schema correctly.
  + *
    * Revision 1.11  2004/09/08 13:56:13  peiyongz
    * Apache License Version 2.0
    *
  @@ -192,6 +195,8 @@
           unsigned int        fCurrentURI;
           XMLCh *             fSchemaElemName;
           unsigned int        fSchemaElemNameMaxLen;
  +        
  +        int                 fPrefixColonPos;
       };
   
       enum MapModes
  @@ -244,6 +249,9 @@
       inline void setCurrentSchemaElemName(const XMLCh * const schemaElemName);
       inline XMLCh *getCurrentSchemaElemName();
   
  +    void setPrefixColonPos(int colonPos);
  +    int getPrefixColonPos() const;
  +
       // -----------------------------------------------------------------------
       //  Prefix map methods
       // -----------------------------------------------------------------------
  @@ -623,6 +631,15 @@
       return fPrefixPool.getValueForId(prefId);
   }
   
  +inline void ElemStack::setPrefixColonPos(int colonPos)
  +{
  +    fStack[fStackTop-1]->fPrefixColonPos = colonPos;
  +}
  + 
  +inline int ElemStack::getPrefixColonPos() const {
  +    return fStack[fStackTop-1]->fPrefixColonPos;
  +}
  +
   // ---------------------------------------------------------------------------
   //  WFElemStack: Miscellaneous methods
   // ---------------------------------------------------------------------------
  
  
  
  1.92      +13 -3     xml-xerces/c/src/xercesc/internal/IGXMLScanner.cpp
  
  Index: IGXMLScanner.cpp
  ===================================================================
  RCS file: /home/cvs/xml-xerces/c/src/xercesc/internal/IGXMLScanner.cpp,v
  retrieving revision 1.91
  retrieving revision 1.92
  diff -u -r1.91 -r1.92
  --- IGXMLScanner.cpp	24 Apr 2005 10:22:15 -0000	1.91
  +++ IGXMLScanner.cpp	26 Apr 2005 17:37:50 -0000	1.92
  @@ -1160,13 +1160,22 @@
   
       // If we have a doc handler, tell it about the end tag
       if (fDocHandler)
  -    {
  +    {        
  +        if (fGrammarType == Grammar::SchemaGrammarType) {
  +            if (topElem->fPrefixColonPos != -1)
  +                fPrefixBuf.set(elemName, topElem->fPrefixColonPos);
  +            else
  +                fPrefixBuf.reset();
  +        }
  +        else {
  +            fPrefixBuf.set(topElem->fThisElement->getElementName()->getPrefix());
  +        }
           fDocHandler->endElement
           (
               *topElem->fThisElement
               , uriId
               , isRoot           
  -            , topElem->fThisElement->getElementName()->getPrefix()
  +            , fPrefixBuf.getRawBuffer()
           );
       }
   
  @@ -2203,6 +2212,7 @@
       //  to expand up to get ready.
       unsigned int elemDepth = fElemStack.addLevel();
       fElemStack.setValidationFlag(fValidate);
  +    fElemStack.setPrefixColonPos(prefixColonPos);
   
       //  Check if there is any external schema location specified, and if we are at root,
       //  go through them first before scanning those specified in the instance document
  
  
  
  1.113     +12 -2     xml-xerces/c/src/xercesc/internal/SGXMLScanner.cpp
  
  Index: SGXMLScanner.cpp
  ===================================================================
  RCS file: /home/cvs/xml-xerces/c/src/xercesc/internal/SGXMLScanner.cpp,v
  retrieving revision 1.112
  retrieving revision 1.113
  diff -u -r1.112 -r1.113
  --- SGXMLScanner.cpp	24 Apr 2005 10:22:15 -0000	1.112
  +++ SGXMLScanner.cpp	26 Apr 2005 17:37:50 -0000	1.113
  @@ -1013,12 +1013,21 @@
       // If we have a doc handler, tell it about the end tag
       if (fDocHandler)
       {
  +        if (fGrammarType == Grammar::SchemaGrammarType) {
  +            if (topElem->fPrefixColonPos != -1)
  +                fPrefixBuf.set(elemName, topElem->fPrefixColonPos);
  +            else
  +                fPrefixBuf.reset();
  +        }
  +        else {
  +            fPrefixBuf.set(topElem->fThisElement->getElementName()->getPrefix());
  +        }
           fDocHandler->endElement
           (
               *topElem->fThisElement
               , uriId
               , isRoot            
  -            , topElem->fThisElement->getElementName()->getPrefix()
  +            , fPrefixBuf.getRawBuffer()
           );
       }
   
  @@ -1155,6 +1164,7 @@
       //  to expand up to get ready.
       unsigned int elemDepth = fElemStack.addLevel();
       fElemStack.setValidationFlag(fValidate);
  +    fElemStack.setPrefixColonPos(prefixColonPos);
   
       //  Check if there is any external schema location specified, and if we are at root,
       //  go through them first before scanning those specified in the instance document
  
  
  
  1.9       +8 -3      xml-xerces/c/src/xercesc/internal/XSAXMLScanner.cpp
  
  Index: XSAXMLScanner.cpp
  ===================================================================
  RCS file: /home/cvs/xml-xerces/c/src/xercesc/internal/XSAXMLScanner.cpp,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- XSAXMLScanner.cpp	24 Apr 2005 10:22:15 -0000	1.8
  +++ XSAXMLScanner.cpp	26 Apr 2005 17:37:50 -0000	1.9
  @@ -156,13 +156,17 @@
   
       // If we have a doc handler, tell it about the end tag
       if (fDocHandler)
  -    {
  +    {        
  +        if (topElem->fPrefixColonPos != -1)
  +            fPrefixBuf.set(elemName, topElem->fPrefixColonPos);
  +        else
  +            fPrefixBuf.reset();        
           fDocHandler->endElement
           (
               *topElem->fThisElement
               , uriId
               , isRoot
  -            , topElem->fThisElement->getElementName()->getPrefix()
  +            , fPrefixBuf.getRawBuffer()            
           );
       }
   
  @@ -259,6 +263,7 @@
       //  to expand up to get ready.
       unsigned int elemDepth = fElemStack.addLevel();
       fElemStack.setValidationFlag(fValidate);
  +    fElemStack.setPrefixColonPos(prefixColonPos);
   
       //  Make an initial pass through the list and find any xmlns attributes or
       //  schema attributes.
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@xerces.apache.org
For additional commands, e-mail: commits-help@xerces.apache.org