24#include <com/sun/star/xml/sax/SAXException.hpp>
37 xDocumentHandler( rSax1DocumentHandler )
55 const OUString& rName,
const Reference< XAttributeList > &xAttribs )
64 ::std::vector< sal_Int16 > aAttributeIndexes;
66 for ( sal_Int16
i=0;
i< xAttribs->getLength();
i++ )
68 OUString
aName = xAttribs->getNameByIndex(
i );
69 if (
aName.startsWith(
"xmlns" ) )
72 aAttributeIndexes.push_back(
i );
82 for (
auto const& attributeIndex : aAttributeIndexes)
84 OUString aAttributeName = xAttribs->getNameByIndex(attributeIndex);
85 OUString aValue = xAttribs->getValueByIndex(attributeIndex);
87 pNewList->AddAttribute(aNamespaceAttributeName, aValue);
90 catch ( SAXException& e )
96 OUString aNamespaceElementName;
102 catch ( SAXException& e )
114 OUString aNamespaceElementName;
120 catch ( SAXException& e )
141 const OUString& aTarget,
const OUString& aData)
147 const Reference< XLocator > &xLocator)
156 return "Line: " + OUString::number(
m_xLocator->getLineNumber() ) +
" - ";
virtual void SAL_CALL startElement(const OUString &aName, const css::uno::Reference< css::xml::sax::XAttributeList > &xAttribs) override
OUString getErrorLineString()
css::uno::Reference< css::xml::sax::XDocumentHandler > xDocumentHandler
NamespaceStack m_aNamespaceStack
virtual void SAL_CALL endDocument() override
virtual ~SaxNamespaceFilter() override
css::uno::Reference< css::xml::sax::XLocator > m_xLocator
virtual void SAL_CALL processingInstruction(const OUString &aTarget, const OUString &aData) override
virtual void SAL_CALL setDocumentLocator(const css::uno::Reference< css::xml::sax::XLocator > &xLocator) override
virtual void SAL_CALL ignorableWhitespace(const OUString &aWhitespaces) override
virtual void SAL_CALL startDocument() override
SaxNamespaceFilter(css::uno::Reference< css::xml::sax::XDocumentHandler > const &rSax1DocumentHandler)
virtual void SAL_CALL endElement(const OUString &aName) override
virtual void SAL_CALL characters(const OUString &aChars) override
void addNamespace(const OUString &aName, const OUString &aValue)
OUString applyNSToAttributeName(const OUString &) const
OUString applyNSToElementName(const OUString &) const
constexpr OUStringLiteral aData