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);
        }
    }
}
void
MutableNodeRefList::addNodesInDocOrder(
			const NodeRefListBase&	nodelist,
			XPathExecutionContext&	executionContext)
{
	const size_type		theOtherLength = nodelist.getLength();

	for(size_type i = 0; i < theOtherLength; i++)
	{
		addNodeInDocOrder(nodelist.item(i), executionContext);
	}
}
Beispiel #3
0
    /**
     * Static conversion function.  Append the string value of the
     * NodeRefListBase to the supplied XalanDOMString parameter.
     *
     * @deprecated This function is deprecated and should not be used.
     *
     * @param theNodeList The NodeRefListBase to convert.
     * @param theString The output XalanDOMString.
     */
    static void
    string(
            const NodeRefListBase&  theNodeList,
            XalanDOMString&         theString)
    {
        if (theNodeList.getLength() > 0)
        {
            assert(theNodeList.item(0) != 0);

            string(*theNodeList.item(0), theString);
        }
    }
Beispiel #4
0
    /**
     * Static conversion function.  Calls the supplied FormatterListener
     * member function with the string value of the NodeRefListBase.
     *
     * @deprecated This function is deprecated and should not be used.
     *
     * @param theNodeList The NodeRefListBase to convert.
     * @param formatterListener The FormatterListener instance.
     * @param function The FormatterListener member function to call.
     */
    static void
    string(
            const NodeRefListBase&  theNodeList,
            FormatterListener&      formatterListener,
            MemberFunctionPtr       function)
    {
        if (theNodeList.getLength() > 0)
        {
            assert(theNodeList.item(0) != 0);

            DOMServices::getNodeData(*theNodeList.item(0), formatterListener, function);
        }
    }
void
MutableNodeRefList::addNodes(const NodeRefListBase&		nodelist)
{
	const size_type	theLength = nodelist.getLength();

	for (size_type i = 0; i < theLength; i++)
	{
		XalanNode* const	theNode = nodelist.item(i);

		if (theNode != 0)
		{

			m_nodeList.push_back(theNode);
		}
	}
}
Beispiel #6
0
void
ElemForEach::transformSelectedChildren(
			StylesheetExecutionContext&		executionContext,
			const ElemTemplateElement*		theTemplate,
			const NodeRefListBase&			sourceNodes,
			NodeRefListBase::size_type		sourceNodesCount) const
{
	if(executionContext.getTraceSelects() == true)
	{
		executionContext.traceSelect(
			*this,
			sourceNodes,
			m_selectPattern);
	}

	// Create an object to set and restore the context node list...
	const StylesheetExecutionContext::ContextNodeListPushAndPop		theContextNodeLisPushAndPop(
				executionContext,
				sourceNodes);

	for(NodeRefListBase::size_type i = 0; i < sourceNodesCount; i++) 
	{
		XalanNode* const		childNode = sourceNodes.item(i);
		assert(childNode != 0);

		transformChild(
				executionContext,
				*this,
				theTemplate,
				childNode);
	}
}
Beispiel #7
0
 /**
  * Static conversion function.  Returns the boolean value
  * of the supplied NodeRefListBase.
  *
  * @param theNodeList The NodeRefListBase to convert.
  * @return bool value
  */
 static bool
 boolean(const NodeRefListBase&  theNodeList)
 {
     return theNodeList.getLength() == 0 ? false : true;
 }