void
TraceListenerDefault::processNodeList(const NodeRefListBase&        nl)
{
    m_printWriter.println();

    const NodeRefListBase::size_type    n = nl.getLength();

    XalanDOMString  msg(m_memoryManager);

    if(n == 0)
    {
        m_printWriter.println(
            XalanMessageLoader::getMessage(
                msg,
                XalanMessages::EmptyNodeList));
    }
    else
    {
        for(NodeRefListBase::size_type i = 0; i < n; i++)
        {
            assert(nl.item(i) != 0);

            m_printWriter.print(XALAN_STATIC_UCODE_STRING("     "));

            DOMServices::getNodeData(*nl.item(i), msg);

            m_printWriter.println(msg);
        }
    }
}
Exemplo n.º 2
0
XALAN_CPP_NAMESPACE_BEGIN



FunctionLang::FunctionLang() :
	m_attributeName(XALAN_STATIC_UCODE_STRING("lang"))
{
}
Exemplo n.º 3
0
const XObjectPtr
ElemVariable::getValue(
			StylesheetExecutionContext&		executionContext,
			XalanNode*						sourceNode) const
{
	if(m_selectPattern == 0)
	{
		if (getFirstChildElem() == 0)
		{
			return executionContext.getXObjectFactory().createStringReference(s_emptyString);
		}
		else
		{
			return executionContext.createXResultTreeFrag(*this, sourceNode);
		}
	}
	else
	{
		XObjectPtr	theValue;

		XalanNode* const	theCurrentNode = executionContext.getCurrentNode();
		
		if (theCurrentNode == sourceNode)
		{
			theValue = m_selectPattern->execute(*this, executionContext);
		}
		else
		{
			const XPathExecutionContext::CurrentNodePushAndPop	theCurrentNodePushAndPop(executionContext, sourceNode);

			theValue = m_selectPattern->execute(*this, executionContext);
		}

		if(0 != executionContext.getTraceListeners())
		{
			executionContext.fireSelectEvent(
				SelectionEvent(
					executionContext,
					sourceNode,
					*this,
					StaticStringToDOMString(XALAN_STATIC_UCODE_STRING("select")),
					*m_selectPattern,
					theValue));
		}

		return theValue;
	}
}
Exemplo n.º 4
0
void
DOMServices::initialize()
{
	::s_XMLString = XALAN_STATIC_UCODE_STRING("xml");
	::s_XMLStringWithSeparator = XALAN_STATIC_UCODE_STRING("xml:");
	::s_XMLNamespacePrefix = XALAN_STATIC_UCODE_STRING("xmlns:xml");
	::s_XMLNamespaceURI = XALAN_STATIC_UCODE_STRING("http://www.w3.org/XML/1998/namespace");
	::s_XMLNamespace = XALAN_STATIC_UCODE_STRING("xmlns");
	::s_XMLNamespaceWithSeparator = XALAN_STATIC_UCODE_STRING("xmlns:");
	::s_XMLNamespaceSeparatorString = XALAN_STATIC_UCODE_STRING(":");
	::s_XMLNamespacePrefixURI = XALAN_STATIC_UCODE_STRING("http://www.w3.org/2000/xmlns/");

	::s_XMLStringLength = length(DOMServices::s_XMLString);
	::s_XMLStringWithSeparatorLength = length(DOMServices::s_XMLStringWithSeparator);
	::s_XMLNamespacePrefixLength = length(DOMServices::s_XMLNamespacePrefix);
	::s_XMLNamespaceURILength = length(DOMServices::s_XMLNamespaceURI);
	::s_XMLNamespaceLength = length(DOMServices::s_XMLNamespace);
	::s_XMLNamespaceWithSeparatorLength = length(DOMServices::s_XMLNamespaceWithSeparator);
	::s_XMLNamespaceSeparatorStringLength = length(DOMServices::s_XMLNamespaceSeparatorString);
	::s_XMLNamespacePrefixURILength = length(DOMServices::s_XMLNamespacePrefixURI);
}
Exemplo n.º 5
0
int
runTests(
			int		argc,
			char*	argv[])
{
	// Just hoist everything...
	XALAN_CPP_NAMESPACE_USE

	MemoryManagerType& theManager = XalanMemMgrs::getDefaultXercesMemMgr();

	XalanFileUtility	h(theManager);

	// Set the program help string,  then get the command line parameters.
	//
	setHelp(h);

	bool setGold = false;

	const XalanDOMString	processorType(XALAN_STATIC_UCODE_STRING("XalanC"));

	if (h.getParams(argc, argv, "PERFT-RESULTS", setGold) == true)
	{
		XalanTransformer xalan;

		// Generate Unique Run id and processor info
		XalanDOMString UniqRunid;
		h.generateUniqRunid(UniqRunid);


		// Defined basic constants for file manipulation and open results file
		const XalanDOMString  resultFilePrefix("cpp");
		XalanDOMString  resultsFile= h.args.output;
		resultsFile += resultFilePrefix;
		resultsFile += UniqRunid;
		resultsFile += XalanFileUtility::s_xmlSuffix;


		XalanXMLFileReporter	logFile(theManager, resultsFile);
		logFile.logTestFileInit("Performance Testing - Reports various performance metrics using the Transformer");

		// Get the list of sub-directories below "base" and iterate through them
		bool foundDir = false;		// Flag indicates directory found. Used in conjunction with -sub cmd-line arg.

		typedef XalanFileUtility::FileNameVectorType		FileNameVectorType;

		FileNameVectorType dirs;
		h.getDirectoryNames(h.args.base, dirs);

		for(FileNameVectorType::size_type	j = 0; j < dirs.size(); j++)
		{
			// Run specific category of files from given directory
			if (length(h.args.sub) > 0 && !equals(dirs[j], h.args.sub))
			{
				continue;
			}

			cout << "Processing files in Directory: " << dirs[j] << endl;

			// Check that output directory is there.
			XalanDOMString  theOutputDir = h.args.output;
			theOutputDir += dirs[j];
			h.checkAndCreateDir(theOutputDir);

					
			// Indicate that directory was processed and get test files from the directory
			foundDir = true;
			FileNameVectorType files;
			h.getTestFileNames(h.args.base, dirs[j], false, files);
			XalanDOMString logEntry;
			logEntry = "Performance Directory: ";
			logEntry += dirs[j];
			logFile.logTestCaseInit(logEntry);

			const long	iterCount = h.args.iters;

			for(FileNameVectorType::size_type i = 0; i < files.size(); i++)
			{
				// Define  variables used for timing and reporting ...
				clock_t startTime, endTime, accmTime, avgEtoe;
				double timeinMilliseconds = 0, theAverage =0;
				int transformResult = 0;

				typedef XalanXMLFileReporter::Hashtable	Hashtable;

				Hashtable attrs(theManager);

				attrs.insert(Hashtable::value_type(XalanDOMString("idref"), files[i]));
				attrs.insert(Hashtable::value_type(XalanDOMString("UniqRunid"),UniqRunid));
				attrs.insert(Hashtable::value_type(XalanDOMString("processor"),processorType));
				logFile.addMetricToAttrs("Iterations",iterCount, attrs);
								
				if (h.args.skip)
				{
					if (checkForExclusion(files[i]))
						continue;
				}

				XalanDOMString  theXSLFile = h.args.base;
				theXSLFile += dirs[j];
				theXSLFile += XalanFileUtility::s_pathSep;
				theXSLFile += files[i];

				XalanDOMString  theXMLFile; 
				h.generateFileName(theXSLFile,"xml", theXMLFile);

				XalanDOMString  outbase = h.args.output;
				outbase += dirs[j];
				outbase += XalanFileUtility::s_pathSep;
				outbase += files[i]; 
				XalanDOMString  theOutputFile;
				h.generateFileName(outbase, "out", theOutputFile);

				const XSLTInputSource	xslInputSource(theXSLFile);
				const XSLTInputSource	xmlInputSource(theXMLFile);
				const XSLTResultTarget	theResultTarget(theOutputFile);

				attrs.insert(Hashtable::value_type(XalanDOMString("href"), theXSLFile));
				cout << endl << files[i] << endl;

				// Time the parsing(compile) of the XSL stylesheet and report the results..
				//
				startTime = clock();
				const XalanCompiledStylesheet*	compiledSS = 0;
				xalan.compileStylesheet(xslInputSource, compiledSS);
				endTime = clock();

				if (compiledSS == 0)
				{
					continue;
				}

				timeinMilliseconds = calculateElapsedTime(startTime, endTime);
				cout << "   XSL: " << timeinMilliseconds << " milliseconds, Parse" << endl;
				logFile.addMetricToAttrs("parsexsl",timeinMilliseconds, attrs);	

				// Time the parsing of the input XML and report the results..
				//
				startTime = clock();
				const XalanParsedSource*	parsedSource = 0;
				xalan.parseSource(xmlInputSource, parsedSource);
				endTime = clock();

				if (parsedSource == 0)
				{
					continue;
				}

				timeinMilliseconds = calculateElapsedTime(startTime, endTime);
				cout << "   XML: " << timeinMilliseconds << " milliseconds, Parse" <<endl;
				logFile.addMetricToAttrs("parsexml",timeinMilliseconds, attrs);

				// Perform One transform using parsed stylesheet and unparsed xml source, report results...
				// 
				startTime = clock();
					transformResult = xalan.transform(xmlInputSource, compiledSS, theResultTarget);
				endTime = clock();
				if(!transformResult)
				{
					timeinMilliseconds = calculateElapsedTime(startTime, endTime);
					cout << endl << "   One: " << timeinMilliseconds << " w/Parsed XSL." << endl;
					logFile.addMetricToAttrs("single", timeinMilliseconds, attrs);	
				}
				else
				{
					cout << xalan.getLastError();
					return -1;
				}

				// Do One eTOe transform with no pre parsing of either xsl or xml files.
				// And output metrics to console and result log
				startTime = clock();
					transformResult = xalan.transform(xmlInputSource, xslInputSource, theResultTarget);
				endTime = clock();
				if(!transformResult)
				{
					timeinMilliseconds = calculateElapsedTime(startTime, endTime);
					cout << "   One: " << timeinMilliseconds << " eTOe." << endl;
					logFile.addMetricToAttrs("etoe", timeinMilliseconds, attrs);	
				}
				else
				{
					cout << xalan.getLastError();
					return -1;
				}


				// Perform multiple transforms and calculate the average time ..
				// These are done 3 different ways.
				//
				// FIRST: Parsed XSL Stylesheet and Parsed XML Source.
				//
				accmTime = 0;
				for(int j = 0; j < iterCount; ++j)
				{	
					startTime = clock();
						transformResult = xalan.transform(*parsedSource, compiledSS, theResultTarget);
					endTime = clock();
					
					accmTime += endTime - startTime;
				}

				theAverage = calculateAvgTime(accmTime, iterCount); 
				cout << endl << "   Avg: " << theAverage << " for " << iterCount << " iter's w/Parsed files" << endl;
				logFile.addMetricToAttrs("avgparsedxml",theAverage, attrs);
				

				// SECOND: Parsed Stylesheet and UnParsed XML Source.
				// This is currently how the XalanJ 2.0 is performing transforms
				//
				accmTime = 0;
				for(int k = 0; k < iterCount; ++k)
				{
					startTime = clock();
						transformResult = xalan.transform(xmlInputSource, compiledSS, theResultTarget);
					endTime = clock();
					
					accmTime += endTime - startTime;						
				}
				theAverage = calculateAvgTime(accmTime, iterCount);
				cout << "   Avg: " << theAverage << " for " << iterCount << " iter's w/UnParsed XML" << endl;
				logFile.addMetricToAttrs("avgunparsedxml",theAverage, attrs);


				// THIRD: Neither Stylesheet nor XML Source are parsed.
				// Perform multiple etoe transforms and calculate the average ...
				//
				avgEtoe = 0;
				for(int jj = 0; jj < iterCount; ++jj)
				{	
					startTime = clock();
						transformResult = xalan.transform(xmlInputSource, xslInputSource, theResultTarget);
					endTime = clock();
					
					avgEtoe += endTime - startTime;						
				}
				theAverage = calculateAvgTime(avgEtoe,iterCount);

				// Output average transform time to console and result log
				cout << "   Avg: " << theAverage << " for " << iterCount << " iter's of eToe" << endl;
				logFile.addMetricToAttrs("avgetoe",theAverage, attrs);

				logFile.logElementWAttrs(10, "perf", attrs, "xxx");

				xalan.destroyParsedSource(parsedSource);
				xalan.destroyStylesheet(compiledSS);

			}

			logEntry = "Performance Directory: ";
			logEntry += dirs[j];
 			logFile.logTestCaseClose(logEntry, XalanDOMString("Done"));
		}

		// Check to see if -sub cmd-line directory was processed correctly.
		if (!foundDir)
		{
			cout << "Specified test directory: \"" << c_str(TranscodeToLocalCodePage(h.args.sub)) << "\" not found" << endl;
		}

		h.reportPassFail(logFile, UniqRunid);
		logFile.logTestFileClose("Performance", "Done");
		logFile.close();
	}

	return 0;
}
Exemplo n.º 6
0
XalanDocument*
XercesParserLiaison::parseXMLStream(
			const InputSourceType&	reader,
			const XalanDOMString&	/* identifier */)
{
	XalanAutoPtr<DOMParserType> 		theParser(CreateDOMParser());

	if (m_errorHandler == 0)
	{
		theParser->setErrorHandler(this);
	}
	else
	{
		theParser->setErrorHandler(m_errorHandler);
	}

	theParser->parse(reader);

#if XERCES_VERSION_MAJOR >= 2
	DOMDocument_Type* const	theXercesDocument =
		theParser->getDocument();

	theXercesDocument->normalize();
#else
	DOM_Document_Type	theXercesDocument =
		theParser->getDocument();

	theXercesDocument.normalize();
#endif

#if XERCES_VERSION_MAJOR >= 2
	XercesDocumentWrapper*	theNewDocument = 0;

	if (theXercesDocument != 0)
	{
		theNewDocument = doCreateDocument(theXercesDocument, m_threadSafe, m_buildWrapper, m_buildMaps, true);

		theParser->adoptDocument();
#else
	XercesDocumentBridge*	theNewDocument = 0;

	if (theXercesDocument.isNull() == false)
	{
		theNewDocument = doCreateDocument(theXercesDocument, m_threadSafe, m_buildBridge, true);
#endif
	}

	return theNewDocument;
}



void
XercesParserLiaison::destroyDocument(XalanDocument* 	theDocument)
{
	const DocumentMapType::iterator		i =
		m_documentMap.find(theDocument);

	if (i != m_documentMap.end())
	{
		const XalanAutoPtr<XalanDocument>	theGuard(theDocument);

		m_documentMap.erase(i);
	}
}



int
XercesParserLiaison::getIndent() const
{
	return m_indent;
}



void
XercesParserLiaison::setIndent(int	i)
{
	m_indent = i;
}



bool
XercesParserLiaison::getUseValidation() const
{
	return m_useValidation;
}



void
XercesParserLiaison::setUseValidation(bool	b)
{
	m_useValidation = b;
}



const XalanDOMString
XercesParserLiaison::getParserDescription() const
{
	return StaticStringToDOMString(XALAN_STATIC_UCODE_STRING("Xerces"));
}


DOMDocument_Type*
XercesParserLiaison::createDOMFactory()
{
    DOMDocument_Type* const     theXercesDocument =
        DOMImplementationType::getImplementation()->createDocument();

	createDocument(theXercesDocument, false, false);
	
    return theXercesDocument;
}



void
XercesParserLiaison::destroyDocument(DOMDocument_Type*  theDocument)
{
	// Delete any live documents...
	for(DocumentMapType::iterator i = m_documentMap.begin();
		i != m_documentMap.end();
		++i)
	{
		if ((*i).second.isDeprecated() == false &&
			(*i).second.m_wrapper->getXercesDocument() == theDocument)
		{
            destroyDocument((XalanDocument*)(*i).first);
		}
	}
}



bool
XercesParserLiaison::getIncludeIgnorableWhitespace() const
{
	return m_includeIgnorableWhitespace;
}



void
XercesParserLiaison::setIncludeIgnorableWhitespace(bool include)
{
	m_includeIgnorableWhitespace = include;
}



ErrorHandlerType*
XercesParserLiaison::getErrorHandler() const
{
	return m_errorHandler;
}



void
XercesParserLiaison::setErrorHandler(ErrorHandlerType*	handler)
{
	m_errorHandler = handler;
}



bool
XercesParserLiaison::getDoNamespaces() const
{
	return m_doNamespaces;
}



void
XercesParserLiaison::setDoNamespaces(bool	newState)
{
	m_doNamespaces = newState;
}



bool
XercesParserLiaison::getExitOnFirstFatalError() const
{
	return m_exitOnFirstFatalError;
}



void
XercesParserLiaison::setExitOnFirstFatalError(bool	newState)
{
	m_exitOnFirstFatalError = newState;
}



EntityResolverType*
XercesParserLiaison::getEntityResolver() const
{
	return m_entityResolver;
}



void
XercesParserLiaison::setEntityResolver(EntityResolverType*	resolver)
{
	m_entityResolver = resolver;
}



const XalanDOMChar*
XercesParserLiaison::getExternalSchemaLocation() const
{
	return m_externalSchemaLocation.length() == 0 ? 0 : m_externalSchemaLocation.c_str();
}



void
XercesParserLiaison::setExternalSchemaLocation(const XalanDOMChar*	location)
{
	if (location == 0)
	{
		m_externalSchemaLocation.clear();
	}
	else
	{
		m_externalSchemaLocation = location;
	}
}



const XalanDOMChar*
XercesParserLiaison::getExternalNoNamespaceSchemaLocation() const
{
	return m_externalNoNamespaceSchemaLocation.length() == 0 ? 0 : m_externalNoNamespaceSchemaLocation.c_str();
}



void
XercesParserLiaison::setExternalNoNamespaceSchemaLocation(const XalanDOMChar*	location)
{
	if (location == 0)
	{
		m_externalNoNamespaceSchemaLocation.clear();
	}
	else
	{
		m_externalNoNamespaceSchemaLocation= location;
	}
}



#if defined(XALAN_BUILD_DEPRECATED_DOM_BRIDGE)
XalanDocument*
XercesParserLiaison::createDocument(
			const DOM_Document_Type& 	theXercesDocument,
			bool						threadSafe,
			bool						buildBridge)
{
	return doCreateDocument(theXercesDocument, threadSafe, buildBridge);
}
#endif



XalanDocument*
XercesParserLiaison::createDocument(
			const DOMDocument_Type*		theXercesDocument,
			bool						threadSafe,
			bool						buildWrapper,
			bool						buildMaps)
{
	// As we did not create the underlying DOMDocument - ensure we don't
	// delete it later.
	return doCreateDocument(theXercesDocument, threadSafe, buildWrapper, buildMaps, false);
}



#if defined(XALAN_BUILD_DEPRECATED_DOM_BRIDGE)
XercesDocumentBridge*
XercesParserLiaison::mapDocument(const XalanDocument*	theDocument) const
{
	const DocumentMapType::const_iterator	i =
		m_documentMap.find(theDocument);

	return i != m_documentMap.end() ? (*i).second.m_isDeprecated == true ? (*i).second.m_bridge : 0 : 0;
}
#endif



XercesDocumentWrapper*
XercesParserLiaison::mapDocumentToWrapper(const XalanDocument*	theDocument) const
{
	const DocumentMapType::const_iterator	i =
		m_documentMap.find(theDocument);

	return i != m_documentMap.end() ? (*i).second.isDeprecated() == false ? (*i).second.m_wrapper : 0 : 0;
}



#if defined(XALAN_BUILD_DEPRECATED_DOM_BRIDGE)
DOM_Document_Type
XercesParserLiaison::mapXercesDocument(const XalanDocument* 	theDocument) const
{
	const DocumentMapType::const_iterator	i =
		m_documentMap.find(theDocument);

	return i != m_documentMap.end() ? (*i).second.isDeprecated() == true ? (*i).second.m_bridge->getXercesDocument() : DOM_Document_Type() : DOM_Document_Type();
}
#endif



const DOMDocument_Type*
XercesParserLiaison::mapToXercesDocument(const XalanDocument*	theDocument) const
{
	const DocumentMapType::const_iterator	i =
		m_documentMap.find(theDocument);

	return i != m_documentMap.end() ? (*i).second.isDeprecated() == false ? (*i).second.m_wrapper->getXercesDocument() : 0 : 0;
}



void
XercesParserLiaison::fatalError(const SAXParseExceptionType&	e)
{
	XalanDOMString	theMessage = XalanMessageLoader::getMessage(XalanMessages::FatalError);

	formatErrorMessage(e, theMessage);

	if (m_executionContext != 0)
	{
		// We call warning() because we don't want the execution
		// context to potentially throw an exception.
		m_executionContext->warn(theMessage);
	}
	else
	{
		XALAN_USING_STD(cerr)
		XALAN_USING_STD(endl)

		cerr << endl << theMessage << endl;
	}

	throw e;
}
Exemplo n.º 7
0
void
Constants::initialize()
{
    ::ATTRNAME_CASEORDER = XALAN_STATIC_UCODE_STRING("case-order");
    ::ATTRNAME_COUNT = XALAN_STATIC_UCODE_STRING("count");
    ::ATTRNAME_DATATYPE = XALAN_STATIC_UCODE_STRING("data-type");
    ::ATTRNAME_DECIMALSEPARATOR = XALAN_STATIC_UCODE_STRING("decimal-separator");
    ::ATTRNAME_DEFAULT = XALAN_STATIC_UCODE_STRING("default");
    ::ATTRNAME_DEFAULTSPACE = XALAN_STATIC_UCODE_STRING("default-space");
    ::ATTRNAME_DIGIT = XALAN_STATIC_UCODE_STRING("digit");
    ::ATTRNAME_DIGITGROUPSEP = XALAN_STATIC_UCODE_STRING("digit-group-sep");
    ::ATTRNAME_DISABLE_OUTPUT_ESCAPING  = XALAN_STATIC_UCODE_STRING("disable-output-escaping");
    ::ATTRNAME_ELEMENTS = XALAN_STATIC_UCODE_STRING("elements");
    ::ATTRNAME_ESCAPE_URLS = XALAN_STATIC_UCODE_STRING("use-url-escaping");
    ::ATTRNAME_EXCLUDE_RESULT_PREFIXES = XALAN_STATIC_UCODE_STRING("exclude-result-prefixes");
    ::ATTRNAME_EXTENSIONELEMENTPREFIXES = XALAN_STATIC_UCODE_STRING("extension-element-prefixes");
    ::ATTRNAME_FORMAT = XALAN_STATIC_UCODE_STRING("format");
    ::ATTRNAME_FROM = XALAN_STATIC_UCODE_STRING("from");
    ::ATTRNAME_GROUPINGSEPARATOR = XALAN_STATIC_UCODE_STRING("grouping-separator");
    ::ATTRNAME_GROUPINGSIZE = XALAN_STATIC_UCODE_STRING("grouping-size");
    ::ATTRNAME_HREF = XALAN_STATIC_UCODE_STRING("href");
    ::ATTRNAME_ID = XALAN_STATIC_UCODE_STRING("id");
    ::ATTRNAME_INDENTAMOUNT = XALAN_STATIC_UCODE_STRING("indent-amount");
    ::ATTRNAME_INDENTRESULT = XALAN_STATIC_UCODE_STRING("indent-result");
    ::ATTRNAME_INFINITY = XALAN_STATIC_UCODE_STRING("infinity");
    ::ATTRNAME_LANG = XALAN_STATIC_UCODE_STRING("lang");
    ::ATTRNAME_LETTERVALUE = XALAN_STATIC_UCODE_STRING("letter-value");
    ::ATTRNAME_MATCH = XALAN_STATIC_UCODE_STRING("match");
    ::ATTRNAME_MINUSSIGN = XALAN_STATIC_UCODE_STRING("minus-sign");
    ::ATTRNAME_MODE = XALAN_STATIC_UCODE_STRING("mode");
    ::ATTRNAME_NAME = XALAN_STATIC_UCODE_STRING("name");
    ::ATTRNAME_NAMESPACE = XALAN_STATIC_UCODE_STRING("namespace");
    ::ATTRNAME_NAN = XALAN_STATIC_UCODE_STRING("NaN");
    ::ATTRNAME_NDIGITSPERGROUP = XALAN_STATIC_UCODE_STRING("n-digits-per-group");
    ::ATTRNAME_OMIT_META_TAG = XALAN_STATIC_UCODE_STRING("omit-meta-tag");
    ::ATTRNAME_ORDER = XALAN_STATIC_UCODE_STRING("order");
    ::ATTRNAME_OUTPUT_CDATA_SECTION_ELEMENTS  = XALAN_STATIC_UCODE_STRING("cdata-section-elements");
    ::ATTRNAME_OUTPUT_DOCTYPE_PUBLIC = XALAN_STATIC_UCODE_STRING("doctype-public");
    ::ATTRNAME_OUTPUT_DOCTYPE_SYSTEM = XALAN_STATIC_UCODE_STRING("doctype-system");
    ::ATTRNAME_OUTPUT_ENCODING = XALAN_STATIC_UCODE_STRING("encoding");
    ::ATTRNAME_OUTPUT_INDENT = XALAN_STATIC_UCODE_STRING("indent");
    ::ATTRNAME_OUTPUT_MEDIATYPE = XALAN_STATIC_UCODE_STRING("media-type");
    ::ATTRNAME_OUTPUT_METHOD = XALAN_STATIC_UCODE_STRING("method");
    ::ATTRNAME_OUTPUT_OMITXMLDECL = XALAN_STATIC_UCODE_STRING("omit-xml-declaration");
    ::ATTRNAME_OUTPUT_STANDALONE  = XALAN_STATIC_UCODE_STRING("standalone");
    ::ATTRNAME_OUTPUT_VERSION = XALAN_STATIC_UCODE_STRING("version");
    ::ATTRNAME_PATTERNSEPARATOR = XALAN_STATIC_UCODE_STRING("pattern-separator");
    ::ATTRNAME_PERCENT = XALAN_STATIC_UCODE_STRING("percent");
    ::ATTRNAME_PERMILLE = XALAN_STATIC_UCODE_STRING("per-mille");
    ::ATTRNAME_PREFIX = XALAN_STATIC_UCODE_STRING("prefix");
    ::ATTRNAME_PRIORITY = XALAN_STATIC_UCODE_STRING("priority");
    ::ATTRNAME_RESULTNS = XALAN_STATIC_UCODE_STRING("result-ns");
    ::ATTRNAME_RESULT_PREFIX = XALAN_STATIC_UCODE_STRING("result-prefix");
    ::ATTRNAME_SELECT = XALAN_STATIC_UCODE_STRING("select");
    ::ATTRNAME_STYLESHEET_PREFIX = XALAN_STATIC_UCODE_STRING("stylesheet-prefix");
    ::ATTRNAME_TERMINATE = XALAN_STATIC_UCODE_STRING("terminate");
    ::ATTRNAME_TEST = XALAN_STATIC_UCODE_STRING("test");
    ::ATTRNAME_TYPE = XALAN_STATIC_UCODE_STRING("type");
    ::ATTRNAME_USE = XALAN_STATIC_UCODE_STRING("use");
    ::ATTRNAME_USEATTRIBUTESETS = XALAN_STATIC_UCODE_STRING("use-attribute-sets");
    ::ATTRNAME_VALUE = XALAN_STATIC_UCODE_STRING("value");
    ::ATTRNAME_VERSION = XALAN_STATIC_UCODE_STRING("version");
    ::ATTRNAME_SPACE = XALAN_STATIC_UCODE_STRING("space");
    ::ATTRNAME_XMLSPACE = XALAN_STATIC_UCODE_STRING("xml:space");
    ::ATTRNAME_ZERODIGIT = XALAN_STATIC_UCODE_STRING("zero-digit");

    ::ATTRTYPE_CDATA = XALAN_STATIC_UCODE_STRING("CDATA");

    ::ATTRVAL_CASEORDER_LOWER = XALAN_STATIC_UCODE_STRING("lower-first");
    ::ATTRVAL_CASEORDER_UPPER = XALAN_STATIC_UCODE_STRING("upper-first");
    ::ATTRVAL_DATATYPE_NUMBER = XALAN_STATIC_UCODE_STRING("number");
    ::ATTRVAL_DATATYPE_TEXT = XALAN_STATIC_UCODE_STRING("text");
    ::ATTRVAL_DEFAULT = XALAN_STATIC_UCODE_STRING("default");
    ::ATTRVAL_DEFAULT_PREFIX = XALAN_STATIC_UCODE_STRING("#default");
    ::ATTRVAL_DEFAULT_TEXT_RULE = XALAN_STATIC_UCODE_STRING("text() | @*");
    ::ATTRVAL_INFINITY = XALAN_STATIC_UCODE_STRING("Infinity");
    ::ATTRVAL_NAN = XALAN_STATIC_UCODE_STRING("NaN");
    ::ATTRVAL_NO = XALAN_STATIC_UCODE_STRING("no");
    ::ATTRVAL_ORDER_ASCENDING = XALAN_STATIC_UCODE_STRING("ascending");
    ::ATTRVAL_ORDER_DESCENDING = XALAN_STATIC_UCODE_STRING("descending");
    ::ATTRVAL_OUTPUT_METHOD_HTML = XALAN_STATIC_UCODE_STRING("html");
    ::ATTRVAL_OUTPUT_METHOD_TEXT = XALAN_STATIC_UCODE_STRING("text");
    ::ATTRVAL_OUTPUT_METHOD_XML = XALAN_STATIC_UCODE_STRING("xml");
    ::ATTRVAL_PRESERVE = XALAN_STATIC_UCODE_STRING("preserve");
    ::ATTRVAL_SIMPLE = XALAN_STATIC_UCODE_STRING("simple");
    ::ATTRVAL_STRIP = XALAN_STATIC_UCODE_STRING("strip");
    ::ATTRVAL_THIS = XALAN_STATIC_UCODE_STRING(".");
    ::ATTRVAL_YES = XALAN_STATIC_UCODE_STRING("yes");

    ::DEFAULT_WHITESPACE_SEPARATOR_STRING = XALAN_STATIC_UCODE_STRING(" \t\n\r");

    ::ELEMNAME_ANY_STRING = XALAN_STATIC_UCODE_STRING("any");
    ::ELEMNAME_APPLY_IMPORTS_WITH_PREFIX_STRING = XALAN_STATIC_UCODE_STRING("xsl:apply-imports");
    ::ELEMNAME_APPLY_TEMPLATES_WITH_PREFIX_STRING = XALAN_STATIC_UCODE_STRING("xsl:apply-templates");
    ::ELEMNAME_ATTRIBUTESET_WITH_PREFIX_STRING = XALAN_STATIC_UCODE_STRING("xsl:attribute-set");
    ::ELEMNAME_ATTRIBUTE_WITH_PREFIX_STRING = XALAN_STATIC_UCODE_STRING("xsl:attribute");
    ::ELEMNAME_CALLTEMPLATE_WITH_PREFIX_STRING = XALAN_STATIC_UCODE_STRING("xsl:call-template");
    ::ELEMNAME_CHOOSE_WITH_PREFIX_STRING = XALAN_STATIC_UCODE_STRING("xsl:choose");
    ::ELEMNAME_COMMENT_WITH_PREFIX_STRING = XALAN_STATIC_UCODE_STRING("xsl:comment");
    ::ELEMNAME_COPY_OF_WITH_PREFIX_STRING = XALAN_STATIC_UCODE_STRING("xsl:copy-of");
    ::ELEMNAME_COPY_WITH_PREFIX_STRING = XALAN_STATIC_UCODE_STRING("xsl:copy");
    ::ELEMNAME_DECIMALFORMAT_WITH_PREFIX_STRING = XALAN_STATIC_UCODE_STRING("xsl:decimal-format");
    ::ELEMNAME_DISPLAYIF_STRING = XALAN_STATIC_UCODE_STRING("display-if");
    ::ELEMNAME_ELEMENT_WITH_PREFIX_STRING = XALAN_STATIC_UCODE_STRING("xsl:element");
    ::ELEMNAME_FALLBACK_WITH_PREFIX_STRING = XALAN_STATIC_UCODE_STRING("xsl:fallback");
    ::ELEMNAME_FOREACH_WITH_PREFIX_STRING = XALAN_STATIC_UCODE_STRING("xsl:for-each");
    ::ELEMNAME_HTML_STRING = XALAN_STATIC_UCODE_STRING("HTML");
    ::ELEMNAME_IF_WITH_PREFIX_STRING = XALAN_STATIC_UCODE_STRING("xsl:if");
    ::ELEMNAME_IMPORT_WITH_PREFIX_STRING = XALAN_STATIC_UCODE_STRING("xsl:import");
    ::ELEMNAME_INCLUDE_WITH_PREFIX_STRING = XALAN_STATIC_UCODE_STRING("xsl:include");
    ::ELEMNAME_KEY_WITH_PREFIX_STRING = XALAN_STATIC_UCODE_STRING("xsl:key");
    ::ELEMNAME_MESSAGE_WITH_PREFIX_STRING = XALAN_STATIC_UCODE_STRING("xsl:message");
    ::ELEMNAME_NUMBER_WITH_PREFIX_STRING = XALAN_STATIC_UCODE_STRING("xsl:number");
    ::ELEMNAME_OTHERWISE_WITH_PREFIX_STRING = XALAN_STATIC_UCODE_STRING("xsl:otherwise");
    ::ELEMNAME_PARAM_WITH_PREFIX_STRING = XALAN_STATIC_UCODE_STRING("xsl:param");
    ::ELEMNAME_PI_WITH_PREFIX_STRING = XALAN_STATIC_UCODE_STRING("xsl:processing-instruction");
    ::ELEMNAME_PRESERVESPACE_WITH_PREFIX_STRING = XALAN_STATIC_UCODE_STRING("xsl:preserve-space");
    ::ELEMNAME_SORT_WITH_PREFIX_STRING = XALAN_STATIC_UCODE_STRING("xsl:sort");
    ::ELEMNAME_STRIPSPACE_WITH_PREFIX_STRING = XALAN_STATIC_UCODE_STRING("xsl:strip-space");
    ::ELEMNAME_TEMPLATE_WITH_PREFIX_STRING = XALAN_STATIC_UCODE_STRING("xsl:template");
    ::ELEMNAME_TEXT_WITH_PREFIX_STRING = XALAN_STATIC_UCODE_STRING("xsl:text");
    ::ELEMNAME_VALUEOF_WITH_PREFIX_STRING = XALAN_STATIC_UCODE_STRING("xsl:value-of");
    ::ELEMNAME_VARIABLE_WITH_PREFIX_STRING = XALAN_STATIC_UCODE_STRING("xsl:variable");
    ::ELEMNAME_WHEN_WITH_PREFIX_STRING = XALAN_STATIC_UCODE_STRING("xsl:when");
    ::ELEMNAME_WITHPARAM_WITH_PREFIX_STRING = XALAN_STATIC_UCODE_STRING("xsl:with-param");

    ::PSEUDONAME_NODE = XALAN_STATIC_UCODE_STRING("node()");
}
Exemplo n.º 8
0
	/**
	 * Constructor
	 * 
	 * @param theMessage message to write when exception thrown
	 * @param theURI the URI of the related document, if known
	 * @param theLineNumber the line number of the related document, or -1 if not known
	 * @param theColumnNumber the column number of the related document, or -1 if not known
	 * @param theType type of exception, default is "XPathParserException"
	 */
	XPathParserException(
			const XalanDOMString&	theMessage,
			const XalanDOMString&	theURI,
			int						theLineNumber,
			int						theColumnNumber,
			const XalanDOMString&	theType = XalanDOMString(XALAN_STATIC_UCODE_STRING("XPathParserException")));

	/**
	 * Constructor
	 * 
	 * @param theLocator The locator instance for error reporting.
	 * @param theMessage message to write when exception thrown
	 * @param theType type of exception, default is "XPathParserException"
	 */
	XPathParserException(
			const LocatorType&		theLocator,
			const XalanDOMString&	theMessage,
			const XalanDOMString&	theType = XalanDOMString(XALAN_STATIC_UCODE_STRING("XPathParserException")));

	/**
	 * Constructor
Exemplo n.º 9
0
XalanDOMString
XNumberBase::getTypeString() const
{
	return StaticStringToDOMString(XALAN_STATIC_UCODE_STRING("#NUMBER"));
}
Exemplo n.º 10
0
XalanInMemoryMessageLoader::XalanInMemoryMessageLoader() :
	m_unknownMessage(XALAN_STATIC_UCODE_STRING("The message was not found in the message library."))
{
}
Exemplo n.º 11
0
void
ElemForEach::selectAndSortChildren(
			StylesheetExecutionContext&		executionContext,
			const ElemTemplateElement*		theTemplate,
			NodeSorter*						sorter,
			int								selectStackFrameIndex) const
{
	typedef StylesheetExecutionContext::SetAndRestoreCurrentStackFrameIndex		SetAndRestoreCurrentStackFrameIndex;

	assert(m_selectPattern != 0);

	typedef XPathExecutionContext::BorrowReturnMutableNodeRefList	BorrowReturnMutableNodeRefList;

	BorrowReturnMutableNodeRefList	theGuard(executionContext);

	const NodeRefListBase*	sourceNodes = 0;

	XObjectPtr				xobjectResult;

	{
		SetAndRestoreCurrentStackFrameIndex		theSetAndRestore(
					executionContext,
					selectStackFrameIndex);

		xobjectResult = m_selectPattern->execute(
						*this,
						executionContext,
						*theGuard);

		if (xobjectResult.null() == true)
		{
			sourceNodes = &*theGuard;
		}
		else
		{
			theGuard.release();

			sourceNodes = &xobjectResult->nodeset();
		}
	}

	if(0 != executionContext.getTraceListeners())
	{
		executionContext.fireSelectEvent(
				SelectionEvent(
					executionContext, 
					executionContext.getCurrentNode(),
					*this,
					StaticStringToDOMString(XALAN_STATIC_UCODE_STRING("select")),
					*m_selectPattern,
					*sourceNodes));
	}

	const NodeRefListBase::size_type	nNodes = sourceNodes->getLength();

	if (nNodes > 0)
	{
		// If there's not NodeSorter, or we've only selected one node,
		// then just do the transform...
		if (sorter == 0 || nNodes == 1)
		{
			transformSelectedChildren(
				executionContext,
				theTemplate,
				*sourceNodes,
				nNodes);
		}
		else
		{
			typedef StylesheetExecutionContext::SetAndRestoreCurrentStackFrameIndex		SetAndRestoreCurrentStackFrameIndex;
			typedef StylesheetExecutionContext::ContextNodeListPushAndPop				ContextNodeListPushAndPop;
			typedef StylesheetExecutionContext::BorrowReturnMutableNodeRefList			BorrowReturnMutableNodeRefList;

			BorrowReturnMutableNodeRefList	sortedSourceNodes(executionContext);

			*sortedSourceNodes = *sourceNodes;

			{
				SetAndRestoreCurrentStackFrameIndex		theStackFrameSetAndRestore(
						executionContext,
						selectStackFrameIndex);

				ContextNodeListPushAndPop	theContextNodeListPushAndPop(
						executionContext,
						*sourceNodes);

				sorter->sort(executionContext, *sortedSourceNodes);
			}

			transformSelectedChildren(
				executionContext,
				theTemplate,
				*sortedSourceNodes,
				nNodes);
		}
	}
}
Exemplo n.º 12
0
const XalanDOMString
FunctionSample::getError() const
{
    return StaticStringToDOMString(XALAN_STATIC_UCODE_STRING("The boolean() function takes one argument!"));
}
Exemplo n.º 13
0
void
XObjectResultTreeFragProxyText::initialize()
{
	::s_nameString = XALAN_STATIC_UCODE_STRING("#text");
}