You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@xalan.apache.org by db...@locus.apache.org on 2000/08/01 21:45:14 UTC
cvs commit: xml-xalan/c/src/XSLT ElemCallTemplate.cpp ElemCallTemplate.hpp
dbertoni 00/08/01 12:45:14
Modified: c/src/XSLT ElemCallTemplate.cpp ElemCallTemplate.hpp
Log:
Made template name a value member rather than a pointer.
Revision Changes Path
1.7 +10 -11 xml-xalan/c/src/XSLT/ElemCallTemplate.cpp
Index: ElemCallTemplate.cpp
===================================================================
RCS file: /home/cvs/xml-xalan/c/src/XSLT/ElemCallTemplate.cpp,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- ElemCallTemplate.cpp 2000/05/15 15:57:45 1.6
+++ ElemCallTemplate.cpp 2000/08/01 19:45:13 1.7
@@ -88,7 +88,7 @@
lineNumber,
columnNumber,
Constants::ELEMNAME_CALLTEMPLATE),
- m_templateName(0)
+ m_templateName()
{
const unsigned int nAttrs = atts.getLength();
@@ -98,25 +98,24 @@
if(equals(aname, Constants::ATTRNAME_NAME))
{
- m_templateName = new QName(atts.getValue(i), getStylesheet().getNamespaces());
-
-/*
- m_pNameAVT = new AVT(aname, atts.getType(i), atts.getValue(i),
- *this, constructionContext);
-*/
+ m_templateName = QName(atts.getValue(i), getStylesheet().getNamespaces());
}
else if(!isAttrOK(aname, atts, i, constructionContext))
{
constructionContext.error(name + " has an illegal attribute: " + aname);
}
}
+
+ if (m_templateName.isEmpty() == true)
+ {
+ constructionContext.error(name + " requires a name attribute!");
+ }
}
ElemCallTemplate::~ElemCallTemplate()
{
- delete m_templateName;
}
@@ -130,10 +129,10 @@
{
ElemTemplateElement::execute(executionContext, sourceTree, sourceNode, mode);
- if(!isEmpty(m_templateName->getLocalPart()))
+ if(!isEmpty(m_templateName.getLocalPart()))
{
ElemTemplateElement* const theTemplate =
- getStylesheet().getStylesheetRoot().findNamedTemplate(*m_templateName,
+ getStylesheet().getStylesheetRoot().findNamedTemplate(m_templateName,
executionContext);
if(0 != theTemplate)
@@ -152,7 +151,7 @@
else
{
executionContext.error("Could not find template named: '" +
- m_templateName->getLocalPart() + "'");
+ m_templateName.getLocalPart() + "'");
}
}
else
1.6 +5 -5 xml-xalan/c/src/XSLT/ElemCallTemplate.hpp
Index: ElemCallTemplate.hpp
===================================================================
RCS file: /home/cvs/xml-xalan/c/src/XSLT/ElemCallTemplate.hpp,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- ElemCallTemplate.hpp 2000/04/12 19:40:57 1.5
+++ ElemCallTemplate.hpp 2000/08/01 19:45:13 1.6
@@ -58,7 +58,7 @@
#define XALAN_ELEMCALLTEMPLATE_HEADER_GUARD
/**
- * $Id: ElemCallTemplate.hpp,v 1.5 2000/04/12 19:40:57 jdonohue Exp $
+ * $Id: ElemCallTemplate.hpp,v 1.6 2000/08/01 19:45:13 dbertoni Exp $
*
*
* $State: Exp $
@@ -71,12 +71,12 @@
-// Base class header file.
-#include "ElemTemplateElement.hpp"
+#include <XPath/QName.hpp>
-class AVT;
+// Base class header file.
+#include "ElemTemplateElement.hpp"
@@ -128,7 +128,7 @@
operator=(const ElemCallTemplate &);
// Data members...
- const QName* m_templateName;
+ QName m_templateName;
};