Commits

Anonymous committed 18115c6

sb129: #i113189# move XmlReader from configmgr to URE

Comments (0)

Files changed (39)

configmgr/prj/build.lst

-cg configmgr : BOOST:boost comphelper cppu cppuhelper offuh sal salhelper stlport NULL
+cg configmgr : BOOST:boost comphelper cppu cppuhelper offuh sal salhelper stlport xmlreader NULL
 cg configmgr\inc nmake - all cg_inc NULL
 cg configmgr\source nmake - all cg_source cg_inc NULL
 cg configmgr\qa\unoapi nmake - all cg_qa_unoapi NULL

configmgr/source/README

 setnode.cxx
  Internal representations of data nodes.
 
-pad.cxx
 parsemanager.cxx
 parser.hxx
-span.hxx
 valueparser.cxx
 xcdparser.cxx
 xcsparser.cxx
 xcuparser.cxx
 xmldata.cxx
-xmlreader.cxx
  XML file reading.
 
 modifications.cxx

configmgr/source/components.cxx

         OSL_TRACE(
             "configmgr user registrymodifications.xcu does not (yet) exist");
         // Migrate old user layer data (can be removed once migration is no
-        // longer relevant; also see hack for xsi namespace in XmlReader
-        // constructor):
+        // longer relevant; also see hack for xsi namespace in
+        // xmlreader::XmlReader constructor):
         parseFiles(
             Data::NO_LAYER, rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(".xcu")),
             &parseXcuFile,

configmgr/source/makefile.mk

     $(SLO)/modifications.obj \
     $(SLO)/node.obj \
     $(SLO)/nodemap.obj \
-    $(SLO)/pad.obj \
     $(SLO)/parsemanager.obj \
     $(SLO)/partial.obj \
     $(SLO)/propertynode.obj \
     $(SLO)/xcdparser.obj \
     $(SLO)/xcsparser.obj \
     $(SLO)/xcuparser.obj \
-    $(SLO)/xmldata.obj \
-    $(SLO)/xmlreader.obj
+    $(SLO)/xmldata.obj
 
 SHL1IMPLIB = i$(SHL1TARGET)
 SHL1OBJS = $(SLOFILES)
     $(CPPUHELPERLIB) \
     $(CPPULIB) \
     $(SALHELPERLIB) \
-    $(SALLIB)
+    $(SALLIB) \
+    $(XMLREADERLIB)
 SHL1TARGET = configmgr.uno
 SHL1USE_EXPORTS = name
 DEF1NAME = $(SHL1TARGET)

configmgr/source/pad.cxx

-/*************************************************************************
-*
-* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-*
-* Copyright 2000, 2010 Oracle and/or its affiliates.
-*
-* OpenOffice.org - a multi-platform office productivity suite
-*
-* This file is part of OpenOffice.org.
-*
-* OpenOffice.org is free software: you can redistribute it and/or modify
-* it under the terms of the GNU Lesser General Public License version 3
-* only, as published by the Free Software Foundation.
-*
-* OpenOffice.org is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-* GNU Lesser General Public License version 3 for more details
-* (a copy is included in the LICENSE file that accompanied this code).
-*
-* You should have received a copy of the GNU Lesser General Public License
-* version 3 along with OpenOffice.org.  If not, see
-* <http://www.openoffice.org/license.html>
-* for a copy of the LGPLv3 License.
-*
-************************************************************************/
-
-#include "precompiled_configmgr.hxx"
-#include "sal/config.h"
-
-#include "osl/diagnose.h"
-#include "rtl/string.h"
-#include "sal/types.h"
-
-#include "pad.hxx"
-#include "span.hxx"
-
-namespace configmgr {
-
-void Pad::add(char const * begin, sal_Int32 length) {
-    OSL_ASSERT(
-        begin != 0 && length >= 0 && !(span_.is() && buffer_.getLength() != 0));
-    if (length != 0) {
-        flushSpan();
-        if (buffer_.getLength() == 0) {
-            span_ = Span(begin, length);
-        } else {
-            buffer_.append(begin, length);
-        }
-    }
-}
-
-void Pad::addEphemeral(char const * begin, sal_Int32 length) {
-    OSL_ASSERT(
-        begin != 0 && length >= 0 && !(span_.is() && buffer_.getLength() != 0));
-    if (length != 0) {
-        flushSpan();
-        buffer_.append(begin, length);
-    }
-}
-
-void Pad::clear() {
-    OSL_ASSERT(!(span_.is() && buffer_.getLength() != 0));
-    span_.clear();
-    buffer_.setLength(0);
-}
-
-bool Pad::is() const {
-    OSL_ASSERT(!(span_.is() && buffer_.getLength() != 0));
-    return span_.is() || buffer_.getLength() != 0;
-}
-
-Span Pad::get() const {
-    OSL_ASSERT(!(span_.is() && buffer_.getLength() != 0));
-    if (span_.is()) {
-        return span_;
-    } else if (buffer_.getLength() == 0) {
-        return Span(RTL_CONSTASCII_STRINGPARAM(""));
-    } else {
-        return Span(buffer_.getStr(), buffer_.getLength());
-    }
-}
-
-void Pad::flushSpan() {
-    if (span_.is()) {
-        buffer_.append(span_.begin, span_.length);
-        span_.clear();
-    }
-}
-
-}

configmgr/source/pad.hxx

-/*************************************************************************
-*
-* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-*
-* Copyright 2000, 2010 Oracle and/or its affiliates.
-*
-* OpenOffice.org - a multi-platform office productivity suite
-*
-* This file is part of OpenOffice.org.
-*
-* OpenOffice.org is free software: you can redistribute it and/or modify
-* it under the terms of the GNU Lesser General Public License version 3
-* only, as published by the Free Software Foundation.
-*
-* OpenOffice.org is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-* GNU Lesser General Public License version 3 for more details
-* (a copy is included in the LICENSE file that accompanied this code).
-*
-* You should have received a copy of the GNU Lesser General Public License
-* version 3 along with OpenOffice.org.  If not, see
-* <http://www.openoffice.org/license.html>
-* for a copy of the LGPLv3 License.
-*
-************************************************************************/
-
-#ifndef INCLUDED_CONFIGMGR_SOURCE_PAD_HXX
-#define INCLUDED_CONFIGMGR_SOURCE_PAD_HXX
-
-#include "sal/config.h"
-
-#include "rtl/strbuf.hxx"
-#include "sal/types.h"
-
-#include "span.hxx"
-
-namespace configmgr {
-
-class Pad {
-public:
-    void add(char const * begin, sal_Int32 length);
-
-    void addEphemeral(char const * begin, sal_Int32 length);
-
-    void clear();
-
-    bool is() const;
-
-    Span get() const;
-
-private:
-    void flushSpan();
-
-    Span span_;
-    rtl::OStringBuffer buffer_;
-};
-
-}
-
-#endif

configmgr/source/parsemanager.cxx

 #include "com/sun/star/uno/RuntimeException.hpp"
 #include "osl/diagnose.h"
 #include "sal/types.h"
+#include "xmlreader/span.hxx"
+#include "xmlreader/xmlreader.hxx"
 
 #include "parsemanager.hxx"
 #include "parser.hxx"
-#include "xmlreader.hxx"
 
 namespace configmgr {
 
     reader_(url), parser_(parser)
 {
     OSL_ASSERT(parser.is());
+    int id;
+    id = reader_.registerNamespaceIri(
+        xmlreader::Span(
+            RTL_CONSTASCII_STRINGPARAM("http://openoffice.org/2001/registry")));
+    OSL_ASSERT(id == NAMESPACE_OOR);
+    id = reader_.registerNamespaceIri(
+        xmlreader::Span(
+            RTL_CONSTASCII_STRINGPARAM("http://www.w3.org/2001/XMLSchema")));
+    OSL_ASSERT(id == NAMESPACE_XS);
+    id = reader_.registerNamespaceIri(
+        xmlreader::Span(
+            RTL_CONSTASCII_STRINGPARAM(
+                "http://www.w3.org/2001/XMLSchema-instance")));
+    OSL_ASSERT(id == NAMESPACE_XSI);
 }
 
 bool ParseManager::parse() {
     for (;;) {
         switch (itemData_.is()
-                ? XmlReader::RESULT_BEGIN
+                ? xmlreader::XmlReader::RESULT_BEGIN
                 : reader_.nextItem(
-                    parser_->getTextMode(), &itemData_, &itemNamespace_))
+                    parser_->getTextMode(), &itemData_, &itemNamespaceId_))
         {
-        case XmlReader::RESULT_BEGIN:
-            if (!parser_->startElement(reader_, itemNamespace_, itemData_))
+        case xmlreader::XmlReader::RESULT_BEGIN:
+            if (!parser_->startElement(reader_, itemNamespaceId_, itemData_))
             {
                 return false;
             }
             break;
-        case XmlReader::RESULT_END:
+        case xmlreader::XmlReader::RESULT_END:
             parser_->endElement(reader_);
             break;
-        case XmlReader::RESULT_TEXT:
+        case xmlreader::XmlReader::RESULT_TEXT:
             parser_->characters(itemData_);
             break;
-        case XmlReader::RESULT_DONE:
+        case xmlreader::XmlReader::RESULT_DONE:
             return true;
         }
         itemData_.clear();

configmgr/source/parsemanager.hxx

 #include "rtl/ref.hxx"
 #include "sal/types.h"
 #include "salhelper/simplereferenceobject.hxx"
-
-#include "span.hxx"
-#include "xmlreader.hxx"
+#include "xmlreader/span.hxx"
+#include "xmlreader/xmlreader.hxx"
 
 namespace rtl { class OUString; }
 
 
     bool parse();
 
+    enum { NAMESPACE_OOR = 1, NAMESPACE_XS = 2, NAMESPACE_XSI = 3 };
+
 private:
     virtual ~ParseManager();
 
-    XmlReader reader_;
+    xmlreader::XmlReader reader_;
     rtl::Reference< Parser > parser_;
-    Span itemData_;
-    XmlReader::Namespace itemNamespace_;
+    xmlreader::Span itemData_;
+    int itemNamespaceId_;
 };
 
 }

