24#include <rtl/ustring.hxx>
27#include <libxml/parserInternals.h>
29#include <com/sun/star/xml/csax/XMLAttribute.hpp>
30#include <com/sun/star/uno/Sequence.hxx>
33#include "libxslt/xslt.h"
43 return xmlStrndup(
reinterpret_cast<xmlChar
const *
>(ostr.getStr()),
static_cast<int>(ostr.getLength()) ) ;
55 return xmlStrndup(
reinterpret_cast<xmlChar
const *
>(ostr.getStr()),
length ) ;
62static const xmlChar**
attrlist_to_nxmlstr(
const css::uno::Sequence< css::xml::csax::XMLAttribute >& aAttributes )
64 xmlChar* attname = nullptr ;
65 xmlChar* attvalue = nullptr ;
66 const xmlChar** attrs = nullptr ;
68 sal_Int32
nLength = aAttributes.getLength();
72 attrs =
static_cast<const xmlChar**
>(xmlMalloc( (
nLength * 2 + 2 ) *
sizeof( xmlChar* ) ));
80 for(
const auto& rAttr : aAttributes )
85 if( attname !=
nullptr && attvalue !=
nullptr )
87 attrs[
i++] = attname ;
88 attrs[
i++] = attvalue ;
90 attrs[
i+1] = nullptr ;
94 if( attname !=
nullptr )
96 if( attvalue !=
nullptr )
111 : m_pParserCtxt( nullptr ),
112 m_pSaxHandler( nullptr )
115 LIBXML_TEST_VERSION ;
121 xmlSubstituteEntitiesDefault(0) ;
123#ifndef XMLSEC_NO_XSLT
124 xmlIndentTreeOutput = 1 ;
135 throw css::uno::RuntimeException() ;
154 throw css::uno::RuntimeException() ;
221 throw css::uno::RuntimeException() ;
226 xmlParserInputPtr pInput = xmlNewInputStream(
m_pParserCtxt ) ;
238 throw css::uno::RuntimeException() ;
254 std::u16string_view aName,
255 const css::uno::Sequence< css::xml::csax::XMLAttribute >& aAttributes )
257 const xmlChar* fullName = nullptr ;
258 const xmlChar** attrs = nullptr ;
263 if( fullName !=
nullptr || attrs !=
nullptr )
268 if( fullName !=
nullptr )
270 xmlFree(
const_cast<xmlChar*
>(fullName) ) ;
274 if( attrs !=
nullptr )
276 for(
int i = 0 ; attrs[
i] != nullptr ; ++
i )
278 xmlFree(
const_cast<xmlChar*
>(attrs[
i]) ) ;
282 xmlFree(
static_cast<void*
>(attrs) ) ;
295 if( fullname !=
nullptr )
297 xmlFree( fullname ) ;
307 const xmlChar* chars = nullptr ;
313 if( chars !=
nullptr )
315 xmlFree(
const_cast<xmlChar*
>(chars) ) ;
324 const xmlChar* chars = nullptr ;
330 if( chars !=
nullptr )
332 xmlFree(
const_cast<xmlChar*
>(chars) ) ;
340 std::u16string_view aTarget,
341 std::u16string_view aData )
343 xmlChar* target = nullptr ;
344 xmlChar* data = nullptr ;
351 if( target !=
nullptr )
357 if( data !=
nullptr )
xmlSAXHandlerPtr m_pSaxHandler
xmlParserCtxtPtr m_pParserCtxt
void characters(std::u16string_view aChars)
XDocumentHandler – an xml element or cdata characters.
void endElement(std::u16string_view aName)
XDocumentHandler – end an xml element.
void setCurrentNode(const xmlNodePtr pNode)
void startElement(std::u16string_view aName, const css::uno::Sequence< css::xml::csax::XMLAttribute > &aAttributes)
XDocumentHandler – start an xml element.
void ignorableWhitespace(std::u16string_view aWhitespaces)
XDocumentHandler – ignorable xml white space.
void startDocument()
XDocumentHandler – start an xml document.
void endDocument()
XDocumentHandler – end an xml document.
void processingInstruction(std::u16string_view aTarget, std::u16string_view aData)
XDocumentHandler – preprocessing instruction.
constexpr OUStringLiteral aData
OString OUStringToOString(std::u16string_view str, ConnectionSettings const *settings)
static xmlChar * ous_to_xmlstr(std::u16string_view oustr)
The return value is NULL terminated.
static const xmlChar ** attrlist_to_nxmlstr(const css::uno::Sequence< css::xml::csax::XMLAttribute > &aAttributes)
The return value and the referenced value must be NULL terminated.
static xmlChar * ous_to_nxmlstr(std::u16string_view oustr, int &length)
The return value is NULL terminated.