Beispiel #1
0
void
ElemAttributeSet::execute(StylesheetExecutionContext&   executionContext) const
{
    typedef StylesheetExecutionContext::SetAndRestoreCurrentStackFrameIndex     SetAndRestoreCurrentStackFrameIndex;
    typedef StylesheetExecutionContext::ElementRecursionStackPusher             ElementRecursionStackPusher;

    // This will push and pop the stack automatically...
    ElementRecursionStackPusher     thePusher(executionContext, this);

    // Make sure only global variables are visible during execution...
    SetAndRestoreCurrentStackFrameIndex     theSetAndRestore(
                    executionContext, 
                    executionContext.getGlobalStackFrameIndex());

    ElemUse::execute(executionContext);

    const ElemTemplateElement*  attr = getFirstChildElem();

    while(0 != attr)
    {
        attr->execute(executionContext);

        attr = attr->getNextSiblingElem();
    }
}
void
VariablesStack::pushParams(const ParamsVectorType&  theParams)
{
    // This object will push the params and pop them
    // if we don't call it's commit() member function.  So
    // if an exception is thrown while transferring the
    // parameters, the stack stays in a consistent state.
    CommitPushParams    thePusher(*this);

    XALAN_USING_STD(for_each)

    for_each(theParams.begin(), theParams.end(), PushParamFunctor(*this));

    thePusher.commit();
}