31#include <osl/diagnose.h>
39 const OUString& rQName,
40 sal_uInt16 nActionMap ) :
42 m_nActionMap( nActionMap )
47 const Reference< XAttributeList >& rAttrList )
49 Reference< XAttributeList > xAttrList( rAttrList );
51 std::vector<rtl::Reference<XMLTransformerContext>> aChildContexts;
56 OSL_ENSURE( pActions,
"go no actions" );
59 sal_Int16 nAttrCount = xAttrList.is() ? xAttrList->getLength() : 0;
60 for( sal_Int16
i=0;
i < nAttrCount; ++
i )
62 const OUString& rAttrName = xAttrList->getNameByIndex(
i );
63 const OUString& rAttrValue = xAttrList->getValueByIndex(
i );
69 XMLTransformerActions::key_type aKey( nPrefix, aLocalName );
70 XMLTransformerActions::const_iterator aIter =
71 pActions->find( aKey );
72 if( aIter != pActions->end() )
74 if( !pMutableAttrList )
77 xAttrList = pMutableAttrList;
79 sal_uInt32 nAction = (*aIter).second.m_nActionType;
86 (*aIter).second.GetQNamePrefixFromParam1(),
88 (*aIter).second.GetQNameTokenFromParam1()) ) );
92 pContext->Characters( rAttrValue );
93 aChildContexts.push_back(pContext);
94 pMutableAttrList->RemoveAttributeByIndex(
i );
100 OSL_ENSURE(
false,
"unknown action" );
108 for (
auto const &
i: aChildContexts)
sal_uInt16 GetKeyByAttrName(const OUString &rAttrName, OUString *pPrefix, OUString *pLocalName, OUString *pNamespace) const
virtual void StartElement(const css::uno::Reference< css::xml::sax::XAttributeList > &xAttrList) override
XMLCreateElemTransformerContext(XMLTransformerBase &rTransformer, const OUString &rQName, sal_uInt16 nActionMap)
sal_uInt16 const m_nActionMap
XMLTransformerBase & GetTransformer()
virtual void StartElement(const css::uno::Reference< css::xml::sax::XAttributeList > &xAttrList)
Handling of tokens in XML:
const OUString & GetXMLToken(enum XMLTokenEnum eToken)
return the OUString representation for eToken