configmgr/source/parser.hxx

 #include <memory>
 
 #include "salhelper/simplereferenceobject.hxx"
+#include "xmlreader/xmlreader.hxx"
 
-#include "xmlreader.hxx"
+namespace xmlreader { struct Span; }
 
 namespace configmgr {
 
-struct Span;
-
 class Parser: public salhelper::SimpleReferenceObject {
 public:
-    virtual XmlReader::Text getTextMode() = 0;
+    virtual xmlreader::XmlReader::Text getTextMode() = 0;
 
     virtual bool startElement(
-        XmlReader & reader, XmlReader::Namespace ns, Span const & name) = 0;
+        xmlreader::XmlReader & reader, int nsId, xmlreader::Span const & name)
+        = 0;
 
-    virtual void endElement(XmlReader const & reader) = 0;
+    virtual void endElement(xmlreader::XmlReader const & reader) = 0;
 
-    virtual void characters(Span const & text) = 0;
+    virtual void characters(xmlreader::Span const & text) = 0;
 
 protected:
     Parser() {}

configmgr/source/span.hxx

-/*************************************************************************
-*
-* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-*
-* Copyright 2000, 2010 Oracle and/or its affiliates.
-*
-* OpenOffice.org - a multi-platform office productivity suite
-*
-* This file is part of OpenOffice.org.
-*
-* OpenOffice.org is free software: you can redistribute it and/or modify
-* it under the terms of the GNU Lesser General Public License version 3
-* only, as published by the Free Software Foundation.
-*
-* OpenOffice.org is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-* GNU Lesser General Public License version 3 for more details
-* (a copy is included in the LICENSE file that accompanied this code).
-*
-* You should have received a copy of the GNU Lesser General Public License
-* version 3 along with OpenOffice.org.  If not, see
-* <http://www.openoffice.org/license.html>
-* for a copy of the LGPLv3 License.
-*
-************************************************************************/
-
-#ifndef INCLUDED_CONFIGMGR_SOURCE_SPAN_HXX
-#define INCLUDED_CONFIGMGR_SOURCE_SPAN_HXX
-
-#include "sal/config.h"
-
-#include "rtl/string.h"
-#include "sal/types.h"
-
-namespace configmgr {
-
-struct Span {
-    char const * begin;
-    sal_Int32 length;
-
-    inline Span(): begin(0), length(0) {}
-        // init length to avoid compiler warnings
-
-    inline Span(char const * theBegin, sal_Int32 theLength):
-        begin(theBegin), length(theLength) {}
-
-    inline void clear() throw() { begin = 0; }
-
-    inline bool is() const { return begin != 0; }
-
-    inline bool equals(Span const & text) const {
-        return rtl_str_compare_WithLength(
-            begin, length, text.begin, text.length) == 0;
-    }
-
-    inline bool equals(char const * textBegin, sal_Int32 textLength) const {
-        return equals(Span(textBegin, textLength));
-    }
-};
-
-}
-
-#endif

configmgr/source/valueparser.cxx

 #include "rtl/ustring.h"
 #include "rtl/ustring.hxx"
 #include "sal/types.h"
+#include "xmlreader/span.hxx"
+#include "xmlreader/xmlreader.hxx"
 
 #include "localizedvaluenode.hxx"
 #include "node.hxx"
 #include "nodemap.hxx"
+#include "parsemanager.hxx"
 #include "propertynode.hxx"
-#include "span.hxx"
 #include "type.hxx"
 #include "valueparser.hxx"
 #include "xmldata.hxx"
-#include "xmlreader.hxx"
 
 namespace configmgr {
 
     return false;
 }
 
-bool parseValue(Span const & text, sal_Bool * value) {
+bool parseValue(xmlreader::Span const & text, sal_Bool * value) {
     OSL_ASSERT(text.is() && value != 0);
     if (text.equals(RTL_CONSTASCII_STRINGPARAM("true")) ||
         text.equals(RTL_CONSTASCII_STRINGPARAM("1")))
     return false;
 }
 
-bool parseValue(Span const & text, sal_Int16 * value) {
+bool parseValue(xmlreader::Span const & text, sal_Int16 * value) {
     OSL_ASSERT(text.is() && value != 0);
     // For backwards compatibility, support hexadecimal values:
     sal_Int32 n =
     return false;
 }
 
-bool parseValue(Span const & text, sal_Int32 * value) {
+bool parseValue(xmlreader::Span const & text, sal_Int32 * value) {
     OSL_ASSERT(text.is() && value != 0);
     // For backwards compatibility, support hexadecimal values:
     *value =
     return true;
 }
 
-bool parseValue(Span const & text, sal_Int64 * value) {
+bool parseValue(xmlreader::Span const & text, sal_Int64 * value) {
     OSL_ASSERT(text.is() && value != 0);
     // For backwards compatibility, support hexadecimal values:
     *value =
     return true;
 }
 
-bool parseValue(Span const & text, double * value) {
+bool parseValue(xmlreader::Span const & text, double * value) {
     OSL_ASSERT(text.is() && value != 0);
     *value = rtl::OString(text.begin, text.length).toDouble();
         //TODO: check valid lexical representation
     return true;
 }
 
-bool parseValue(Span const & text, rtl::OUString * value) {
+bool parseValue(xmlreader::Span const & text, rtl::OUString * value) {
     OSL_ASSERT(text.is() && value != 0);
-    *value = xmldata::convertFromUtf8(text);
+    *value = text.convertFromUtf8();
     return true;
 }
 
-bool parseValue(Span const & text, css::uno::Sequence< sal_Int8 > * value) {
+bool parseValue(
+    xmlreader::Span const & text, css::uno::Sequence< sal_Int8 > * value)
+{
     OSL_ASSERT(text.is() && value != 0);
     if ((text.length & 1) != 0) {
         return false;
     return true;
 }
 
-template< typename T > css::uno::Any parseSingleValue(Span const & text) {
+template< typename T > css::uno::Any parseSingleValue(
+    xmlreader::Span const & text)
+{
     T val;
     if (!parseValue(text, &val)) {
         throw css::uno::RuntimeException(
 }
 
 template< typename T > css::uno::Any parseListValue(
-    rtl::OString const & separator, Span const & text)
+    rtl::OString const & separator, xmlreader::Span const & text)
 {
     comphelper::SequenceAsVector< T > seq;
-    Span sep;
+    xmlreader::Span sep;
     if (separator.getLength() == 0) {
-        sep = Span(RTL_CONSTASCII_STRINGPARAM(" "));
+        sep = xmlreader::Span(RTL_CONSTASCII_STRINGPARAM(" "));
     } else {
-        sep = Span(separator.getStr(), separator.getLength());
+        sep = xmlreader::Span(separator.getStr(), separator.getLength());
     }
     if (text.length != 0) {
-        for (Span t(text);;) {
+        for (xmlreader::Span t(text);;) {
             sal_Int32 i = rtl_str_indexOfStr_WithLength(
                 t.begin, t.length, sep.begin, sep.length);
             T val;
-            if (!parseValue(Span(t.begin, i == -1 ? t.length : i), &val)) {
+            if (!parseValue(
+                    xmlreader::Span(t.begin, i == -1 ? t.length : i), &val))
+            {
                 throw css::uno::RuntimeException(
                     rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("invalid value")),
                     css::uno::Reference< css::uno::XInterface >());
 }
 
 css::uno::Any parseValue(
-    rtl::OString const & separator, Span const & text, Type type)
+    rtl::OString const & separator, xmlreader::Span const & text, Type type)
 {
     switch (type) {
     case TYPE_ANY:
 
 ValueParser::~ValueParser() {}
 
-XmlReader::Text ValueParser::getTextMode() const {
+xmlreader::XmlReader::Text ValueParser::getTextMode() const {
     if (node_.is()) {
         switch (state_) {
         case STATE_TEXT:
             return
                 (type_ == TYPE_STRING || type_ == TYPE_STRING_LIST ||
                  separator_.getLength() != 0)
-                ? XmlReader::TEXT_RAW : XmlReader::TEXT_NORMALIZED;
+                ? xmlreader::XmlReader::TEXT_RAW
+                : xmlreader::XmlReader::TEXT_NORMALIZED;
         default:
             break;
         }
     }
-    return XmlReader::TEXT_NONE;
+    return xmlreader::XmlReader::TEXT_NONE;
 }
 
 bool ValueParser::startElement(
-    XmlReader & reader, XmlReader::Namespace ns, Span const & name)
+    xmlreader::XmlReader & reader, int nsId, xmlreader::Span const & name)
 {
     if (!node_.is()) {
         return false;
     }
     switch (state_) {
     case STATE_TEXT:
-        if (ns == XmlReader::NAMESPACE_NONE &&
+        if (nsId == xmlreader::XmlReader::NAMESPACE_NONE &&
             name.equals(RTL_CONSTASCII_STRINGPARAM("it")) &&
             isListType(type_) && separator_.getLength() == 0)
         {
         }
         // fall through
     case STATE_IT:
-        if (ns == XmlReader::NAMESPACE_NONE &&
+        if (nsId == xmlreader::XmlReader::NAMESPACE_NONE &&
             name.equals(RTL_CONSTASCII_STRINGPARAM("unicode")) &&
             (type_ == TYPE_STRING || type_ == TYPE_STRING_LIST))
         {
             sal_Int32 scalar = -1;
             for (;;) {
-                XmlReader::Namespace attrNs;
-                Span attrLn;
-                if (!reader.nextAttribute(&attrNs, &attrLn)) {
+                int attrNsId;
+                xmlreader::Span attrLn;
+                if (!reader.nextAttribute(&attrNsId, &attrLn)) {
                     break;
                 }
-                if (attrNs == XmlReader::NAMESPACE_OOR &&
+                if (attrNsId == ParseManager::NAMESPACE_OOR &&
                     attrLn.equals(RTL_CONSTASCII_STRINGPARAM("scalar")))
                 {
                     if (!parseValue(reader.getAttributeValue(true), &scalar)) {
     }
     throw css::uno::RuntimeException(
         (rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("bad member <")) +
-         xmldata::convertFromUtf8(name) +
+         name.convertFromUtf8() +
          rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("> in ")) + reader.getUrl()),
         css::uno::Reference< css::uno::XInterface >());
 }
     return true;
 }
 
-void ValueParser::characters(Span const & text) {
+void ValueParser::characters(xmlreader::Span const & text) {
     if (node_.is()) {
         OSL_ASSERT(state_ == STATE_TEXT || state_ == STATE_IT);
         pad_.add(text.begin, text.length);

configmgr/source/valueparser.hxx

 #include "rtl/ref.hxx"
 #include "rtl/string.hxx"
 #include "rtl/ustring.hxx"
+#include "xmlreader/pad.hxx"
+#include "xmlreader/xmlreader.hxx"
 
-#include "pad.hxx"
 #include "type.hxx"
-#include "xmlreader.hxx"
 
 namespace com { namespace sun { namespace star { namespace uno {
     class Any;
 } } } }
+namespace xmlreader { struct Span; }
 
 namespace configmgr {
 
 class Node;
-struct Span;
 
 class ValueParser: private boost::noncopyable {
 public:
 
     ~ValueParser();
 
-    XmlReader::Text getTextMode() const;
+    xmlreader::XmlReader::Text getTextMode() const;
 
     bool startElement(
-        XmlReader & reader, XmlReader::Namespace ns, Span const & name);
+        xmlreader::XmlReader & reader, int nsId, xmlreader::Span const & name);
 
     bool endElement();
 
-    void characters(Span const & text);
+    void characters(xmlreader::Span const & text);
 
     void start(
         rtl::Reference< Node > const & property,
     rtl::Reference< Node > node_;
     rtl::OUString localizedName_;
     State state_;
-    Pad pad_;
+    xmlreader::Pad pad_;
     std::vector< com::sun::star::uno::Any > items_;
 };
 

configmgr/source/writemodfile.cxx

 #include "rtl/ustring.h"
 #include "rtl/ustring.hxx"
 #include "sal/types.h"
+#include "xmlreader/span.hxx"
 
 #include "data.hxx"
 #include "groupnode.hxx"
 #include "node.hxx"
 #include "nodemap.hxx"
 #include "propertynode.hxx"
-#include "span.hxx"
 #include "type.hxx"
 #include "writemodfile.hxx"
 
     rtl::Reference< Node > const & parent, rtl::OUString const & name,
     rtl::Reference< Node > const & node)
 {
-    static Span const typeNames[] = {
-        Span(), Span(), Span(), // TYPE_ERROR, TYPE_NIL, TYPE_ANY
-        Span(RTL_CONSTASCII_STRINGPARAM("xs:boolean")),
-        Span(RTL_CONSTASCII_STRINGPARAM("xs:short")),
-        Span(RTL_CONSTASCII_STRINGPARAM("xs:int")),
-        Span(RTL_CONSTASCII_STRINGPARAM("xs:long")),
-        Span(RTL_CONSTASCII_STRINGPARAM("xs:double")),
-        Span(RTL_CONSTASCII_STRINGPARAM("xs:string")),
-        Span(RTL_CONSTASCII_STRINGPARAM("xs:hexBinary")),
-        Span(RTL_CONSTASCII_STRINGPARAM("oor:boolean-list")),
-        Span(RTL_CONSTASCII_STRINGPARAM("oor:short-list")),
-        Span(RTL_CONSTASCII_STRINGPARAM("oor:int-list")),
-        Span(RTL_CONSTASCII_STRINGPARAM("oor:long-list")),
-        Span(RTL_CONSTASCII_STRINGPARAM("oor:double-list")),
-        Span(RTL_CONSTASCII_STRINGPARAM("oor:string-list")),
-        Span(RTL_CONSTASCII_STRINGPARAM("oor:hexBinary-list")) };
+    static xmlreader::Span const typeNames[] = {
+        xmlreader::Span(), xmlreader::Span(), xmlreader::Span(),
+            // TYPE_ERROR, TYPE_NIL, TYPE_ANY
+        xmlreader::Span(RTL_CONSTASCII_STRINGPARAM("xs:boolean")),
+        xmlreader::Span(RTL_CONSTASCII_STRINGPARAM("xs:short")),
+        xmlreader::Span(RTL_CONSTASCII_STRINGPARAM("xs:int")),
+        xmlreader::Span(RTL_CONSTASCII_STRINGPARAM("xs:long")),
+        xmlreader::Span(RTL_CONSTASCII_STRINGPARAM("xs:double")),
+        xmlreader::Span(RTL_CONSTASCII_STRINGPARAM("xs:string")),
+        xmlreader::Span(RTL_CONSTASCII_STRINGPARAM("xs:hexBinary")),
+        xmlreader::Span(RTL_CONSTASCII_STRINGPARAM("oor:boolean-list")),
+        xmlreader::Span(RTL_CONSTASCII_STRINGPARAM("oor:short-list")),
+        xmlreader::Span(RTL_CONSTASCII_STRINGPARAM("oor:int-list")),
+        xmlreader::Span(RTL_CONSTASCII_STRINGPARAM("oor:long-list")),
+        xmlreader::Span(RTL_CONSTASCII_STRINGPARAM("oor:double-list")),
+        xmlreader::Span(RTL_CONSTASCII_STRINGPARAM("oor:string-list")),
+        xmlreader::Span(RTL_CONSTASCII_STRINGPARAM("oor:hexBinary-list")) };
     switch (node->kind()) {
     case Node::KIND_PROPERTY:
         {

configmgr/source/xcdparser.cxx

 #include "rtl/string.h"
 #include "rtl/ustring.h"
 #include "rtl/ustring.hxx"
+#include "xmlreader/span.hxx"
+#include "xmlreader/xmlreader.hxx"
 
-#include "span.hxx"
+#include "parsemanager.hxx"
 #include "xcdparser.hxx"
 #include "xcsparser.hxx"
 #include "xcuparser.hxx"
 #include "xmldata.hxx"
-#include "xmlreader.hxx"
 
 namespace configmgr {
 
 
 XcdParser::~XcdParser() {}
 
-XmlReader::Text XcdParser::getTextMode() {
+xmlreader::XmlReader::Text XcdParser::getTextMode() {
     return nestedParser_.is()
-        ? nestedParser_->getTextMode() : XmlReader::TEXT_NONE;
+        ? nestedParser_->getTextMode() : xmlreader::XmlReader::TEXT_NONE;
 }
 
 bool XcdParser::startElement(
-    XmlReader & reader, XmlReader::Namespace ns, Span const & name)
+    xmlreader::XmlReader & reader, int nsId, xmlreader::Span const & name)
 {
     if (nestedParser_.is()) {
         OSL_ASSERT(nesting_ != LONG_MAX);
         ++nesting_;
-        return nestedParser_->startElement(reader, ns, name);
+        return nestedParser_->startElement(reader, nsId, name);
     }
     switch (state_) {
     case STATE_START:
-        if (ns == XmlReader::NAMESPACE_OOR &&
+        if (nsId == ParseManager::NAMESPACE_OOR &&
             name.equals(RTL_CONSTASCII_STRINGPARAM("data")))
         {
             state_ = STATE_DEPENDENCIES;
         }
         break;
     case STATE_DEPENDENCIES:
-        if (ns == XmlReader::NAMESPACE_NONE &&
+        if (nsId == xmlreader::XmlReader::NAMESPACE_NONE &&
             name.equals(RTL_CONSTASCII_STRINGPARAM("dependency")))
         {
             if (dependency_.getLength() == 0) {
-                Span attrFile;
+                xmlreader::Span attrFile;
                 for (;;) {
-                    XmlReader::Namespace attrNs;
-                    Span attrLn;
-                    if (!reader.nextAttribute(&attrNs, &attrLn)) {
+                    int attrNsId;
+                    xmlreader::Span attrLn;
+                    if (!reader.nextAttribute(&attrNsId, &attrLn)) {
                         break;
                     }
-                    if (attrNs == XmlReader::NAMESPACE_NONE && //TODO: _OOR
+                    if (attrNsId == xmlreader::XmlReader::NAMESPACE_NONE &&
+                            //TODO: _OOR
                         attrLn.equals(RTL_CONSTASCII_STRINGPARAM("file")))
                     {
                         attrFile = reader.getAttributeValue(false);
                          reader.getUrl()),
                         css::uno::Reference< css::uno::XInterface >());
                 }
-                dependency_ = xmldata::convertFromUtf8(attrFile);
+                dependency_ = attrFile.convertFromUtf8();
                 if (dependency_.getLength() == 0) {
                     throw css::uno::RuntimeException(
                         (rtl::OUString(
         state_ = STATE_COMPONENTS;
         // fall through
     case STATE_COMPONENTS:
-        if (ns == XmlReader::NAMESPACE_OOR &&
+        if (nsId == ParseManager::NAMESPACE_OOR &&
             name.equals(RTL_CONSTASCII_STRINGPARAM("component-schema")))
         {
             nestedParser_ = new XcsParser(layer_, data_);
             nesting_ = 1;
-            return nestedParser_->startElement(reader, ns, name);
+            return nestedParser_->startElement(reader, nsId, name);
         }
-        if (ns == XmlReader::NAMESPACE_OOR &&
+        if (nsId == ParseManager::NAMESPACE_OOR &&
             name.equals(RTL_CONSTASCII_STRINGPARAM("component-data")))
         {
             nestedParser_ = new XcuParser(layer_ + 1, data_, 0, 0);
             nesting_ = 1;
-            return nestedParser_->startElement(reader, ns, name);
+            return nestedParser_->startElement(reader, nsId, name);
         }
         break;
     default: // STATE_DEPENDENCY
     }
     throw css::uno::RuntimeException(
         (rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("bad member <")) +
-         xmldata::convertFromUtf8(name) +
+         name.convertFromUtf8() +
          rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("> in ")) + reader.getUrl()),
         css::uno::Reference< css::uno::XInterface >());
 }
 
-void XcdParser::endElement(XmlReader const & reader) {
+void XcdParser::endElement(xmlreader::XmlReader const & reader) {
     if (nestedParser_.is()) {
         nestedParser_->endElement(reader);
         if (--nesting_ == 0) {
     }
 }
 
-void XcdParser::characters(Span const & text) {
+void XcdParser::characters(xmlreader::Span const & text) {
     if (nestedParser_.is()) {
         nestedParser_->characters(text);
     }

configmgr/source/xcdparser.hxx

 
 #include "rtl/ref.hxx"
 #include "rtl/ustring.hxx"
+#include "xmlreader/xmlreader.hxx"
 
 #include "parser.hxx"
-#include "xmlreader.hxx"
+
+namespace xmlreader { struct Span; }
 
 namespace configmgr {
 
 struct Data;
-struct Span;
 
 class XcdParser: public Parser {
 public:
 private:
     virtual ~XcdParser();
 
-    virtual XmlReader::Text getTextMode();
+    virtual xmlreader::XmlReader::Text getTextMode();
 
     virtual bool startElement(
-        XmlReader & reader, XmlReader::Namespace ns, Span const & name);
+        xmlreader::XmlReader & reader, int nsId, xmlreader::Span const & name);
 
-    virtual void endElement(XmlReader const & reader);
+    virtual void endElement(xmlreader::XmlReader const & reader);
 
-    virtual void characters(Span const & text);
+    virtual void characters(xmlreader::Span const & text);
 
     enum State {
         STATE_START, STATE_DEPENDENCIES, STATE_DEPENDENCY, STATE_COMPONENTS };

configmgr/source/xcsparser.cxx

 #include "rtl/string.hxx"
 #include "rtl/ustring.h"
 #include "rtl/ustring.hxx"
+#include "xmlreader/span.hxx"
+#include "xmlreader/xmlreader.hxx"
 
 #include "data.hxx"
 #include "localizedpropertynode.hxx"
 #include "groupnode.hxx"
 #include "node.hxx"
 #include "nodemap.hxx"
+#include "parsemanager.hxx"
 #include "propertynode.hxx"
 #include "setnode.hxx"
-#include "span.hxx"
 #include "xcsparser.hxx"
 #include "xmldata.hxx"
-#include "xmlreader.hxx"
 
 namespace configmgr {
 
 
 XcsParser::~XcsParser() {}
 
-XmlReader::Text XcsParser::getTextMode() {
+xmlreader::XmlReader::Text XcsParser::getTextMode() {
     return valueParser_.getTextMode();
 }
 
 bool XcsParser::startElement(
-    XmlReader & reader, XmlReader::Namespace ns, Span const & name)
+    xmlreader::XmlReader & reader, int nsId, xmlreader::Span const & name)
 {
-    if (valueParser_.startElement(reader, ns, name)) {
+    if (valueParser_.startElement(reader, nsId, name)) {
         return true;
     }
     if (state_ == STATE_START) {
-        if (ns == XmlReader::NAMESPACE_OOR &&
+        if (nsId == ParseManager::NAMESPACE_OOR &&
             name.equals(RTL_CONSTASCII_STRINGPARAM("component-schema"))) {
             handleComponentSchema(reader);
             state_ = STATE_COMPONENT_SCHEMA;
         // prop constraints; accepting all four at illegal places (and with
         // illegal content):
         if (ignoring_ > 0 ||
-            (ns == XmlReader::NAMESPACE_NONE &&
+            (nsId == xmlreader::XmlReader::NAMESPACE_NONE &&
              (name.equals(RTL_CONSTASCII_STRINGPARAM("info")) ||
               name.equals(RTL_CONSTASCII_STRINGPARAM("import")) ||
               name.equals(RTL_CONSTASCII_STRINGPARAM("uses")) ||
         }
         switch (state_) {
         case STATE_COMPONENT_SCHEMA:
-            if (ns == XmlReader::NAMESPACE_NONE &&
+            if (nsId == xmlreader::XmlReader::NAMESPACE_NONE &&
                 name.equals(RTL_CONSTASCII_STRINGPARAM("templates")))
             {
                 state_ = STATE_TEMPLATES;
             }
             // fall through
         case STATE_TEMPLATES_DONE:
-            if (ns == XmlReader::NAMESPACE_NONE &&
+            if (nsId == xmlreader::XmlReader::NAMESPACE_NONE &&
                 name.equals(RTL_CONSTASCII_STRINGPARAM("component")))
             {
                 state_ = STATE_COMPONENT;
             break;
         case STATE_TEMPLATES:
             if (elements_.empty()) {
-                if (ns == XmlReader::NAMESPACE_NONE &&
+                if (nsId == xmlreader::XmlReader::NAMESPACE_NONE &&
                     name.equals(RTL_CONSTASCII_STRINGPARAM("group")))
                 {
                     handleGroup(reader, true);
                     return true;
                 }
-                if (ns == XmlReader::NAMESPACE_NONE &&
+                if (nsId == xmlreader::XmlReader::NAMESPACE_NONE &&
                     name.equals(RTL_CONSTASCII_STRINGPARAM("set")))
                 {
                     handleSet(reader, true);
             switch (elements_.top().node->kind()) {
             case Node::KIND_PROPERTY:
             case Node::KIND_LOCALIZED_PROPERTY:
-                if (ns == XmlReader::NAMESPACE_NONE &&
+                if (nsId == xmlreader::XmlReader::NAMESPACE_NONE &&
                     name.equals(RTL_CONSTASCII_STRINGPARAM("value")))
                 {
                     handlePropValue(reader, elements_.top().node);
                 }
                 break;
             case Node::KIND_GROUP:
-                if (ns == XmlReader::NAMESPACE_NONE &&
+                if (nsId == xmlreader::XmlReader::NAMESPACE_NONE &&
                     name.equals(RTL_CONSTASCII_STRINGPARAM("prop")))
                 {
                     handleProp(reader);
                     return true;
                 }
-                if (ns == XmlReader::NAMESPACE_NONE &&
+                if (nsId == xmlreader::XmlReader::NAMESPACE_NONE &&
                     name.equals(RTL_CONSTASCII_STRINGPARAM("node-ref")))
                 {
                     handleNodeRef(reader);
                     return true;
                 }
-                if (ns == XmlReader::NAMESPACE_NONE &&
+                if (nsId == xmlreader::XmlReader::NAMESPACE_NONE &&
                     name.equals(RTL_CONSTASCII_STRINGPARAM("group")))
                 {
                     handleGroup(reader, false);
                     return true;
                 }
-                if (ns == XmlReader::NAMESPACE_NONE &&
+                if (nsId == xmlreader::XmlReader::NAMESPACE_NONE &&
                     name.equals(RTL_CONSTASCII_STRINGPARAM("set")))
                 {
                     handleSet(reader, false);
                 }
                 break;
             case Node::KIND_SET:
-                if (ns == XmlReader::NAMESPACE_NONE &&
+                if (nsId == xmlreader::XmlReader::NAMESPACE_NONE &&
                     name.equals(RTL_CONSTASCII_STRINGPARAM("item")))
                 {
                     handleSetItem(
     }
     throw css::uno::RuntimeException(
         (rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("bad member <")) +
-         xmldata::convertFromUtf8(name) +
+         name.convertFromUtf8() +
          rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("> in ")) + reader.getUrl()),
         css::uno::Reference< css::uno::XInterface >());
 }
 
-void XcsParser::endElement(XmlReader const & reader) {
+void XcsParser::endElement(xmlreader::XmlReader const & reader) {
     if (valueParser_.endElement()) {
         return;
     }
     }
 }
 
-void XcsParser::characters(Span const & text) {
+void XcsParser::characters(xmlreader::Span const & text) {
     valueParser_.characters(text);
 }
 
-void XcsParser::handleComponentSchema(XmlReader & reader) {
+void XcsParser::handleComponentSchema(xmlreader::XmlReader & reader) {
     //TODO: oor:version, xml:lang attributes
     rtl::OStringBuffer buf;
     buf.append('.');
     bool hasPackage = false;
     bool hasName = false;
     for (;;) {
-        XmlReader::Namespace attrNs;
-        Span attrLn;
-        if (!reader.nextAttribute(&attrNs, &attrLn)) {
+        int attrNsId;
+        xmlreader::Span attrLn;
+        if (!reader.nextAttribute(&attrNsId, &attrLn)) {
             break;
         }
-        if (attrNs == XmlReader::NAMESPACE_OOR &&
+        if (attrNsId == ParseManager::NAMESPACE_OOR &&
             attrLn.equals(RTL_CONSTASCII_STRINGPARAM("package")))
         {
             if (hasPackage) {
                     css::uno::Reference< css::uno::XInterface >());
             }
             hasPackage = true;
-            Span s(reader.getAttributeValue(false));
+            xmlreader::Span s(reader.getAttributeValue(false));
             buf.insert(0, s.begin, s.length);
-        } else if (attrNs == XmlReader::NAMESPACE_OOR &&
+        } else if (attrNsId == ParseManager::NAMESPACE_OOR &&
                    attrLn.equals(RTL_CONSTASCII_STRINGPARAM("name")))
         {
             if (hasName) {
                     css::uno::Reference< css::uno::XInterface >());
             }
             hasName = true;
-            Span s(reader.getAttributeValue(false));
+            xmlreader::Span s(reader.getAttributeValue(false));
             buf.append(s.begin, s.length);
         }
     }
              reader.getUrl()),
             css::uno::Reference< css::uno::XInterface >());
     }
-    componentName_ = xmldata::convertFromUtf8(
-        Span(buf.getStr(), buf.getLength()));
+    componentName_ = xmlreader::Span(buf.getStr(), buf.getLength()).
+        convertFromUtf8();
 }
 
-void XcsParser::handleNodeRef(XmlReader & reader) {
+void XcsParser::handleNodeRef(xmlreader::XmlReader & reader) {
     bool hasName = false;
     rtl::OUString name;
     rtl::OUString component(componentName_);
     bool hasNodeType = false;
     rtl::OUString nodeType;
     for (;;) {
-        XmlReader::Namespace attrNs;
-        Span attrLn;
-        if (!reader.nextAttribute(&attrNs, &attrLn)) {
+        int attrNsId;
+        xmlreader::Span attrLn;
+        if (!reader.nextAttribute(&attrNsId, &attrLn)) {
             break;
         }
-        if (attrNs == XmlReader::NAMESPACE_OOR &&
+        if (attrNsId == ParseManager::NAMESPACE_OOR &&
             attrLn.equals(RTL_CONSTASCII_STRINGPARAM("name")))
         {
             hasName = true;
-            name = xmldata::convertFromUtf8(reader.getAttributeValue(false));
-        } else if (attrNs == XmlReader::NAMESPACE_OOR &&
+            name = reader.getAttributeValue(false).convertFromUtf8();
+        } else if (attrNsId == ParseManager::NAMESPACE_OOR &&
                    attrLn.equals(RTL_CONSTASCII_STRINGPARAM("component")))
         {
-            component = xmldata::convertFromUtf8(
-                reader.getAttributeValue(false));
-        } else if (attrNs == XmlReader::NAMESPACE_OOR &&
+            component = reader.getAttributeValue(false).convertFromUtf8();
+        } else if (attrNsId == ParseManager::NAMESPACE_OOR &&
                    attrLn.equals(RTL_CONSTASCII_STRINGPARAM("node-type")))
         {
             hasNodeType = true;
-            nodeType = xmldata::convertFromUtf8(
-                reader.getAttributeValue(false));
+            nodeType = reader.getAttributeValue(false).convertFromUtf8();
         }
     }
     if (!hasName) {
     elements_.push(Element(node, name));
 }
 
-void XcsParser::handleProp(XmlReader & reader) {
+void XcsParser::handleProp(xmlreader::XmlReader & reader) {
     bool hasName = false;
     rtl::OUString name;
     valueParser_.type_ = TYPE_ERROR;
     bool localized = false;
     bool nillable = true;
     for (;;) {
-        XmlReader::Namespace attrNs;
-        Span attrLn;
-        if (!reader.nextAttribute(&attrNs, &attrLn)) {
+        int attrNsId;
+        xmlreader::Span attrLn;
+        if (!reader.nextAttribute(&attrNsId, &attrLn)) {
             break;
         }
-        if (attrNs == XmlReader::NAMESPACE_OOR &&
+        if (attrNsId == ParseManager::NAMESPACE_OOR &&
             attrLn.equals(RTL_CONSTASCII_STRINGPARAM("name")))
         {
             hasName = true;
-            name = xmldata::convertFromUtf8(reader.getAttributeValue(false));
-        } else if (attrNs == XmlReader::NAMESPACE_OOR &&
+            name = reader.getAttributeValue(false).convertFromUtf8();
+        } else if (attrNsId == ParseManager::NAMESPACE_OOR &&
                    attrLn.equals(RTL_CONSTASCII_STRINGPARAM("type")))
         {
             valueParser_.type_ = xmldata::parseType(
                 reader, reader.getAttributeValue(true));
-        } else if (attrNs == XmlReader::NAMESPACE_OOR &&
+        } else if (attrNsId == ParseManager::NAMESPACE_OOR &&
                    attrLn.equals(RTL_CONSTASCII_STRINGPARAM("localized")))
         {
             localized = xmldata::parseBoolean(reader.getAttributeValue(true));
-        } else if (attrNs == XmlReader::NAMESPACE_OOR &&
+        } else if (attrNsId == ParseManager::NAMESPACE_OOR &&
                    attrLn.equals(RTL_CONSTASCII_STRINGPARAM("nillable")))
         {
             nillable = xmldata::parseBoolean(reader.getAttributeValue(true));
 }
 
 void XcsParser::handlePropValue(
-    XmlReader & reader, rtl::Reference< Node > const & property)
+    xmlreader::XmlReader & reader, rtl::Reference< Node > const & property)
 {
-    Span attrSeparator;
+    xmlreader::Span attrSeparator;
     for (;;) {
-        XmlReader::Namespace attrNs;
-        Span attrLn;
-        if (!reader.nextAttribute(&attrNs, &attrLn)) {
+        int attrNsId;
+        xmlreader::Span attrLn;
+        if (!reader.nextAttribute(&attrNsId, &attrLn)) {
             break;
         }
-        if (attrNs == XmlReader::NAMESPACE_OOR &&
+        if (attrNsId == ParseManager::NAMESPACE_OOR &&
             attrLn.equals(RTL_CONSTASCII_STRINGPARAM("separator")))
         {
             attrSeparator = reader.getAttributeValue(false);
     valueParser_.start(property);
 }
 
-void XcsParser::handleGroup(XmlReader & reader, bool isTemplate) {
+void XcsParser::handleGroup(xmlreader::XmlReader & reader, bool isTemplate) {
     bool hasName = false;
     rtl::OUString name;
     bool extensible = false;
     for (;;) {
-        XmlReader::Namespace attrNs;
-        Span attrLn;
-        if (!reader.nextAttribute(&attrNs, &attrLn)) {
+        int attrNsId;
+        xmlreader::Span attrLn;
+        if (!reader.nextAttribute(&attrNsId, &attrLn)) {
             break;
         }
-        if (attrNs == XmlReader::NAMESPACE_OOR &&
+        if (attrNsId == ParseManager::NAMESPACE_OOR &&
             attrLn.equals(RTL_CONSTASCII_STRINGPARAM("name")))
         {
             hasName = true;
-            name = xmldata::convertFromUtf8(reader.getAttributeValue(false));
-        } else if (attrNs == XmlReader::NAMESPACE_OOR &&
+            name = reader.getAttributeValue(false).convertFromUtf8();
+        } else if (attrNsId == ParseManager::NAMESPACE_OOR &&
                    attrLn.equals(RTL_CONSTASCII_STRINGPARAM("extensible")))
         {
             extensible = xmldata::parseBoolean(reader.getAttributeValue(true));
             name));
 }
 
-void XcsParser::handleSet(XmlReader & reader, bool isTemplate) {
+void XcsParser::handleSet(xmlreader::XmlReader & reader, bool isTemplate) {
     bool hasName = false;
     rtl::OUString name;
     rtl::OUString component(componentName_);
     bool hasNodeType = false;
     rtl::OUString nodeType;
     for (;;) {
-        XmlReader::Namespace attrNs;
-        Span attrLn;
-        if (!reader.nextAttribute(&attrNs, &attrLn)) {
+        int attrNsId;
+        xmlreader::Span attrLn;
+        if (!reader.nextAttribute(&attrNsId, &attrLn)) {
             break;
         }
-        if (attrNs == XmlReader::NAMESPACE_OOR &&
+        if (attrNsId == ParseManager::NAMESPACE_OOR &&
             attrLn.equals(RTL_CONSTASCII_STRINGPARAM("name")))
         {
             hasName = true;
-            name = xmldata::convertFromUtf8(reader.getAttributeValue(false));
-        } else if (attrNs == XmlReader::NAMESPACE_OOR &&
+            name = reader.getAttributeValue(false).convertFromUtf8();
+        } else if (attrNsId == ParseManager::NAMESPACE_OOR &&
                    attrLn.equals(RTL_CONSTASCII_STRINGPARAM("component")))
         {
-            component = xmldata::convertFromUtf8(
-                reader.getAttributeValue(false));
-        } else if (attrNs == XmlReader::NAMESPACE_OOR &&
+            component = reader.getAttributeValue(false).convertFromUtf8();
+        } else if (attrNsId == ParseManager::NAMESPACE_OOR &&
                    attrLn.equals(RTL_CONSTASCII_STRINGPARAM("node-type")))
         {
             hasNodeType = true;
-            nodeType = xmldata::convertFromUtf8(
-                reader.getAttributeValue(false));
+            nodeType = reader.getAttributeValue(false).convertFromUtf8();
         }
     }
     if (!hasName) {
             name));
 }
 
-void XcsParser::handleSetItem(XmlReader & reader, SetNode * set) {
+void XcsParser::handleSetItem(xmlreader::XmlReader & reader, SetNode * set) {
     rtl::OUString component(componentName_);
     bool hasNodeType = false;
     rtl::OUString nodeType;
     for (;;) {
-        XmlReader::Namespace attrNs;
-        Span attrLn;
-        if (!reader.nextAttribute(&attrNs, &attrLn)) {
+        int attrNsId;
+        xmlreader::Span attrLn;
+        if (!reader.nextAttribute(&attrNsId, &attrLn)) {
             break;
         }
-        if (attrNs == XmlReader::NAMESPACE_OOR &&
+        if (attrNsId == ParseManager::NAMESPACE_OOR &&
             attrLn.equals(RTL_CONSTASCII_STRINGPARAM("component")))
         {
-            component = xmldata::convertFromUtf8(
-                reader.getAttributeValue(false));
-        } else if (attrNs == XmlReader::NAMESPACE_OOR &&
+            component = reader.getAttributeValue(false).convertFromUtf8();
+        } else if (attrNsId == ParseManager::NAMESPACE_OOR &&
                    attrLn.equals(RTL_CONSTASCII_STRINGPARAM("node-type")))
         {
             hasNodeType = true;
-            nodeType = xmldata::convertFromUtf8(
-                reader.getAttributeValue(false));
+            nodeType = reader.getAttributeValue(false).convertFromUtf8();
         }
     }
     set->getAdditionalTemplateNames().push_back(

configmgr/source/xcsparser.hxx

 
 #include "rtl/ref.hxx"
 #include "rtl/ustring.hxx"
+#include "xmlreader/xmlreader.hxx"
 
 #include "node.hxx"
 #include "parser.hxx"
 #include "valueparser.hxx"
-#include "xmlreader.hxx"
+
+namespace xmlreader { struct Span; }
 
 namespace configmgr {
 
 class SetNode;
 struct Data;
-struct Span;
 
 class XcsParser: public Parser {
 public:
 private:
     virtual ~XcsParser();
 
-    virtual XmlReader::Text getTextMode();
+    virtual xmlreader::XmlReader::Text getTextMode();
 
     virtual bool startElement(
-        XmlReader & reader, XmlReader::Namespace ns, Span const & name);
+        xmlreader::XmlReader & reader, int nsId, xmlreader::Span const & name);
 
-    virtual void endElement(XmlReader const & reader);
+    virtual void endElement(xmlreader::XmlReader const & reader);
 
-    virtual void characters(Span const & text);
+    virtual void characters(xmlreader::Span const & text);
 
-    void handleComponentSchema(XmlReader & reader);
+    void handleComponentSchema(xmlreader::XmlReader & reader);
 
-    void handleNodeRef(XmlReader & reader);
+    void handleNodeRef(xmlreader::XmlReader & reader);
 
-    void handleProp(XmlReader & reader);
+    void handleProp(xmlreader::XmlReader & reader);
 
     void handlePropValue(
-        XmlReader & reader, rtl::Reference< Node > const & property);
+        xmlreader::XmlReader & reader, rtl::Reference< Node > const & property);
 
-    void handleGroup(XmlReader & reader, bool isTemplate);
+    void handleGroup(xmlreader::XmlReader & reader, bool isTemplate);
 
-    void handleSet(XmlReader & reader, bool isTemplate);
+    void handleSet(xmlreader::XmlReader & reader, bool isTemplate);
 
-    void handleSetItem(XmlReader & reader, SetNode * set);
+    void handleSetItem(xmlreader::XmlReader & reader, SetNode * set);
 
     enum State {
         STATE_START, STATE_COMPONENT_SCHEMA, STATE_TEMPLATES,

configmgr/source/xcuparser.cxx

 #include "rtl/string.hxx"
 #include "rtl/ustring.h"
 #include "rtl/ustring.hxx"
+#include "xmlreader/span.hxx"
+#include "xmlreader/xmlreader.hxx"
 
 #include "data.hxx"
 #include "localizedpropertynode.hxx"
 #include "modifications.hxx"
 #include "node.hxx"
 #include "nodemap.hxx"
+#include "parsemanager.hxx"
 #include "partial.hxx"
 #include "path.hxx"
 #include "propertynode.hxx"
 #include "setnode.hxx"
-#include "span.hxx"
 #include "xcuparser.hxx"
 #include "xmldata.hxx"
-#include "xmlreader.hxx"
 
 namespace configmgr {
 
 
 XcuParser::~XcuParser() {}
 
-XmlReader::Text XcuParser::getTextMode() {
+xmlreader::XmlReader::Text XcuParser::getTextMode() {
     return valueParser_.getTextMode();
 }
 
 bool XcuParser::startElement(
-    XmlReader & reader, XmlReader::Namespace ns, Span const & name)
+    xmlreader::XmlReader & reader, int nsId, xmlreader::Span const & name)
 {
-    if (valueParser_.startElement(reader, ns, name)) {
+    if (valueParser_.startElement(reader, nsId, name)) {
         return true;
     }
     if (state_.empty()) {
-        if (ns == XmlReader::NAMESPACE_OOR &&
+        if (nsId == ParseManager::NAMESPACE_OOR &&
             name.equals(RTL_CONSTASCII_STRINGPARAM("component-data")))
         {
             handleComponentData(reader);
-        } else if (ns == XmlReader::NAMESPACE_OOR &&
+        } else if (nsId == ParseManager::NAMESPACE_OOR &&
                    name.equals(RTL_CONSTASCII_STRINGPARAM("items")))
         {
             state_.push(State(rtl::Reference< Node >(), false));
             throw css::uno::RuntimeException(
                 (rtl::OUString(
                     RTL_CONSTASCII_USTRINGPARAM("bad root element <")) +
-                 xmldata::convertFromUtf8(name) +
+                 name.convertFromUtf8() +
                  rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("> in ")) +
                  reader.getUrl()),
                 css::uno::Reference< css::uno::XInterface >());
     } else if (state_.top().ignore) {
         state_.push(State(false));
     } else if (!state_.top().node.is()) {
-        if (ns == XmlReader::NAMESPACE_NONE &&
+        if (nsId == xmlreader::XmlReader::NAMESPACE_NONE &&
             name.equals(RTL_CONSTASCII_STRINGPARAM("item")))
         {
             handleItem(reader);
             throw css::uno::RuntimeException(
                 (rtl::OUString(
                     RTL_CONSTASCII_USTRINGPARAM("bad items node member <")) +
-                 xmldata::convertFromUtf8(name) +
+                 name.convertFromUtf8() +
                  rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("> in ")) +
                  reader.getUrl()),
                 css::uno::Reference< css::uno::XInterface >());
     } else {
         switch (state_.top().node->kind()) {
         case Node::KIND_PROPERTY:
-            if (ns == XmlReader::NAMESPACE_NONE &&
+            if (nsId == xmlreader::XmlReader::NAMESPACE_NONE &&
                 name.equals(RTL_CONSTASCII_STRINGPARAM("value")))
             {
                 handlePropValue(
                     (rtl::OUString(
                         RTL_CONSTASCII_USTRINGPARAM(
                             "bad property node member <")) +
-                     xmldata::convertFromUtf8(name) +
+                     name.convertFromUtf8() +
                      rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("> in ")) +
                      reader.getUrl()),
                     css::uno::Reference< css::uno::XInterface >());
             }
             break;
         case Node::KIND_LOCALIZED_PROPERTY:
-            if (ns == XmlReader::NAMESPACE_NONE &&
+            if (nsId == xmlreader::XmlReader::NAMESPACE_NONE &&
                 name.equals(RTL_CONSTASCII_STRINGPARAM("value")))
             {
                 handleLocpropValue(
                     (rtl::OUString(
                         RTL_CONSTASCII_USTRINGPARAM(
                             "bad localized property node member <")) +
-                     xmldata::convertFromUtf8(name) +
+                     name.convertFromUtf8() +
                      rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("> in ")) +
                      reader.getUrl()),
                     css::uno::Reference< css::uno::XInterface >());
         case Node::KIND_LOCALIZED_VALUE:
             throw css::uno::RuntimeException(
                 (rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("bad member <")) +
-                 xmldata::convertFromUtf8(name) +
+                 name.convertFromUtf8() +
                  rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("> in ")) +
                  reader.getUrl()),
                 css::uno::Reference< css::uno::XInterface >());
         case Node::KIND_GROUP:
-            if (ns == XmlReader::NAMESPACE_NONE &&
+            if (nsId == xmlreader::XmlReader::NAMESPACE_NONE &&
                 name.equals(RTL_CONSTASCII_STRINGPARAM("prop")))
             {
                 handleGroupProp(
                     reader,
                     dynamic_cast< GroupNode * >(state_.top().node.get()));
-            } else if (ns == XmlReader::NAMESPACE_NONE &&
+            } else if (nsId == xmlreader::XmlReader::NAMESPACE_NONE &&
                        name.equals(RTL_CONSTASCII_STRINGPARAM("node")))
             {
                 handleGroupNode(reader, state_.top().node);
                     (rtl::OUString(
                         RTL_CONSTASCII_USTRINGPARAM(
                             "bad group node member <")) +
-                     xmldata::convertFromUtf8(name) +
+                     name.convertFromUtf8() +
                      rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("> in ")) +
                      reader.getUrl()),
                     css::uno::Reference< css::uno::XInterface >());
             }
             break;
         case Node::KIND_SET:
-            if (ns == XmlReader::NAMESPACE_NONE &&
+            if (nsId == xmlreader::XmlReader::NAMESPACE_NONE &&
                 name.equals(RTL_CONSTASCII_STRINGPARAM("node")))
             {
                 handleSetNode(
                     reader, dynamic_cast< SetNode * >(state_.top().node.get()));
-            } else if (ns == XmlReader::NAMESPACE_NONE &&
+            } else if (nsId == xmlreader::XmlReader::NAMESPACE_NONE &&
                        name.equals(RTL_CONSTASCII_STRINGPARAM("prop")))
             {
                 OSL_TRACE(
                 throw css::uno::RuntimeException(
                     (rtl::OUString(
                         RTL_CONSTASCII_USTRINGPARAM("bad set node member <")) +
-                     xmldata::convertFromUtf8(name) +
+                     name.convertFromUtf8() +
                      rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("> in ")) +
                      reader.getUrl()),
                     css::uno::Reference< css::uno::XInterface >());
     return true;
 }
 
-void XcuParser::endElement(XmlReader const &) {
+void XcuParser::endElement(xmlreader::XmlReader const &) {
     if (valueParser_.endElement()) {
         return;
     }
     }
 }
 
-void XcuParser::characters(Span const & text) {
+void XcuParser::characters(xmlreader::Span const & text) {
     valueParser_.characters(text);
 }
 
-XcuParser::Operation XcuParser::parseOperation(Span const & text) {
+XcuParser::Operation XcuParser::parseOperation(xmlreader::Span const & text) {
     OSL_ASSERT(text.is());
     if (text.equals(RTL_CONSTASCII_STRINGPARAM("modify"))) {
         return OPERATION_MODIFY;
     }
     throw css::uno::RuntimeException(
         (rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("invalid op ")) +
-         xmldata::convertFromUtf8(text)),
+         text.convertFromUtf8()),
         css::uno::Reference< css::uno::XInterface >());
 }
 
-void XcuParser::handleComponentData(XmlReader & reader) {
+void XcuParser::handleComponentData(xmlreader::XmlReader & reader) {
     rtl::OStringBuffer buf;
     buf.append('.');
     bool hasPackage = false;
     Operation op = OPERATION_MODIFY;
     bool finalized = false;
     for (;;) {
-        XmlReader::Namespace attrNs;
-        Span attrLn;
-        if (!reader.nextAttribute(&attrNs, &attrLn)) {
+        int attrNsId;
+        xmlreader::Span attrLn;
+        if (!reader.nextAttribute(&attrNsId, &attrLn)) {
             break;
         }
-        if (attrNs == XmlReader::NAMESPACE_OOR &&
+        if (attrNsId == ParseManager::NAMESPACE_OOR &&
             attrLn.equals(RTL_CONSTASCII_STRINGPARAM("package")))
         {
             if (hasPackage) {
                     css::uno::Reference< css::uno::XInterface >());
             }
             hasPackage = true;
-            Span s(reader.getAttributeValue(false));
+            xmlreader::Span s(reader.getAttributeValue(false));
             buf.insert(0, s.begin, s.length);
-        } else if (attrNs == XmlReader::NAMESPACE_OOR &&
+        } else if (attrNsId == ParseManager::NAMESPACE_OOR &&
                    attrLn.equals(RTL_CONSTASCII_STRINGPARAM("name")))
         {
             if (hasName) {
                     css::uno::Reference< css::uno::XInterface >());
             }
             hasName = true;
-            Span s(reader.getAttributeValue(false));
+            xmlreader::Span s(reader.getAttributeValue(false));
             buf.append(s.begin, s.length);
-        } else if (attrNs == XmlReader::NAMESPACE_OOR &&
+        } else if (attrNsId == ParseManager::NAMESPACE_OOR &&
                    attrLn.equals(RTL_CONSTASCII_STRINGPARAM("op")))
         {
             op = parseOperation(reader.getAttributeValue(true));
-        } else if (attrNs == XmlReader::NAMESPACE_OOR &&
+        } else if (attrNsId == ParseManager::NAMESPACE_OOR &&
                    attrLn.equals(RTL_CONSTASCII_STRINGPARAM("finalized")))
         {
             finalized = xmldata::parseBoolean(reader.getAttributeValue(true));
              reader.getUrl()),
             css::uno::Reference< css::uno::XInterface >());
     }
-    componentName_ = xmldata::convertFromUtf8(
-        Span(buf.getStr(), buf.getLength()));
+    componentName_ = xmlreader::Span(buf.getStr(), buf.getLength()).
+        convertFromUtf8();
     if (trackPath_) {
         OSL_ASSERT(path_.empty());
         path_.push_back(componentName_);
     state_.push(State(node, finalizedLayer < valueParser_.getLayer()));
 }
 
-void XcuParser::handleItem(XmlReader & reader) {
-    Span attrPath;
+void XcuParser::handleItem(xmlreader::XmlReader & reader) {
+    xmlreader::Span attrPath;
     for (;;) {
-        XmlReader::Namespace attrNs;
-        Span attrLn;
-        if (!reader.nextAttribute(&attrNs, &attrLn)) {
+        int attrNsId;
+        xmlreader::Span attrLn;
+        if (!reader.nextAttribute(&attrNsId, &attrLn)) {
             break;
         }
-        if (attrNs == XmlReader::NAMESPACE_OOR &&
+        if (attrNsId == ParseManager::NAMESPACE_OOR &&
             attrLn.equals(RTL_CONSTASCII_STRINGPARAM("path")))
         {
             attrPath = reader.getAttributeValue(false);
              reader.getUrl()),
             css::uno::Reference< css::uno::XInterface >());
     }
-    rtl::OUString path(xmldata::convertFromUtf8(attrPath));
+    rtl::OUString path(attrPath.convertFromUtf8());
     int finalizedLayer;
     rtl::Reference< Node > node(
         data_.resolvePathRepresentation(
     state_.push(State(node, finalizedLayer < valueParser_.getLayer()));
 }
 
-void XcuParser::handlePropValue(XmlReader & reader, PropertyNode * prop) {
+void XcuParser::handlePropValue(
+    xmlreader::XmlReader & reader, PropertyNode * prop)
+ {
     bool nil = false;
     rtl::OString separator;
     rtl::OUString external;
     for (;;) {
-        XmlReader::Namespace attrNs;
-        Span attrLn;
-        if (!reader.nextAttribute(&attrNs, &attrLn)) {
+        int attrNsId;
+        xmlreader::Span attrLn;
+        if (!reader.nextAttribute(&attrNsId, &attrLn)) {
             break;
         }
-        if (attrNs == XmlReader::NAMESPACE_XSI &&
+        if (attrNsId == ParseManager::NAMESPACE_XSI &&
             attrLn.equals(RTL_CONSTASCII_STRINGPARAM("nil")))
         {
             nil = xmldata::parseBoolean(reader.getAttributeValue(true));
-        } else if (attrNs == XmlReader::NAMESPACE_OOR &&
+        } else if (attrNsId == ParseManager::NAMESPACE_OOR &&
             attrLn.equals(RTL_CONSTASCII_STRINGPARAM("type")))
         {
             Type type = xmldata::parseType(
                     css::uno::Reference< css::uno::XInterface >());
             }
             valueParser_.type_ = type;
-        } else if (attrNs == XmlReader::NAMESPACE_OOR &&
+        } else if (attrNsId == ParseManager::NAMESPACE_OOR &&
             attrLn.equals(RTL_CONSTASCII_STRINGPARAM("separator")))
         {
-            Span s(reader.getAttributeValue(false));
+            xmlreader::Span s(reader.getAttributeValue(false));
             if (s.length == 0) {
                 throw css::uno::RuntimeException(
                     (rtl::OUString(
                     css::uno::Reference< css::uno::XInterface >());
             }
             separator = rtl::OString(s.begin, s.length);
-        } else if (attrNs == XmlReader::NAMESPACE_OOR &&
+        } else if (attrNsId == ParseManager::NAMESPACE_OOR &&
             attrLn.equals(RTL_CONSTASCII_STRINGPARAM("external")))
         {
-            external = xmldata::convertFromUtf8(reader.getAttributeValue(true));
+            external = reader.getAttributeValue(true).convertFromUtf8();
             if (external.getLength() == 0) {
                 throw css::uno::RuntimeException(
                     (rtl::OUString(
 }
 
 void XcuParser::handleLocpropValue(
-    XmlReader & reader, LocalizedPropertyNode * locprop)
+    xmlreader::XmlReader & reader, LocalizedPropertyNode * locprop)
 {
     rtl::OUString name;
     bool nil = false;
     rtl::OString separator;
     Operation op = OPERATION_FUSE;
     for (;;) {
-        XmlReader::Namespace attrNs;
-        Span attrLn;
-        if (!reader.nextAttribute(&attrNs, &attrLn)) {
+        int attrNsId;
+        xmlreader::Span attrLn;
+        if (!reader.nextAttribute(&attrNsId, &attrLn)) {
             break;
         }
-        if (attrNs == XmlReader::NAMESPACE_XML &&
+        if (attrNsId == xmlreader::XmlReader::NAMESPACE_XML &&
             attrLn.equals(RTL_CONSTASCII_STRINGPARAM("lang")))
         {
-            name = xmldata::convertFromUtf8(reader.getAttributeValue(false));
-        } else if (attrNs == XmlReader::NAMESPACE_XSI &&
+            name = reader.getAttributeValue(false).convertFromUtf8();
+        } else if (attrNsId == ParseManager::NAMESPACE_XSI &&
             attrLn.equals(RTL_CONSTASCII_STRINGPARAM("nil")))
         {
             nil = xmldata::parseBoolean(reader.getAttributeValue(true));
-        } else if (attrNs == XmlReader::NAMESPACE_OOR &&
+        } else if (attrNsId == ParseManager::NAMESPACE_OOR &&
             attrLn.equals(RTL_CONSTASCII_STRINGPARAM("type")))
         {
             Type type = xmldata::parseType(
                     css::uno::Reference< css::uno::XInterface >());
             }
             valueParser_.type_ = type;
-        } else if (attrNs == XmlReader::NAMESPACE_OOR &&
+        } else if (attrNsId == ParseManager::NAMESPACE_OOR &&
             attrLn.equals(RTL_CONSTASCII_STRINGPARAM("separator")))
         {
-            Span s(reader.getAttributeValue(false));
+            xmlreader::Span s(reader.getAttributeValue(false));
             if (s.length == 0) {
                 throw css::uno::RuntimeException(
                     (rtl::OUString(
                     css::uno::Reference< css::uno::XInterface >());
             }
             separator = rtl::OString(s.begin, s.length);
-        } else if (attrNs == XmlReader::NAMESPACE_OOR &&
+        } else if (attrNsId == ParseManager::NAMESPACE_OOR &&
             attrLn.equals(RTL_CONSTASCII_STRINGPARAM("op")))
         {
             op = parseOperation(reader.getAttributeValue(true));
     }
 }
 
-void XcuParser::handleGroupProp(XmlReader & reader, GroupNode * group) {
+void XcuParser::handleGroupProp(
+    xmlreader::XmlReader & reader, GroupNode * group)
+{
     bool hasName = false;
     rtl::OUString name;
     Type type = TYPE_ERROR;
     Operation op = OPERATION_MODIFY;
     bool finalized = false;
     for (;;) {
-        XmlReader::Namespace attrNs;
-        Span attrLn;
-        if (!reader.nextAttribute(&attrNs, &attrLn)) {
+        int attrNsId;
+        xmlreader::Span attrLn;
+        if (!reader.nextAttribute(&attrNsId, &attrLn)) {
             break;
         }
-        if (attrNs == XmlReader::NAMESPACE_OOR &&
+        if (attrNsId == ParseManager::NAMESPACE_OOR &&
                    attrLn.equals(RTL_CONSTASCII_STRINGPARAM("name")))
         {
             hasName = true;
-            name = xmldata::convertFromUtf8(reader.getAttributeValue(false));
-        } else if (attrNs == XmlReader::NAMESPACE_OOR &&
+            name = reader.getAttributeValue(false).convertFromUtf8();
+        } else if (attrNsId == ParseManager::NAMESPACE_OOR &&
                    attrLn.equals(RTL_CONSTASCII_STRINGPARAM("type")))
         {
             type = xmldata::parseType(reader, reader.getAttributeValue(true));
-        } else if (attrNs == XmlReader::NAMESPACE_OOR &&
+        } else if (attrNsId == ParseManager::NAMESPACE_OOR &&
                    attrLn.equals(RTL_CONSTASCII_STRINGPARAM("op")))
         {
             op = parseOperation(reader.getAttributeValue(true));
-        } else if (attrNs == XmlReader::NAMESPACE_OOR &&
+        } else if (attrNsId == ParseManager::NAMESPACE_OOR &&
                    attrLn.equals(RTL_CONSTASCII_STRINGPARAM("finalized")))
         {
             finalized = xmldata::parseBoolean(reader.getAttributeValue(true));
 }
 
 void XcuParser::handleUnknownGroupProp(
-    XmlReader const & reader, GroupNode * group, rtl::OUString const & name,
-    Type type, Operation operation, bool finalized)
+    xmlreader::XmlReader const & reader, GroupNode * group,
+    rtl::OUString const & name, Type type, Operation operation, bool finalized)
 {
     switch (operation) {
     case OPERATION_REPLACE:
 }
 
 void XcuParser::handlePlainGroupProp(
-    XmlReader const & reader, GroupNode * group,
+    xmlreader::XmlReader const & reader, GroupNode * group,
     NodeMap::iterator const & propertyIndex, rtl::OUString const & name,
     Type type, Operation operation, bool finalized)
 {
 }
 
 void XcuParser::handleLocalizedGroupProp(
-    XmlReader const & reader, LocalizedPropertyNode * property,
+    xmlreader::XmlReader const & reader, LocalizedPropertyNode * property,
     rtl::OUString const & name, Type type, Operation operation, bool finalized)
 {
     if (property->getLayer() > valueParser_.getLayer()) {
 }
 
 void XcuParser::handleGroupNode(
-    XmlReader & reader, rtl::Reference< Node > const & group)
+    xmlreader::XmlReader & reader, rtl::Reference< Node > const & group)
 {
     bool hasName = false;
     rtl::OUString name;
     Operation op = OPERATION_MODIFY;
     bool finalized = false;
     for (;;) {
-        XmlReader::Namespace attrNs;
-        Span attrLn;
-        if (!reader.nextAttribute(&attrNs, &attrLn)) {
+        int attrNsId;
+        xmlreader::Span attrLn;
+        if (!reader.nextAttribute(&attrNsId, &attrLn)) {
             break;
         }
-        if (attrNs == XmlReader::NAMESPACE_OOR &&
+        if (attrNsId == ParseManager::NAMESPACE_OOR &&
                    attrLn.equals(RTL_CONSTASCII_STRINGPARAM("name")))
         {
             hasName = true;
-            name = xmldata::convertFromUtf8(reader.getAttributeValue(false));
-        } else if (attrNs == XmlReader::NAMESPACE_OOR &&
+            name = reader.getAttributeValue(false).convertFromUtf8();
+        } else if (attrNsId == ParseManager::NAMESPACE_OOR &&
                    attrLn.equals(RTL_CONSTASCII_STRINGPARAM("op")))
         {
             op = parseOperation(reader.getAttributeValue(true));
-        } else if (attrNs == XmlReader::NAMESPACE_OOR &&
+        } else if (attrNsId == ParseManager::NAMESPACE_OOR &&
                    attrLn.equals(RTL_CONSTASCII_STRINGPARAM("finalized")))
         {
             finalized = xmldata::parseBoolean(reader.getAttributeValue(true));
             state_.top().locked || finalizedLayer < valueParser_.getLayer()));
 }
 
-void XcuParser::handleSetNode(XmlReader & reader, SetNode * set) {
+void XcuParser::handleSetNode(xmlreader::XmlReader & reader, SetNode * set) {
     bool hasName = false;
     rtl::OUString name;
     rtl::OUString component(componentName_);
     bool finalized = false;
     bool mandatory = false;
     for (;;) {
-        XmlReader::Namespace attrNs;
-        Span attrLn;
-        if (!reader.nextAttribute(&attrNs, &attrLn)) {
+        int attrNsId;
+        xmlreader::Span attrLn;
+        if (!reader.nextAttribute(&attrNsId, &attrLn)) {
             break;
         }
-        if (attrNs == XmlReader::NAMESPACE_OOR &&
+        if (attrNsId == ParseManager::NAMESPACE_OOR &&
                    attrLn.equals(RTL_CONSTASCII_STRINGPARAM("name")))
         {
             hasName = true;
-            name = xmldata::convertFromUtf8(reader.getAttributeValue(false));
-        } else if (attrNs == XmlReader::NAMESPACE_OOR &&
+            name = reader.getAttributeValue(false).convertFromUtf8();
+        } else if (attrNsId == ParseManager::NAMESPACE_OOR &&
                    attrLn.equals(RTL_CONSTASCII_STRINGPARAM("component")))
         {
-            component = xmldata::convertFromUtf8(
-                reader.getAttributeValue(false));
-        } else if (attrNs == XmlReader::NAMESPACE_OOR &&
+            component = reader.getAttributeValue(false).convertFromUtf8();
+        } else if (attrNsId == ParseManager::NAMESPACE_OOR &&
                    attrLn.equals(RTL_CONSTASCII_STRINGPARAM("node-type")))
         {
             hasNodeType = true;
-            nodeType = xmldata::convertFromUtf8(
-                reader.getAttributeValue(false));
-        } else if (attrNs == XmlReader::NAMESPACE_OOR &&
+            nodeType = reader.getAttributeValue(false).convertFromUtf8();
+        } else if (attrNsId == ParseManager::NAMESPACE_OOR &&
                    attrLn.equals(RTL_CONSTASCII_STRINGPARAM("op")))
         {
             op = parseOperation(reader.getAttributeValue(true));
-        } else if (attrNs == XmlReader::NAMESPACE_OOR &&
+        } else if (attrNsId == ParseManager::NAMESPACE_OOR &&
                    attrLn.equals(RTL_CONSTASCII_STRINGPARAM("finalized")))
         {
             finalized = xmldata::parseBoolean(reader.getAttributeValue(true));
-        } else if (attrNs == XmlReader::NAMESPACE_OOR &&
+        } else if (attrNsId == ParseManager::NAMESPACE_OOR &&
                    attrLn.equals(RTL_CONSTASCII_STRINGPARAM("mandatory")))
         {
             mandatory = xmldata::parseBoolean(reader.getAttributeValue(true));

configmgr/source/xcuparser.hxx

 
 #include "rtl/ref.hxx"
 #include "rtl/ustring.hxx"
+#include "xmlreader/xmlreader.hxx"
 
 #include "node.hxx"
 #include "nodemap.hxx"
 #include "type.hxx"
 #include "valueparser.hxx"
 #include "xmldata.hxx"
-#include "xmlreader.hxx"
+
+namespace xmlreader { struct Span; }
 
 namespace configmgr {
 
 class PropertyNode;
 class SetNode;
 struct Data;
-struct Span;
 
 class XcuParser: public Parser {
 public:
 private:
     virtual ~XcuParser();
 
-    virtual XmlReader::Text getTextMode();
+    virtual xmlreader::XmlReader::Text getTextMode();
 
     virtual bool startElement(
-        XmlReader & reader, XmlReader::Namespace ns, Span const & name);
+        xmlreader::XmlReader & reader, int nsId, xmlreader::Span const & name);
 
-    virtual void endElement(XmlReader const & reader);
+    virtual void endElement(xmlreader::XmlReader const & reader);