void ElemLiteralResult::postConstruction( StylesheetConstructionContext& constructionContext, const NamespacesHandler& theParentHandler) { if (m_avtsCount != 0 || getNamespacesHandler().getNamespaceDeclarationsCount() != 0) { canGenerateAttributes(true); } else { // OK, let's turn this off and see what our // base classes say about it when we chain up... canGenerateAttributes(false); } // OK, now we can chain-up... ElemUse::postConstruction(constructionContext, theParentHandler); // OK, now let's do some more checking to see if we'll // generate attributes... if (canGenerateAttributes() == false) { // If there are no children, we can't generate any attributes... if (hasChildren() == true) { assert(getFirstChildElem() != 0); // If there's a single text child, or the first child // is another LRE, then we won't generate any attributes. // Otherwise, we might... if (hasSingleTextChild() == false && getFirstChildElem()->getXSLToken() != StylesheetConstructionContext::ELEMNAME_LITERAL_RESULT) { canGenerateAttributes(true); } } } }
void ElemUse::postConstruction( StylesheetConstructionContext& constructionContext, const NamespacesHandler& theParentHandler) { if (m_attributeSetsNamesCount > 0) { canGenerateAttributes(true); } // OK, now we can chain-up... ElemTemplateElement::postConstruction(constructionContext, theParentHandler); }
const ElemTemplateElement* ElemUse::startElement(StylesheetExecutionContext& executionContext) const { if (m_attributeSetsNamesCount > 0) { assert(canGenerateAttributes() == true); executionContext.pushInvoker(this); executionContext.createUseAttributeSetIndexesOnStack(); return getNextAttributeSet(executionContext); } return 0; }
void ElemUse::doExecute( StylesheetExecutionContext& executionContext, bool applyAttributeSets) const { assert(m_attributeSetsNamesCount == 0 || m_attributeSetsNames != 0); ElemTemplateElement::execute(executionContext); if(applyAttributeSets == true && m_attributeSetsNamesCount > 0) { assert(canGenerateAttributes() == true); const StylesheetRoot& theStylesheetRoot = getStylesheet().getStylesheetRoot(); const LocatorType* const theLocator = getLocator(); for(size_type i = 0; i < m_attributeSetsNamesCount; ++i) { theStylesheetRoot.executeAttributeSet(executionContext, *m_attributeSetsNames[i], theLocator); } } }