From 9df633c727cb037c52ff118cd99b61b9a1480d0a Mon Sep 17 00:00:00 2001
From: PeiYong Zhang <peiyongz@apache.org>
Date: Fri, 2 Apr 2004 16:51:45 +0000
Subject: [PATCH] Better error report support in XSAnnotation

git-svn-id: https://svn.apache.org/repos/asf/xerces/c/trunk@175852 13f79535-47bb-0310-9956-ffa450edef68
---
 .../validators/schema/TraverseSchema.cpp        | 17 +++++++++++++++--
 1 file changed, 15 insertions(+), 2 deletions(-)

diff --git a/src/xercesc/validators/schema/TraverseSchema.cpp b/src/xercesc/validators/schema/TraverseSchema.cpp
index 2c486b93f..c2d05b669 100644
--- a/src/xercesc/validators/schema/TraverseSchema.cpp
+++ b/src/xercesc/validators/schema/TraverseSchema.cpp
@@ -496,6 +496,8 @@ TraverseSchema::traverseAnnotationDecl(const DOMElement* const annotationElem,
 
     if (contents)
     {
+        XSAnnotation* theAnnotation = 0;
+
         unsigned int nonXSAttSize = nonXSAttList->size();
 
         if (nonXSAttSize)
@@ -533,12 +535,23 @@ TraverseSchema::traverseAnnotationDecl(const DOMElement* const annotationElem,
             // add remaining annotation content
             fBuffer.append(contents + annotTokenStart + 10);
 
-            return new (fGrammarPoolMemoryManager) XSAnnotation(fBuffer.getRawBuffer(), fGrammarPoolMemoryManager);
+            theAnnotation = new (fGrammarPoolMemoryManager) XSAnnotation(fBuffer.getRawBuffer(), fGrammarPoolMemoryManager);
         }
         else
         {
-            return new (fGrammarPoolMemoryManager) XSAnnotation(contents, fGrammarPoolMemoryManager);
+            theAnnotation = new (fGrammarPoolMemoryManager) XSAnnotation(contents, fGrammarPoolMemoryManager);
         }
+
+        /***
+         * set line, col and systemId info
+        ***/
+        theAnnotation->setLineCol(
+                                  ((XSDElementNSImpl*)annotationElem)->getLineNo()
+                                , ((XSDElementNSImpl*)annotationElem)->getColumnNo()
+                                 );
+        theAnnotation->setSystemId(fSchemaInfo->getCurrentSchemaURL());
+
+        return theAnnotation;
     }
 
     return 0;
-- 
GitLab