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...@apache.org on 2001/12/21 02:30:42 UTC

cvs commit: xml-xalan/c/src/XSLT StylesheetHandler.cpp

dbertoni    01/12/20 17:30:42

  Modified:    c/src/XSLT StylesheetHandler.cpp
  Log:
  Check for apply-imports as a child of xsl:for-each.
  
  Revision  Changes    Path
  1.74      +21 -3     xml-xalan/c/src/XSLT/StylesheetHandler.cpp
  
  Index: StylesheetHandler.cpp
  ===================================================================
  RCS file: /home/cvs/xml-xalan/c/src/XSLT/StylesheetHandler.cpp,v
  retrieving revision 1.73
  retrieving revision 1.74
  diff -u -r1.73 -r1.74
  --- StylesheetHandler.cpp	2001/11/26 23:23:05	1.73
  +++ StylesheetHandler.cpp	2001/12/21 01:30:42	1.74
  @@ -467,9 +467,27 @@
   					break;
   
   				case Constants::ELEMNAME_APPLY_IMPORTS:
  -					elem = new ElemApplyImport(m_constructionContext,
  -											 m_stylesheet,
  -											 atts, lineNumber, columnNumber);
  +					{
  +						if (m_elemStack.empty() == true)
  +						{
  +							error("xsl:apply-imports is not allowed at this position in the stylesheet", locator);
  +						}
  +
  +						ElemTemplateElement* const	theElement =
  +								m_elemStack.back();
  +						assert(theElement != 0);
  +
  +						const int	xslToken = theElement->getXSLToken();
  +
  +						if (xslToken == Constants::ELEMNAME_FOREACH)
  +						{
  +							error("xsl:apply-imports is not allowed at this position in the stylesheet", locator);
  +						}
  +
  +						elem = new ElemApplyImport(m_constructionContext,
  +												 m_stylesheet,
  +												 atts, lineNumber, columnNumber);
  +					}
   					break;
             
   				case Constants::ELEMNAME_VALUEOF:
  
  
  

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