xalan-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dbert...@apache.org
Subject cvs commit: xml-xalan/c/src/XSLT XSLTEngineImpl.cpp
Date Tue, 30 Oct 2001 04:09:52 GMT
dbertoni    01/10/29 20:09:52

  Modified:    c/src/XSLT XSLTEngineImpl.cpp
  Log:
  Fixed problems with stylesheet PI and type pseudo-attribute.
  
  Revision  Changes    Path
  1.124     +19 -13    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.123
  retrieving revision 1.124
  diff -u -r1.123 -r1.124
  --- XSLTEngineImpl.cpp	2001/10/19 18:42:23	1.123
  +++ XSLTEngineImpl.cpp	2001/10/30 04:09:52	1.124
  @@ -110,7 +110,7 @@
   
   #include <XPath/ElementPrefixResolverProxy.hpp>
   #include <XPath/XalanQNameByReference.hpp>
  -#include <XPath/ResultTreeFrag.hpp>
  +#include <XPath/ResultTreeFragBase.hpp>
   #include <XPath/XObject.hpp>
   #include <XPath/XObjectFactory.hpp>
   #include <XPath/XPathEnvSupport.hpp>
  @@ -291,9 +291,12 @@
   
   		vector<XalanDOMString>	hrefs;
   
  -		// $$$ ToDo: is this first one style valid?
  -		const XalanDOMString	stylesheetNodeName1(XALAN_STATIC_UCODE_STRING("xml-stylesheet"));
  -		const XalanDOMString	stylesheetNodeName2(XALAN_STATIC_UCODE_STRING("xml:stylesheet"));
  +		const XalanDOMString	stylesheetNodeName(XALAN_STATIC_UCODE_STRING("xml-stylesheet"));
  +		const XalanDOMString	typeString(XALAN_STATIC_UCODE_STRING("type"));
  +		const XalanDOMString	typeValueString1(XALAN_STATIC_UCODE_STRING("text/xml"));
  +		const XalanDOMString	typeValueString2(XALAN_STATIC_UCODE_STRING("text/xsl"));
  +		const XalanDOMString	typeValueString3(XALAN_STATIC_UCODE_STRING("application/xml"));
  +		const XalanDOMString	typeValueString4(XALAN_STATIC_UCODE_STRING("application/xml+xslt"));
   
   		// $$$ ToDo: This code is much like that in getStyleSheetURIFromDoc().
   		// Why is it repeated???
  @@ -307,28 +310,30 @@
   			{
   				const XalanDOMString	nodeName(child->getNodeName());
   
  -				if(equals(nodeName, stylesheetNodeName1) ||
  -				   equals(nodeName, stylesheetNodeName2))
  +				if(equals(nodeName, stylesheetNodeName))
   				{
  -					bool isOK = true;
  +					bool isOK = false;
   
   					StringTokenizer 	tokenizer(child->getNodeValue(), XALAN_STATIC_UCODE_STRING(" \t="));
   
   					while(tokenizer.hasMoreTokens())
   					{
  -						if(equals(tokenizer.nextToken(), XALAN_STATIC_UCODE_STRING("type")))
  +						if(equals(tokenizer.nextToken(), typeString)) // "type"
   						{
   							XalanDOMString	typeVal = tokenizer.nextToken();
   
   							typeVal = substring(typeVal, 1, length(typeVal) - 1);
   
  -							if(!equals(typeVal, XALAN_STATIC_UCODE_STRING("text/xsl")))
  +							if(equals(typeVal, typeValueString1) ||
  +								equals(typeVal, typeValueString2) ||
  +								equals(typeVal, typeValueString3) ||
  +								equals(typeVal, typeValueString4))
   							{
  -								isOK = false;
  +								isOK = true;
   							}
   						}
  -					}	
  -						
  +					}
  +
   					if(isOK)
   					{
   						StringTokenizer 	tokenizer(child->getNodeValue(), XALAN_STATIC_UCODE_STRING("
\t="));
  @@ -2267,6 +2272,7 @@
   			bool					shouldCloneAttributes)
   {
   	assert(nodeType == node.getNodeType());
  +	assert(m_executionContext != 0);
   
   	switch(nodeType)
   	{
  @@ -2279,7 +2285,7 @@
   			if(!overrideStrip)
   			{
   				stripWhiteSpace = isLiteral ? true : false;
  -			  // was: stripWhiteSpace = isLiteral ? true : shouldStripSourceNode(node);
  +				// stripWhiteSpace = isLiteral ? true : shouldStripSourceNode(*m_executionContext,
node);
   			}
   
   			const XalanText& 	tx =
  
  
  

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


Mime
View raw message