You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@xalan.apache.org by db...@apache.org on 2001/11/27 00:21:45 UTC

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

dbertoni    01/11/26 15:21:45

  Modified:    c/src/XSLT Stylesheet.cpp Stylesheet.hpp
  Log:
  Fixed error reporting.  Retrieve xsl:decimal-format elements by QName.
  
  Revision  Changes    Path
  1.67      +15 -27    xml-xalan/c/src/XSLT/Stylesheet.cpp
  
  Index: Stylesheet.cpp
  ===================================================================
  RCS file: /home/cvs/xml-xalan/c/src/XSLT/Stylesheet.cpp,v
  retrieving revision 1.66
  retrieving revision 1.67
  diff -u -r1.66 -r1.67
  --- Stylesheet.cpp	2001/11/15 15:44:04	1.66
  +++ Stylesheet.cpp	2001/11/26 23:21:44	1.67
  @@ -267,21 +267,18 @@
   		}
   		else if (isAttrOK(aname, atts, i, constructionContext) == false)
   		{
  -			constructionContext.error(
  -				TranscodeFromLocalCodePage("xsl:key, unrecognized keyword '") +
  -					aname +
  -					TranscodeFromLocalCodePage("'!"));
  +			constructionContext.error("xsl:key has an illegal attribute");
   		}
   	}
   
   	if(0 == nameAttr)
  -		constructionContext.error(TranscodeFromLocalCodePage("xsl:key requires a ") + Constants::ATTRNAME_NAME + " attribute!");
  +		constructionContext.error("xsl:key requires a 'name' attribute");
   
   	if(0 == matchAttr)
  -		constructionContext.error(TranscodeFromLocalCodePage("xsl:key requires a ") + Constants::ATTRNAME_MATCH + " attribute!");
  +		constructionContext.error("xsl:key requires a 'match' attribute");
   
   	if(0 == useAttr)
  -		constructionContext.error(TranscodeFromLocalCodePage("xsl:key requires a ") + Constants::ATTRNAME_USE + " attribute!");
  +		constructionContext.error("xsl:key requires a 'use' attribute");
   
   	m_keyDeclarations.push_back(KeyDeclaration(XalanDOMString(nameAttr), *matchAttr, *useAttr));
   }
  @@ -509,7 +506,7 @@
   
   bool
   Stylesheet::getYesOrNo(
  -			const XalanDOMChar* 			aname,
  +			const XalanDOMChar* 			/* aname */,
   			const XalanDOMChar* 			val,
   			StylesheetConstructionContext&	constructionContext) const
   {
  @@ -523,7 +520,7 @@
   	}
   	else
   	{
  -		constructionContext.error(XalanDOMString(val) + " is unknown value for " + aname);
  +		constructionContext.error("The attribute value must be 'yes' or 'no'");
   
   		return false;
   	}
  @@ -578,19 +575,10 @@
   		else
   		{
   			// This is an error...
  -			XalanDOMString	theMessage(TranscodeFromLocalCodePage("The stylesheet already has a template with the name "));
  -
  -			const XalanDOMString&	theNamespace = theName.getNamespace();
  -
  -			if (length(theNamespace) != 0)
  -			{
  -				theMessage += theNamespace;
  -				theMessage += DOMServices::s_XMLNamespaceSeparatorString;
  -			}
  -
  -			theMessage += theName.getLocalPart();
  -
  -			constructionContext.error(theMessage, 0, theTemplate);
  +			constructionContext.error(
  +				"The stylesheet already has a template with this name",
  +				0,
  +				theTemplate);
   		}
   	}
   
  @@ -1159,7 +1147,7 @@
   
   void
   Stylesheet::processNSAliasElement(
  -			const XalanDOMChar*				name,
  +			const XalanDOMChar*				/* name */,
   			const AttributeList&			atts,
   			StylesheetConstructionContext&	constructionContext)
   {
  @@ -1201,7 +1189,7 @@
   		}
   		else if(!isAttrOK(aname, atts, i, constructionContext))
   		{
  -			constructionContext.error(XalanDOMString(name) + " has an illegal attribute: " + aname);
  +			constructionContext.error("xsl:namespace-alias has an illegal attribute");
   		}
   	}
   
  @@ -1284,7 +1272,7 @@
   
   
   const XalanDecimalFormatSymbols*
  -Stylesheet::getDecimalFormatSymbols(const XalanDOMString&	name) const
  +Stylesheet::getDecimalFormatSymbols(const XalanQName&	theQName) const
   {
   	const XalanDecimalFormatSymbols* 				dfs = 0;
   
  @@ -1302,7 +1290,7 @@
   				m_elemDecimalFormats[i - 1];
   			assert(theCurrent != 0);
   
  -			if (equals(theCurrent->getName(), name) == true)
  +			if (theCurrent->getQName().equals(theQName) == true)
   			{
   				dfs = &theCurrent->getDecimalFormatSymbols();
   
  @@ -1320,7 +1308,7 @@
   	{
   		for(StylesheetVectorType::size_type i = 0; i < m_importsSize; ++i)
   		{
  -			dfs = m_imports[i]->getDecimalFormatSymbols(name);
  +			dfs = m_imports[i]->getDecimalFormatSymbols(theQName);
   
   			if(dfs != 0)
   			{
  
  
  
  1.41      +3 -3      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.40
  retrieving revision 1.41
  diff -u -r1.40 -r1.41
  --- Stylesheet.hpp	2001/08/13 17:08:53	1.40
  +++ Stylesheet.hpp	2001/11/26 23:21:44	1.41
  @@ -524,13 +524,13 @@
   
   	/**
   	 * Retrieve the XalanDecimalFormatSymbols instance associated with
  -	 * the name.
  +	 * the QName.
   	 *
  -	 * @param name the name for the lookup
  +	 * @param theQName the QName for the lookup
   	 * @return a pointer to the matching instance, or 0 if none was found
   	 */
   	const XalanDecimalFormatSymbols*
  -	getDecimalFormatSymbols(const XalanDOMString&	name) const;
  +	getDecimalFormatSymbols(const XalanQName&	theQName) const;
   
   	/**
   	 * Add an attribute set to the list.
  
  
  

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