Exemplo n.º 1
0
inline void
getChildData(
            const XalanNode*    child,
            ExecutionContext&   executionContext,
            XalanDOMString&     data)
{
    assert(executionContext.hasPreserveOrStripSpaceConditions() == true);

    const XalanNode::NodeType   theType = child->getNodeType();

    if (theType == XalanNode::ELEMENT_NODE)
    {
        const XalanElement* const   theElementNode =
                static_cast<const XalanElement*>(child);

        DOMServices::doGetNodeData(*theElementNode, executionContext, data);
    }
    else if (theType == XalanNode::TEXT_NODE ||
             theType == XalanNode::CDATA_SECTION_NODE)
    {
        const XalanText*    theTextNode =
                static_cast<const XalanText*>(child);

        DOMServices::doGetNodeData(*theTextNode, executionContext, data);
    }
}
Exemplo n.º 2
0
inline void
getChildData(
            const XalanNode*                child,
            ExecutionContext&               executionContext,
            FormatterListener&              formatterListener,
            DOMServices::MemberFunctionPtr  function)
{
    assert(executionContext.hasPreserveOrStripSpaceConditions() == true);

    const XalanNode::NodeType   theType = child->getNodeType();

    if (theType == XalanNode::ELEMENT_NODE)
    {
        const XalanElement* const   theElementNode =
                static_cast<const XalanElement*>(child);

        DOMServices::getNodeData(*theElementNode, executionContext, formatterListener, function);
    }
    else if (theType == XalanNode::TEXT_NODE ||
             theType == XalanNode::CDATA_SECTION_NODE)
    {
        const XalanText*    theTextNode =
                static_cast<const XalanText*>(child);

        DOMServices::getNodeData(*theTextNode, executionContext, formatterListener, function);
    }
}
Exemplo n.º 3
0
void
DOMServices::doGetNodeData(
            const XalanElement&     element,
            ExecutionContext&       executionContext,
            XalanDOMString&         data)
{
    assert(executionContext.hasPreserveOrStripSpaceConditions() == true);

    getChildrenData(element.getFirstChild(), executionContext, data);
}
Exemplo n.º 4
0
void
DOMServices::doGetNodeData(
            const XalanDocument&    document,
            ExecutionContext&       executionContext,
            XalanDOMString&         data)
{
    assert(executionContext.hasPreserveOrStripSpaceConditions() == true);
    assert(document.getDocumentElement() != 0);

    getChildrenData(
        document.getDocumentElement(),
        executionContext,
        data);
}
Exemplo n.º 5
0
void
DOMServices::doGetNodeData(
            const XalanElement&     element,
            ExecutionContext&       executionContext,
            FormatterListener&      formatterListener,
            MemberFunctionPtr       function)
{
    assert(executionContext.hasPreserveOrStripSpaceConditions() == true);

    getChildrenData(
        element.getFirstChild(),
        executionContext,
        formatterListener,
        function);
}
Exemplo n.º 6
0
void
DOMServices::doGetNodeData(
            const XalanDocumentFragment&    documentFragment,
            ExecutionContext&               executionContext,
            XalanDOMString&                 data)
{
    assert(executionContext.hasPreserveOrStripSpaceConditions() == true);

    for(const XalanNode* child = documentFragment.getFirstChild(); child != 0; child = child->getNextSibling())
    {
        assert(child != 0);

        getChildData(child, executionContext, data);
    }
}
Exemplo n.º 7
0
inline void
getChildrenData(
            const XalanNode*    firstChild,
            ExecutionContext&   executionContext,
            XalanDOMString&     data)
{
    assert(executionContext.hasPreserveOrStripSpaceConditions() == true);

    while(firstChild != 0)
    {
        getChildData(firstChild, executionContext, data);

        firstChild = firstChild->getNextSibling();
    }
}
Exemplo n.º 8
0
void
DOMServices::doGetNodeData(
            const XalanDocumentFragment&    documentFragment,
            ExecutionContext&               executionContext,
            FormatterListener&              formatterListener,
            MemberFunctionPtr               function)
{
    assert(executionContext.hasPreserveOrStripSpaceConditions() == true);

    for(const XalanNode* child = documentFragment.getFirstChild(); child != 0; child = child->getNextSibling())
    {
        assert(child != 0);

        getChildData(child, executionContext, formatterListener, function);
    }
}
Exemplo n.º 9
0
inline void
getChildrenData(
            const XalanNode*                firstChild,
            ExecutionContext&               executionContext,
            FormatterListener&              formatterListener,
            DOMServices::MemberFunctionPtr  function)
{
    assert(executionContext.hasPreserveOrStripSpaceConditions() == true);

    while(firstChild != 0)
    {
        getChildData(firstChild, executionContext, formatterListener, function);

        firstChild = firstChild->getNextSibling();
    }
}
Exemplo n.º 10
0
void
DOMServices::doGetNodeData(
            const XalanNode&    node,
            ExecutionContext&   executionContext,
            FormatterListener&  formatterListener,
            MemberFunctionPtr   function)
{
    assert(executionContext.hasPreserveOrStripSpaceConditions() == true);

    switch(node.getNodeType())
    {
    case XalanNode::DOCUMENT_FRAGMENT_NODE:
        {
            const XalanDocumentFragment&        theDocumentFragment =
                static_cast<const XalanDocumentFragment&>(node);

            doGetNodeData(theDocumentFragment, executionContext, formatterListener, function);
        }
        break;

    case XalanNode::DOCUMENT_NODE:
        {
            const XalanDocument&    theDocument =
                static_cast<const XalanDocument&>(node);

            doGetNodeData(theDocument, executionContext, formatterListener, function);
        }
        break;

    case XalanNode::ELEMENT_NODE:
        {
            const XalanElement&     theElement =
                static_cast<const XalanElement&>(node);

            doGetNodeData(theElement, executionContext, formatterListener, function);
        }
        break;

    case XalanNode::TEXT_NODE:
    case XalanNode::CDATA_SECTION_NODE:
        {
            const XalanText&    theTextNode =
                static_cast<const XalanText&>(node);

                doGetNodeData(theTextNode, executionContext, formatterListener, function);
        }
        break;

    case XalanNode::ATTRIBUTE_NODE:
        {
            const XalanAttr&        theAttr =
                static_cast<const XalanAttr&>(node);

            getNodeData(theAttr, formatterListener, function);
        }
        break;

    case XalanNode::COMMENT_NODE:
        {
            const XalanComment&     theComment =
                static_cast<const XalanComment&>(node);

            getNodeData(theComment, formatterListener, function);
        }
        break;

    case XalanNode::PROCESSING_INSTRUCTION_NODE:
        {
            const XalanProcessingInstruction&       thePI =
                static_cast<const XalanProcessingInstruction&>(node);

            getNodeData(thePI, formatterListener, function);
        }
        break;

    default:
        // ignore
        break;
    }
}