25#include <rtl/ustring.hxx>
27#include <com/sun/star/uno/Reference.hxx>
28#include <com/sun/star/beans/PropertyValue.hpp>
29#include <com/sun/star/xml/dom/XDocument.hpp>
30#include <com/sun/star/xforms/XModel2.hpp>
31#include <osl/diagnose.h>
40using com::sun::star::uno::Any;
42using com::sun::star::xforms::XModel2;
43using com::sun::star::beans::PropertyValue;
58 sal_Int32 nElement,
const css::uno::Reference< css::xml::sax::XFastAttributeList >& )
67 const OUString& rLocalName = SvXMLImport::getNameFromToken( nElement );
78 SAL_WARN_IF( pContext ==
nullptr,
"xmloff",
"no context!" );
84 const OUString & rNamespace,
const OUString &rName,
const css::uno::Reference< css::xml::sax::XFastAttributeList > & )
100 pContext = pInstance;
103 SAL_WARN_IF( pContext ==
nullptr,
"xmloff",
"no context!" );
111 PropertyValue* pSequence = aSequence.getArray();
112 pSequence[0].Name =
"Instance";
114 pSequence[1].Name =
"ID";
115 pSequence[1].Value <<=
msId;
116 pSequence[2].Name =
"URL";
117 pSequence[2].Value <<=
msURL;
119 mxModel->getInstances()->insert(
Any( aSequence ) );
125 PropertyValue* pSequence = aSequence.getArray();
126 pSequence[0].Name =
"Instance";
128 pSequence[1].Name =
"ID";
129 pSequence[1].Value <<=
msId;
130 pSequence[2].Name =
"URL";
131 pSequence[2].Value <<=
msURL;
133 mxModel->getInstances()->insert(
Any( aSequence ) );
148 assert(
false &&
"this should not happen" );
157 assert(
false &&
"to be handled by CreateChildContext" );
css::uno::Reference< css::frame::XModel2 > mxModel
DomBuilderContext creates a DOM tree suitable for in-memory processing of XML data from a sequence of...
css::uno::Reference< css::xml::dom::XDocument > getTree()
access the DOM tree
This class deliberately does not support XWeak, to improve performance when loading large documents.
SvXMLImport & GetImport()
handle attributes through an SvXMLTokenMap
css::uno::Reference< css::xml::dom::XDocument > mxInstance
virtual SvXMLImportContext * HandleChild(sal_Int32 nElementToken, const css::uno::Reference< css::xml::sax::XFastAttributeList > &xAttrList) override
will be called for each child element
XFormsInstanceContext(SvXMLImport &rImport, const css::uno::Reference< css::xforms::XModel2 > &xModel)
virtual void SAL_CALL endFastElement(sal_Int32 nElement) override
endFastElement is called before a context will be destructed, but after an elements context has been ...
virtual void SAL_CALL endUnknownElement(const OUString &Namespace, const OUString &Name) override
css::uno::Reference< css::xforms::XModel2 > mxModel
virtual css::uno::Reference< css::xml::sax::XFastContextHandler > SAL_CALL createFastChildContext(sal_Int32 nElement, const css::uno::Reference< css::xml::sax::XFastAttributeList > &AttrList) override
call HandleChild for each child element in the token map; create a warning for all others.
virtual void HandleAttribute(const sax_fastparser::FastAttributeList::FastAttributeIter &aIter) override
will be called for each attribute
virtual css::uno::Reference< css::xml::sax::XFastContextHandler > SAL_CALL createUnknownChildContext(const OUString &Namespace, const OUString &Name, const css::uno::Reference< css::xml::sax::XFastAttributeList > &Attribs) override
sal_Int32 getToken() const
OUString toString() const
#define SAL_WARN_IF(condition, area, stream)
Reference< XModel > xModel
#define XMLERROR_XFORMS_ONLY_ONE_INSTANCE_ELEMENT
#define XMLOFF_WARN_UNKNOWN(area, rIter)
constexpr sal_Int32 TOKEN_MASK