summaryrefslogtreecommitdiff
path: root/desktop/WinResTarget_sdraw.mk
blob: 7ad5a7c0a79ab5f824b9900527ec295391c3ff4d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
#
# This file is part of the LibreOffice project.
#
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
#

$(eval $(call gb_WinResTarget_WinResTarget,sdraw/launcher))

$(eval $(call gb_WinResTarget_set_include,sdraw/launcher,\
    $$(INCLUDE) \
    -I$(SRCDIR)/sysui/desktop \
))

$(eval $(call gb_WinResTarget_add_defs,sdraw/launcher,\
    -DRES_APP_NAME=sdraw \
    -DRES_APP_FILEDESC="$(PRODUCTNAME) Draw" \
    -DRES_APP_ICON=icons/draw_app.ico \
    -DVERVARIANT=$(LIBO_VERSION_PATCH) \
    -DRES_APP_VENDOR="$(OOO_VENDOR)" \
))

$(eval $(call gb_WinResTarget_add_dependencies,sdraw/launcher,\
    sysui/desktop/icons/draw_app.ico \
))

$(eval $(call gb_WinResTarget_set_rcfile,sdraw/launcher,desktop/win32/source/applauncher/launcher))

# vim: set ts=4 sw=4 et:

ac9297cc65bd553b93a95f172a (diff)
CWS-TOOLING: integrate CWS xmlfix3
Diffstat (limited to 'unoxml')
-rw-r--r--unoxml/JunitTest_unordf_complex.mk52
-rw-r--r--unoxml/JunitTest_unoxml_complex.mk52
-rw-r--r--unoxml/Library_unordf.mk74
-rw-r--r--unoxml/Library_unoxml.mk96
-rw-r--r--unoxml/Makefile (renamed from unoxml/qa/complex/unoxml/makefile.mk)41
-rw-r--r--unoxml/Module_unoxml.mk (renamed from unoxml/source/events/makefile.mk)44
-rw-r--r--unoxml/prj/build.lst10
-rw-r--r--unoxml/prj/d.lst5
-rw-r--r--unoxml/prj/makefile.mk (renamed from unoxml/source/xpath/makefile.mk)32
-rw-r--r--unoxml/qa/complex/unoxml/DOMTest.java2986
-rw-r--r--unoxml/qa/complex/unoxml/TestDocument.java3
-rw-r--r--unoxml/source/dom/attr.cxx172
-rw-r--r--unoxml/source/dom/attr.hxx50
-rw-r--r--unoxml/source/dom/attributesmap.cxx163
-rw-r--r--unoxml/source/dom/attributesmap.hxx53
-rw-r--r--unoxml/source/dom/cdatasection.cxx14
-rw-r--r--unoxml/source/dom/cdatasection.hxx25
-rw-r--r--unoxml/source/dom/characterdata.cxx77
-rw-r--r--unoxml/source/dom/characterdata.hxx31
-rw-r--r--unoxml/source/dom/childlist.cxx41
-rw-r--r--unoxml/source/dom/childlist.hxx30
-rw-r--r--unoxml/source/dom/comment.cxx11
-rw-r--r--unoxml/source/dom/comment.hxx25
-rw-r--r--unoxml/source/dom/document.cxx739
-rw-r--r--unoxml/source/dom/document.hxx85
-rw-r--r--unoxml/source/dom/documentbuilder.cxx151
-rw-r--r--unoxml/source/dom/documentbuilder.hxx42
-rw-r--r--unoxml/source/dom/documentfragment.cxx26
-rw-r--r--unoxml/source/dom/documentfragment.hxx24
-rw-r--r--unoxml/source/dom/documenttype.cxx37
-rw-r--r--unoxml/source/dom/documenttype.hxx24
-rw-r--r--unoxml/source/dom/domimplementation.cxx47
-rw-r--r--unoxml/source/dom/domimplementation.hxx20
-rw-r--r--unoxml/source/dom/element.cxx651
-rw-r--r--unoxml/source/dom/element.hxx35
-rw-r--r--unoxml/source/dom/elementlist.cxx98
-rw-r--r--unoxml/source/dom/elementlist.hxx55
-rw-r--r--unoxml/source/dom/entitiesmap.cxx54
-rw-r--r--unoxml/source/dom/entitiesmap.hxx52
-rw-r--r--unoxml/source/dom/entity.cxx36
-rw-r--r--unoxml/source/dom/entity.hxx28
-rw-r--r--unoxml/source/dom/entityreference.cxx30
-rw-r--r--unoxml/source/dom/entityreference.hxx29
-rw-r--r--unoxml/source/dom/makefile.mk74
-rw-r--r--unoxml/source/dom/node.cxx796
-rw-r--r--unoxml/source/dom/node.hxx81
-rw-r--r--unoxml/source/dom/notation.cxx21
-rw-r--r--unoxml/source/dom/notation.hxx24
-rw-r--r--unoxml/source/dom/notationsmap.cxx57
-rw-r--r--unoxml/source/dom/notationsmap.hxx50
-rw-r--r--unoxml/source/dom/processinginstruction.cxx99
-rw-r--r--unoxml/source/dom/processinginstruction.hxx36
-rw-r--r--unoxml/source/dom/saxbuilder.cxx35
-rw-r--r--unoxml/source/dom/saxbuilder.hxx8
-rw-r--r--unoxml/source/dom/text.cxx49
-rw-r--r--unoxml/source/dom/text.hxx36
-rw-r--r--unoxml/source/events/event.cxx61
-rw-r--r--unoxml/source/events/event.hxx55
-rw-r--r--unoxml/source/events/eventdispatcher.cxx143
-rw-r--r--unoxml/source/events/eventdispatcher.hxx80
-rw-r--r--unoxml/source/events/mouseevent.cxx54
-rw-r--r--unoxml/source/events/mouseevent.hxx53
-rw-r--r--unoxml/source/events/mutationevent.cxx44
-rw-r--r--unoxml/source/events/mutationevent.hxx50
-rw-r--r--unoxml/source/events/testlistener.cxx4
-rw-r--r--unoxml/source/events/testlistener.hxx35
-rw-r--r--unoxml/source/events/uievent.cxx44
-rw-r--r--unoxml/source/events/uievent.hxx51
-rw-r--r--unoxml/source/rdf/librdf_services.cxx5
-rw-r--r--unoxml/source/rdf/makefile.mk92
-rw-r--r--unoxml/source/service/makefile.mk86
-rw-r--r--unoxml/source/service/services.cxx4
-rw-r--r--unoxml/source/xpath/nodelist.cxx31
-rw-r--r--unoxml/source/xpath/nodelist.hxx29
-rw-r--r--unoxml/source/xpath/xpathapi.cxx133
-rw-r--r--unoxml/source/xpath/xpathapi.hxx30
-rw-r--r--unoxml/source/xpath/xpathobject.cxx112
-rw-r--r--unoxml/source/xpath/xpathobject.hxx39
78 files changed, 6828 insertions, 2123 deletions
diff --git a/unoxml/JunitTest_unordf_complex.mk b/unoxml/JunitTest_unordf_complex.mk
new file mode 100644
index 000000000000..7637eef13a82
--- /dev/null
+++ b/unoxml/JunitTest_unordf_complex.mk
@@ -0,0 +1,52 @@
+#*************************************************************************
+#
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# Copyright 2009 by Sun Microsystems, Inc.
+#
+# 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.
+#
+#*************************************************************************
+
+$(eval $(call gb_JunitTest_JunitTest,unordf_complex))
+
+$(eval $(call gb_JunitTest_set_defs,unordf_complex,\
+ $$(DEFS) \
+ -Dorg.openoffice.test.arg.tdoc=$(SRCDIR)/unoxml/qa/complex/unoxml/testdocuments \
+))
+
+$(eval $(call gb_JunitTest_add_jars,unordf_complex,\
+ $(OUTDIR)/bin/OOoRunner.jar \
+ $(OUTDIR)/bin/ridl.jar \
+ $(OUTDIR)/bin/test.jar \
+ $(OUTDIR)/bin/unoil.jar \
+ $(OUTDIR)/bin/jurt.jar \
+))
+
+$(eval $(call gb_JunitTest_add_sourcefiles,unordf_complex,\
+ unoxml/qa/complex/unoxml/RDFRepositoryTest \
+ unoxml/qa/complex/unoxml/TestDocument \
+))
+
+$(eval $(call gb_JunitTest_add_classes,unordf_complex,\
+ complex.unoxml.RDFRepositoryTest \
+))
+
+# vim: set noet sw=4 ts=4:
diff --git a/unoxml/JunitTest_unoxml_complex.mk b/unoxml/JunitTest_unoxml_complex.mk
new file mode 100644
index 000000000000..09eaa32e7bbe
--- /dev/null
+++ b/unoxml/JunitTest_unoxml_complex.mk
@@ -0,0 +1,52 @@
+#*************************************************************************
+#
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# Copyright 2009 by Sun Microsystems, Inc.
+#
+# 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.
+#
+#*************************************************************************
+
+$(eval $(call gb_JunitTest_JunitTest,unoxml_complex))
+
+$(eval $(call gb_JunitTest_set_defs,unoxml_complex,\
+ $$(DEFS) \
+ -Dorg.openoffice.test.arg.tdoc=$(SRCDIR)/unoxml/qa/complex/unoxml/testdocuments \
+))
+
+$(eval $(call gb_JunitTest_add_jars,unoxml_complex,\
+ $(OUTDIR)/bin/OOoRunner.jar \
+ $(OUTDIR)/bin/ridl.jar \
+ $(OUTDIR)/bin/test.jar \
+ $(OUTDIR)/bin/unoil.jar \
+ $(OUTDIR)/bin/jurt.jar \
+))
+
+$(eval $(call gb_JunitTest_add_sourcefiles,unoxml_complex,\
+ unoxml/qa/complex/unoxml/DOMTest \
+ unoxml/qa/complex/unoxml/TestDocument \
+))
+
+$(eval $(call gb_JunitTest_add_classes,unoxml_complex,\
+ complex.unoxml.DOMTest \
+))
+
+# vim: set noet sw=4 ts=4:
diff --git a/unoxml/Library_unordf.mk b/unoxml/Library_unordf.mk
new file mode 100644
index 000000000000..79123c6a359c
--- /dev/null
+++ b/unoxml/Library_unordf.mk
@@ -0,0 +1,74 @@
+#*************************************************************************
+#
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# Copyright 2009 by Sun Microsystems, Inc.
+#
+# 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.
+#
+#*************************************************************************
+
+$(eval $(call gb_Library_Library,unordf))
+
+$(eval $(call gb_Library_set_componentfile,unordf,unoxml/source/rdf/unordf))
+
+$(eval $(call gb_Library_set_include,unordf,\
+ $$(INCLUDE) \
+ -I$(OUTDIR)/inc/offuh \
+))
+
+$(eval $(call gb_Library_set_defs,unordf,\
+ $$(DEFS) \
+))
+
+$(eval $(call gb_Library_add_linked_libs,unordf,\
+ cppuhelper \
+ cppu \
+ sal \
+ stl \
+ rdf \
+ xslt \
+ $(gb_STDLIBS) \
+))
+
+$(eval $(call gb_Library_add_exception_objects,unordf,\
+ unoxml/source/rdf/CBlankNode \
+ unoxml/source/rdf/CURI \
+ unoxml/source/rdf/CLiteral \
+ unoxml/source/rdf/librdf_repository \
+ unoxml/source/rdf/librdf_services \
+))
+
+ifeq ($(SYSTEM_REDLAND),YES)
+$(eval $(call gb_Library_set_cxxflags,unordf,\
+ $$(CXXFLAGS) \
+ -DSYSTEM_REDLAND $$(REDLAND_CFLAGS) \
+))
+endif
+
+ifeq ($(SYSTEM_LIBXSLT),YES)
+$(eval $(call gb_Library_set_cxxflags,unordf,\
+ $$(CXXFLAGS) \
+ $$(LIBXSLT_CFLAGS) \
+))
+endif
+
+# vim: set noet sw=4 ts=4:
+
diff --git a/unoxml/Library_unoxml.mk b/unoxml/Library_unoxml.mk
new file mode 100644
index 000000000000..517c8a8462c0
--- /dev/null
+++ b/unoxml/Library_unoxml.mk
@@ -0,0 +1,96 @@
+#*************************************************************************
+#
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# Copyright 2009 by Sun Microsystems, Inc.
+#
+# 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.
+#
+#*************************************************************************
+
+$(eval $(call gb_Library_Library,unoxml))
+
+$(eval $(call gb_Library_set_componentfile,unoxml,unoxml/source/service/unoxml))
+
+$(eval $(call gb_Library_set_include,unoxml,\
+ $$(INCLUDE) \
+ -I$(OUTDIR)/inc/offuh \
+))
+
+$(eval $(call gb_Library_set_defs,unoxml,\
+ $$(DEFS) \
+))
+
+$(eval $(call gb_Library_add_linked_libs,unoxml,\
+ ucbhelper \
+ sax \
+ comphelper \
+ cppuhelper \
+ cppu \
+ sal \
+ stl \
+ xml2 \
+ $(gb_STDLIBS) \
+))
+
+$(eval $(call gb_Library_add_exception_objects,unoxml,\
+ unoxml/source/dom/node \
+ unoxml/source/dom/document \
+ unoxml/source/dom/element \
+ unoxml/source/dom/attr \
+ unoxml/source/dom/cdatasection \
+ unoxml/source/dom/characterdata \
+ unoxml/source/dom/comment \
+ unoxml/source/dom/documentbuilder \
+ unoxml/source/dom/documentfragment \
+ unoxml/source/dom/documenttype \
+ unoxml/source/dom/entity \
+ unoxml/source/dom/entityreference \
+ unoxml/source/dom/notation \
+ unoxml/source/dom/processinginstruction \
+ unoxml/source/dom/text \
+ unoxml/source/dom/domimplementation \
+ unoxml/source/dom/elementlist \
+ unoxml/source/dom/childlist \
+ unoxml/source/dom/notationsmap \
+ unoxml/source/dom/entitiesmap \
+ unoxml/source/dom/attributesmap \
+ unoxml/source/dom/saxbuilder \
+ unoxml/source/xpath/xpathobject \
+ unoxml/source/xpath/nodelist \
+ unoxml/source/xpath/xpathapi \
+ unoxml/source/events/event \
+ unoxml/source/events/eventdispatcher \
+ unoxml/source/events/mutationevent \
+ unoxml/source/events/uievent \
+ unoxml/source/events/mouseevent \
+ unoxml/source/events/testlistener \
+ unoxml/source/service/services \
+))
+
+ifeq ($(SYSTEM_LIBXML),YES)
+$(eval $(call gb_Library_set_cxxflags,unoxml,\
+ $$(CXXFLAGS) \
+ -DSYSTEM_LIBXML $$(LIBXML_CFLAGS) \
+))
+endif
+
+# vim: set noet sw=4 ts=4:
+
diff --git a/unoxml/qa/complex/unoxml/makefile.mk b/unoxml/Makefile
index 136d23a9a232..c898975e5277 100644
--- a/unoxml/qa/complex/unoxml/makefile.mk
+++ b/unoxml/Makefile
@@ -1,7 +1,7 @@
#*************************************************************************
#
# 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
@@ -23,37 +23,16 @@
# <http://www.openoffice.org/license.html>
# for a copy of the LGPLv3 License.
#
-#***********************************************************************/
-
-.IF "$(OOO_SUBSEQUENT_TESTS)" == ""
-nothing .PHONY:
-.ELSE
-
-PRJ = ../../..
-PRJNAME = unoxml
-TARGET = qa_complex_unoxml
-
-.IF "$(OOO_JUNIT_JAR)" != ""
-PACKAGE = complex/unoxml
-JAVATESTFILES = \
- RDFRepositoryTest.java
-
-JAVAFILES = $(JAVATESTFILES) \
- TestDocument.java
-
-JARFILES = OOoRunner.jar ridl.jar test.jar unoil.jar jurt.jar
-EXTRAJARFILES = $(OOO_JUNIT_JAR)
-
-# Sample how to debug
-# JAVAIFLAGS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,address=9003,suspend=y
-.END
-
-.INCLUDE: settings.mk
-.INCLUDE: target.mk
-.INCLUDE: installationtest.mk
+#*************************************************************************
-ALLTAR : javatest
+ifeq ($(strip $(SOLARENV)),)
+$(error No environment set!)
+endif
-.END
+gb_PARTIALBUILD := T
+GBUILDDIR := $(SOLARENV)/gbuild
+include $(GBUILDDIR)/gbuild.mk
+$(eval $(call gb_Module_make_global_targets,$(shell ls $(dir $(realpath $(firstword $(MAKEFILE_LIST))))/Module*.mk)))
+# vim: set noet sw=4 ts=4:
diff --git a/unoxml/source/events/makefile.mk b/unoxml/Module_unoxml.mk
index 2ec7489e1a8d..5050d0701f3f 100644
--- a/unoxml/source/events/makefile.mk
+++ b/unoxml/Module_unoxml.mk
@@ -1,8 +1,8 @@
#*************************************************************************
#
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-#
-# Copyright 2000, 2010 Oracle and/or its affiliates.
+#
+# Copyright 2009 by Sun Microsystems, Inc.
#
# OpenOffice.org - a multi-platform office productivity suite
#
@@ -14,43 +14,27 @@
#
# 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
+# 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
+# version 3 along with OpenOffice.org. If not, see
# <http://www.openoffice.org/license.html>
# for a copy of the LGPLv3 License.
#
#*************************************************************************
-PRJ=../..
-
-PRJNAME=unoxml
-TARGET=eventsimpl
-ENABLE_EXCEPTIONS=TRUE
-
-# --- Settings -----------------------------------------------------
-
-.INCLUDE : settings.mk
-
-.IF "$(SYSTEM_LIBXML)" == "YES"
-CFLAGS+=-DSYSTEM_LIBXML $(LIBXML_CFLAGS)
-.ENDIF
-
-# --- Files --------------------------------------------------------
-
-SLOFILES =\
- $(SLO)$/event.obj \
- $(SLO)$/eventdispatcher.obj \
- $(SLO)$/mutationevent.obj \
- $(SLO)$/uievent.obj \
- $(SLO)$/mouseevent.obj \
- $(SLO)$/testlistener.obj
-
-# --- Targets ------------------------------------------------------
+$(eval $(call gb_Module_Module,unoxml))
-.INCLUDE : target.mk
+$(eval $(call gb_Module_add_targets,unoxml,\
+ Library_unoxml \
+ Library_unordf \
+))
+$(eval $(call gb_Module_add_subsequentcheck_targets,unoxml,\
+ JunitTest_unoxml_complex \
+ JunitTest_unordf_complex \
+))
+# vim: set noet sw=4 ts=4:
diff --git a/unoxml/prj/build.lst b/unoxml/prj/build.lst
index 4da29cb9d669..02f0482d76f8 100644
--- a/unoxml/prj/build.lst
+++ b/unoxml/prj/build.lst
@@ -1,8 +1,2 @@
-ux unoxml : offuh cppuhelper LIBXML2:libxml2 LIBXSLT:libxslt REDLAND:redland tools NULL
-ux unoxml\source\dom nmake - all ux_dom NULL
-ux unoxml\source\xpath nmake - all ux_xpath ux_dom NULL
-ux unoxml\source\events nmake - all ux_events ux_dom NULL
-ux unoxml\source\service nmake - all ux_service ux_dom ux_xpath ux_events NULL
-ux unoxml\source\rdf nmake - all ux_librdf NULL
-
-ux unoxml\qa\complex\unoxml nmake - all ux_complex ux_librdf NULL
+ux unoxml : offuh cppuhelper LIBXML2:libxml2 LIBXSLT:libxslt REDLAND:redland sax comphelper ucbhelper NULL
+ux unoxml\prj nmake - all ux_prj NULL
diff --git a/unoxml/prj/d.lst b/unoxml/prj/d.lst
index 4fcedbdba7a2..e69de29bb2d1 100644
--- a/unoxml/prj/d.lst
+++ b/unoxml/prj/d.lst
@@ -1,5 +0,0 @@
-..\%__SRC%\lib\lib*.so %_DEST%\lib%_EXT%\lib*.so
-..\%__SRC%\lib\lib*.dylib %_DEST%\lib%_EXT%\lib*.dylib
-..\%__SRC%\bin\*.dll %_DEST%\bin%_EXT%\*.dll
-..\%__SRC%\misc\unordf.component %_DEST%\xml%_EXT%\unordf.component
-..\%__SRC%\misc\unoxml.component %_DEST%\xml%_EXT%\unoxml.component
diff --git a/unoxml/source/xpath/makefile.mk b/unoxml/prj/makefile.mk
index 7b1ccdae742b..5ebed8a45c4a 100644
--- a/unoxml/source/xpath/makefile.mk
+++ b/unoxml/prj/makefile.mk
@@ -1,7 +1,7 @@
#*************************************************************************
#
# 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
@@ -25,28 +25,16 @@
#
#*************************************************************************
-PRJ=../..
-
-PRJNAME=unoxml
-TARGET=xpathimpl
-ENABLE_EXCEPTIONS=TRUE
+PRJ=..
+TARGET=prj
-# --- Settings -----------------------------------------------------
+.INCLUDE : settings.mk
-.INCLUDE : settings.mk
-
-.IF "$(SYSTEM_LIBXML)" == "YES"
-CFLAGS+=-DSYSTEM_LIBXML $(LIBXML_CFLAGS)
+.IF "$(VERBOSE)"!=""
+VERBOSEFLAG :=
+.ELSE
+VERBOSEFLAG := -s
.ENDIF
-# --- Files --------------------------------------------------------
-
-SLOFILES = \
- $(SLO)$/xpathobject.obj \
- $(SLO)$/nodelist.obj \
- $(SLO)$/xpathapi.obj
-
-# --- Targets ------------------------------------------------------
-
-.INCLUDE : target.mk
-
+all:
+ cd $(PRJ) && $(GNUMAKE) $(VERBOSEFLAG) -r -j$(MAXPROCESS) $(gb_MAKETARGET)
diff --git a/unoxml/qa/complex/unoxml/DOMTest.java b/unoxml/qa/complex/unoxml/DOMTest.java
new file mode 100644
index 000000000000..e7efad8ab5a7
--- /dev/null
+++ b/unoxml/qa/complex/unoxml/DOMTest.java
@@ -0,0 +1,2986 @@
+/*************************************************************************
+ *
+ * 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.
+ *
+ ************************************************************************/
+
+package complex.unoxml;
+
+import lib.TestParameters;
+import helper.StreamSimulator;
+
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XComponentContext;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.beans.XPropertySet;
+import com.sun.star.io.XInputStream;
+import com.sun.star.xml.dom.*;
+import static com.sun.star.xml.dom.DOMExceptionType.*;
+import static com.sun.star.xml.dom.NodeType.*;
+import com.sun.star.xml.dom.events.*;
+import com.sun.star.xml.xpath.*;
+import static com.sun.star.xml.xpath.XPathObjectType.*;
+
+import org.junit.After;
+import org.junit.AfterClass;
+import org.junit.Before;
+import org.junit.BeforeClass;
+import org.junit.Test;
+import org.openoffice.test.OfficeConnection;
+import static org.junit.Assert.*;
+
+/**
+ * Test for com.sun.star.xml.dom.*, com.sun.star.xml.xpath.*
+ */
+public class DOMTest
+{
+ private static final OfficeConnection connection = new OfficeConnection();
+
+ // setup and close connections
+ @BeforeClass public static void setUpConnection() throws Exception {
+ System.out.println("setUpConnection()");
+ connection.setUp();
+ }
+
+ @AfterClass public static void tearDownConnection()
+ throws InterruptedException, com.sun.star.uno.Exception
+ {
+ System.out.println("tearDownConnection()");
+ connection.tearDown();
+ }
+
+ XComponentContext m_xContext;
+ XMultiServiceFactory m_xMSF;
+ TestParameters m_params;
+
+ @Before public void before() throws Exception
+ {
+ final XMultiServiceFactory xMSF = UnoRuntime.queryInterface(
+ XMultiServiceFactory.class,
+ connection.getComponentContext().getServiceManager());
+ assertNotNull("could not create MultiServiceFactory.", xMSF);
+ m_params = new TestParameters();
+ m_params.put("ServiceFactory", xMSF);
+ XPropertySet xPropertySet =
+ UnoRuntime.queryInterface(XPropertySet.class, xMSF);
+ m_xContext = UnoRuntime.queryInterface(XComponentContext.class,
+ xPropertySet.getPropertyValue("DefaultContext"));
+ assertNotNull("could not get component context.", m_xContext);
+ m_xMSF = xMSF;
+ }
+
+ @Test public void testXSAXDocumentBuilder() throws Exception
+ {
+ XSAXDocumentBuilder xSAXBuilder =
+ UnoRuntime.queryInterface(XSAXDocumentBuilder.class,
+ m_xMSF.createInstance("com.sun.star.xml.dom.SAXDocumentBuilder"));
+ //FIXME TODO
+ }
+
+ @Test public void testXDocumentBuilder() throws Exception
+ {
+ XDocumentBuilder xBuilder =
+ UnoRuntime.queryInterface(XDocumentBuilder.class,
+ m_xMSF.createInstance("com.sun.star.xml.dom.DocumentBuilder"));
+
+ XDOMImplementation xDomImpl = xBuilder.getDOMImplementation();
+//FIXME fails assertNotNull("getDOMImplementation", xDomImpl);
+
+ xBuilder.isNamespaceAware();
+ xBuilder.isValidating();
+
+ {
+ XDocument xDoc = xBuilder.newDocument();
+ assertNotNull("newDocument", xDoc);
+ }
+
+ try {
+ xBuilder.parse(null);
+ fail("XDocumentBuilder.parse(null)");
+ } catch (Exception e) { /* expected */ }
+ {
+ XInputStream xIn = new StreamSimulator(
+ TestDocument.getUrl("example.rdf"), true, m_params);
+ XDocument xDoc = xBuilder.parse(xIn);
+ assertNotNull("XDocumentBuilder.parse", xDoc);
+ }
+ try {
+ xBuilder.parseURI("");
+ fail("XDocumentBuilder.parseURI(\"\")");
+ } catch (Exception e) { /* expected */ }
+ {
+ XDocument xDoc =
+ xBuilder.parseURI(TestDocument.getUrl("example.rdf"));
+ assertNotNull("XDocumentBuilder.parseURI", xDoc);
+ }
+
+ xBuilder.setEntityResolver(null);
+ /* FIXME TODO
+ XEntityResolver xER;
+ xBuilder.setEntityResolver(xER);
+ */
+
+ xBuilder.setErrorHandler(null);
+ /* FIXME TODO
+ XErrorHandler xEH;
+ xBuilder.setErrorHandler(xEH);
+ */
+ }
+
+ @Test public void testXDocument() throws Exception
+ {
+ XDocumentBuilder xBuilder =
+ UnoRuntime.queryInterface(XDocumentBuilder.class,
+ m_xMSF.createInstance("com.sun.star.xml.dom.DocumentBuilder"));
+ XDocument xDoc = xBuilder.newDocument();
+
+ /* FIXME
+ try {
+ xDoc.createAttribute("&");
+ fail("XDocument.createAttribute");
+ } catch (DOMException e) {
+ assertTrue("XDocument.createAttribute",
+ INVALID_CHARACTER_ERR == e.Code);
+ }*/
+ {
+ XAttr xAttr = xDoc.createAttribute("foo");
+ assertNotNull("XDocument.createAttribute", xAttr);
+ assertEquals("XDocument.createAttribute",
+ "foo", xAttr.getNodeName());
+ }
+
+ String ns = "http://example.com/";
+ /* FIXME
+ try {
+ xDoc.createAttributeNS(ns, "&");
+ fail("XDocument.createAttributeNS");
+ } catch (DOMException e) {
+ assertTrue("XDocument.createAttributeNS",
+ INVALID_CHARACTER_ERR == e.Code);
+ }
+ */
+ {
+ XAttr xAttr = xDoc.createAttributeNS(ns, "e:foo");
+ assertNotNull("XDocument.createAttributeNS", xAttr);
+ assertEquals("XDocument.createAttributeNS", "foo",
+ xAttr.getNodeName());
+ }
+
+ XCDATASection xCDS = xDoc.createCDATASection("foo");
+ assertNotNull("XDocument.createCDATASection", xCDS);
+
+ XComment xComment = xDoc.createComment("foo");
+ assertNotNull("XDocument.createComment", xComment);
+
+ XDocumentFragment xDF = xDoc.createDocumentFragment();
+ assertNotNull("XDocument.createDocumentFragment", xDF);
+
+ /* FIXME
+ try {
+ xDoc.createElement("&");
+ fail("XDocument.createElement(\"&\")");
+ } catch (DOMException e) {
+ assertTrue("XDocument.createElement(\"&\")",
+ INVALID_CHARACTER_ERR == e.Code);
+ }
+ */
+ XElement xElemFoo = xDoc.createElement("foo");
+ assertNotNull("XDocument.createElement(\"foo\")", xElemFoo);
+ assertEquals("XDocument.createElement(\"foo\")",
+ "foo", xElemFoo.getNodeName());
+
+ /* FIXME
+ try {
+ xDoc.createElementNS(ns, "&");
+ fail("XDocument.createElementNS(\"&\")");
+ } catch (DOMException e) {
+ assertTrue("XDocument.createElementNS(\"&\")",
+ INVALID_CHARACTER_ERR == e.Code);
+ }
+ */
+ XElement xElemFooNs = xDoc.createElementNS(ns, "foo");
+ assertNotNull("XDocument.createElementNS(\"foo\")", xElemFooNs);
+ assertEquals("XDocument.createElementNS(\"foo\")",
+ "foo", xElemFooNs.getNodeName());
+
+ XEntityReference xER = xDoc.createEntityReference("foo");
+ assertNotNull("XDocument.createEntityReference", xER);
+
+ XProcessingInstruction xPI =
+ xDoc.createProcessingInstruction("foo", "bar");
+ assertNotNull("XDocument.createProcessingInstruction", xPI);
+
+ XText xText = xDoc.createTextNode("foo");
+ assertNotNull("XDocument.createTextNode", xText);
+
+ XDocumentType xDT = xDoc.getDoctype();
+ assertNull("XDocument.getDoctype", xDT);
+
+ {
+ XElement xDE = xDoc.getDocumentElement();
+ assertNull("XDocument.getDocumentElement", xDE);
+ }
+ {
+ XElement xById = xDoc.getElementById("foo");
+ assertNull("XDocument.getDocumentElement", xById);
+ }
+
+ {
+ XNodeList xNodeList = xDoc.getElementsByTagName("foo");
+ assertNotNull("XDocument.getElementsByTagName", xNodeList);
+ assertTrue("XDocument.getElementsByTagName",
+ 0 == xNodeList.getLength());
+ }
+
+ {
+ XNodeList xNodeList = xDoc.getElementsByTagNameNS(ns, "foo");
+ assertNotNull("XDocument.getElementsByTagNameNS", xNodeList);
+ assertTrue("XDocument.getElementsByTagNameNS",
+ 0 == xNodeList.getLength());
+ }
+
+ XDOMImplementation xDOMImpl = xDoc.getImplementation();
+ assertNotNull("XDocument.getImplementation", xDOMImpl);
+
+ {
+ XNode xRet = xElemFooNs.appendChild(xElemFoo);
+ assertEquals("XElement.appendChild(xElemFoo)", xElemFoo, xRet);
+ }
+ {
+ XNode xRet = xDoc.appendChild(xElemFooNs);
+ assertTrue("XDocument.appendChild(xElemFooNs)",
+ xElemFooNs.equals(xRet));
+ }
+
+ XElement xDE = xDoc.getDocumentElement();
+ assertNotNull("XDocument.getDocumentElement", xDE);
+ assertEquals("XDocument.getDocumentElement", xElemFooNs, xDE);
+
+ {
+ XNodeList xNodeList = xDoc.getElementsByTagName("foo");
+ assertNotNull("XDocument.getElementsByTagName", xNodeList);
+ assertTrue("XDocument.getElementsByTagName",
+ 2 == xNodeList.getLength());
+ assertEquals("XDocument.getElementsByTagNameNS",
+ xElemFooNs, xNodeList.item(0));
+ assertEquals("XDocument.getElementsByTagName",
+ xElemFoo, xNodeList.item(1));
+ }
+
+ {
+ XNodeList xNodeList = xDoc.getElementsByTagNameNS(ns, "foo");
+ assertNotNull("XDocument.getElementsByTagNameNS", xNodeList);
+ assertTrue("XDocument.getElementsByTagNameNS",
+ 1 == xNodeList.getLength());
+ assertEquals("XDocument.getElementsByTagNameNS",
+ xElemFooNs, xNodeList.item(0));
+ }
+
+ xElemFoo.setAttributeNS("http://www.w3.org/XML/1998/namespace",
+ "xml:id", "bar");
+
+ XElement xById = xDoc.getElementById("bar");
+ assertNotNull("XDocument.getDocumentElement", xById);
+ assertEquals("XDocument.getDocumentElement", xElemFoo, xById);
+
+ try {
+ xDoc.importNode(null, false);
+ fail("XDocument.importNode(null)");
+ } catch (Exception e) { /* expected */ }
+ {
+ XNode xImported = xDoc.importNode(xElemFoo, false);
+ assertNotNull("XDocument.importNode()", xImported);
+ assertEquals("XDocument.importNode()", xElemFoo, xImported);
+ }
+ {
+ MockAttr xMockAttrBar = new MockAttr("bar", "blah");
+ MockAttr xMockAttrBaz = new MockAttr("baz", "quux");
+ MockElement xMockElemFoo = new MockElement("foo",
+ new MockAttr[] { xMockAttrBar, xMockAttrBaz });
+ MockElement xMockElemBar = new MockElement("bar",
+ new MockAttr[] { });
+ MockElement xMockElemRoot =
+ new MockElement("root", new MockAttr[] { });
+ MockDoc xMockDoc = new MockDoc();
+ xMockDoc.init(new MockNode[] { xMockElemRoot });
+ xMockElemRoot.init(xMockDoc, xMockDoc, null, null,
+ new MockNode[] { xMockElemFoo, xMockElemBar });
+ xMockElemFoo.init(xMockDoc, xMockElemRoot, null, xMockElemBar,
+ new MockNode[] { });
+ xMockElemBar.init(xMockDoc, xMockElemRoot, xMockElemFoo, null,
+ new MockNode[] { });
+
+ {
+ XNode xImported = xDoc.importNode(xMockElemRoot, false);
+ assertNotNull("XDocument.importNode(false)", xImported);
+ XElement xE =
+ UnoRuntime.queryInterface(XElement.class, xImported);
+ assertNotNull("XDocument.importNode(false)", xE);
+ assertEquals("XDocument.importNode(false)",
+ "root", xE.getLocalName());
+ assertFalse("XDocument.importNode(false)", xE.hasAttributes());
+ assertFalse("XDocument.importNode(false)", xE.hasChildNodes());
+ }
+
+ {
+ XNode xImported = xDoc.importNode(xMockElemRoot, true);
+ assertNotNull("XDocument.importNode(true)", xImported);
+ XElement xImpRoot =
+ UnoRuntime.queryInterface(XElement.class, xImported);
+ assertNotNull("XDocument.importNode(true)", xImpRoot);
+ assertEquals("XDocument.importNode(true)",
+ "root", xImpRoot.getLocalName());
+ assertFalse("XDocument.importNode(true)",
+ xImpRoot.hasAttributes());
+ assertTrue("XDocument.importNode(true)",
+ xImpRoot.hasChildNodes());
+ assertEquals("XDocument.importNode(true)",
+ "root", xImpRoot.getNodeName());
+
+ XNode xImpFooN = xImpRoot.getFirstChild();
+ assertNotNull("XDocument.importNode(true)", xImpFooN);
+ XElement xImpFoo =
+ UnoRuntime.queryInterface(XElement.class, xImpFooN);
+ assertNotNull("XDocument.importNode(true)", xImpFoo);
+ assertTrue("XDocument.importNode(true)",
+ xImpFoo.hasAttributes());
+ assertFalse("XDocument.importNode(true)",
+ xImpFoo.hasChildNodes());
+ assertEquals("XDocument.importNode(true)",
+ "foo", xImpFoo.getNodeName());
+ assertEquals("XDocument.importNode(true)",
+ "blah", xImpFoo.getAttribute("bar"));
+ assertEquals("XDocument.importNode(true)",
+ "quux", xImpFoo.getAttribute("baz"));
+ XNode xImpBarN = xImpFooN.getNextSibling();
+ assertNotNull("XDocument.importNode(true)", xImpBarN);
+ XElement xImpBar =
+ UnoRuntime.queryInterface(XElement.class, xImpBarN);
+ assertNotNull("XDocument.importNode(true)", xImpBar);
+ assertFalse("XDocument.importNode(true)",
+ xImpBar.hasAttributes());
+ assertFalse("XDocument.importNode(true)",
+ xImpBar.hasChildNodes());
+ assertEquals("XDocument.importNode(true)",
+ "bar", xImpBar.getNodeName());
+ assertNull("XDocument.importNode(true)",
+ xImpBar.getNextSibling());
+ }
+ }
+
+ // XNode ////////////////////////////////////////////////////
+
+ {
+ XNode xDocCloneN = xDoc.cloneNode(false);
+ assertNotNull("XDocument.cloneNode(false)", xDocCloneN);
+ XDocument xDocClone =
+ UnoRuntime.queryInterface(XDocument.class, xDocCloneN);
+ assertNotNull("XDocument.cloneNode(false)", xDocClone);
+ assertFalse("XDocument.cloneNode(false)",
+ xDocClone.hasChildNodes());
+ assertNull("XDocument.cloneNode(false)", xDocClone.getFirstChild());
+ assertNull("XDocument.cloneNode(false)",
+ xDocClone.getDocumentElement());
+ }
+ {
+ XNode xDocCloneN = xDoc.cloneNode(true);
+ assertNotNull("XDocument.cloneNode(true)", xDocCloneN);
+ XDocument xDocClone =
+ UnoRuntime.queryInterface(XDocument.class, xDocCloneN);
+ assertNotNull("XDocument.cloneNode(true)", xDocClone);
+ assertTrue("XDocument.cloneNode(true)", xDocClone.hasChildNodes());
+ assertNotNull("XDocument.cloneNode(true)",
+ xDocClone.getFirstChild());
+ XElement xE = xDocClone.getDocumentElement();
+ assertNotNull("XDocument.cloneNode(true)", xE);
+ assertFalse("XDocument.cloneNode(true)", xElemFooNs.equals(xE));
+ assertEquals("XDocument.cloneNode(true)", "foo", xE.getLocalName());
+ assertEquals("XDocument.cloneNode(true)", ns, xE.getNamespaceURI());
+ }
+
+ assertNull("XDocument.getAttributes()", xDoc.getAttributes());
+
+ {
+ XNodeList xChildren = xDoc.getChildNodes();
+ assertTrue("XDocument.getChildNodes()", 1 == xChildren.getLength());
+ assertEquals("XDocument.getChildNodes()",
+ xElemFooNs, xChildren.item(0));
+
+ XNode xFirst = xDoc.getFirstChild();
+ assertEquals("XDocument.getFirstChild()", xElemFooNs, xFirst);
+ XNode xLast = xDoc.getLastChild();
+ assertEquals("XDocument.getLastChild()", xElemFooNs, xLast);
+ }
+
+ assertEquals("XDocument.getLocalName()", "", xDoc.getLocalName());
+
+ assertEquals("XDocument.getNamespaceURI()", "", xDoc.getNamespaceURI());
+
+ assertNull("XDocument.getNextSibling()", xDoc.getNextSibling());
+
+ assertEquals("XDocument.getNodeName()",
+ "#document", xDoc.getNodeName());
+
+ assertTrue("XDocument.getNodeType()",
+ DOCUMENT_NODE == xDoc.getNodeType());
+
+ assertEquals("XDocument.getNodeValue()", "", xDoc.getNodeValue());
+
+ assertEquals("XDocument.getOwnerDocument()",
+ xDoc, xDoc.getOwnerDocument());
+
+ assertNull("XDocument.getParentNode()", xDoc.getParentNode());
+
+ assertEquals("XDocument.getPrefix()", "", xDoc.getPrefix());
+
+ assertNull("XDocument.getPreviousSibling()", xDoc.getPreviousSibling());
+
+ assertFalse("XDocument.hasAttributes()", xDoc.hasAttributes());
+
+ assertTrue("XDocument.hasChildNodes()", xDoc.hasChildNodes());
+
+ assertFalse("XDocument.isSupported()",
+ xDoc.isSupported("frobnication", "v99.33.0.0.0.1"));
+
+ xDoc.normalize();
+
+ try {
+ xDoc.setNodeValue("42");
+ fail("XDocument.setNodeValue()");
+ } catch (DOMException e) {
+ assertTrue("XDocument.setNodeValue()",
+ NO_MODIFICATION_ALLOWED_ERR == e.Code);
+ }
+
+ try {
+ xDoc.setPrefix("foo");
+ fail("XDocument.setPrefix()");
+ } catch (DOMException e) {
+ assertTrue("XDocument.setPrefix()",
+ NO_MODIFICATION_ALLOWED_ERR == e.Code);
+ }
+
+ try {
+ xDoc.appendChild(null);
+ fail("XDocument.appendChild(null)");
+ } catch (Exception e) { /* expected */ }
+
+
+ try {
+ xDoc.insertBefore(null, xText);
+ fail("XDocument.insertBefore(null,)");
+ } catch (Exception e) { /* expected */ }
+ try {
+ xDoc.insertBefore(xText, null);
+ fail("XDocument.insertBefore(, null)");
+ } catch (Exception e) { /* expected */ }
+ try {
+ xDoc.insertBefore(xText, xText);
+ fail("XDocument.insertBefore(x, x)");
+ } catch (DOMException e) {
+ assertTrue("XDocument.insertBefore(x, x)",
+ HIERARCHY_REQUEST_ERR == e.Code);
+ }
+
+ {
+ XNode xRet = xDoc.insertBefore(xComment, xElemFooNs);
+ assertEquals("XDocument.insertBefore(xComment, xElemFooNs)",
+ xRet, xElemFooNs); // why does this return the old node?
+ assertEquals("XDocument.insertBefore(xComment, xElemFooNs)",
+ xComment, xDoc.getFirstChild());
+ assertEquals("XDocument.insertBefore(xComment, xElemFooNs)",
+ xDoc, xComment.getParentNode());
+ assertEquals("XDocument.insertBefore(xCommnet, xElemFooNs)",
+ xElemFooNs, xDoc.getLastChild());
+ }
+
+ try {
+ xDoc.replaceChild(null, xText);
+ fail("XDocument.replaceChild(null, )");
+ } catch (Exception e) { /* expected */ }
+ try {
+ xDoc.replaceChild(xText, null);
+ fail("XDocument.replaceChild(, null)");
+ } catch (Exception e) { /* expected */ }
+ try {
+ xDoc.replaceChild(xElemFoo, xElemFoo); // not child
+ fail("XDocument.replaceChild(xElemFoo, xElemFoo)");
+ } catch (DOMException e) {
+ assertTrue("XDocument.replaceChild(xElemFoo, xElemFoo)",
+ HIERARCHY_REQUEST_ERR == e.Code);
+ }
+ try {
+ xDoc.replaceChild(xElemFooNs, xElemFooNs); // child
+ assertFalse("XDocument.replaceChild(xElemFooNs, xElemFooNs)",
+ false);
+ } catch (DOMException e) {
+ assertTrue("XDocument.replaceChild(xElemFooNs, xElemFooNs)",
+ HIERARCHY_REQUEST_ERR == e.Code);
+ }
+ XNode xReplaced = xDoc.replaceChild(xPI, xComment);
+ assertEquals("XDocument.replaceChild(xPI, xComment)",
+ xReplaced, xComment);
+ assertEquals("XDocument.replaceChild(xPI, xComment)",
+ xPI, xDoc.getFirstChild());
+ assertEquals("XDocument.replaceChild(xPI, xComment)",
+ xElemFooNs, xDoc.getLastChild());
+
+ try {
+ xDoc.removeChild(null);
+ fail("XDocument.removeChild(null)");
+ } catch (Exception e) { /* expected */ }
+ try {
+ xDoc.removeChild(xElemFoo);
+ fail("XDocument.removeChild()");
+ } catch (DOMException e) {
+ assertTrue("XDocument.removeChild()",
+ HIERARCHY_REQUEST_ERR == e.Code);
+ }
+
+ XNode xRemoved = xDoc.removeChild(xPI);
+ assertEquals("XDocument.removeChild(xPI)", xRemoved, xPI);
+ assertTrue("XDocument.removeChild(xPI)", xDoc.hasChildNodes());
+ assertEquals("XDocument.removeChild(xPI)",
+ xElemFooNs, xDoc.getFirstChild());
+ assertEquals("XDocument.removeChild(xPI)",
+ xElemFooNs, xDoc.getLastChild());
+ }
+
+ @Test public void testXDocumentFragment() throws Exception
+ {
+ XDocumentBuilder xBuilder =
+ UnoRuntime.queryInterface(XDocumentBuilder.class,
+ m_xMSF.createInstance("com.sun.star.xml.dom.DocumentBuilder"));
+ XDocument xDoc = xBuilder.newDocument();
+
+ XDocumentFragment xDF = xDoc.createDocumentFragment();
+ assertNotNull("XDocument.createDocumentFragment", xDF);
+
+ XElement xElemFoo = xDoc.createElement("foo");
+ assertNotNull("XDocument.createElement", xElemFoo);
+
+ xDF.appendChild(xElemFoo);
+
+ // XNode ////////////////////////////////////////////////////
+
+ XText xText = xDoc.createTextNode("foo");
+ XComment xComment = xDoc.createComment("foo");
+
+ {
+ XNode xDFCloneN = xDF.cloneNode(false);
+ assertNotNull("XDocumentFragment.cloneNode(false)", xDFCloneN);
+ XDocumentFragment xDFClone =
+ UnoRuntime.queryInterface(XDocumentFragment.class, xDFCloneN);
+ assertNotNull("XDocumentFragment.cloneNode(false)", xDFClone);
+ assertFalse("XDocumentFragment.cloneNode(false)",
+ xDFClone.hasChildNodes());
+ assertNull("XDocumentFragment.cloneNode(false)",
+ xDFClone.getFirstChild());
+ }
+ {
+ XNode xDFCloneN = xDF.cloneNode(true);
+ assertNotNull("XDocumentFragment.cloneNode(true)", xDFCloneN);
+ XDocumentFragment xDFClone =
+ UnoRuntime.queryInterface(XDocumentFragment.class, xDFCloneN);
+ assertNotNull("XDocumentFragment.cloneNode(true)", xDFClone);
+ assertTrue("XDocumentFragment.cloneNode(true)",
+ xDFClone.hasChildNodes());
+ XNode xChild = xDFClone.getFirstChild();
+ assertNotNull("XDocumentFragment.cloneNode(true)", xChild);
+ XElement xE = UnoRuntime.queryInterface(XElement.class, xChild);
+ assertFalse("XDocumentFragment.cloneNode(true)",
+ xElemFoo.equals(xE));
+ assertEquals("XDocumentFragment.cloneNode(true)",
+ "foo", xE.getLocalName());
+ }
+
+ assertNull("XDocumentFragment.getAttributes()", xDF.getAttributes());
+
+ {
+ XNodeList xChildren = xDF.getChildNodes();
+ assertTrue("XDocumentFragment.getChildNodes()",
+ 1 == xChildren.getLength());
+ assertEquals("XDocumentFragment.getChildNodes()",
+ xElemFoo, xChildren.item(0));
+
+ XNode xFirst = xDF.getFirstChild();
+ assertEquals("XDocumentFragment.getFirstChild()",
+ xElemFoo, xFirst);
+ XNode xLast = xDF.getLastChild();
+ assertEquals("XDocumentFragment.getLastChild()", xElemFoo, xLast);
+ }
+
+ assertEquals("XDocumentFragment.getLocalName()",
+ "", xDF.getLocalName());
+
+ assertEquals("XDocumentFragment.getNamespaceURI()",
+ "", xDF.getNamespaceURI());
+
+ assertNull("XDocumentFragment.getNextSibling()", xDF.getNextSibling());
+
+ assertEquals("XDocumentFragment.getNodeName()",
+ "#document-fragment", xDF.getNodeName());
+
+ assertTrue("XDocumentFragment.getNodeType()",
+ DOCUMENT_FRAGMENT_NODE == xDF.getNodeType());
+
+ assertEquals("XDocumentFragment.getNodeValue()",
+ "", xDF.getNodeValue());
+
+ assertEquals("XDocumentFragment.getOwnerDocument()",
+ xDoc, xDF.getOwnerDocument());
+
+ assertNull("XDocumentFragment.getParentNode()", xDF.getParentNode());
+
+ assertEquals("XDocumentFragment.getPrefix()", "", xDF.getPrefix());
+
+ assertNull("XDocumentFragment.getPreviousSibling()",
+ xDF.getPreviousSibling());
+
+ assertFalse("XDocumentFragment.hasAttributes()", xDF.hasAttributes());
+
+ assertTrue("XDocumentFragment.hasChildNodes()", xDF.hasChildNodes());
+
+ assertFalse("XDocumentFragment.isSupported()",
+ xDF.isSupported("frobnication", "v99.33.0.0.0.1"));
+
+ xDF.normalize();
+
+ try {
+ xDF.setNodeValue("42");
+ fail("XDocumentFragment.setNodeValue()");
+ } catch (DOMException e) {
+ assertTrue("XDocumentFragment.setNodeValue()",
+ NO_MODIFICATION_ALLOWED_ERR == e.Code);
+ }
+
+ try {
+ xDF.setPrefix("foo");
+ fail("XDocumentFragment.setPrefix()");
+ } catch (DOMException e) {
+ assertTrue("XDocumentFragment.setPrefix()",
+ NO_MODIFICATION_ALLOWED_ERR == e.Code);
+ }
+
+ try {
+ xDF.appendChild(null);
+ fail("XDocumentFragment.appendChild(null)");
+ } catch (Exception e) { /* expected */ }
+
+
+ try {
+ xDF.insertBefore(null, xText);
+ fail("XDocumentFragment.insertBefore(null,)");
+ } catch (Exception e) { /* expected */ }
+ try {
+ xDF.insertBefore(xText, null);
+ fail("XDocumentFragment.insertBefore(, null)");
+ } catch (Exception e) { /* expected */ }
+ try {
+ xDF.insertBefore(xText, xText);
+ fail("XDocumentFragment.insertBefore(x, x)");
+ } catch (DOMException e) {
+ assertTrue("XDocumentFragment.insertBefore(x, x)",
+ HIERARCHY_REQUEST_ERR == e.Code);
+ }
+
+ {
+ XNode xRet = xDF.insertBefore(xComment, xElemFoo);
+ assertEquals("XDocumentFragment.insertBefore(xComment, xElemFoo)",
+ xRet, xElemFoo); // why does this return the old node?
+ assertEquals("XDocumentFragment.insertBefore(xComment, xElemFoo)",
+ xComment, xDF.getFirstChild());
+ assertEquals("XDocumentFragment.insertBefore(xComment, xElemFoo)",
+ xDF, xComment.getParentNode());
+ assertEquals("XDocumentFragment.insertBefore(xCommnet, xElemFoo)",
+ xElemFoo, xDF.getLastChild());
+ }
+
+ try {
+ xDF.replaceChild(null, xText);
+ fail("XDocumentFragment.replaceChild(null, )");
+ } catch (Exception e) { /* expected */ }
+ try {
+ xDF.replaceChild(xText, null);
+ fail("XDocumentFragment.replaceChild(, null)");
+ } catch (Exception e) { /* expected */ }
+ try {
+ xDF.replaceChild(xElemFoo, xElemFoo); // not child
+ fail("XDocumentFragment.replaceChild(xElemFoo, xElemFoo)");
+ } catch (DOMException e) {
+ assertTrue("XDocumentFragment.replaceChild(xElemFoo, xElemFoo)",
+ HIERARCHY_REQUEST_ERR == e.Code);
+ }
+ try {
+ xDF.replaceChild(xElemFoo, xElemFoo); // child
+ assertFalse("XDocumentFragment.replaceChild(xElemFoo, xElemFoo)",
+ false);
+ } catch (DOMException e) {
+ assertTrue("XDocumentFragment.replaceChild(xElemFoo, xElemFoo)",
+ HIERARCHY_REQUEST_ERR == e.Code);
+ }
+ XNode xReplaced = xDF.replaceChild(xText, xComment);
+ assertEquals("XDocumentFragment.replaceChild(xText, xComment)",
+ xReplaced, xComment);
+ assertEquals("XDocumentFragment.replaceChild(xText, xComment)",
+ xText, xDF.getFirstChild());
+ assertEquals("XDocumentFragment.replaceChild(xText, xComment)",
+ xElemFoo, xDF.getLastChild());
+
+ try {
+ xDF.removeChild(null);
+ fail("XDocumentFragment.removeChild(null)");
+ } catch (Exception e) { /* expected */ }
+ try {
+ xDF.removeChild(xComment);
+ fail("XDocumentFragment.removeChild()");
+ } catch (DOMException e) {
+ assertTrue("XDocumentFragment.removeChild()",
+ HIERARCHY_REQUEST_ERR == e.Code);
+ }
+
+ XNode xRemoved = xDF.removeChild(xText);
+ assertEquals("XDocumentFragment.removeChild(xText)", xRemoved, xText);
+ assertTrue("XDocumentFragment.removeChild(xText)", xDF.hasChildNodes());
+ assertEquals("XDocumentFragment.removeChild(xText)",
+ xElemFoo, xDF.getFirstChild());
+ assertEquals("XDocumentFragment.removeChild(xText)",
+ xElemFoo, xDF.getLastChild());
+ }
+
+ @Test public void testXElement() throws Exception
+ {
+ XDocumentBuilder xBuilder =
+ UnoRuntime.queryInterface(XDocumentBuilder.class,
+ m_xMSF.createInstance("com.sun.star.xml.dom.DocumentBuilder"));
+ XDocument xDoc = xBuilder.newDocument();
+
+ String ns = "http://example.com/";
+
+ XElement xElemFoo = xDoc.createElement("foo");
+ assertNotNull("XDocument.createElement(\"foo\")", xElemFoo);
+
+ XElement xElemFooNs = xDoc.createElementNS(ns, "e:foo");
+ assertNotNull("XDocument.createElementNs(\"foo\")", xElemFooNs);
+
+ assertEquals("XElement.getTagName", "foo", xElemFoo.getTagName());
+
+ {
+ XNodeList xNodeList = xElemFoo.getElementsByTagName("bar");
+ assertNotNull("XElement.getElementsByTagName", xNodeList);
+ assertTrue("XElement.getElementsByTagName",
+ 0 == xNodeList.getLength());
+ }
+
+ {
+ XNodeList xNodeList = xElemFoo.getElementsByTagNameNS(ns, "bar");
+ assertNotNull("XElement.getElementsByTagNameNS", xNodeList);
+ assertTrue("XElement.getElementsByTagNameNS",
+ 0 == xNodeList.getLength());
+ }
+
+ xElemFoo.appendChild(xElemFooNs);
+
+ {
+ XNodeList xNodeList = xElemFoo.getElementsByTagName("foo");
+ assertNotNull("XElement.getElementsByTagName", xNodeList);
+ assertTrue("XElement.getElementsByTagName",