[prev in list] [next in list] [prev in thread] [next in thread] 

List:       xerces-cvs
Subject:    cvs commit: xml-xerces/c/src/xercesc/validators/schema TraverseSchema.cpp
From:       cargilld () apache ! org
Date:       2004-10-27 15:24:22
Message-ID: 20041027152422.32989.qmail () minotaur ! apache ! org
[Download RAW message or body]

cargilld    2004/10/27 08:24:22

  Modified:    c/src/xercesc/validators/schema TraverseSchema.cpp
  Log:
  Fix problem where an XSAnnotation was not being created if it didn't have a child \
(document or appinfo).  
  Revision  Changes    Path
  1.123     +29 -19    xml-xerces/c/src/xercesc/validators/schema/TraverseSchema.cpp
  
  Index: TraverseSchema.cpp
  ===================================================================
  RCS file: /home/cvs/xml-xerces/c/src/xercesc/validators/schema/TraverseSchema.cpp,v
  retrieving revision 1.122
  retrieving revision 1.123
  diff -u -r1.122 -r1.123
  --- TraverseSchema.cpp	30 Sep 2004 13:14:28 -0000	1.122
  +++ TraverseSchema.cpp	27 Oct 2004 15:24:22 -0000	1.123
  @@ -438,31 +438,41 @@
       );
   
       const XMLCh* contents = 0;
  -    for (DOMElement* child = XUtil::getFirstChildElement(annotationElem);
  -         child != 0;
  -         child = XUtil::getNextSiblingElement(child)) {
  -
  -        const XMLCh* name = child->getLocalName();
  -
  -        if (XMLString::equals(name, SchemaSymbols::fgELT_APPINFO)) {
  -
  -            DOMNode* textContent = child->getFirstChild();
  -            if (textContent && textContent->getNodeType() == DOMNode::TEXT_NODE)
  -                contents = ((DOMText*) textContent)->getData();
  -
  -            fAttributeCheck.checkAttributes(child, \
                GeneralAttributeCheck::E_Appinfo, this);
  -        }
  -        else if (XMLString::equals(name, SchemaSymbols::fgELT_DOCUMENTATION)) {
  -
  -            DOMNode* textContent = child->getFirstChild();
  -            if (textContent && textContent->getNodeType() == DOMNode::TEXT_NODE)
  -                contents = ((DOMText*) textContent)->getData();
  -
  -            fAttributeCheck.checkAttributes(child, \
                GeneralAttributeCheck::E_Documentation, this);
  -        }
  -        else {
  -            reportSchemaError(child, XMLUni::fgXMLErrDomain, \
XMLErrs::InvalidAnnotationContent);  +    DOMElement* child = \
XUtil::getFirstChildElement(annotationElem);  +    if (child) {
  +        for (;
  +             child != 0;
  +             child = XUtil::getNextSiblingElement(child)) {
  +
  +            const XMLCh* name = child->getLocalName();
  +
  +            if (XMLString::equals(name, SchemaSymbols::fgELT_APPINFO)) {
  +
  +                DOMNode* textContent = child->getFirstChild();
  +                if (textContent && textContent->getNodeType() == \
DOMNode::TEXT_NODE)  +                    contents = ((DOMText*) \
textContent)->getData();  +
  +                fAttributeCheck.checkAttributes(child, \
GeneralAttributeCheck::E_Appinfo, this);  +            }
  +            else if (XMLString::equals(name, SchemaSymbols::fgELT_DOCUMENTATION)) \
{  +
  +                DOMNode* textContent = child->getFirstChild();
  +                if (textContent && textContent->getNodeType() == \
DOMNode::TEXT_NODE)  +                    contents = ((DOMText*) \
textContent)->getData();  +
  +                fAttributeCheck.checkAttributes(child, \
GeneralAttributeCheck::E_Documentation, this);  +            }
  +            else {
  +                reportSchemaError(child, XMLUni::fgXMLErrDomain, \
XMLErrs::InvalidAnnotationContent);  +            }
           }
  +    }
  +    else
  +    {
  +        // If the Annotation has no children, get the text directly
  +        DOMNode* textContent = annotationElem->getFirstChild();
  +        if (textContent && textContent->getNodeType() == DOMNode::TEXT_NODE)
  +            contents = ((DOMText*) textContent)->getData();    
       }
   
       if (contents)
  
  
  

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


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic