You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@xalan.apache.org by jd...@locus.apache.org on 2000/04/12 21:41:12 UTC

cvs commit: xml-xalan/c/src/XercesParserLiaison XercesParserLiaison.hpp

jdonohue    00/04/12 12:41:12

  Modified:    c/src/PlatformSupport NumberFormat.cpp
               c/src/TestXSLT process.cpp
               c/src/XMLSupport FormatterToHTML.cpp FormatterToHTML.hpp
                        FormatterToXML.cpp FormatterToXML.hpp
               c/src/XPath FunctionContains.hpp FunctionString.hpp
                        XPath.cpp
               c/src/XSLT Constants.cpp Constants.hpp
                        ElemApplyTemplates.cpp ElemCallTemplate.cpp
                        ElemCallTemplate.hpp ElemForEach.cpp ElemIf.cpp
                        ElemLiteralResult.cpp ElemLiteralResult.hpp
                        ElemNumber.cpp ElemTemplate.cpp
                        ElemTemplateElement.cpp ElemTemplateElement.hpp
                        ElemValueOf.cpp ElemVariable.cpp ElemWhen.cpp
                        FunctionDocument.cpp FunctionKey.cpp
                        FunctionKey.hpp NumeratorFormatter.cpp
                        Stylesheet.hpp StylesheetExecutionContext.hpp
                        StylesheetExecutionContextDefault.cpp
                        StylesheetExecutionContextDefault.hpp
                        StylesheetHandler.cpp StylesheetHandler.hpp
                        StylesheetRoot.cpp XSLTEngineImpl.cpp
                        XSLTEngineImpl.hpp
               c/src/XercesParserLiaison XercesParserLiaison.hpp
  Log:
  no message
  
  Revision  Changes    Path
  1.4       +5 -12     xml-xalan/c/src/PlatformSupport/NumberFormat.cpp
  
  Index: NumberFormat.cpp
  ===================================================================
  RCS file: /home/cvs/xml-xalan/c/src/PlatformSupport/NumberFormat.cpp,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- NumberFormat.cpp	2000/04/11 14:35:30	1.3
  +++ NumberFormat.cpp	2000/04/12 19:40:45	1.4
  @@ -117,18 +117,11 @@
    * and separator; returns the converted string
    */
   {
  -	if (!m_isGroupingUsed)
  -	{
  -		return value;
  -	}
  -
  -	const unsigned int	len = length(value);
  -
  -	if (len == 0)
  -	{
  -		return value;
  -	}
  -
  +	if (!m_isGroupingUsed) return value;
  +	if (m_groupingSize == 0) return value;
  +	int len = value.length();
  +	if (len == 0) return value;
  +	
   	const unsigned int	bufsize = len + len/m_groupingSize + 1;
   
   	XalanDOMChar* const		buffer = new XalanDOMChar[bufsize];
  
  
  
  1.12      +8 -1      xml-xalan/c/src/TestXSLT/process.cpp
  
  Index: process.cpp
  ===================================================================
  RCS file: /home/cvs/xml-xalan/c/src/TestXSLT/process.cpp,v
  retrieving revision 1.11
  retrieving revision 1.12
  diff -u -r1.11 -r1.12
  --- process.cpp	2000/04/11 21:38:43	1.11
  +++ process.cpp	2000/04/12 19:40:46	1.12
  @@ -541,7 +541,8 @@
   		xslFileName = params.xslFileName.c_str();
   	}
   
  -	stylesheet = processor.processStylesheet(xslFileName, theConstructionContext);
  +	if (! isEmpty(xslFileName))
  +		stylesheet = processor.processStylesheet(xslFileName, theConstructionContext);
   
   	const XalanDOMString	mimeEncoding(XALAN_STATIC_UCODE_STRING("UTF-8"));
   	const XalanDOMString	encoding(XALAN_STATIC_UCODE_STRING("UTF-8"));
  @@ -764,6 +765,10 @@
   
   			theResult = -1;
   		}
  +		catch (...)
  +		{
  +			cout << "\nUnhandled Exception\n";
  +		}
   
   #if !defined(NDEBUG)
   		const unsigned long		theInstanceCount =
  @@ -806,11 +811,13 @@
   					 << endl;
   			}
   
  +#if defined(INTERACTIVE)
   			cout << "Hit <Enter> to continue..."
   				 << endl
   				 << endl;
   
   			cin.get();
  +#endif
   		}
   #endif
   
  
  
  
  1.11      +75 -32    xml-xalan/c/src/XMLSupport/FormatterToHTML.cpp
  
  Index: FormatterToHTML.cpp
  ===================================================================
  RCS file: /home/cvs/xml-xalan/c/src/XMLSupport/FormatterToHTML.cpp,v
  retrieving revision 1.10
  retrieving revision 1.11
  diff -u -r1.10 -r1.11
  --- FormatterToHTML.cpp	2000/04/11 14:43:00	1.10
  +++ FormatterToHTML.cpp	2000/04/12 19:40:49	1.11
  @@ -55,7 +55,7 @@
    * <http://www.apache.org/>.
    */
   /**
  - * $Id: FormatterToHTML.cpp,v 1.10 2000/04/11 14:43:00 dbertoni Exp $
  + * $Id: FormatterToHTML.cpp,v 1.11 2000/04/12 19:40:49 jdonohue Exp $
    * 
    * $State: Exp $
    * 
  @@ -105,27 +105,21 @@
   
   
   FormatterToHTML::FormatterToHTML(
  -			Writer&					writer,
  -			const XalanDOMString&	version,
  -			bool					doIndent,
  -			int						indent,
  -			const XalanDOMString&	encoding,
  -			const XalanDOMString&	mediaType,
  -			const XalanDOMString&	doctypeSystem,
  -			const XalanDOMString&	doctypePublic,
  -			bool					xmlDecl,
  -			const XalanDOMString&	standalone) :
  -	FormatterToXML(writer,
  -				   version,
  -				   doIndent,
  -				   indent,
  -				   encoding,
  -				   mediaType,
  -				   doctypeSystem,
  -				   doctypePublic,
  -				   xmlDecl,
  -				   standalone),
  -	m_currentElementName()
  +	  Writer&				writer,
  +	  const XalanDOMString& version,
  +	  bool doIndent, 
  +	  int indent,
  +	  const XalanDOMString& encoding, 
  +	  const XalanDOMString& mediaType,
  +	  const XalanDOMString& doctypeSystem,
  +	  const XalanDOMString& doctypePublic,
  +	  bool xmlDecl,
  +	  const XalanDOMString& standalone) :
  +	FormatterToXML( writer, version, doIndent, indent,
  +	  encoding, mediaType, doctypeSystem, doctypePublic,
  +	  xmlDecl, standalone),
  +	m_currentElementName(),
  +	m_inBlockElem(false)
   {
   }
   
  @@ -176,7 +170,7 @@
   {
   	try
   	{
  -		m_writer.write("\n");
  +		m_writer.write(m_lineSep);
   	}
   	catch(...)
   	{
  @@ -193,6 +187,7 @@
   			const	XMLCh* const	name,
   			AttributeList&			attrs)
   {
  +	// @@ JMD: this block is not in the java version any more ...
   	XalanDOMString theName(name);
   	if(true == m_needToOutputDocTypeDecl)
   	{
  @@ -228,28 +223,39 @@
   		}
   	}
   	m_needToOutputDocTypeDecl = false;
  +
   	bool savedDoIndent = m_doIndent;
   
  +	XalanDOMString nameUpper = toUpperCase(theName);
  +
   	// If the previous element is a non-block element or the next 
   	// element is a non-block element, then do not indent.
  -	m_doIndent =
  -	((s_nonblockelems.end() != s_nonblockelems.find(toUpperCase(theName))) ||
  +	bool isBlockElement = 
  +	((s_nonblockelems.end() != s_nonblockelems.find(nameUpper)) ||
   	((! isEmpty(m_currentElementName) &&
   		(s_nonblockelems.end() !=
  -		 s_nonblockelems.find(toUpperCase(m_currentElementName))))))
  +		 s_nonblockelems.find(m_currentElementName)))))
   			? false : true;
   
  -	m_currentElementName = name;
   	try
   	{      
   		writeParentTagEnd();
  -		m_ispreserve = false;
   
  -		if (shouldIndent() && !m_elemStack.empty()) 
  +		if (m_ispreserve)
  +			m_ispreserve = false;
  +		else if(m_doIndent
  +					&& (!isEmpty(m_currentElementName))
  +					&& (!m_inBlockElem || isBlockElement))
   		{
   			m_startNewLine = true;
   			indent(m_writer, m_currentIndent);
   		}
  +		m_inBlockElem = !isBlockElement;
  +		
  +		// @@@ JMD: need to provide equivalent functionality here ...
  +		// m_isRawStack.push(elemDesc.is(ElemDesc.RAW));
  +			 
  +		m_currentElementName = nameUpper;
   
   		m_writer.write('<');
   		m_writer.write(name);
  @@ -265,7 +271,6 @@
   		m_currentIndent += m_indent;
   		m_isprevtext = false;
   	}
  -	// java: catch(IOException ioe)
   	catch(...)
   	{
   		throw SAXException("IO error");
  @@ -285,9 +290,29 @@
   		// name = name.toUpperCase();
   		const bool	hasChildNodes = childNodesWereAdded();
   
  +// @@ JMD: need to provide this ...		
  +//		m_isRawStack.pop();
  +
  +	// @@ JMD: check that this doesn't change name ...
  +		XalanDOMString nameUpper = toUpperCase(name);
  +		bool isBlockElement = s_nonblockelems.end() == s_nonblockelems.find(nameUpper);
  +
  +		bool shouldIndent = false;
  +		if(m_ispreserve)
  +		{
  +			m_ispreserve = false;
  +		}
  +		else if(m_doIndent && (!m_inBlockElem || isBlockElement))
  +		{
  +			m_startNewLine = true;
  +			shouldIndent = true;
  +		}
  +
  +		m_inBlockElem = !isBlockElement;
  +
   		if (hasChildNodes == true) 
   		{
  -			if (shouldIndent() == true)
  +			if (shouldIndent == true)
   				indent(m_writer, m_currentIndent);
   			m_writer.write("</");
   			m_writer.write(name);
  @@ -297,7 +322,10 @@
   		{
   			if(s_empties.find(toUpperCase(name)) == s_empties.end())
   			{
  -				m_writer.write("></");
  +				m_writer.write(">");
  +				if (shouldIndent)
  +					indent(m_writer, m_currentIndent);
  +				m_writer.write("</");
   				m_writer.write(name);
   				m_writer.write(">");
   			}
  @@ -306,6 +334,12 @@
   				m_writer.write(">");
   			}
   		}
  +/*
  +		@@@ JMD: need to provide equivalent functionality here ...
  +		if (elemDesc.is(ElemDesc.WHITESPACESENSITIVE))
  +			m_ispreserve = true;
  +*/
  +
   		if (hasChildNodes == true) 
   		{
   			m_ispreserve = m_preserves.top();
  @@ -515,6 +549,14 @@
   	}
   }
   
  +void FormatterToHTML::processingInstruction(
  +		const XMLCh* const	target,
  +		const XMLCh* const	data)
  +
  +{
  +	FormatterToXML::processingInstruction( target, data, true);
  +}
  +
   
   void
   FormatterToHTML::processAttribute(
  @@ -681,6 +723,7 @@
   	theElems.insert(XALAN_STATIC_UCODE_STRING("IMG"));
   	theElems.insert(XALAN_STATIC_UCODE_STRING("B"));
   	theElems.insert(XALAN_STATIC_UCODE_STRING("I"));
  +	theElems.insert(XALAN_STATIC_UCODE_STRING("Q"));
   	return theElems;
   }
   
  
  
  
  1.6       +9 -2      xml-xalan/c/src/XMLSupport/FormatterToHTML.hpp
  
  Index: FormatterToHTML.hpp
  ===================================================================
  RCS file: /home/cvs/xml-xalan/c/src/XMLSupport/FormatterToHTML.hpp,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- FormatterToHTML.hpp	2000/04/11 14:43:01	1.5
  +++ FormatterToHTML.hpp	2000/04/12 19:40:49	1.6
  @@ -58,7 +58,7 @@
   #define FORMATTERTOHTML_HEADER_GUARD_1357924680
   
   /**
  - * $Id: FormatterToHTML.hpp,v 1.5 2000/04/11 14:43:01 dbertoni Exp $
  + * $Id: FormatterToHTML.hpp,v 1.6 2000/04/12 19:40:49 jdonohue Exp $
    * 
    * $State: Exp $
    * 
  @@ -81,6 +81,7 @@
   // Base class header file.
   #include <XMLSupport/FormatterToXML.hpp>
   
  +#include <XPath/QName.hpp>
   
   
   /**
  @@ -160,6 +161,11 @@
   			const XMLCh* const	ch,
   			const unsigned int 	length);
   
  +	virtual void
  +	processingInstruction(
  +			const XMLCh* const	target,
  +			const XMLCh* const	data);
  +
   
   	// These methods are new ...
   
  @@ -265,7 +271,8 @@
   	static const AttributesMapType			s_attruris;
   	static const StringSetType				s_escapetb;
   
  -	XalanDOMString							m_currentElementName;
  +	XalanDOMString								m_currentElementName;
  +	bool m_inBlockElem;
   
   };
   
  
  
  
  1.14      +20 -6     xml-xalan/c/src/XMLSupport/FormatterToXML.cpp
  
  Index: FormatterToXML.cpp
  ===================================================================
  RCS file: /home/cvs/xml-xalan/c/src/XMLSupport/FormatterToXML.cpp,v
  retrieving revision 1.13
  retrieving revision 1.14
  diff -u -r1.13 -r1.14
  --- FormatterToXML.cpp	2000/04/11 14:43:01	1.13
  +++ FormatterToXML.cpp	2000/04/12 19:40:49	1.14
  @@ -267,11 +267,11 @@
   		m_needToOutputDocTypeDecl = false;
   		writeParentTagEnd();
   		m_ispreserve = false;
  -		if (shouldIndent() && !m_elemStack.empty()) 
  +		if (shouldIndent() && m_startNewLine) 
   		{
  -			m_startNewLine = true;
   			indent(m_writer, m_currentIndent);
   		}
  +		m_startNewLine = true;
   
   		m_writer.write('<');
   		m_writer.write(name);
  @@ -602,13 +602,20 @@
   	characters(chars, length);
   }
   
  -
  -
   void
   FormatterToXML::processingInstruction(
   			const XMLCh* const	target,
   			const XMLCh* const	data)
   {
  +	processingInstruction( target, data, false);
  +}			
  +
  +void
  +FormatterToXML::processingInstruction(
  +			const XMLCh* const	target,
  +			const XMLCh* const	data,
  +			bool isHTML)
  +{
   // @@ Need to add this --
   //    if(m_inEntityRef)
   //      return;
  @@ -640,7 +647,10 @@
   			}
   
   			m_writer.write(data);
  -			m_writer.write(XALAN_STATIC_UCODE_STRING("?>"));
  +			if (isHTML)
  +				m_writer.write(XALAN_STATIC_UCODE_STRING(">"));
  +			else
  +				m_writer.write(XALAN_STATIC_UCODE_STRING("?>"));
   
   			m_startNewLine = true;
   		}
  @@ -749,6 +759,7 @@
   			if(false == m_elemStack.top())
   			{
   				m_writer.write(XALAN_STATIC_UCODE_STRING(">"));
  +				m_isprevtext = false;
   
   				m_elemStack.pop();
   				m_elemStack.push(true);
  @@ -841,7 +852,10 @@
   		{
   			vec.push_back('&');
   			vec.push_back('#');
  -			vec.push_back(ch);
  +			DOMString ds = LongToDOMString(ch);
  +			const XMLCh* pb = c_wstr(ds);
  +			for(int k = 0; k < ds.length(); k++)
  +				vec.push_back(*pb++);
   			vec.push_back(';');
   		}
   		else if (0xd800 <= chNum && chNum < 0xdc00) 
  
  
  
  1.8       +11 -0     xml-xalan/c/src/XMLSupport/FormatterToXML.hpp
  
  Index: FormatterToXML.hpp
  ===================================================================
  RCS file: /home/cvs/xml-xalan/c/src/XMLSupport/FormatterToXML.hpp,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- FormatterToXML.hpp	2000/04/11 14:43:01	1.7
  +++ FormatterToXML.hpp	2000/04/12 19:40:50	1.8
  @@ -374,6 +374,10 @@
     
   	bool			m_ispreserve;
   	BoolStackType	m_preserves;
  +	/**
  +	 * State flag that tells if the previous node processed 
  +	 * was text, so we can tell if we should preserve whitespace.
  +	 */
   	bool			m_isprevtext;
   	bool			m_doIndent;
   	int				m_currentIndent;
  @@ -381,6 +385,7 @@
   	XalanDOMString	m_doctypeSystem;
   	XalanDOMString	m_doctypePublic;
   	bool			m_startNewLine;
  +
     /**
      * Assume java encoding names are the same as the ISO encoding names if this is true.
      */
  @@ -412,6 +417,12 @@
   			int&					pos,			// Index in m_charBuf
   			int						length		// Length of 'chars' string
   		);
  +
  +	void FormatterToXML::processingInstruction(
  +			const XMLCh* const	target,
  +			const XMLCh* const	data,
  +			bool isHTML);
  +
   	
   private:
   
  
  
  
  1.5       +7 -2      xml-xalan/c/src/XPath/FunctionContains.hpp
  
  Index: FunctionContains.hpp
  ===================================================================
  RCS file: /home/cvs/xml-xalan/c/src/XPath/FunctionContains.hpp,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- FunctionContains.hpp	2000/04/11 14:46:04	1.4
  +++ FunctionContains.hpp	2000/04/12 19:40:53	1.5
  @@ -112,9 +112,14 @@
   		const XalanDOMString	arg1 = args[0]->str();
   		const XalanDOMString	arg2 = args[1]->str();
   
  -		const unsigned int		theIndex = indexOf(arg1, arg2);
  +		// This is rather a moot point but conformance test str62 indicates the
  +		// answer should be true
  +		if (isEmpty(arg1) && isEmpty(arg2))
  +			return executionContext.getXObjectFactory().createBoolean(true);
   
  -		return executionContext.getXObjectFactory().createBoolean(theIndex < length(arg1) ? true : false);
  +		const int			theIndex = indexOf(arg1, arg2);
  +
  +		return executionContext.getXObjectFactory().createBoolean(theIndex >= 0 ? true : false);
   	}
   
   #if defined(XALAN_NO_COVARIANT_RETURN_TYPE)
  
  
  
  1.5       +4 -2      xml-xalan/c/src/XPath/FunctionString.hpp
  
  Index: FunctionString.hpp
  ===================================================================
  RCS file: /home/cvs/xml-xalan/c/src/XPath/FunctionString.hpp,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- FunctionString.hpp	2000/04/11 14:46:08	1.4
  +++ FunctionString.hpp	2000/04/12 19:40:53	1.5
  @@ -103,11 +103,13 @@
   			int								/* opPos */,
   			const XObjectArgVectorType&		args)
   	{
  -		if(args.size() != 1)
  +		if(args.size() > 1)
   		{
  -			executionContext.error("The string() function takes one argument!",
  +			executionContext.error("The string() function takes zero or one argument!",
   								   context);
   		}
  +		if(args.size() == 0)
  +			return executionContext.getXObjectFactory().createNodeSet(*context);
   
   		return executionContext.getXObjectFactory().createString(args[0]->str());
   	}
  
  
  
  1.9       +2 -1      xml-xalan/c/src/XPath/XPath.cpp
  
  Index: XPath.cpp
  ===================================================================
  RCS file: /home/cvs/xml-xalan/c/src/XPath/XPath.cpp,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- XPath.cpp	2000/04/11 14:46:16	1.8
  +++ XPath.cpp	2000/04/12 19:40:53	1.9
  @@ -1475,7 +1475,8 @@
   {
   	assert(m_expression.getToken(funcID) != 0);
   
  -	const XalanDOMString	theFunctionName(m_expression.getToken(funcID)->str());
  +	const XalanDOMString		theFunctionName(m_expression.getToken(funcID)->str());
  +	assert(theFunctionName != 0);
   	assert(!isEmpty(theFunctionName));
   
   	return s_functions[theFunctionName].execute(executionContext, context, opPos, argVec);
  
  
  
  1.4       +116 -126  xml-xalan/c/src/XSLT/Constants.cpp
  
  Index: Constants.cpp
  ===================================================================
  RCS file: /home/cvs/xml-xalan/c/src/XSLT/Constants.cpp,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- Constants.cpp	2000/04/11 15:09:21	1.3
  +++ Constants.cpp	2000/04/12 19:40:55	1.4
  @@ -62,98 +62,30 @@
   #include <PlatformSupport/DOMStringHelper.hpp>
   
   
  -
  -const XalanDOMString		Constants::ELEMNAME_ANCHOR_STRING(XALAN_STATIC_UCODE_STRING("anchor"));
  -const XalanDOMString		Constants::ELEMNAME_ANY_STRING(XALAN_STATIC_UCODE_STRING("any"));
  -const XalanDOMString		Constants::ELEMNAME_APPLY_IMPORTS_STRING(XALAN_STATIC_UCODE_STRING("apply-imports"));
  -const XalanDOMString		Constants::ELEMNAME_APPLY_TEMPLATES_STRING(XALAN_STATIC_UCODE_STRING("apply-templates"));
  -const XalanDOMString		Constants::ELEMNAME_ARG_STRING(XALAN_STATIC_UCODE_STRING("arg"));
  -const XalanDOMString		Constants::ELEMNAME_ATTRIBUTESET_STRING(XALAN_STATIC_UCODE_STRING("attribute-set"));
  -const XalanDOMString		Constants::ELEMNAME_ATTRIBUTE_STRING(XALAN_STATIC_UCODE_STRING("attribute"));
  -const XalanDOMString		Constants::ELEMNAME_CALLTEMPLATEARG_STRING(XALAN_STATIC_UCODE_STRING("invoke-arg"));
  -const XalanDOMString		Constants::ELEMNAME_CALLTEMPLATE_STRING(XALAN_STATIC_UCODE_STRING("call-template"));
  -const XalanDOMString		Constants::ELEMNAME_CALL_STRING(XALAN_STATIC_UCODE_STRING("call"));
  -const XalanDOMString		Constants::ELEMNAME_CHILDREN_STRING(XALAN_STATIC_UCODE_STRING("children"));
  -const XalanDOMString		Constants::ELEMNAME_CHOOSE_STRING(XALAN_STATIC_UCODE_STRING("choose"));
  -const XalanDOMString		Constants::ELEMNAME_COMMENT_STRING(XALAN_STATIC_UCODE_STRING("comment"));
  -const XalanDOMString		Constants::ELEMNAME_CONSTRUCT_STRING(XALAN_STATIC_UCODE_STRING("construct"));
  -const XalanDOMString		Constants::ELEMNAME_CONTENTS_STRING(XALAN_STATIC_UCODE_STRING("contents"));
  -const XalanDOMString		Constants::ELEMNAME_COPY_OF_STRING(XALAN_STATIC_UCODE_STRING("copy-of"));
  -const XalanDOMString		Constants::ELEMNAME_COPY_STRING(XALAN_STATIC_UCODE_STRING("copy"));
  -const XalanDOMString		Constants::ELEMNAME_COUNTERINCREMENT_STRING(XALAN_STATIC_UCODE_STRING("counter-increment"));
  -const XalanDOMString		Constants::ELEMNAME_COUNTERRESET_STRING(XALAN_STATIC_UCODE_STRING("counter-reset"));
  -const XalanDOMString		Constants::ELEMNAME_COUNTERSCOPE_STRING(XALAN_STATIC_UCODE_STRING("counter-scope"));
  -const XalanDOMString		Constants::ELEMNAME_COUNTERS_STRING(XALAN_STATIC_UCODE_STRING("counters"));
  -const XalanDOMString		Constants::ELEMNAME_COUNTER_STRING(XALAN_STATIC_UCODE_STRING("counter"));
  -const XalanDOMString		Constants::ELEMNAME_DECIMALFORMAT_STRING(XALAN_STATIC_UCODE_STRING("decimal-format"));
  -const XalanDOMString		Constants::ELEMNAME_DISPLAYIF_STRING(XALAN_STATIC_UCODE_STRING("display-if"));
  -const XalanDOMString		Constants::ELEMNAME_ELEMENT_STRING(XALAN_STATIC_UCODE_STRING("element"));
  -const XalanDOMString		Constants::ELEMNAME_EMPTY_STRING(XALAN_STATIC_UCODE_STRING("empty"));
  -const XalanDOMString		Constants::ELEMNAME_EVAL_STRING(XALAN_STATIC_UCODE_STRING("eval"));
  -const XalanDOMString		Constants::ELEMNAME_EXPECTEDCHILDREN_STRING(XALAN_STATIC_UCODE_STRING("expectedchildren"));
  -const XalanDOMString		Constants::ELEMNAME_EXTENSIONHANDLER_STRING(XALAN_STATIC_UCODE_STRING("code-dispatcher"));
  -const XalanDOMString		Constants::ELEMNAME_EXTENSION_STRING(XALAN_STATIC_UCODE_STRING("functions"));
  -const XalanDOMString		Constants::ELEMNAME_FALLBACK_STRING(XALAN_STATIC_UCODE_STRING("fallback"));
  -const XalanDOMString		Constants::ELEMNAME_FOREACH_STRING(XALAN_STATIC_UCODE_STRING("for-each"));
  -const XalanDOMString		Constants::ELEMNAME_IF_STRING(XALAN_STATIC_UCODE_STRING("if"));
  -const XalanDOMString		Constants::ELEMNAME_IMPORT_STRING(XALAN_STATIC_UCODE_STRING("import"));
  -const XalanDOMString		Constants::ELEMNAME_INCLUDE_STRING(XALAN_STATIC_UCODE_STRING("include"));
  -const XalanDOMString		Constants::ELEMNAME_KEY_STRING(XALAN_STATIC_UCODE_STRING("key"));
  -const XalanDOMString		Constants::ELEMNAME_LOCALE_STRING(XALAN_STATIC_UCODE_STRING("locale"));
  -const XalanDOMString		Constants::ELEMNAME_MESSAGE_STRING(XALAN_STATIC_UCODE_STRING("message"));
  -const XalanDOMString		Constants::ELEMNAME_NSALIAS_STRING(XALAN_STATIC_UCODE_STRING("namespace-alias"));
  -
  -const XalanDOMString		Constants::ELEMNAME_NUMBER_STRING(XALAN_STATIC_UCODE_STRING("number"));
  -const XalanDOMString		Constants::ELEMNAME_OTHERWISE_STRING(XALAN_STATIC_UCODE_STRING("otherwise"));
  -const XalanDOMString		Constants::ELEMNAME_PARAM_STRING(XALAN_STATIC_UCODE_STRING("param"));
  -const XalanDOMString		Constants::ELEMNAME_PRESERVESPACE_STRING(XALAN_STATIC_UCODE_STRING("preserve-space"));
  -const XalanDOMString		Constants::ELEMNAME_ROOT_STRING(XALAN_STATIC_UCODE_STRING("root"));
  -const XalanDOMString		Constants::ELEMNAME_SORT_STRING(XALAN_STATIC_UCODE_STRING("sort"));
  -const XalanDOMString		Constants::ELEMNAME_STRIPSPACE_STRING(XALAN_STATIC_UCODE_STRING("strip-space"));
  -const XalanDOMString		Constants::ELEMNAME_STYLESHEET_STRING(XALAN_STATIC_UCODE_STRING("stylesheet"));
  -const XalanDOMString		Constants::ELEMNAME_TARGETATTRIBUTE_STRING(XALAN_STATIC_UCODE_STRING("target-attribute"));
  -const XalanDOMString		Constants::ELEMNAME_TARGETCOMMENT_STRING(XALAN_STATIC_UCODE_STRING("target-comment"));
  -const XalanDOMString		Constants::ELEMNAME_TARGETELEMENT_STRING(XALAN_STATIC_UCODE_STRING("target-element"));
  -const XalanDOMString		Constants::ELEMNAME_TARGETPI_STRING(XALAN_STATIC_UCODE_STRING("target-pi"));
  -const XalanDOMString		Constants::ELEMNAME_TARGETTEXT_STRING(XALAN_STATIC_UCODE_STRING("target-text"));
  -const XalanDOMString		Constants::ELEMNAME_TEMPLATE_STRING(XALAN_STATIC_UCODE_STRING("template"));
  -const XalanDOMString		Constants::ELEMNAME_TEXT_STRING(XALAN_STATIC_UCODE_STRING("text"));
  -const XalanDOMString		Constants::ELEMNAME_TRANSFORM_STRING(XALAN_STATIC_UCODE_STRING("transform"));
  -const XalanDOMString		Constants::ELEMNAME_URL_STRING(XALAN_STATIC_UCODE_STRING("uri"));
  -const XalanDOMString		Constants::ELEMNAME_USE_STRING(XALAN_STATIC_UCODE_STRING("use"));
  -const XalanDOMString		Constants::ELEMNAME_VALUEOF_STRING(XALAN_STATIC_UCODE_STRING("value-of"));
  -const XalanDOMString		Constants::ELEMNAME_VARIABLE_STRING(XALAN_STATIC_UCODE_STRING("variable"));
  -const XalanDOMString		Constants::ELEMNAME_WHEN_STRING(XALAN_STATIC_UCODE_STRING("when"));
  -const XalanDOMString		Constants::ELEMNAME_COMPONENT_STRING(XALAN_STATIC_UCODE_STRING("component"));
  -const XalanDOMString		Constants::ELEMNAME_CSSSTYLECONVERSION_STRING(XALAN_STATIC_UCODE_STRING("css-style-conversion"));
  -const XalanDOMString		Constants::ELEMNAME_OUTPUT_STRING(XALAN_STATIC_UCODE_STRING("output"));
  -const XalanDOMString		Constants::ELEMNAME_PARAMVARIABLE_OLD_STRING(XALAN_STATIC_UCODE_STRING("param-variable"));
  -const XalanDOMString		Constants::ELEMNAME_PARAMVARIABLE_STRING(XALAN_STATIC_UCODE_STRING("param"));
  -const XalanDOMString		Constants::ELEMNAME_PI_OLD_STRING(XALAN_STATIC_UCODE_STRING("pi"));
  -const XalanDOMString		Constants::ELEMNAME_PI_STRING(XALAN_STATIC_UCODE_STRING("processing-instruction"));
  -const XalanDOMString		Constants::ELEMNAME_SCRIPT_STRING(XALAN_STATIC_UCODE_STRING("script"));
  -const XalanDOMString		Constants::ELEMNAME_WITHPARAM_STRING(XALAN_STATIC_UCODE_STRING("with-param"));
  -
  -
  -
  -const XalanDOMString		Constants::ATTRNAME_CLASS(XALAN_STATIC_UCODE_STRING("class"));
  -const XalanDOMString		Constants::ATTRNAME_ATTRIBUTE(XALAN_STATIC_UCODE_STRING("attribute"));
  -const XalanDOMString		Constants::ATTRNAME_ATTRIBUTE_SET(XALAN_STATIC_UCODE_STRING("attribute-set"));
   const XalanDOMString		Constants::ATTRNAME_AMOUNT(XALAN_STATIC_UCODE_STRING("amount"));
   const XalanDOMString		Constants::ATTRNAME_ANCESTOR(XALAN_STATIC_UCODE_STRING("ancestor"));
  +const XalanDOMString		Constants::ATTRNAME_ARCHIVE(XALAN_STATIC_UCODE_STRING("archive"));
  +const XalanDOMString		Constants::ATTRNAME_ATTRIBUTE(XALAN_STATIC_UCODE_STRING("attribute"));
  +const XalanDOMString		Constants::ATTRNAME_ATTRIBUTE_SET(XALAN_STATIC_UCODE_STRING("attribute-set"));
   const XalanDOMString		Constants::ATTRNAME_CASEORDER(XALAN_STATIC_UCODE_STRING("case-order"));
  +const XalanDOMString		Constants::ATTRNAME_CLASS(XALAN_STATIC_UCODE_STRING("class"));
  +const XalanDOMString		Constants::ATTRNAME_CLASSID(XALAN_STATIC_UCODE_STRING("classid"));
  +const XalanDOMString		Constants::ATTRNAME_CODEBASE(XALAN_STATIC_UCODE_STRING("codebase"));
  +const XalanDOMString		Constants::ATTRNAME_CODETYPE(XALAN_STATIC_UCODE_STRING("type"));
   const XalanDOMString		Constants::ATTRNAME_CONDITION(XALAN_STATIC_UCODE_STRING("condition"));
   const XalanDOMString		Constants::ATTRNAME_COPYTYPE(XALAN_STATIC_UCODE_STRING("copy-type"));
   const XalanDOMString		Constants::ATTRNAME_COUNT(XALAN_STATIC_UCODE_STRING("count"));
   const XalanDOMString		Constants::ATTRNAME_DATATYPE(XALAN_STATIC_UCODE_STRING("data-type"));
   const XalanDOMString		Constants::ATTRNAME_DECIMALSEPARATOR(XALAN_STATIC_UCODE_STRING("decimal-separator"));
  -const XalanDOMString		Constants::ATTRNAME_DEFAULTSPACE(XALAN_STATIC_UCODE_STRING("default-space"));
   const XalanDOMString		Constants::ATTRNAME_DEFAULT(XALAN_STATIC_UCODE_STRING("default"));
  +const XalanDOMString		Constants::ATTRNAME_DEFAULTSPACE(XALAN_STATIC_UCODE_STRING("default-space"));
   const XalanDOMString		Constants::ATTRNAME_DEPTH(XALAN_STATIC_UCODE_STRING("with-children"));
   const XalanDOMString		Constants::ATTRNAME_DIGIT(XALAN_STATIC_UCODE_STRING("digit"));
   const XalanDOMString		Constants::ATTRNAME_DIGITGROUPSEP(XALAN_STATIC_UCODE_STRING("digit-group-sep"));
  +const XalanDOMString		Constants::ATTRNAME_DISABLE_OUTPUT_ESCAPING (XALAN_STATIC_UCODE_STRING("disable-output-escaping"));
   const XalanDOMString		Constants::ATTRNAME_ELEMENT(XALAN_STATIC_UCODE_STRING("element"));
   const XalanDOMString		Constants::ATTRNAME_ELEMENTS(XALAN_STATIC_UCODE_STRING("elements"));
  +const XalanDOMString		Constants::ATTRNAME_EXCLUDE_RESULT_PREFIXES(XALAN_STATIC_UCODE_STRING("exclude-result-prefixes"));
   const XalanDOMString		Constants::ATTRNAME_EXPR(XALAN_STATIC_UCODE_STRING("expr"));
   const XalanDOMString		Constants::ATTRNAME_EXTENSIONELEMENTPREFIXES(XALAN_STATIC_UCODE_STRING("extension-element-prefixes"));
   const XalanDOMString		Constants::ATTRNAME_FORMAT(XALAN_STATIC_UCODE_STRING("format"));
  @@ -165,19 +97,30 @@
   const XalanDOMString		Constants::ATTRNAME_IMPORTANCE(XALAN_STATIC_UCODE_STRING("importance"));
   const XalanDOMString		Constants::ATTRNAME_INDENTRESULT(XALAN_STATIC_UCODE_STRING("indent-result"));
   const XalanDOMString		Constants::ATTRNAME_INFINITY(XALAN_STATIC_UCODE_STRING("infinity"));
  +const XalanDOMString		Constants::ATTRNAME_LANG(XALAN_STATIC_UCODE_STRING("lang"));
   const XalanDOMString		Constants::ATTRNAME_LETTERVALUE(XALAN_STATIC_UCODE_STRING("letter-value"));
   const XalanDOMString		Constants::ATTRNAME_LEVEL(XALAN_STATIC_UCODE_STRING("level"));
  -const XalanDOMString		Constants::ATTRNAME_LANG(XALAN_STATIC_UCODE_STRING("lang"));
  -//const XalanDOMString	Constants::ATTRNAME_MACRO(XALAN_STATIC_UCODE_STRING("macro"));
   const XalanDOMString		Constants::ATTRNAME_MATCH(XALAN_STATIC_UCODE_STRING("match"));
  +const XalanDOMString		Constants::ATTRNAME_METHOD(XALAN_STATIC_UCODE_STRING("calls"));
   const XalanDOMString		Constants::ATTRNAME_MINUSSIGN(XALAN_STATIC_UCODE_STRING("minus-sign"));
   const XalanDOMString		Constants::ATTRNAME_MODE(XALAN_STATIC_UCODE_STRING("mode"));
   const XalanDOMString		Constants::ATTRNAME_NAME(XALAN_STATIC_UCODE_STRING("name"));
   const XalanDOMString		Constants::ATTRNAME_NAMESPACE(XALAN_STATIC_UCODE_STRING("namespace"));
   const XalanDOMString		Constants::ATTRNAME_NAN(XALAN_STATIC_UCODE_STRING("NaN"));
   const XalanDOMString		Constants::ATTRNAME_NDIGITSPERGROUP(XALAN_STATIC_UCODE_STRING("n-digits-per-group"));
  +const XalanDOMString		Constants::ATTRNAME_NS(XALAN_STATIC_UCODE_STRING("ns"));
   const XalanDOMString		Constants::ATTRNAME_ONLY(XALAN_STATIC_UCODE_STRING("only"));
   const XalanDOMString		Constants::ATTRNAME_ORDER(XALAN_STATIC_UCODE_STRING("order"));
  +const XalanDOMString		Constants::ATTRNAME_OUTPUT_CDATA_SECTION_ELEMENTS (XALAN_STATIC_UCODE_STRING("cdata-section-elements"));
  +const XalanDOMString		Constants::ATTRNAME_OUTPUT_DOCTYPE_PUBLIC(XALAN_STATIC_UCODE_STRING("doctype-public"));
  +const XalanDOMString		Constants::ATTRNAME_OUTPUT_DOCTYPE_SYSTEM(XALAN_STATIC_UCODE_STRING("doctype-system"));
  +const XalanDOMString		Constants::ATTRNAME_OUTPUT_ENCODING(XALAN_STATIC_UCODE_STRING("encoding"));
  +const XalanDOMString		Constants::ATTRNAME_OUTPUT_INDENT(XALAN_STATIC_UCODE_STRING("indent"));
  +const XalanDOMString		Constants::ATTRNAME_OUTPUT_MEDIATYPE(XALAN_STATIC_UCODE_STRING("media-type"));
  +const XalanDOMString		Constants::ATTRNAME_OUTPUT_METHOD(XALAN_STATIC_UCODE_STRING("method"));
  +const XalanDOMString		Constants::ATTRNAME_OUTPUT_OMITXMLDECL(XALAN_STATIC_UCODE_STRING("omit-xml-declaration"));
  +const XalanDOMString		Constants::ATTRNAME_OUTPUT_STANDALONE (XALAN_STATIC_UCODE_STRING("standalone"));
  +const XalanDOMString		Constants::ATTRNAME_OUTPUT_VERSION(XALAN_STATIC_UCODE_STRING("version"));
   const XalanDOMString		Constants::ATTRNAME_PATTERNSEPARATOR(XALAN_STATIC_UCODE_STRING("pattern-separator"));
   const XalanDOMString		Constants::ATTRNAME_PERCENT(XALAN_STATIC_UCODE_STRING("percent"));
   const XalanDOMString		Constants::ATTRNAME_PERMILLE(XALAN_STATIC_UCODE_STRING("per-mille"));
  @@ -195,61 +138,108 @@
   const XalanDOMString		Constants::ATTRNAME_USE(XALAN_STATIC_UCODE_STRING("use"));
   const XalanDOMString		Constants::ATTRNAME_USEATTRIBUTESETS(XALAN_STATIC_UCODE_STRING("use-attribute-sets"));
   const XalanDOMString		Constants::ATTRNAME_VALUE(XALAN_STATIC_UCODE_STRING("value"));
  -const XalanDOMString		Constants::ATTRNAME_XMLNSDEF(XALAN_STATIC_UCODE_STRING("xmlns"));
   const XalanDOMString		Constants::ATTRNAME_XMLNS(XALAN_STATIC_UCODE_STRING("xmlns:"));
  +const XalanDOMString		Constants::ATTRNAME_XMLNSDEF(XALAN_STATIC_UCODE_STRING("xmlns"));
   const XalanDOMString		Constants::ATTRNAME_XMLSPACE(XALAN_STATIC_UCODE_STRING("xml:space"));
  -const XalanDOMString		Constants::ATTRNAME_NS(XALAN_STATIC_UCODE_STRING("ns"));
  -const XalanDOMString		Constants::ATTRNAME_CLASSID(XALAN_STATIC_UCODE_STRING("classid"));
  -const XalanDOMString		Constants::ATTRNAME_ARCHIVE(XALAN_STATIC_UCODE_STRING("archive"));
  -const XalanDOMString		Constants::ATTRNAME_CODETYPE(XALAN_STATIC_UCODE_STRING("type"));
  -const XalanDOMString		Constants::ATTRNAME_CODEBASE(XALAN_STATIC_UCODE_STRING("codebase"));
  -const XalanDOMString		Constants::ATTRNAME_METHOD(XALAN_STATIC_UCODE_STRING("calls"));
  -const XalanDOMString		Constants::ATTRVAL_PRESERVE(XALAN_STATIC_UCODE_STRING("preserve"));
  -const XalanDOMString		Constants::ATTRVAL_STRIP(XALAN_STATIC_UCODE_STRING("strip"));
  -const XalanDOMString		Constants::ATTRVAL_YES(XALAN_STATIC_UCODE_STRING("yes"));
  -const XalanDOMString		Constants::ATTRVAL_NO(XALAN_STATIC_UCODE_STRING("no"));
  -const XalanDOMString		Constants::ATTRVAL_ALPHABETIC(XALAN_STATIC_UCODE_STRING("alphabetic"));
  -const XalanDOMString		Constants::ATTRVAL_OTHER(XALAN_STATIC_UCODE_STRING("other"));
  -const XalanDOMString		Constants::ATTRVAL_SINGLE(XALAN_STATIC_UCODE_STRING("single"));
  -const XalanDOMString		Constants::ATTRVAL_MULTI(XALAN_STATIC_UCODE_STRING("multiple"));
  -const XalanDOMString		Constants::ATTRVAL_ANY(XALAN_STATIC_UCODE_STRING("any"));
  -const XalanDOMString		Constants::ATTRNAME_OUTPUT_METHOD(XALAN_STATIC_UCODE_STRING("method"));
  -const XalanDOMString		Constants::ATTRNAME_DISABLE_OUTPUT_ESCAPING (XALAN_STATIC_UCODE_STRING("disable-output-escaping"));
  -const XalanDOMString		Constants::ATTRNAME_OUTPUT_CDATA_SECTION_ELEMENTS (XALAN_STATIC_UCODE_STRING("cdata-section-elements"));
  -const XalanDOMString		Constants::ATTRNAME_OUTPUT_DOCTYPE_PUBLIC(XALAN_STATIC_UCODE_STRING("doctype-public"));
  -const XalanDOMString		Constants::ATTRNAME_OUTPUT_DOCTYPE_SYSTEM(XALAN_STATIC_UCODE_STRING("doctype-system"));
  -const XalanDOMString		Constants::ATTRNAME_OUTPUT_ENCODING(XALAN_STATIC_UCODE_STRING("encoding"));
  -const XalanDOMString		Constants::ATTRNAME_OUTPUT_INDENT(XALAN_STATIC_UCODE_STRING("indent"));
  -const XalanDOMString		Constants::ATTRNAME_OUTPUT_MEDIATYPE(XALAN_STATIC_UCODE_STRING("media-type"));
  -const XalanDOMString		Constants::ATTRNAME_OUTPUT_STANDALONE (XALAN_STATIC_UCODE_STRING("standalone"));
  -const XalanDOMString		Constants::ATTRNAME_OUTPUT_VERSION(XALAN_STATIC_UCODE_STRING("version"));
  -//const XalanDOMString		Constants::ATTRNAME_OUTPUT_XMLDECL(XALAN_STATIC_UCODE_STRING("xml-declaration"));
  -const XalanDOMString		Constants::ATTRNAME_OUTPUT_OMITXMLDECL(XALAN_STATIC_UCODE_STRING("omit-xml-declaration"));
   const XalanDOMString		Constants::ATTRNAME_ZERODIGIT(XALAN_STATIC_UCODE_STRING("zero-digit"));
  -
  -const XalanDOMString		Constants::ATTRVAL_OUTPUT_METHOD_HTML(XALAN_STATIC_UCODE_STRING("html"));
  -const XalanDOMString		Constants::ATTRVAL_OUTPUT_METHOD_XML(XALAN_STATIC_UCODE_STRING("xml"));
  -const XalanDOMString		Constants::ATTRVAL_OUTPUT_METHOD_TEXT(XALAN_STATIC_UCODE_STRING("text"));
  -const XalanDOMString		Constants::ATTRVAL_THIS(XALAN_STATIC_UCODE_STRING("."));
  -const XalanDOMString		Constants::ATTRVAL_PARENT(XALAN_STATIC_UCODE_STRING(".."));
  +const XalanDOMString		Constants::ATTRVAL_ALPHABETIC(XALAN_STATIC_UCODE_STRING("alphabetic"));
   const XalanDOMString		Constants::ATTRVAL_ANCESTOR(XALAN_STATIC_UCODE_STRING("ancestor"));
  -const XalanDOMString		Constants::ATTRVAL_ID(XALAN_STATIC_UCODE_STRING("id"));
  -const XalanDOMString		Constants::ATTRVAL_DATATYPE_TEXT(XALAN_STATIC_UCODE_STRING("text"));
  -const XalanDOMString		Constants::ATTRVAL_DATATYPE_NUMBER(XALAN_STATIC_UCODE_STRING("number"));
  -const XalanDOMString		Constants::ATTRVAL_ORDER_ASCENDING(XALAN_STATIC_UCODE_STRING("ascending"));
  -const XalanDOMString		Constants::ATTRVAL_ORDER_DESCENDING(XALAN_STATIC_UCODE_STRING("descending"));
  -const XalanDOMString		Constants::ATTRVAL_CASEORDER_UPPER(XALAN_STATIC_UCODE_STRING("upper-first"));
  +const XalanDOMString		Constants::ATTRVAL_ANY(XALAN_STATIC_UCODE_STRING("any"));
   const XalanDOMString		Constants::ATTRVAL_CASEORDER_LOWER(XALAN_STATIC_UCODE_STRING("lower-first"));
  +const XalanDOMString		Constants::ATTRVAL_CASEORDER_UPPER(XALAN_STATIC_UCODE_STRING("upper-first"));
  +const XalanDOMString		Constants::ATTRVAL_DATATYPE_NUMBER(XALAN_STATIC_UCODE_STRING("number"));
  +const XalanDOMString		Constants::ATTRVAL_DATATYPE_TEXT(XALAN_STATIC_UCODE_STRING("text"));
   const XalanDOMString		Constants::ATTRVAL_DEFAULT_PREFIX(XALAN_STATIC_UCODE_STRING("#default"));
  -
  +const XalanDOMString		Constants::ATTRVAL_ID(XALAN_STATIC_UCODE_STRING("id"));
   const XalanDOMString		Constants::ATTRVAL_INFINITY(XALAN_STATIC_UCODE_STRING("Infinity"));
  +const XalanDOMString		Constants::ATTRVAL_MULTI(XALAN_STATIC_UCODE_STRING("multiple"));
   const XalanDOMString		Constants::ATTRVAL_NAN(XALAN_STATIC_UCODE_STRING("NaN"));
  -
  +const XalanDOMString		Constants::ATTRVAL_NO(XALAN_STATIC_UCODE_STRING("no"));
  +const XalanDOMString		Constants::ATTRVAL_ORDER_ASCENDING(XALAN_STATIC_UCODE_STRING("ascending"));
  +const XalanDOMString		Constants::ATTRVAL_ORDER_DESCENDING(XALAN_STATIC_UCODE_STRING("descending"));
  +const XalanDOMString		Constants::ATTRVAL_OTHER(XALAN_STATIC_UCODE_STRING("other"));
  +const XalanDOMString		Constants::ATTRVAL_OUTPUT_METHOD_HTML(XALAN_STATIC_UCODE_STRING("html"));
  +const XalanDOMString		Constants::ATTRVAL_OUTPUT_METHOD_TEXT(XALAN_STATIC_UCODE_STRING("text"));
  +const XalanDOMString		Constants::ATTRVAL_OUTPUT_METHOD_XML(XALAN_STATIC_UCODE_STRING("xml"));
  +const XalanDOMString		Constants::ATTRVAL_PARENT(XALAN_STATIC_UCODE_STRING(".."));
  +const XalanDOMString		Constants::ATTRVAL_PRESERVE(XALAN_STATIC_UCODE_STRING("preserve"));
  +const XalanDOMString		Constants::ATTRVAL_SINGLE(XALAN_STATIC_UCODE_STRING("single"));
  +const XalanDOMString		Constants::ATTRVAL_STRIP(XALAN_STATIC_UCODE_STRING("strip"));
  +const XalanDOMString		Constants::ATTRVAL_THIS(XALAN_STATIC_UCODE_STRING("."));
  +const XalanDOMString		Constants::ATTRVAL_YES(XALAN_STATIC_UCODE_STRING("yes"));
   const XalanDOMString		Constants::DEFAULT_DECIMAL_FORMAT(XALAN_STATIC_UCODE_STRING("#default"));
  -
  +const XalanDOMString		Constants::ELEMNAME_ANCHOR_STRING(XALAN_STATIC_UCODE_STRING("anchor"));
  +const XalanDOMString		Constants::ELEMNAME_ANY_STRING(XALAN_STATIC_UCODE_STRING("any"));
  +const XalanDOMString		Constants::ELEMNAME_APPLY_IMPORTS_STRING(XALAN_STATIC_UCODE_STRING("apply-imports"));
  +const XalanDOMString		Constants::ELEMNAME_APPLY_TEMPLATES_STRING(XALAN_STATIC_UCODE_STRING("apply-templates"));
  +const XalanDOMString		Constants::ELEMNAME_ARG_STRING(XALAN_STATIC_UCODE_STRING("arg"));
  +const XalanDOMString		Constants::ELEMNAME_ATTRIBUTESET_STRING(XALAN_STATIC_UCODE_STRING("attribute-set"));
  +const XalanDOMString		Constants::ELEMNAME_ATTRIBUTE_STRING(XALAN_STATIC_UCODE_STRING("attribute"));
  +const XalanDOMString		Constants::ELEMNAME_CALLTEMPLATEARG_STRING(XALAN_STATIC_UCODE_STRING("invoke-arg"));
  +const XalanDOMString		Constants::ELEMNAME_CALLTEMPLATE_STRING(XALAN_STATIC_UCODE_STRING("call-template"));
  +const XalanDOMString		Constants::ELEMNAME_CALL_STRING(XALAN_STATIC_UCODE_STRING("call"));
  +const XalanDOMString		Constants::ELEMNAME_CHILDREN_STRING(XALAN_STATIC_UCODE_STRING("children"));
  +const XalanDOMString		Constants::ELEMNAME_CHOOSE_STRING(XALAN_STATIC_UCODE_STRING("choose"));
  +const XalanDOMString		Constants::ELEMNAME_COMMENT_STRING(XALAN_STATIC_UCODE_STRING("comment"));
  +const XalanDOMString		Constants::ELEMNAME_COMPONENT_STRING(XALAN_STATIC_UCODE_STRING("component"));
  +const XalanDOMString		Constants::ELEMNAME_CONSTRUCT_STRING(XALAN_STATIC_UCODE_STRING("construct"));
  +const XalanDOMString		Constants::ELEMNAME_CONTENTS_STRING(XALAN_STATIC_UCODE_STRING("contents"));
  +const XalanDOMString		Constants::ELEMNAME_COPY_OF_STRING(XALAN_STATIC_UCODE_STRING("copy-of"));
  +const XalanDOMString		Constants::ELEMNAME_COPY_STRING(XALAN_STATIC_UCODE_STRING("copy"));
  +const XalanDOMString		Constants::ELEMNAME_COUNTERINCREMENT_STRING(XALAN_STATIC_UCODE_STRING("counter-increment"));
  +const XalanDOMString		Constants::ELEMNAME_COUNTERRESET_STRING(XALAN_STATIC_UCODE_STRING("counter-reset"));
  +const XalanDOMString		Constants::ELEMNAME_COUNTERSCOPE_STRING(XALAN_STATIC_UCODE_STRING("counter-scope"));
  +const XalanDOMString		Constants::ELEMNAME_COUNTERS_STRING(XALAN_STATIC_UCODE_STRING("counters"));
  +const XalanDOMString		Constants::ELEMNAME_COUNTER_STRING(XALAN_STATIC_UCODE_STRING("counter"));
  +const XalanDOMString		Constants::ELEMNAME_CSSSTYLECONVERSION_STRING(XALAN_STATIC_UCODE_STRING("css-style-conversion"));
  +const XalanDOMString		Constants::ELEMNAME_DECIMALFORMAT_STRING(XALAN_STATIC_UCODE_STRING("decimal-format"));
  +const XalanDOMString		Constants::ELEMNAME_DISPLAYIF_STRING(XALAN_STATIC_UCODE_STRING("display-if"));
  +const XalanDOMString		Constants::ELEMNAME_ELEMENT_STRING(XALAN_STATIC_UCODE_STRING("element"));
  +const XalanDOMString		Constants::ELEMNAME_EMPTY_STRING(XALAN_STATIC_UCODE_STRING("empty"));
  +const XalanDOMString		Constants::ELEMNAME_EVAL_STRING(XALAN_STATIC_UCODE_STRING("eval"));
  +const XalanDOMString		Constants::ELEMNAME_EXPECTEDCHILDREN_STRING(XALAN_STATIC_UCODE_STRING("expectedchildren"));
  +const XalanDOMString		Constants::ELEMNAME_EXTENSIONHANDLER_STRING(XALAN_STATIC_UCODE_STRING("code-dispatcher"));
  +const XalanDOMString		Constants::ELEMNAME_EXTENSION_STRING(XALAN_STATIC_UCODE_STRING("functions"));
  +const XalanDOMString		Constants::ELEMNAME_FALLBACK_STRING(XALAN_STATIC_UCODE_STRING("fallback"));
  +const XalanDOMString		Constants::ELEMNAME_FOREACH_STRING(XALAN_STATIC_UCODE_STRING("for-each"));
  +const XalanDOMString		Constants::ELEMNAME_IF_STRING(XALAN_STATIC_UCODE_STRING("if"));
  +const XalanDOMString		Constants::ELEMNAME_IMPORT_STRING(XALAN_STATIC_UCODE_STRING("import"));
  +const XalanDOMString		Constants::ELEMNAME_INCLUDE_STRING(XALAN_STATIC_UCODE_STRING("include"));
  +const XalanDOMString		Constants::ELEMNAME_KEY_STRING(XALAN_STATIC_UCODE_STRING("key"));
  +const XalanDOMString		Constants::ELEMNAME_LOCALE_STRING(XALAN_STATIC_UCODE_STRING("locale"));
  +const XalanDOMString		Constants::ELEMNAME_MESSAGE_STRING(XALAN_STATIC_UCODE_STRING("message"));
  +const XalanDOMString		Constants::ELEMNAME_NSALIAS_STRING(XALAN_STATIC_UCODE_STRING("namespace-alias"));
  +const XalanDOMString		Constants::ELEMNAME_NUMBER_STRING(XALAN_STATIC_UCODE_STRING("number"));
  +const XalanDOMString		Constants::ELEMNAME_OTHERWISE_STRING(XALAN_STATIC_UCODE_STRING("otherwise"));
  +const XalanDOMString		Constants::ELEMNAME_OUTPUT_STRING(XALAN_STATIC_UCODE_STRING("output"));
  +const XalanDOMString		Constants::ELEMNAME_PARAMVARIABLE_OLD_STRING(XALAN_STATIC_UCODE_STRING("param-variable"));
  +const XalanDOMString		Constants::ELEMNAME_PARAMVARIABLE_STRING(XALAN_STATIC_UCODE_STRING("param"));
  +const XalanDOMString		Constants::ELEMNAME_PARAM_STRING(XALAN_STATIC_UCODE_STRING("param"));
  +const XalanDOMString		Constants::ELEMNAME_PI_OLD_STRING(XALAN_STATIC_UCODE_STRING("pi"));
  +const XalanDOMString		Constants::ELEMNAME_PI_STRING(XALAN_STATIC_UCODE_STRING("processing-instruction"));
  +const XalanDOMString		Constants::ELEMNAME_PRESERVESPACE_STRING(XALAN_STATIC_UCODE_STRING("preserve-space"));
  +const XalanDOMString		Constants::ELEMNAME_ROOT_STRING(XALAN_STATIC_UCODE_STRING("root"));
  +const XalanDOMString		Constants::ELEMNAME_SCRIPT_STRING(XALAN_STATIC_UCODE_STRING("script"));
  +const XalanDOMString		Constants::ELEMNAME_SORT_STRING(XALAN_STATIC_UCODE_STRING("sort"));
  +const XalanDOMString		Constants::ELEMNAME_STRIPSPACE_STRING(XALAN_STATIC_UCODE_STRING("strip-space"));
  +const XalanDOMString		Constants::ELEMNAME_STYLESHEET_STRING(XALAN_STATIC_UCODE_STRING("stylesheet"));
  +const XalanDOMString		Constants::ELEMNAME_TARGETATTRIBUTE_STRING(XALAN_STATIC_UCODE_STRING("target-attribute"));
  +const XalanDOMString		Constants::ELEMNAME_TARGETCOMMENT_STRING(XALAN_STATIC_UCODE_STRING("target-comment"));
  +const XalanDOMString		Constants::ELEMNAME_TARGETELEMENT_STRING(XALAN_STATIC_UCODE_STRING("target-element"));
  +const XalanDOMString		Constants::ELEMNAME_TARGETPI_STRING(XALAN_STATIC_UCODE_STRING("target-pi"));
  +const XalanDOMString		Constants::ELEMNAME_TARGETTEXT_STRING(XALAN_STATIC_UCODE_STRING("target-text"));
  +const XalanDOMString		Constants::ELEMNAME_TEMPLATE_STRING(XALAN_STATIC_UCODE_STRING("template"));
  +const XalanDOMString		Constants::ELEMNAME_TEXT_STRING(XALAN_STATIC_UCODE_STRING("text"));
  +const XalanDOMString		Constants::ELEMNAME_TRANSFORM_STRING(XALAN_STATIC_UCODE_STRING("transform"));
  +const XalanDOMString		Constants::ELEMNAME_URL_STRING(XALAN_STATIC_UCODE_STRING("uri"));
  +const XalanDOMString		Constants::ELEMNAME_USE_STRING(XALAN_STATIC_UCODE_STRING("use"));
  +const XalanDOMString		Constants::ELEMNAME_VALUEOF_STRING(XALAN_STATIC_UCODE_STRING("value-of"));
  +const XalanDOMString		Constants::ELEMNAME_VARIABLE_STRING(XALAN_STATIC_UCODE_STRING("variable"));
  +const XalanDOMString		Constants::ELEMNAME_WHEN_STRING(XALAN_STATIC_UCODE_STRING("when"));
  +const XalanDOMString		Constants::ELEMNAME_WITHPARAM_STRING(XALAN_STATIC_UCODE_STRING("with-param"));
   const XalanDOMString		Constants::PSEUDONAME_ANY(XALAN_STATIC_UCODE_STRING("*"));
  -const XalanDOMString		Constants::PSEUDONAME_ROOT(XALAN_STATIC_UCODE_STRING("/"));
  -const XalanDOMString		Constants::PSEUDONAME_TEXT(XALAN_STATIC_UCODE_STRING("#text"));
   const XalanDOMString		Constants::PSEUDONAME_COMMENT(XALAN_STATIC_UCODE_STRING("#comment"));
  -const XalanDOMString		Constants::PSEUDONAME_PI(XALAN_STATIC_UCODE_STRING("#pi"));
   const XalanDOMString		Constants::PSEUDONAME_OTHER(XALAN_STATIC_UCODE_STRING("*"));
  +const XalanDOMString		Constants::PSEUDONAME_PI(XALAN_STATIC_UCODE_STRING("#pi"));
  +const XalanDOMString		Constants::PSEUDONAME_ROOT(XALAN_STATIC_UCODE_STRING("/"));
  +const XalanDOMString		Constants::PSEUDONAME_TEXT(XALAN_STATIC_UCODE_STRING("#text"));
  
  
  
  1.6       +11 -10    xml-xalan/c/src/XSLT/Constants.hpp
  
  Index: Constants.hpp
  ===================================================================
  RCS file: /home/cvs/xml-xalan/c/src/XSLT/Constants.hpp,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- Constants.hpp	2000/04/11 15:09:21	1.5
  +++ Constants.hpp	2000/04/12 19:40:56	1.6
  @@ -249,24 +249,25 @@
   	/*---------------------------------------------
   	 * Literals for XSL attribute names.
   	 */
  -	static const XalanDOMString	ATTRNAME_CLASS;
  -	static const XalanDOMString	ATTRNAME_ATTRIBUTE;
  -	static const XalanDOMString	ATTRNAME_ATTRIBUTE_SET;
   	static const XalanDOMString	ATTRNAME_AMOUNT;
   	static const XalanDOMString	ATTRNAME_ANCESTOR;
  +	static const XalanDOMString	ATTRNAME_ATTRIBUTE;
  +	static const XalanDOMString	ATTRNAME_ATTRIBUTE_SET;
   	static const XalanDOMString	ATTRNAME_CASEORDER;
  +	static const XalanDOMString	ATTRNAME_CLASS;
   	static const XalanDOMString	ATTRNAME_CONDITION;
   	static const XalanDOMString	ATTRNAME_COPYTYPE;
   	static const XalanDOMString	ATTRNAME_COUNT;
   	static const XalanDOMString	ATTRNAME_DATATYPE;
   	static const XalanDOMString	ATTRNAME_DECIMALSEPARATOR;
  -	static const XalanDOMString	ATTRNAME_DEFAULTSPACE;
   	static const XalanDOMString	ATTRNAME_DEFAULT;
  +	static const XalanDOMString	ATTRNAME_DEFAULTSPACE;
   	static const XalanDOMString	ATTRNAME_DEPTH;
   	static const XalanDOMString	ATTRNAME_DIGIT;
   	static const XalanDOMString	ATTRNAME_DIGITGROUPSEP;
   	static const XalanDOMString	ATTRNAME_ELEMENT;
   	static const XalanDOMString	ATTRNAME_ELEMENTS;
  +	static const XalanDOMString	ATTRNAME_EXCLUDE_RESULT_PREFIXES;
   	static const XalanDOMString	ATTRNAME_EXPR;
   	static const XalanDOMString	ATTRNAME_EXTENSIONELEMENTPREFIXES;
   	static const XalanDOMString	ATTRNAME_FORMAT;
  @@ -278,16 +279,15 @@
   	static const XalanDOMString	ATTRNAME_IMPORTANCE;
   	static const XalanDOMString	ATTRNAME_INDENTRESULT;
   	static const XalanDOMString	ATTRNAME_INFINITY;
  +	static const XalanDOMString	ATTRNAME_LANG;
   	static const XalanDOMString	ATTRNAME_LETTERVALUE;
   	static const XalanDOMString	ATTRNAME_LEVEL;
  -	static const XalanDOMString	ATTRNAME_LANG;
  -	// static const XalanDOMString	ATTRNAME_MACRO;
   	static const XalanDOMString	ATTRNAME_MATCH;
   	static const XalanDOMString	ATTRNAME_MINUSSIGN;
   	static const XalanDOMString	ATTRNAME_MODE;
   	static const XalanDOMString	ATTRNAME_NAME;
  -	static const XalanDOMString	ATTRNAME_NAN;
   	static const XalanDOMString	ATTRNAME_NAMESPACE;
  +	static const XalanDOMString	ATTRNAME_NAN;
   	static const XalanDOMString	ATTRNAME_NDIGITSPERGROUP;
   	static const XalanDOMString	ATTRNAME_ONLY;
   	static const XalanDOMString	ATTRNAME_ORDER;
  @@ -301,17 +301,17 @@
   	static const XalanDOMString	ATTRNAME_SELECT;
   	static const XalanDOMString	ATTRNAME_SEQUENCESRC;
   	static const XalanDOMString	ATTRNAME_STYLE;
  -    static const XalanDOMString	ATTRNAME_STYLESHEET_PREFIX;
   	static const XalanDOMString	ATTRNAME_TEST;
   	static const XalanDOMString	ATTRNAME_TOSTRING;
   	static const XalanDOMString	ATTRNAME_TYPE;
   	static const XalanDOMString	ATTRNAME_USE;
   	static const XalanDOMString	ATTRNAME_USEATTRIBUTESETS;
   	static const XalanDOMString	ATTRNAME_VALUE;
  -	static const XalanDOMString	ATTRNAME_XMLNSDEF;
   	static const XalanDOMString	ATTRNAME_XMLNS;
  +	static const XalanDOMString	ATTRNAME_XMLNSDEF;
   	static const XalanDOMString	ATTRNAME_XMLSPACE;
   	static const XalanDOMString	ATTRNAME_ZERODIGIT;
  +   static const XalanDOMString	ATTRNAME_STYLESHEET_PREFIX;
    
   	  // Atributes on the functions element
   	static const XalanDOMString	ATTRNAME_NS;
  @@ -463,7 +463,8 @@
   		TATTRNAME_VALUE = 65,
   		TATTRNAME_XMLNSDEF = 66,
   		TATTRNAME_XMLNS = 67,
  -		TATTRNAME_XMLSPACE = 68
  +		TATTRNAME_XMLSPACE = 68,
  +		TATTRNAME_EXCLUDE_RESULT_PREFIXES = 69
   	};
   
   	// These are used mainly for keys in the pattern lookup table,
  
  
  
  1.5       +24 -4     xml-xalan/c/src/XSLT/ElemApplyTemplates.cpp
  
  Index: ElemApplyTemplates.cpp
  ===================================================================
  RCS file: /home/cvs/xml-xalan/c/src/XSLT/ElemApplyTemplates.cpp,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- ElemApplyTemplates.cpp	2000/04/11 15:09:22	1.4
  +++ ElemApplyTemplates.cpp	2000/04/12 19:40:56	1.5
  @@ -108,7 +108,7 @@
   			break;
   
   		default:
  -			if(!isAttrOK(tok, aname, atts, i))
  +			if(!isAttrOK(aname, atts, i, constructionContext))
   			{
   				constructionContext.error(XalanDOMString(name) + " has an illegal attribute: " + aname);
   			}
  @@ -142,9 +142,24 @@
   	  getStylesheet().getStylesheetRoot().fireTraceEvent(TracerEvent(
   		  executionContext, sourceTree, sourceNode, mode, *this));
   	}
  -
   	if (0 != sourceNode)
   	{
  +		ElemTemplateElement* const	theTemplate = 
  +			const_cast<ElemTemplateElement* const>
  +				(static_cast<const ElemTemplateElement* const>(this));
  +
  +		// Dragons here.  Push the params & stack frame, but then execute the
  +		// select statement inside transformSelectedChildren, which must be
  +		// executed in the stack frame before the new stack frame.  Because of
  +		// depth-first searching, this gets worse.
  +		int selectStackFrameIndex = executionContext.getCurrentStackFrameIndex();
  +		executionContext.pushContextMarker(theTemplate,
  +				sourceNode);
  +		executionContext.setCurrentStackFrameIndex(selectStackFrameIndex);
  +		executionContext.pushParams(*this, sourceTree, sourceNode, mode,
  +				theTemplate);
  +
  +		executionContext.setCurrentStackFrameIndex();
   		transformSelectedChildren(
   			executionContext,
   			getStylesheet(),
  @@ -154,7 +169,12 @@
   			sourceNode, 
   			m_isDefaultTemplate == false ? m_mode : mode,
   			m_pSelectPattern, 
  -			Constants::ELEMNAME_APPLY_TEMPLATES);
  +			Constants::ELEMNAME_APPLY_TEMPLATES,
  +			selectStackFrameIndex);
  +
  +		executionContext.popCurrentContext();
  +		executionContext.setCurrentStackFrameIndex(selectStackFrameIndex);
  +
   	}
       else
   	{
  @@ -173,7 +193,7 @@
   	{
   	// char-instructions 
   	case Constants::ELEMNAME_SORT:
  -	case Constants::ELEMNAME_PARAM:
  +	case Constants::ELEMNAME_WITHPARAM:
   		fResult = true;
   		break;
   		
  
  
  
  1.4       +21 -16    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.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- ElemCallTemplate.cpp	2000/04/11 15:09:23	1.3
  +++ ElemCallTemplate.cpp	2000/04/12 19:40:56	1.4
  @@ -88,7 +88,7 @@
   						lineNumber,
   						columnNumber,
   						Constants::ELEMNAME_CALLTEMPLATE),
  -	m_pNameAVT(0)
  +	m_templateName(0)
   {
   	const unsigned int	nAttrs = atts.getLength();
   
  @@ -98,8 +98,12 @@
   
   		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);
  +*/
   		}
   		else if(!isAttrOK(aname, atts, i, constructionContext))
   		{
  @@ -112,7 +116,7 @@
   	
   ElemCallTemplate::~ElemCallTemplate()
   {
  -	delete m_pNameAVT;
  +	delete m_templateName;
   }
   
   
  @@ -125,37 +129,38 @@
   			const QName&					mode) const
   {
   	ElemTemplateElement::execute(executionContext,	sourceTree, sourceNode, mode);
  -
  -	assert(m_pNameAVT != 0);
  -
  -	XalanDOMString templateName; 
  -
  -	m_pNameAVT->evaluate(templateName, sourceNode, *this, executionContext.getXPathExecutionContext());
   
  -	if(!isEmpty(templateName))
  +	if(!isEmpty(m_templateName->getLocalPart()))
   	{
   		ElemTemplateElement* const	theTemplate =
  -			getStylesheet().getStylesheetRoot().findNamedTemplate(templateName, executionContext);
  +			getStylesheet().getStylesheetRoot().findNamedTemplate(*m_templateName,
  +					executionContext);
   
   		if(0 != theTemplate)
   		{
  -			executionContext.pushContextMarker(theTemplate, sourceNode);
  -			
  -			executionContext.pushParams(*this, 
  -				sourceTree, sourceNode, mode, theTemplate);
  +			int selectStackFrameIndex = executionContext.getCurrentStackFrameIndex();
  +			executionContext.pushContextMarker(theTemplate,
  +					sourceNode);
  +			executionContext.setCurrentStackFrameIndex(selectStackFrameIndex);
  +			executionContext.pushParams(*this, sourceTree, sourceNode, mode,
  +					theTemplate);
  +			executionContext.markGlobalStackFrame();
   
  +			executionContext.setCurrentStackFrameIndex();
   			theTemplate->execute(executionContext, sourceTree, sourceNode, mode);
   
   			executionContext.popCurrentContext();
  +			executionContext.setCurrentStackFrameIndex(selectStackFrameIndex);
   		}
   		else
   		{
  -			executionContext.error("Could not find template named: '" + templateName + "'");
  +			executionContext.error("Could not find template named: '" +
  +					m_templateName->getLocalPart() + "'");
   		}
   	}
   	else
   	{
  -		executionContext.error("Could not resolve name AVT in xsl:call-template.");
  +		executionContext.error("Could not resolve name in xsl:call-template.");
   	}
   }
   
  
  
  
  1.5       +2 -2      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.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- ElemCallTemplate.hpp	2000/04/11 15:09:23	1.4
  +++ ElemCallTemplate.hpp	2000/04/12 19:40:57	1.5
  @@ -58,7 +58,7 @@
   #define XALAN_ELEMCALLTEMPLATE_HEADER_GUARD 
   
   /**
  - * $Id: ElemCallTemplate.hpp,v 1.4 2000/04/11 15:09:23 dbertoni Exp $
  + * $Id: ElemCallTemplate.hpp,v 1.5 2000/04/12 19:40:57 jdonohue Exp $
    * 
    * 
    * $State: Exp $
  @@ -128,7 +128,7 @@
   	operator=(const ElemCallTemplate &);
   
   	// Data members...
  -	const AVT*	m_pNameAVT;
  +	const QName* m_templateName;
   };
   
   
  
  
  
  1.4       +4 -5      xml-xalan/c/src/XSLT/ElemForEach.cpp
  
  Index: ElemForEach.cpp
  ===================================================================
  RCS file: /home/cvs/xml-xalan/c/src/XSLT/ElemForEach.cpp,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- ElemForEach.cpp	2000/04/11 15:09:24	1.3
  +++ ElemForEach.cpp	2000/04/12 19:40:58	1.4
  @@ -146,11 +146,10 @@
   		assert(m_pSelectPattern != 0);
   
   		transformSelectedChildren(executionContext, getStylesheet(), 
  -								  *this,
  -								  this,
  -								  sourceTree,sourceNode,mode,
  -								  m_pSelectPattern,
  -								  Constants::ELEMNAME_FOREACH);
  +			*this,this,sourceTree,sourceNode,mode,
  +			m_pSelectPattern, Constants::ELEMNAME_FOREACH,
  +			executionContext.getCurrentStackFrameIndex()
  +			);
   	}
       else
       {
  
  
  
  1.4       +1 -1      xml-xalan/c/src/XSLT/ElemIf.cpp
  
  Index: ElemIf.cpp
  ===================================================================
  RCS file: /home/cvs/xml-xalan/c/src/XSLT/ElemIf.cpp,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- ElemIf.cpp	2000/04/11 15:09:24	1.3
  +++ ElemIf.cpp	2000/04/12 19:40:58	1.4
  @@ -114,7 +114,7 @@
   			break;
   
   		default:
  -			if(!isAttrOK(tok, aname, atts, i))
  +			if(!isAttrOK(aname, atts, i, constructionContext))
   			{
   				constructionContext.error(name + " has an illegal attribute: " + aname);
   			}
  
  
  
  1.8       +62 -32    xml-xalan/c/src/XSLT/ElemLiteralResult.cpp
  
  Index: ElemLiteralResult.cpp
  ===================================================================
  RCS file: /home/cvs/xml-xalan/c/src/XSLT/ElemLiteralResult.cpp,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- ElemLiteralResult.cpp	2000/04/11 15:09:24	1.7
  +++ ElemLiteralResult.cpp	2000/04/12 19:40:58	1.8
  @@ -70,6 +70,7 @@
   #include <PlatformSupport/STLHelper.hpp>
   
   
  +#include <sax/SAXException.hpp>
   
   #include "AVT.hpp"
   #include "Constants.hpp"
  @@ -77,6 +78,9 @@
   #include "StylesheetConstructionContext.hpp"
   #include "StylesheetExecutionContext.hpp"
   
  +#if !defined(XALAN_NO_NAMESPACES)
  +	using std::make_pair;
  +#endif
   
   
   ElemLiteralResult::ElemLiteralResult(
  @@ -116,27 +120,15 @@
   
   				if(startsWith(ns, constructionContext.getXSLNameSpaceURLPre()))
   				{
  -					const XalanDOMString localName = substring(aname, indexOfNSSep + 1);
  -
  -					if(equals(localName, Constants::ATTRNAME_EXTENSIONELEMENTPREFIXES))
  -					{
  +					const XalanDOMString localName = substring(aname,indexOfNSSep + 1);
  +            	processPrefixControl(localName, atts.getValue(i));
  +					if(0 != m_excludeResultPrefixes.size())
   						needToProcess = false;
  -
  -						const XalanDOMString qnames = atts.getValue(i);
  -
  -						StringTokenizer tokenizer(qnames,
  -												  XALAN_STATIC_UCODE_STRING(" \t\n\r"),
  -												  false);
  -
  -						m_extensionElementPrefixes.reserve(tokenizer.countTokens());
  -
  -						while(tokenizer.hasMoreTokens())
  -						{
  -							m_extensionElementPrefixes.push_back(tokenizer.nextToken());
  -						}
  -					}
   				}
   			}
  +			else
  +				// don't process namespace decls
  +				needToProcess = false;
   		}
   
   		if(needToProcess == true)
  @@ -152,6 +144,7 @@
   							*this, constructionContext));
   			}
   		}
  +		removeExcludedPrefixes(m_excludeResultPrefixes);
   	}
   }
   
  @@ -202,6 +195,10 @@
   		}
   	}
   
  +	// @@@ JMD:
  +	// This logic has been eliminated in the java version and replaced by a
  +	// method 'processResultNS' in the base class ElemTemplateElement
  +	// This also requires implementation of namespace alias logic
   	const ElemTemplateElement*	elem = this;
   
   	const NamespaceVectorType*	nsVector = &elem->getNameSpace();
  @@ -230,22 +227,10 @@
   					|| 0 != getStylesheet().lookupExtensionNSHandler(srcURI)
   					|| equalsIgnoreCase(srcURI,executionContext.getXalanXSLNameSpaceURL());
   
  -				if(!isXSLNS)
  +				if(!isXSLNS && !equalsIgnoreCase(srcURI,desturi)) // TODO: Check for extension namespaces
   				{
  -					if(startsWith(srcURI, XALAN_STATIC_UCODE_STRING("quote:")))
  -					{
  -						srcURI = substring(srcURI, 6);
  -					}
  -
  -					if(!equalsIgnoreCase(srcURI,desturi)) // TODO: Check for extension namespaces
  -					{
  -						executionContext.addResultAttribute(attrName, srcURI);
  -					}
  +					executionContext.addResultAttribute(attrName, srcURI);
   				}
  -				else
  -				{
  -					ns.setResultCandidate(false);
  -				}
   			}
   		}
   
  @@ -273,8 +258,53 @@
   		else
   			more = false;
   	}
  +/*
  +	java:
  +    // Handle namespaces(including those on the ancestor chain 
  +    // and stylesheet root declarations).
  +    processResultNS(processor);           
  +*/
   
   	executeChildren(executionContext, sourceTree, sourceNode, mode);
   
   	executionContext.endElement(toCharArray(m_QName));
   }
  +
  +/**
  + * Process the exclude-result-prefixes or the extension-element-prefixes
  + * attributes, for the purpose of prefix exclusion.
  + */
  +void ElemLiteralResult::processPrefixControl(const DOMString& localName, 
  +		const DOMString& attrValue) 
  +{                                                                                                                   
  +/*
  +	OLD:
  +	if(equals(localName, Constants::ATTRNAME_EXTENSIONELEMENTPREFIXES))
  +	{
  +		needToProcess = false;
  +		const DOMString qnames = attrValue;
  +		StringTokenizer tokenizer(qnames, " \t\n\r", false);
  +		m_extensionElementPrefixes.reserve(tokenizer.countTokens());
  +		while(tokenizer.hasMoreTokens())
  +		{
  +			m_extensionElementPrefixes.push_back(tokenizer.nextToken());
  +		}
  +	}
  +*/
  +	if(equals(localName, Constants::ATTRNAME_EXTENSIONELEMENTPREFIXES) ||
  +			equals(localName, Constants::ATTRNAME_EXCLUDE_RESULT_PREFIXES))
  +	{
  +		const DOMString qnames = attrValue;
  +		StringTokenizer tokenizer(qnames, " \t\n\r", false);
  +		while(tokenizer.hasMoreTokens())
  +		{
  +			DOMString prefix = tokenizer.nextToken();
  +			if(equalsIgnoreCase(prefix, "#default")) prefix="";
  +			DOMString ns = getStylesheet().getNamespaceForPrefixFromStack(prefix);
  +			if(isEmpty(ns))
  +				throw SAXException("Invalid prefix in exclude-result-prefixes");
  +			m_excludeResultPrefixes.insert(make_pair(prefix, ns));
  +		}
  +	}
  +}
  +
  
  
  
  1.6       +21 -4     xml-xalan/c/src/XSLT/ElemLiteralResult.hpp
  
  Index: ElemLiteralResult.hpp
  ===================================================================
  RCS file: /home/cvs/xml-xalan/c/src/XSLT/ElemLiteralResult.hpp,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- ElemLiteralResult.hpp	2000/04/11 15:09:24	1.5
  +++ ElemLiteralResult.hpp	2000/04/12 19:40:59	1.6
  @@ -118,21 +118,38 @@
   
   #if defined(XALAN_NO_NAMESPACES)
   	typedef vector<const AVT*>				AVTVectorType;
  -	typedef vector<XalanDOMString>			ExtensionElementPrefixesVectoryType;
  +	typedef vector<XalanDOMString>			ExtensionElementPrefixesVectorType;
  +	typedef map<DOMString, DOMString>	String2StringMapType;
   #else
   	typedef std::vector<const AVT*>			AVTVectorType;
  -	typedef std::vector<XalanDOMString>		ExtensionElementPrefixesVectoryType;
  +	typedef std::vector<XalanDOMString>		ExtensionElementPrefixesVectorType;
  +	typedef std::map<DOMString, DOMString>	String2StringMapType;
   #endif
   
  -
   	/**
   	 * A stack to keep track of the attribute elements.
   	 */
   	AVTVectorType							m_avts;
   
   	XalanDOMString							m_QName;
  +
  +
  +	ExtensionElementPrefixesVectorType		m_extensionElementPrefixes;
  +	
  +	/**
  +	 * This is in support of the exclude-result-prefixes attribute.  It is
  +	 * really needed only at construction time, and so should probably go
  +	 * somewhere else.
  +	 */
  +	String2StringMapType m_excludeResultPrefixes;
   
  -	ExtensionElementPrefixesVectoryType		m_extensionElementPrefixes;
  +/**
  + * Process the exclude-result-prefixes or the extension-element-prefixes
  + * attributes, for the purpose of prefix exclusion.
  + */
  +void ElemLiteralResult::processPrefixControl(const DOMString& localName, 
  +		const DOMString& attrValue);
  +		
   };
   
   
  
  
  
  1.9       +23 -10    xml-xalan/c/src/XSLT/ElemNumber.cpp
  
  Index: ElemNumber.cpp
  ===================================================================
  RCS file: /home/cvs/xml-xalan/c/src/XSLT/ElemNumber.cpp,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- ElemNumber.cpp	2000/04/11 20:05:07	1.8
  +++ ElemNumber.cpp	2000/04/12 19:40:59	1.9
  @@ -208,6 +208,7 @@
   
   
   
  +
   XalanNode*
   ElemNumber::findAncestor(
   			StylesheetExecutionContext&		executionContext,
  @@ -265,8 +266,8 @@
   		if(0 != fromMatchPattern)
   		{
   			if(fromMatchPattern->getMatchScore(contextCopy,
  -											   *this,
  -											   executionContext.getXPathExecutionContext()) != XPath::s_MatchScoreNone)
  +						*this,
  +						executionContext.getXPathExecutionContext()) != XPath::s_MatchScoreNone)
   			{
   				contextCopy = 0;
   				break;
  @@ -383,6 +384,7 @@
   		if((Constants::NUMBERLEVEL_ANY == m_level) || 
   			(Constants::NUMBERLEVEL_SINGLE == m_level))
   		{
  +			int numberFound;
   			if(Constants::NUMBERLEVEL_SINGLE == m_level)
   			{
   				XalanNode*	target =
  @@ -397,7 +399,9 @@
   
   				if(target != 0)
   				{
  -					numberList.push_back(getSiblingNumber(executionContext, countMatchPattern, target));
  +					numberFound = getSiblingNumber(executionContext, countMatchPattern, target);
  +					if (numberFound > 0)
  +						numberList.push_back(numberFound);
   				}
   				else
   				{
  @@ -413,10 +417,6 @@
   
   				if(0 != m_fromMatchPattern)
   				{
  -// @@ JMD: was as below, which looked wrong to me based on java code and the
  -// meaning of the arguments. The sad fact is that the number of tests we
  -// passed went DOWN after this change
  -// 					from = findPrecedingOrAncestorOrSelf(executionContext, 0, m_fromMatchPattern, 
   					from = findPrecedingOrAncestorOrSelf(executionContext, m_fromMatchPattern, countMatchPattern,
   						sourceNode, this);
   
  @@ -432,7 +432,10 @@
   
   				XalanNode* const	fromPos = (from != sourceNode) ? getNextInTree(from, from) : from;
   
  -				numberList.push_back(getNumberInTree(executionContext.getXPathExecutionContext(), countMatchPattern, fromPos, from, sourceNode, 0));
  +				numberFound = getNumberInTree(executionContext.getXPathExecutionContext(),
  +						countMatchPattern, fromPos, from, sourceNode, 0);
  +				if (numberFound > 0)
  +					numberList.push_back(numberFound);
   			}
   		}
   		else // if NUMBERLEVEL_MULTI
  @@ -716,6 +719,10 @@
   	XalanDOMString	sepString(XALAN_STATIC_UCODE_STRING("."));
   	XalanDOMString	lastSepString;
   
  +	// Pathological cases
  +	if (nNumbers == 0) return formattedNumber;
  +	if (contextNode == 0) return formattedNumber;
  +
   	XalanDOMString	formatValue = !isEmpty(m_format_avt)
   		? executionContext.evaluateAttrVal(contextNode,
   										   *this,
  @@ -751,7 +758,7 @@
   		leaderStr = *it;
   		tokenVector.erase(it);
   	}
  -	it += tokenVector.size()-1;
  +	it = tokenVector.end()-1;
   	if(! isLetterOrDigit(charAt((*it), 0)))
   	{
   		trailerStr = *it;
  @@ -939,12 +946,18 @@
   			long	val,
   			bool	prefixesAreOK)
   {
  -	if(val <= 0)
  +	if(val < 0)
   	{
   		return XalanDOMString(XALAN_STATIC_UCODE_STRING("#E(") +
   								LongToDOMString(val) +
   								XALAN_STATIC_UCODE_STRING(")"));
   	}
  +	// Make this match the conformance test
  +	else if(val == 0)
  +	{
  +		return XalanDOMString("0");
  +	}
  +
   
   	XalanDOMString	roman;
   
  
  
  
  1.5       +1 -1      xml-xalan/c/src/XSLT/ElemTemplate.cpp
  
  Index: ElemTemplate.cpp
  ===================================================================
  RCS file: /home/cvs/xml-xalan/c/src/XSLT/ElemTemplate.cpp,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- ElemTemplate.cpp	2000/04/11 15:09:26	1.4
  +++ ElemTemplate.cpp	2000/04/12 19:40:59	1.5
  @@ -126,7 +126,7 @@
   			break;
   
   		default:
  -			if(isAttrOK(tok, aname, atts, i)== false)
  +			if(!isAttrOK(aname, atts, i, constructionContext))
   			{
   				constructionContext.error(name + " has an illegal attribute: " + aname);
   			}
  
  
  
  1.13      +117 -3    xml-xalan/c/src/XSLT/ElemTemplateElement.cpp
  
  Index: ElemTemplateElement.cpp
  ===================================================================
  RCS file: /home/cvs/xml-xalan/c/src/XSLT/ElemTemplateElement.cpp,v
  retrieving revision 1.12
  retrieving revision 1.13
  diff -u -r1.12 -r1.13
  --- ElemTemplateElement.cpp	2000/04/12 17:12:43	1.12
  +++ ElemTemplateElement.cpp	2000/04/12 19:40:59	1.13
  @@ -99,6 +99,10 @@
   #include "SelectionEvent.hpp"
   #include "TracerEvent.hpp"
   
  +#if !defined(XALAN_NO_NAMESPACES)
  +	using std::make_pair;
  +#endif
  +
   
   /** 
    * @param processor The XSLT Processor.
  @@ -123,7 +127,7 @@
   	m_columnNumber(columnNumber),
   	m_defaultSpace(true),
   	m_finishedConstruction(false),
  -	m_namespaces(m_stylesheet.getCurrentNamespace()),
  +	m_namespaces(),
   	m_elemName(name),
   	m_xslToken(xslToken),
   	m_parentNode(0),
  @@ -132,6 +136,30 @@
   	m_firstChild(0),
   	m_surrogateChildren(*this)
   {
  +	/*
  +	 * Copy the stylesheet namespaces to the element namespace vector
  +	 */
  +	const Stylesheet::NamespacesStackType& stylesheetNamespaces =
  +		m_stylesheet.getNamespaces();
  +	int n = stylesheetNamespaces.size();
  +	for(int i = (n-1); i >= 0; i--)
  +	{
  +		const Stylesheet::NamespaceVectorType& nsVector = stylesheetNamespaces[i];
  +		for(int j = 0; j < nsVector.size(); j++)
  +		{
  +			NameSpace ns = nsVector[j];
  +			if(isEmpty(ns.getURI()))
  +				continue;
  +			if(!shouldExcludeResultNamespaceNode(ns.getPrefix(), ns.getURI()))
  +			{
  +				m_namespaces.push_back(ns);
  +			}
  +			else
  +			{
  +				m_excludedNamespaces.insert(make_pair(ns.getPrefix(), ns.getURI()));
  +			}
  +		}
  +	}
   }
   
   
  @@ -577,13 +605,15 @@
   			XalanNode*						sourceNodeContext,
   			const QName&					mode,
   			const XPath*					selectPattern,
  -			int								xslToken) const
  +			int								xslToken,
  +			int selectStackFrameIndex) const
   {
   	// Sort the nodes according to the xsl:sort method
   	const int	tok = xslInstruction.getXSLToken();
   
   	NodeSorter::NodeSortKeyVectorType	keys;
   
  +	// @@ JMD: Now in method processSortKeys in java ...
   	if((Constants::ELEMNAME_APPLY_TEMPLATES == tok) ||
   		(Constants::ELEMNAME_FOREACH == tok))
   	{
  @@ -622,11 +652,37 @@
   			keys.push_back(key);
   		}
   	}
  +	// @@ JMD: Now in method processSortKeys in java ...
   
   	MutableNodeRefList sourceNodes;
   
  +/*
  +	@@@ JMD: This is newer java code that is not implemented in C++; so, the
  +	manipulation of the current stack frame index really does nothing now, it's
  +	just a placeholder for future implementation
  +
  +    // We can only do callbacks if the node list isn't sorted.
  +    NodeCallback callback = (null == keys) ? this : null;
  +*/
  +
  +	int savedCurrentStackFrameIndex = executionContext.getCurrentStackFrameIndex();
   	if (0 != selectPattern)
   	{
  +		executionContext.setCurrentStackFrameIndex(selectStackFrameIndex);
  +/*
  +	@@@ JMD: This is newer java code that is not implemented in C++; the
  +	callback mechanism may affect the correct positioning of the stack frame and
  +	may be why the parameters aren't working right
  +
  +      // Optimization note: is there a way we can keep from creating 
  +      // a new callback context every time?
  +      TemplateElementContext callbackContext 
  +        = (null != callback) 
  +			 ? new TemplateElementContext(stylesheetTree, xslInstruction,
  +					 template, sourceNodeContext, mode, xslToken, tcontext,
  +					 savedCurrentStackFrameIndex) : null;
  +*/
  +
   		XObject* const	result = selectPattern->execute(
   			sourceNodeContext,
   			xslInstruction,
  @@ -644,6 +700,7 @@
   					*selectPattern,
   					result));
   		}
  +		executionContext.setCurrentStackFrameIndex(savedCurrentStackFrameIndex);
   	}
   	else if (keys.size() > 0)
   	{
  @@ -658,7 +715,9 @@
   		{
   			NodeSorter sorter(executionContext.getXPathExecutionContext());
   
  +			executionContext.setCurrentStackFrameIndex(selectStackFrameIndex);
   			sorter.sort(sourceNodes, keys);
  +			executionContext.setCurrentStackFrameIndex(savedCurrentStackFrameIndex);
   		}
   
   		const MutableNodeRefList	savedContextNodeList(executionContext.getContextNodeList());
  @@ -1068,6 +1127,11 @@
   }
   
   
  +/** 
  + * Throw a template element error.
  + * 
  + * @param msg Description of the error that occured.
  + */
   
   XalanNode*
   ElemTemplateElement::appendChild(XalanNode*		oldChild)
  @@ -1088,7 +1152,6 @@
   }
   
   
  -
   void
   ElemTemplateElement::setNodeValue(const XalanDOMString&		/* nodeValue */)
   {
  @@ -1169,6 +1232,57 @@
   	return 0;
   }
   
  +
  +void ElemTemplateElement::removeExcludedPrefixes(
  +		const String2StringMapType& excludeResultPrefixes)
  +{
  +	if(0 !=excludeResultPrefixes.size() && 0 != m_namespaces.size())
  +	{
  +		for( NamespaceVectorType::iterator it = m_namespaces.begin();
  +				it != m_namespaces.end(); )
  +		{
  +			NameSpace ns = *it;
  +			DOMString p = ns.getPrefix();
  +			String2StringMapType::const_iterator it2 = excludeResultPrefixes.find(p);
  +			if(it2 != excludeResultPrefixes.end())
  +			{
  +				m_excludedNamespaces.insert(make_pair(p, ns.getURI()));
  +				it = m_namespaces.erase(it);
  +			}
  +			else 
  +				it++;
  +		}
  +	}
  +}
  +  
  +bool ElemTemplateElement::shouldExcludeResultNamespaceNode(
  +		const DOMString& prefix, const DOMString& uri)
  +{
  +/*
  +	@@ JMD: Need to implement this ---
  +
  +	if(uri.equals(m_stylesheet.m_XSLNameSpaceURL)
  +			|| (null != m_stylesheet.lookupExtensionNSHandler(uri))
  +			|| uri.equals("http://xml.apache.org/xslt")
  +			|| uri.equals("http://xsl.lotus.com/")
  +			|| uri.equals("http://xsl.lotus.com"))
  +		return true; 
  +	ElemTemplateElement elem = this;
  +	while(0 != elem)
  +	{
  +		elem = elem.m_parentNode;
  +		if(0 == elem)
  +		{
  +			if(0 != m_stylesheet.m_excludeResultPrefixes)
  +			{
  +				if(m_stylesheet.m_excludeResultPrefixes.contains(prefix))
  +					return true;
  +			}
  +		}
  +	}
  +*/
  +	return false;
  +}
   
   
   XalanNodeList*
  
  
  
  1.9       +49 -3     xml-xalan/c/src/XSLT/ElemTemplateElement.hpp
  
  Index: ElemTemplateElement.hpp
  ===================================================================
  RCS file: /home/cvs/xml-xalan/c/src/XSLT/ElemTemplateElement.hpp,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- ElemTemplateElement.hpp	2000/04/11 15:09:26	1.8
  +++ ElemTemplateElement.hpp	2000/04/12 19:40:59	1.9
  @@ -65,6 +65,7 @@
   
   
   #include <vector>
  +#include <map>
   
   
   
  @@ -144,7 +145,7 @@
   	* @param atts     attribute list where the element comes from (not used at 
   	*                 this time)
   	* @param which    index into the attribute list (not used at this time)
  -	* @return         true if this attribute should not be flagged as an error
  +	* @return         true if this is a namespace name
   	*/
   	bool
   	isAttrOK(
  @@ -306,8 +307,11 @@
   
   #if defined(XALAN_NO_NAMESPACES)
   	typedef	vector<NameSpace>		NamespaceVectorType;
  +	typedef map<XalanDOMString, XalanDOMString>	String2StringMapType;
   #else
  -	typedef	std::vector<NameSpace>	NamespaceVectorType;
  +	typedef	std::vector<NameSpace>		NamespaceVectorType;
  +	typedef std::map<XalanDOMString, XalanDOMString>	String2StringMapType;
  +
   #endif
   
   	/** 
  @@ -343,7 +347,14 @@
   		m_finishedConstruction = bFinished;
   	}
   
  +  /**
  +   * Remove any excluded prefixes from the current namespaces.
  +	* 
  +	* @param map of prefixes and associated namespaces to be excluded
  +   */
  +  void removeExcludedPrefixes(const String2StringMapType& excludeResultPrefixes);
   
  +
   	// Type-safe getters/setters...
   
   	/**
  @@ -436,6 +447,8 @@
   	virtual ElemTemplateElement*
   	appendChildElem(ElemTemplateElement*	newChild);
   
  +	// Type-safe getters...
  +
   	/**
   	 * Append a child.
   	 *
  @@ -517,6 +530,12 @@
   	virtual XalanNode*
   	removeChild(XalanNode*	oldChild);
   
  +	/** 
  +	 * Add a child to the child list.
  +	 * 
  +	 * @exception DOMException 
  +	 * @param newChild child node to add
  +	 */
   	virtual XalanNode*
   	appendChild(XalanNode*	newChild);
   
  @@ -627,6 +646,8 @@
   	 * @param selectPattern The XPath with which to perform the selection.
   	 * @param xslToken The current XSLT instruction (deprecated -- I do not     
   	 *     think we want this).
  +	 * @param selectStackFrameIndex stack frame context for executing the
  +	 *                              select statement
   	 */
   	void
   	transformSelectedChildren(
  @@ -638,7 +659,32 @@
   			XalanNode*						sourceNodeContext,
   			const QName&					mode,
   			const XPath*					selectPattern,
  -			int								xslToken) const;
  +			int	xslToken,
  +			int selectStackFrameIndex) const;
  +
  +  /**
  +   * Tell if the result namespace decl should be excluded.  Should be called before 
  +   * namespace aliasing (I think).
  +   * TODO: I believe this contains a bug, in that included elements will check with with 
  +   * their including stylesheet, since in this implementation right now the included 
  +   * templates are merged with the including stylesheet.  The XSLT Recommendation says: "The 
  +   * designation of a namespace as an excluded namespace is effective within 
  +   * the subtree of the stylesheet rooted at the element bearing the 
  +   * <code>exclude-result-prefixes</code> or <code>xsl:exclude-result-prefixes</code> 
  +   * attribute; a subtree rooted at an <code>xsl:stylesheet</code> element
  +   * does not include any stylesheets imported or included by children
  +   * of that <code>xsl:stylesheet</code> element."
  +   */
  +  bool shouldExcludeResultNamespaceNode(
  +		  const XalanDOMString& prefix, const XalanDOMString& uri);
  +
  +  /** 
  +   * The table of namespaces that are excluded from being 
  +   * used in the result tree but which need to be used 
  +   * in to resolve prefixes.
  +   * @serial
  +   */
  +  String2StringMapType m_excludedNamespaces;
   
   	/**
   	 * Given an element and mode, find the corresponding
  
  
  
  1.4       +1 -1      xml-xalan/c/src/XSLT/ElemValueOf.cpp
  
  Index: ElemValueOf.cpp
  ===================================================================
  RCS file: /home/cvs/xml-xalan/c/src/XSLT/ElemValueOf.cpp,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- ElemValueOf.cpp	2000/04/11 15:09:26	1.3
  +++ ElemValueOf.cpp	2000/04/12 19:41:00	1.4
  @@ -121,7 +121,7 @@
   			break; 
   
   		default:
  -			if(!isAttrOK(tok, aname, atts, i))
  +			if(!isAttrOK(aname, atts, i, constructionContext))
   			{
   				constructionContext.error(name + " has an illegal attribute: " + aname);
   			} 
  
  
  
  1.4       +1 -1      xml-xalan/c/src/XSLT/ElemVariable.cpp
  
  Index: ElemVariable.cpp
  ===================================================================
  RCS file: /home/cvs/xml-xalan/c/src/XSLT/ElemVariable.cpp,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- ElemVariable.cpp	2000/04/11 15:09:27	1.3
  +++ ElemVariable.cpp	2000/04/12 19:41:00	1.4
  @@ -125,7 +125,7 @@
   			break; 
   
   		default:
  -			if(!isAttrOK(tok, aname, atts, i))
  +			if(!isAttrOK(aname, atts, i, constructionContext))
   			{
   				constructionContext.error(name + " has an illegal attribute: " + aname);
   			}
  
  
  
  1.4       +1 -1      xml-xalan/c/src/XSLT/ElemWhen.cpp
  
  Index: ElemWhen.cpp
  ===================================================================
  RCS file: /home/cvs/xml-xalan/c/src/XSLT/ElemWhen.cpp,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- ElemWhen.cpp	2000/04/11 15:09:27	1.3
  +++ ElemWhen.cpp	2000/04/12 19:41:00	1.4
  @@ -106,7 +106,7 @@
   			break;
   
   		default:
  -			if(!isAttrOK(tok, aname, atts, i))
  +			if(!isAttrOK(aname, atts, i, constructionContext))
   			{
   				constructionContext.error(name + " has an illegal attribute: " + aname);
   			}
  
  
  
  1.6       +1 -1      xml-xalan/c/src/XSLT/FunctionDocument.cpp
  
  Index: FunctionDocument.cpp
  ===================================================================
  RCS file: /home/cvs/xml-xalan/c/src/XSLT/FunctionDocument.cpp,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- FunctionDocument.cpp	2000/04/11 15:09:27	1.5
  +++ FunctionDocument.cpp	2000/04/12 19:41:00	1.6
  @@ -234,7 +234,7 @@
   													executionContext.getNodeData(*arg->nodeset().item(i)) :
   													arg->str();
   
  -			if(length(ref) > 0)
  +			if(! isEmpty(ref))
   			{
   				if(docContext == 0)
   				{
  
  
  
  1.5       +3 -0      xml-xalan/c/src/XSLT/FunctionKey.cpp
  
  Index: FunctionKey.cpp
  ===================================================================
  RCS file: /home/cvs/xml-xalan/c/src/XSLT/FunctionKey.cpp,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- FunctionKey.cpp	2000/04/11 15:09:27	1.4
  +++ FunctionKey.cpp	2000/04/12 19:41:00	1.5
  @@ -79,6 +79,9 @@
   #include <XPath/XPathExecutionContext.hpp>
   
   
  +#if !defined(XALAN_NO_NAMESPACES)
  +	using std::set;
  +#endif 
   
   
   
  
  
  
  1.4       +6 -0      xml-xalan/c/src/XSLT/FunctionKey.hpp
  
  Index: FunctionKey.hpp
  ===================================================================
  RCS file: /home/cvs/xml-xalan/c/src/XSLT/FunctionKey.hpp,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- FunctionKey.hpp	2000/04/11 15:09:27	1.3
  +++ FunctionKey.hpp	2000/04/12 19:41:00	1.4
  @@ -84,6 +84,12 @@
   {
   public:
   
  +#if defined(XALAN_NO_NAMESPACES)
  +	typedef vector<XObject*> XObjectPtrVectorType;
  +#else
  +	typedef std::vector<XObject*> XObjectPtrVectorType;
  +#endif 
  +
   	FunctionKey();
   
   	virtual
  
  
  
  1.7       +6 -1      xml-xalan/c/src/XSLT/NumeratorFormatter.cpp
  
  Index: NumeratorFormatter.cpp
  ===================================================================
  RCS file: /home/cvs/xml-xalan/c/src/XSLT/NumeratorFormatter.cpp,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- NumeratorFormatter.cpp	2000/04/11 15:09:28	1.6
  +++ NumeratorFormatter.cpp	2000/04/12 19:41:01	1.7
  @@ -484,9 +484,14 @@
   {
   	XalanDOMString	roman;
   
  -	if(val <= 0)
  +	if(val < 0)
   	{
   		roman = XalanDOMString(XALAN_STATIC_UCODE_STRING("#E(")) + XalanDOMString(val) + XalanDOMString(XALAN_STATIC_UCODE_STRING(")"));
  +	}
  +	// Make this match the conformance test
  +	else if(val == 0)
  +	{
  +		roman = DOMString(XALAN_STATIC_UCODE_STRING("0"));
   	}
   	else
   	{
  
  
  
  1.9       +4 -7      xml-xalan/c/src/XSLT/Stylesheet.hpp
  
  Index: Stylesheet.hpp
  ===================================================================
  RCS file: /home/cvs/xml-xalan/c/src/XSLT/Stylesheet.hpp,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- Stylesheet.hpp	2000/04/11 15:09:29	1.8
  +++ Stylesheet.hpp	2000/04/12 19:41:01	1.9
  @@ -599,13 +599,10 @@
   	 * XSL document, according to the rules specified in the xsl draft. 
   	 *
   	 * @param executionContext current execution context
  -	 * @param sourceTree		where the targetElem is to be found
  -	 * @param targetElem		element that needs a rule
  -	 * @param mode				string indicating the display mode
  -	 * @param useImports		means that this is an xsl:apply-imports commend
  -	 * @param foundStylesheet	if non-null, the Stylesheet that the found
  -	 *							template belongs to will be returned in the
  -	 *							foundStylesheet[0]
  +	 * @param sourceTree        where the targetElem is to be found
  +	 * @param targetElem        element that needs a rule
  +	 * @param mode              string indicating the display mode
  +	 * @param useImports        means that this is an xsl:apply-imports commend
   	 * @return pointer to rule that best matches targetElem
   	 */
   	virtual
  
  
  
  1.6       +21 -0     xml-xalan/c/src/XSLT/StylesheetExecutionContext.hpp
  
  Index: StylesheetExecutionContext.hpp
  ===================================================================
  RCS file: /home/cvs/xml-xalan/c/src/XSLT/StylesheetExecutionContext.hpp,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- StylesheetExecutionContext.hpp	2000/04/11 15:09:29	1.5
  +++ StylesheetExecutionContext.hpp	2000/04/12 19:41:01	1.6
  @@ -480,6 +480,27 @@
   	getParamVariable(const QName&	theName) const = 0;
   
   	/**
  +	 * Get the top of the stack frame from where a search 
  +	 * for a variable or param should take place.
  +	 *
  +	 * @return current value of index
  +	 */
  +	virtual int getCurrentStackFrameIndex() const = 0;
  +
  +	/**
  +	 * Set the top of the stack frame from where a search 
  +	 * for a variable or param should take place.
  +	 *
  +	 * @param currentStackFrameIndex new value of index
  +	 */
  +	virtual void setCurrentStackFrameIndex(int currentStackFrameIndex = -1) = 0;
  +
  +	/**
  +	 * Mark the top of the global stack where global searches should start.
  +	 */
  +	virtual void markGlobalStackFrame() = 0;
  +
  +	/**
   	 * Receive notification of the beginning of a document.
   	 *
   	 * <p>The SAX parser will invoke this method only once, before any
  
  
  
  1.5       +17 -1     xml-xalan/c/src/XSLT/StylesheetExecutionContextDefault.cpp
  
  Index: StylesheetExecutionContextDefault.cpp
  ===================================================================
  RCS file: /home/cvs/xml-xalan/c/src/XSLT/StylesheetExecutionContextDefault.cpp,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- StylesheetExecutionContextDefault.cpp	2000/04/11 15:09:30	1.4
  +++ StylesheetExecutionContextDefault.cpp	2000/04/12 19:41:01	1.5
  @@ -290,7 +290,7 @@
   	AttributeListImpl	thePendingAttributes(m_xsltProcessor.getPendingAttributes());
   
   	// Remove the old attribute, then add the new one...
  -	thePendingAttributes.removeAttribute(theName);
  +	// thePendingAttributes.removeAttribute(theName);
   	thePendingAttributes.addAttribute(theName, theNewType, theNewValue);
   
   	// Set the new pending attributes...
  @@ -497,6 +497,22 @@
   	return m_xsltProcessor.getParamVariable(theName);
   }
   
  +int StylesheetExecutionContextDefault::getCurrentStackFrameIndex() const
  +{
  +	return m_xsltProcessor.getVariableStacks().getCurrentStackFrameIndex();
  +}
  +
  +void StylesheetExecutionContextDefault::setCurrentStackFrameIndex(int
  +		currentStackFrameIndex)
  +{
  +	m_xsltProcessor.getVariableStacks().setCurrentStackFrameIndex(currentStackFrameIndex);
  +}
  +
  +void StylesheetExecutionContextDefault::markGlobalStackFrame()
  +{
  +	m_xsltProcessor.getVariableStacks().markGlobalStackFrame();
  +}
  +	
   
   
   void
  
  
  
  1.6       +6 -0      xml-xalan/c/src/XSLT/StylesheetExecutionContextDefault.hpp
  
  Index: StylesheetExecutionContextDefault.hpp
  ===================================================================
  RCS file: /home/cvs/xml-xalan/c/src/XSLT/StylesheetExecutionContextDefault.hpp,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- StylesheetExecutionContextDefault.hpp	2000/04/11 15:09:30	1.5
  +++ StylesheetExecutionContextDefault.hpp	2000/04/12 19:41:01	1.6
  @@ -241,6 +241,12 @@
   	virtual XObject*
   	getParamVariable(const QName&	theName) const;
   
  +	virtual int getCurrentStackFrameIndex() const;
  +
  +	virtual void setCurrentStackFrameIndex(int currentStackFrameIndex = -1);
  +
  +	virtual void markGlobalStackFrame();
  +	
   	virtual void
   	startDocument();
   
  
  
  
  1.16      +36 -16    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.15
  retrieving revision 1.16
  diff -u -r1.15 -r1.16
  --- StylesheetHandler.cpp	2000/04/11 15:09:30	1.15
  +++ StylesheetHandler.cpp	2000/04/12 19:41:02	1.16
  @@ -125,7 +125,7 @@
   	m_constructionContext(constructionContext),
   	m_includeBase(stylesheetTree.getBaseIdentifier()),
   	m_pTemplate(0),
  -	m_pLastPopped(0),
  +	m_lastPopped(0),
   	m_inTemplate(false),
   	m_foundStylesheet(false),
   	m_foundNotImport(false),
  @@ -518,6 +518,21 @@
   						{
   							throw SAXException("default-space no longer supported!  Use xsl:strip-space or xsl:preserve-space instead.");
   						}
  +						else if(equals(aname, Constants::ATTRNAME_EXCLUDE_RESULT_PREFIXES))
  +						{
  +							m_constructionContext.warn(Constants::ATTRNAME_EXCLUDE_RESULT_PREFIXES
  +									+ " not supported yet!");
  +
  +						/*
  +							@@ TODO: implement this ---
  +							StringToStringTable excluded =
  +								m_stylesheet.getExcludeResultPrefixes();
  +							excluded =
  +								m_stylesheet.processExcludeResultPrefixes(atts.getValue(i),
  +										excluded);
  +							m_stylesheet.setExcludeResultPrefixes(excluded);
  +						*/
  +						}
   						else if(equals(aname, Constants::ATTRNAME_EXTENSIONELEMENTPREFIXES))
   						{
   							// BEGIN SANJIVA CODE
  @@ -1153,8 +1168,10 @@
   		{
   			foundIt = true;
   			
  -			PushPopIncludeState		theStateHandler(*this);
  +// ??			PushPopIncludeState		theStateHandler(*this);
   
  +			ElemTemplateElement* saved_pLastPopped = m_lastPopped;
  +			m_lastPopped = 0;
   			const XalanDOMString	href = atts.getValue(i);
   
   			assert(m_stylesheet.getIncludeStack().back() != 0);
  @@ -1173,6 +1190,7 @@
   			
   			m_stylesheet.getIncludeStack().pop_back();
   
  +			m_lastPopped = saved_pLastPopped;
   		}
   		else if(!isAttrOK(aname, atts, i))
   		{
  @@ -1198,11 +1216,11 @@
   
   	m_stylesheet.popNamespaces();
   
  -	m_pLastPopped = m_elemStack.back();
  +	m_lastPopped = m_elemStack.back();
   	m_elemStack.pop_back();
  -	m_pLastPopped->setFinishedConstruction(true);
  +	m_lastPopped->setFinishedConstruction(true);
   
  -	const int	tok = m_pLastPopped->getXSLToken();
  +	const int tok = m_lastPopped->getXSLToken();
   
   	if(Constants::ELEMNAME_TEMPLATE == tok)
   	{
  @@ -1211,7 +1229,7 @@
   	else if((Constants::ELEMNAME_PARAMVARIABLE == tok) ||
   		Constants::ELEMNAME_VARIABLE == tok)
   	{
  -		ElemVariable* const		var = static_cast<ElemVariable*>(m_pLastPopped);
  +		ElemVariable* const		var = static_cast<ElemVariable*>(m_lastPopped);
   
   		if(var->isTopLevel())
   		{
  @@ -1227,7 +1245,7 @@
   		tok == Constants::ELEMNAME_TEXT)
   	{
   		// These are stray elements, so delete them...
  -		delete m_pLastPopped;
  +		delete m_lastPopped;
   	}
   
   	// BEGIN SANJIVA CODE
  @@ -1314,8 +1332,14 @@
   
   			if(0 != last)
   			{
  -				if(Constants::ELEMNAME_TEXTLITERALRESULT == last->getXSLToken() &&
  -					static_cast<ElemTextLiteral*>(last)->isPreserveSpace() == false)
  +				ElemTemplateElement* lastElem = dynamic_cast<ElemTemplateElement*>(last);
  +				// If it was surrounded by xsl:text, it will count as an element.
  +				bool isPrevCharData =
  +					Constants::ELEMNAME_TEXTLITERALRESULT == lastElem->getXSLToken();
  +				bool isLastPoppedXSLText = (m_lastPopped != 0) &&
  +					(Constants::ELEMNAME_TEXT == m_lastPopped->getXSLToken());
  +
  +				if(isPrevCharData && ! isLastPoppedXSLText)
   				{
   					parent->appendChildElem(elem);
   
  @@ -1324,11 +1348,7 @@
   			}
   
   			if(shouldPush)
  -			{
   				m_whiteSpaceElems.push_back(elem);
  -
  -				elem = 0;
  -			}
   		}
   	}
   	// BEGIN SANJIVA CODE
  @@ -1483,7 +1503,7 @@
   	m_handler(theHandler),
   	m_elemStack(theHandler.m_elemStack),
   	m_pTemplate(theHandler.m_pTemplate),
  -	m_pLastPopped(theHandler.m_pLastPopped),
  +	m_lastPopped(theHandler.m_lastPopped),
   	m_inTemplate(theHandler.m_inTemplate),
   	m_foundStylesheet(theHandler.m_foundStylesheet),
   	m_XSLNameSpaceURL(theHandler.m_processor.getXSLNameSpaceURL()),
  @@ -1491,7 +1511,7 @@
   {
   	m_handler.m_elemStack.clear();
   	m_handler.m_pTemplate = 0;
  -	m_handler.m_pLastPopped = 0;
  +	m_handler.m_lastPopped = 0;
   	m_handler.m_inTemplate = false;
   	m_handler.m_foundStylesheet = false;
   	m_handler.m_foundNotImport = false;
  @@ -1513,7 +1533,7 @@
   
   	m_handler.m_elemStack = m_elemStack;
   	m_handler.m_pTemplate = m_pTemplate;
  -	m_handler.m_pLastPopped = m_pLastPopped;
  +	m_handler.m_lastPopped = m_lastPopped;
   	m_handler.m_inTemplate = m_inTemplate;
   	m_handler.m_foundStylesheet = m_foundStylesheet;
   	m_handler.m_processor.setXSLNameSpaceURL(m_XSLNameSpaceURL);
  
  
  
  1.10      +2 -2      xml-xalan/c/src/XSLT/StylesheetHandler.hpp
  
  Index: StylesheetHandler.hpp
  ===================================================================
  RCS file: /home/cvs/xml-xalan/c/src/XSLT/StylesheetHandler.hpp,v
  retrieving revision 1.9
  retrieving revision 1.10
  diff -u -r1.9 -r1.10
  --- StylesheetHandler.hpp	2000/04/11 15:09:30	1.9
  +++ StylesheetHandler.hpp	2000/04/12 19:41:02	1.10
  @@ -439,7 +439,7 @@
   	 * The last element popped from the stack.  I'm not totally clear 
   	 * anymore as to why this is needed.
   	 */
  -	ElemTemplateElement* m_pLastPopped;
  +	ElemTemplateElement* m_lastPopped;
   	
   	/**
   	 * True if the process is in a template context.
  @@ -491,7 +491,7 @@
   
   		ElemTemplate* const			m_pTemplate;
   
  -		ElemTemplateElement* const	m_pLastPopped;
  +		ElemTemplateElement* const	m_lastPopped;
   
   		const bool					m_inTemplate;
   
  
  
  
  1.9       +2 -7      xml-xalan/c/src/XSLT/StylesheetRoot.cpp
  
  Index: StylesheetRoot.cpp
  ===================================================================
  RCS file: /home/cvs/xml-xalan/c/src/XSLT/StylesheetRoot.cpp,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- StylesheetRoot.cpp	2000/04/11 15:09:30	1.8
  +++ StylesheetRoot.cpp	2000/04/12 19:41:02	1.9
  @@ -200,9 +200,7 @@
   
   		FormatterListener* flistener = 0;
   		bool newListener = false;
  -
  -		// $$$ ToDo: Why is this Xerces-specific?
  -		XercesDOMPrintWriter* pw = 0;
  +		Writer* pw = 0;
   		bool newPW = false;
   
   		/*
  @@ -224,10 +222,7 @@
   
   			if(0 != outputTarget.getCharacterStream())
   			{
  -				// @@ JMD: is this right ??
  -				// java: pw = new PrintWriter(outputTarget.getCharacterStream());
  -				pw = static_cast<XercesDOMPrintWriter*>
  -					(outputTarget.getCharacterStream());
  +				pw = outputTarget.getCharacterStream();
   			}
   			else
   			{
  
  
  
  1.23      +86 -83    xml-xalan/c/src/XSLT/XSLTEngineImpl.cpp
  
  Index: XSLTEngineImpl.cpp
  ===================================================================
  RCS file: /home/cvs/xml-xalan/c/src/XSLT/XSLTEngineImpl.cpp,v
  retrieving revision 1.22
  retrieving revision 1.23
  diff -u -r1.22 -r1.23
  --- XSLTEngineImpl.cpp	2000/04/12 17:13:36	1.22
  +++ XSLTEngineImpl.cpp	2000/04/12 19:41:02	1.23
  @@ -144,6 +144,31 @@
   #include "XSLTInputSource.hpp"
   #include "XSLTProcessorException.hpp"
   
  + // @@@@
  +#include <iostream>
  +void dumpStack(XSLTEngineImpl::VariableStackStackType& m_stack)
  +{
  +	int  size = m_stack.size();
  +	assert (size < 100);
  +	for(int i = 0; i < size; i++)
  +	{
  +		const StackEntry* const		theEntry = m_stack[i];
  +		if(theEntry->getType() == StackEntry::eArgument)
  +		{
  +			const Arg* const	theArg =
  +				dynamic_cast<const Arg*>(theEntry);
  +			std::cout << i << ": " << theArg->getName().getLocalPart() << "\n";
  +		}
  +		else if(theEntry->getType() == StackEntry::eContextMarker)
  +			std::cout << i << " Context marker" << "\n";
  +		else if(theEntry->getType() == StackEntry::eElementMarker)
  +			std::cout << i <<  " Element marker" << "\n";
  +		else
  +			std::cout << "??" << "\n";
  +	}
  +//	std::cout << m_globalStackFrameIndex <<  ": global stack frame index" << "\n";
  +//	std::cout << m_currentStackFrameIndex <<  ": current stack frame index" << "\n";
  +}
   
   
   const double			XSLTEngineImpl::s_XSLTVerSupported(1.0);
  @@ -2310,7 +2335,7 @@
   void
   XSLTEngineImpl::copyNamespaceAttributes(
   			const XalanNode&	src,
  -			bool				srcIsStylesheetTree) 
  +			bool				/* srcIsStylesheetTree */) 
   {
   	int type;
   
  @@ -2341,7 +2366,8 @@
   					const XalanDOMString 	prefix = isPrefix ? substring(aname, 6) : XalanDOMString();
   					const XalanDOMString 	desturi = getResultNamespaceForPrefix(prefix);
   					XalanDOMString			srcURI = attr->getNodeValue();
  -
  +					/*
  +					@@ JMD: Not used anymore in java ...
   					const bool			isXSLNS =
   						srcIsStylesheetTree && equalsIgnoreCase(srcURI, m_XSLNameSpaceURL)
   						|| 0 != m_stylesheetRoot->lookupExtensionNSHandler(srcURI)
  @@ -2353,6 +2379,8 @@
   					}
   
   					if(!equalsIgnoreCase(srcURI, desturi) && !isXSLNS)
  +					*/
  +					if(!equalsIgnoreCase(srcURI, desturi))
   					{
   						addResultAttribute(m_pendingAttributes, aname, srcURI);
   					}
  @@ -3559,6 +3587,8 @@
   XSLTEngineImpl::resolveTopLevelParams(StylesheetExecutionContext&	executionContext)
   {
   	m_stylesheetRoot->pushTopLevelVariables(executionContext, m_topLevelParams);
  +	getVariableStacks().markGlobalStackFrame();
  +	getVariableStacks().pushContextMarker(0, 0);
   }
   
   
  @@ -3585,7 +3615,7 @@
   			const XalanDOMString&	/* codetype */)
   {
   #if 1
  -	error("XSL4C does not support extensions at this time!");
  +	error("Xalan does not support extensions at this time!");
   #else
   	try
   	{
  @@ -3631,7 +3661,7 @@
   			DispatcherFactory*	/* factory */)
   {
   #if 1
  -	error("XSL4C does not support extensions at this time!");
  +	error("Xalan does not support extensions at this time!");
   #else
   	if(0 != m_diagnosticsPrintWriter)
   	{
  @@ -3958,7 +3988,9 @@
   XSLTEngineImpl::VariableStack::VariableStack(XSLTEngineImpl&	theProcessor) :
   	m_caller(),
   	m_stack(),
  -	m_processor(theProcessor)
  +	m_processor(theProcessor),
  +	m_globalStackFrameIndex(-1),
  +	m_currentStackFrameIndex(0)
   {
   	pushContextMarker(0, 0);	
   }
  @@ -3990,7 +4022,7 @@
   void
   XSLTEngineImpl::VariableStack::pushElementMarker(const XalanNode*	elem)
   {
  -	m_stack.push_back(new ElementMarker(elem));
  +	push(new ElementMarker(elem), true);
   }
   
   
  @@ -4012,15 +4044,14 @@
   
   			if(theEntry->getType() == StackEntry::eElementMarker)
   			{
  -				m_stack.pop_back();
  +				pop();
   				fFound = true;
   			}
   			else
   			{
  -				m_stack.pop_back();
  +				pop();
   			}
   
  -			delete theEntry;
   		}
   	}
   }
  @@ -4059,7 +4090,7 @@
   			const XalanNode*	caller,
   			const XalanNode*	sourceNode)
   {
  -	m_stack.push_back(new ContextMarker(caller, sourceNode));
  +	push(new ContextMarker(caller, sourceNode), true);
   }
   
   
  @@ -4075,10 +4106,11 @@
   		const StackEntry* const		theEntry = m_stack[i];
   		assert(theEntry != 0);
   		int type = theEntry->getType();
  +		if (type >3 || type < 0)
  +			dumpStack(m_stack);
   		assert(type <4 && type >= 0);
   		fFound  = (type == StackEntry::eContextMarker);
  -		m_stack.pop_back();
  -		delete theEntry;
  +		pop();
   	}
   }
   
  @@ -4115,65 +4147,70 @@
   	{
   		try
   		{
  -			m_stack.pop_back();
  -
  +			// If we do a pop, the current stack index may point to the last
  +			// element, in which case it will be changed when the push happens, so
  +			// we need to preserve the current index
   			const ElemTemplateElement*	child =
   				xslCallTemplateElement.getFirstChildElem();
  -
  -			while(0 != child)
  +			if (0 != child)
   			{
  -				if(Constants::ELEMNAME_WITHPARAM == child->getXSLToken())
  +				pop();
  +
  +				while(0 != child)
   				{
  -					const ElemWithParam* const	xslParamElement =
  +					if(Constants::ELEMNAME_WITHPARAM == child->getXSLToken())
  +					{
  +						const ElemWithParam* const	xslParamElement =
   #if defined(XALAN_OLD_STYLE_CASTS)
  -						(ElemWithParam*)child;
  +							(ElemWithParam*)child;
   #else
   						static_cast<const ElemWithParam*>(child);
   #endif
   
  -					Arg*	theArg = 0;
  +						Arg*	theArg = 0;
   
  -					const XPath* const	pxpath = xslParamElement->getSelectPattern();
  +						const XPath* const	pxpath = xslParamElement->getSelectPattern();
   
  -					if(0 != pxpath)
  -					{
  -						XObject* const	theXObject =
  +						if(0 != pxpath)
  +						{
  +							XObject* const	theXObject =
   								pxpath->execute(sourceNode,
  -												*xslParamElement,
  -												executionContext.getXPathExecutionContext());
  +										*xslParamElement,
  +										executionContext.getXPathExecutionContext());
   
  -						theArg = new Arg(xslParamElement->getQName(), theXObject, true);
  -					}
  -					else
  -					{
  -						ResultTreeFragBase* const	theDocFragment =
  -							m_processor.createResultTreeFrag(executionContext,
  -									*xslParamElement,
  -									sourceTree,
  -									sourceNode,
  -									mode);
  -						assert(theDocFragment != 0);
  +							theArg = new Arg(xslParamElement->getQName(), theXObject, true);
  +						}
  +						else
  +						{
  +							ResultTreeFragBase* const	theDocFragment =
  +								m_processor.createResultTreeFrag(executionContext,
  +										*xslParamElement,
  +										sourceTree,
  +										sourceNode,
  +										mode);
  +							assert(theDocFragment != 0);
   
  -						XObject* var = m_processor.createXResultTreeFrag(*theDocFragment);
  +							XObject* var = m_processor.createXResultTreeFrag(*theDocFragment);
   
  -						theArg = new Arg(xslParamElement->getQName(), var, true);
  +							theArg = new Arg(xslParamElement->getQName(), var, true);
  +						}
  +						assert(theArg != 0);
  +
  +						tempStack.push_back(theArg);
   					}
  -					assert(theArg != 0);
   
  -					tempStack.push_back(theArg);
  +					child = child->getNextSiblingElem();
   				}
  -
  -				child = child->getNextSiblingElem();
   			}
   		}
   		catch(...)
   		{
  -			m_stack.push_back(cm);
  +			push(cm);
   
   			throw;
   		}
   
  -		m_stack.push_back(cm);
  +		push(cm);
   
   		try
   		{
  @@ -4181,7 +4218,7 @@
   			const int	nParams = tempStack.size();
   			for(int i = 0; i < nParams; i++)
   			{
  -				m_stack.push_back(tempStack.back());
  +				push(tempStack.back());
   				tempStack.pop_back();
   			}
   		}
  @@ -4205,39 +4242,6 @@
   }
   
   
  -
  -bool
  -XSLTEngineImpl::VariableStack::hasParamVariable(const QName&	qname) const
  -{
  -	bool hasit = false;
  -
  -	const int	nElems = m_stack.size();
  -
  -	// Sub 1 extra for the context marker.
  -	for(int i = (nElems - 1); i >= 0; i--)
  -	{
  -		const StackEntry* const		theEntry = m_stack[i];
  -		assert(theEntry != 0);
  -		if(theEntry->getType() == StackEntry::eArgument)
  -		{
  -			const Arg* const	theArg = static_cast<const Arg*>(theEntry);
  -
  -			if(theArg->getName().equals(qname))
  -			{
  -				hasit = true;
  -				break;
  -			}
  -		}
  -		else if(theEntry->getType() == StackEntry::eContextMarker)
  -		{
  -			break;
  -		}
  -	}
  -
  -	return hasit;
  -}
  -
  -
   void
   XSLTEngineImpl::VariableStack::pushVariable(
   			const QName&		name,
  @@ -4249,7 +4253,7 @@
   		pushElementMarker(e);
   	}
   
  -	m_stack.push_back(new Arg(name, val, false));
  +	push(new Arg(name, val, false), true);
   }
   
   
  @@ -4286,7 +4290,7 @@
   {
   	const Arg*	theResult = 0;
   
  -	const int	nElems = m_stack.size();
  +	const int	nElems = getCurrentStackFrameIndex();
   
   	// Sub 1 extra for the context marker.
   	for(int i = (nElems - 1); i >= 0; i--)
  @@ -4315,7 +4319,7 @@
   	if(0 == theResult && true == fSearchGlobalSpace)
   	{
   		// Look in the global space
  -		for(int i = 2; i < (nElems - 1); i++)
  +		for(int i = (m_globalStackFrameIndex-1); i >= 2; i--)
   		{
   			const StackEntry* const		theEntry = m_stack[i];
   			assert(theEntry != 0);
  @@ -4346,7 +4350,6 @@
   XSLTEngineImpl::InstallFunctions()
   {
   	XPath::installFunction(XALAN_STATIC_UCODE_STRING("current"), FunctionCurrent());
  -	XPath::installFunction(XALAN_STATIC_UCODE_STRING("current"), FunctionDocument());
   	XPath::installFunction(XALAN_STATIC_UCODE_STRING("format-number"), FunctionFormatNumber());
   	XPath::installFunction(XALAN_STATIC_UCODE_STRING("key"), FunctionKey());
   	XPath::installFunction(XALAN_STATIC_UCODE_STRING("unparsed-entity-uri"), FunctionUnparsedEntityURI());
  
  
  
  1.22      +83 -10    xml-xalan/c/src/XSLT/XSLTEngineImpl.hpp
  
  Index: XSLTEngineImpl.hpp
  ===================================================================
  RCS file: /home/cvs/xml-xalan/c/src/XSLT/XSLTEngineImpl.hpp,v
  retrieving revision 1.21
  retrieving revision 1.22
  diff -u -r1.21 -r1.22
  --- XSLTEngineImpl.hpp	2000/04/11 15:09:30	1.21
  +++ XSLTEngineImpl.hpp	2000/04/12 19:41:03	1.22
  @@ -69,6 +69,7 @@
   
   
   
  +
   // Standard library headers
   #include <cassert>
   #include <ctime>
  @@ -1619,15 +1620,6 @@
   		}
   
   		/**
  -		 * Tell if there is a param variable on the stack.
  -		 *
  -		 * @param qname name of variable
  -		 * @return true if variable is on stack
  -		 */
  -		bool
  -		hasParamVariable(const QName&	qname) const;
  -
  -		/**
   		 * Given a name, find the corresponding XObject.
   		 *
   		 * @param qname name of variable
  @@ -1654,6 +1646,76 @@
   				XObject*			val,
   				const XalanNode*	e);
   
  +		/**
  +		 * Mark the top of the global stack frame.
  +		 */
  +		void markGlobalStackFrame()
  +		{
  +			m_globalStackFrameIndex = m_stack.size();
  +		}
  +
  +		/**
  +		 * Set the top of the stack frame from where a search for a variable or
  +		 * param should take place.  Calling with no parameter will cause the
  +		 * index to be set to the size of the stack.
  +		 *
  +		 * @param currentStackFrameIndex new value of index
  +		 */
  +		void setCurrentStackFrameIndex(int currentStackFrameIndex = -1)
  +		{
  +			if (currentStackFrameIndex == -1)
  +				m_currentStackFrameIndex = m_stack.size();
  +			else
  +				m_currentStackFrameIndex = currentStackFrameIndex;
  +		}
  +
  +		/**
  +		 * Get the top of the stack frame from where a search 
  +		 * for a variable or param should take place.
  +		 *
  +		 * @return current value of index
  +		 */
  +		int getCurrentStackFrameIndex() const
  +		{
  +			return m_currentStackFrameIndex;
  +		}
  +
  +		/**
  +		 * Override the push in order to track the 
  +		 * m_currentStackFrameIndex correctly.
  +		 *
  +		 * @param stack entry to push
  +		 * @param isNew true if object was created on the heap
  +		 */
  +		void push(StackEntry* theEntry, bool isNew = false)
  +		{
  +			int type = theEntry->getType();
  +			assert(type <4 && type >= 0);
  +			if(m_currentStackFrameIndex == m_stack.size())
  +				m_currentStackFrameIndex+=1;
  +			m_stack.push_back(theEntry);
  +			m_isNew.push_back(isNew);
  +		}
  +
  +		/**
  +		 * Override the pop in order to track the 
  +		 * m_currentStackFrameIndex correctly.
  +		 *
  +		 * @return stack entry popped
  +		 */
  +		void pop()
  +		{
  +			assert (! m_stack.empty());
  +			if(m_currentStackFrameIndex == m_stack.size())
  +				m_currentStackFrameIndex-=1;
  +			StackEntry* theEntry = m_stack.back();
  +			m_stack.pop_back();
  +			if (m_isNew.back() == true)
  +				delete theEntry;
  +			m_isNew.pop_back();
  +		}
  +
  +
   	private:
   
   		XObject*
  @@ -1675,8 +1737,19 @@
   
   
   		VariableStackStackType			m_stack;
  +		BoolVectorType	m_isNew;
   
  -		XSLTEngineImpl& 				m_processor;
  +		XSLTEngineImpl&					m_processor;
  +
  +		int m_globalStackFrameIndex;
  +
  +		/**
  +		 * This is the top of the stack frame from where a search 
  +		 * for a variable or param should take place.  It may not 
  +		 * be the real stack top.
  +		 */
  +		unsigned int m_currentStackFrameIndex;
  +	
   	}; // end VariableStack
   
   	// Give VariableStack access to stuff.
  
  
  
  1.7       +1 -0      xml-xalan/c/src/XercesParserLiaison/XercesParserLiaison.hpp
  
  Index: XercesParserLiaison.hpp
  ===================================================================
  RCS file: /home/cvs/xml-xalan/c/src/XercesParserLiaison/XercesParserLiaison.hpp,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- XercesParserLiaison.hpp	2000/04/11 14:38:42	1.6
  +++ XercesParserLiaison.hpp	2000/04/12 19:41:11	1.7
  @@ -69,6 +69,7 @@
   
   
   // Xerces DOM header files
  +#include <util/XercesDefs.hpp>
   #include <sax/ErrorHandler.hpp>