summaryrefslogtreecommitdiffstats
path: root/dom
diff options
context:
space:
mode:
authorThe Android Open Source Project <initial-contribution@android.com>2009-01-09 17:50:54 -0800
committerThe Android Open Source Project <initial-contribution@android.com>2009-01-09 17:50:54 -0800
commita0881d052ee72e3f7e773374e9b1aa75fbd6be4c (patch)
tree8a9462436077d0d906368cb21f521f1bf8a25500 /dom
parentdd828f42a5c83b4270d4fbf6fce2da1878f1e84a (diff)
downloadlibcore-a0881d052ee72e3f7e773374e9b1aa75fbd6be4c.zip
libcore-a0881d052ee72e3f7e773374e9b1aa75fbd6be4c.tar.gz
libcore-a0881d052ee72e3f7e773374e9b1aa75fbd6be4c.tar.bz2
auto import from //branches/cupcake/...@125939
Diffstat (limited to 'dom')
-rw-r--r--dom/src/test/java/README10
-rw-r--r--dom/src/test/java/org/w3c/dom/DOMError.java85
-rw-r--r--dom/src/test/java/org/w3c/dom/DOMErrorHandler.java34
-rw-r--r--dom/src/test/java/org/w3c/dom/DOMLocator.java62
-rw-r--r--dom/src/test/java/org/w3c/dom/UserDataHandler.java65
-rw-r--r--dom/src/test/java/org/w3c/dom/events/Event.java141
-rw-r--r--dom/src/test/java/org/w3c/dom/events/EventException.java36
-rw-r--r--dom/src/test/java/org/w3c/dom/events/EventListener.java41
-rw-r--r--dom/src/test/java/org/w3c/dom/events/EventTarget.java102
-rw-r--r--dom/src/test/java/org/w3c/domts/BatikTestDocumentBuilderFactory.java239
-rw-r--r--dom/src/test/java/org/w3c/domts/DOM4JTestDocumentBuilderFactory.java154
-rw-r--r--dom/src/test/java/org/w3c/domts/DOMErrorImpl.java68
-rw-r--r--dom/src/test/java/org/w3c/domts/DOMErrorMonitor.java66
-rw-r--r--dom/src/test/java/org/w3c/domts/DOMLocatorImpl.java84
-rw-r--r--dom/src/test/java/org/w3c/domts/DOMTest.java289
-rw-r--r--dom/src/test/java/org/w3c/domts/DOMTestCase.java983
-rw-r--r--dom/src/test/java/org/w3c/domts/DOMTestDocumentBuilderFactory.java192
-rw-r--r--dom/src/test/java/org/w3c/domts/DOMTestFramework.java177
-rw-r--r--dom/src/test/java/org/w3c/domts/DOMTestIncompatibleException.java76
-rw-r--r--dom/src/test/java/org/w3c/domts/DOMTestInnerClass.java193
-rw-r--r--dom/src/test/java/org/w3c/domts/DOMTestLoadException.java40
-rw-r--r--dom/src/test/java/org/w3c/domts/DOMTestSink.java27
-rw-r--r--dom/src/test/java/org/w3c/domts/DOMTestSuite.java62
-rw-r--r--dom/src/test/java/org/w3c/domts/DocumentBuilderSetting.java282
-rw-r--r--dom/src/test/java/org/w3c/domts/DocumentBuilderSettingStrategy.java199
-rw-r--r--dom/src/test/java/org/w3c/domts/EventMonitor.java68
-rw-r--r--dom/src/test/java/org/w3c/domts/JAXPDOMTestDocumentBuilderFactory.java183
-rw-r--r--dom/src/test/java/org/w3c/domts/JTidyDOMImplementation.java131
-rw-r--r--dom/src/test/java/org/w3c/domts/JTidyDocumentBuilderFactory.java135
-rw-r--r--dom/src/test/java/org/w3c/domts/JUnitTestCaseAdapter.java368
-rw-r--r--dom/src/test/java/org/w3c/domts/JUnitTestSuiteAdapter.java64
-rw-r--r--dom/src/test/java/org/w3c/domts/LSDocumentBuilderFactory.java414
-rw-r--r--dom/src/test/java/org/w3c/domts/UserDataMonitor.java69
-rw-r--r--dom/src/test/java/org/w3c/domts/UserDataNotification.java88
-rw-r--r--dom/src/test/java/org/w3c/domts/XalanDOMTestDocumentBuilderFactory.java79
-rw-r--r--dom/src/test/java/org/w3c/domts/XercesHTML2DocumentBuilderFactory.java261
-rw-r--r--dom/src/test/java/org/w3c/domts/XercesHTMLDocumentBuilderFactory.java261
-rw-r--r--dom/src/test/java/org/w3c/domts/level1/core/TestBatik.java43
-rw-r--r--dom/src/test/java/org/w3c/domts/level1/core/TestCrimson.java48
-rw-r--r--dom/src/test/java/org/w3c/domts/level1/core/TestCrimsonAltConfig.java48
-rw-r--r--dom/src/test/java/org/w3c/domts/level1/core/TestDOM4J.java43
-rw-r--r--dom/src/test/java/org/w3c/domts/level1/core/TestDefaultLS.java51
-rw-r--r--dom/src/test/java/org/w3c/domts/level1/core/TestDefaultLSAltConfig.java51
-rw-r--r--dom/src/test/java/org/w3c/domts/level1/core/TestDefaultParser.java43
-rw-r--r--dom/src/test/java/org/w3c/domts/level1/core/TestDefaultParserAltConfig.java43
-rw-r--r--dom/src/test/java/org/w3c/domts/level1/core/TestGNUJAXP.java51
-rw-r--r--dom/src/test/java/org/w3c/domts/level1/core/TestGNUJAXPAltConfig.java49
-rw-r--r--dom/src/test/java/org/w3c/domts/level1/core/TestJTidy.java41
-rw-r--r--dom/src/test/java/org/w3c/domts/level1/core/TestOracle.java50
-rw-r--r--dom/src/test/java/org/w3c/domts/level1/core/TestOracleAltConfig.java49
-rw-r--r--dom/src/test/java/org/w3c/domts/level1/core/TestXerces.java49
-rw-r--r--dom/src/test/java/org/w3c/domts/level1/core/TestXercesAltConfig.java48
-rw-r--r--dom/src/test/java/org/w3c/domts/level1/core/alltests.java595
-rw-r--r--dom/src/test/java/org/w3c/domts/level1/core/attrcreatedocumentfragment.java97
-rw-r--r--dom/src/test/java/org/w3c/domts/level1/core/attrcreatetextnode.java98
-rw-r--r--dom/src/test/java/org/w3c/domts/level1/core/attrcreatetextnode2.java97
-rw-r--r--dom/src/test/java/org/w3c/domts/level1/core/attrdefaultvalue.java104
-rw-r--r--dom/src/test/java/org/w3c/domts/level1/core/attreffectivevalue.java91
-rw-r--r--dom/src/test/java/org/w3c/domts/level1/core/attrentityreplacement.java96
-rw-r--r--dom/src/test/java/org/w3c/domts/level1/core/attrname.java94
-rw-r--r--dom/src/test/java/org/w3c/domts/level1/core/attrnextsiblingnull.java91
-rw-r--r--dom/src/test/java/org/w3c/domts/level1/core/attrnotspecifiedvalue.java101
-rw-r--r--dom/src/test/java/org/w3c/domts/level1/core/attrparentnodenull.java91
-rw-r--r--dom/src/test/java/org/w3c/domts/level1/core/attrprevioussiblingnull.java91
-rw-r--r--dom/src/test/java/org/w3c/domts/level1/core/attrremovechild1.java99
-rw-r--r--dom/src/test/java/org/w3c/domts/level1/core/attrreplacechild1.java101
-rw-r--r--dom/src/test/java/org/w3c/domts/level1/core/attrsetvaluenomodificationallowederr.java133
-rw-r--r--dom/src/test/java/org/w3c/domts/level1/core/attrsetvaluenomodificationallowederrEE.java123
-rw-r--r--dom/src/test/java/org/w3c/domts/level1/core/attrspecifiedvalue.java94
-rw-r--r--dom/src/test/java/org/w3c/domts/level1/core/attrspecifiedvaluechanged.java96
-rw-r--r--dom/src/test/java/org/w3c/domts/level1/core/attrspecifiedvalueremove.java107
-rw-r--r--dom/src/test/java/org/w3c/domts/level1/core/cdatasectiongetdata.java99
-rw-r--r--dom/src/test/java/org/w3c/domts/level1/core/cdatasectionnormalize.java98
-rw-r--r--dom/src/test/java/org/w3c/domts/level1/core/characterdataappenddata.java97
-rw-r--r--dom/src/test/java/org/w3c/domts/level1/core/characterdataappenddatagetdata.java96
-rw-r--r--dom/src/test/java/org/w3c/domts/level1/core/characterdataappenddatanomodificationallowederr.java114
-rw-r--r--dom/src/test/java/org/w3c/domts/level1/core/characterdataappenddatanomodificationallowederrEE.java101
-rw-r--r--dom/src/test/java/org/w3c/domts/level1/core/characterdatadeletedatabegining.java94
-rw-r--r--dom/src/test/java/org/w3c/domts/level1/core/characterdatadeletedataend.java96
-rw-r--r--dom/src/test/java/org/w3c/domts/level1/core/characterdatadeletedataexceedslength.java98
-rw-r--r--dom/src/test/java/org/w3c/domts/level1/core/characterdatadeletedatagetlengthanddata.java104
-rw-r--r--dom/src/test/java/org/w3c/domts/level1/core/characterdatadeletedatamiddle.java96
-rw-r--r--dom/src/test/java/org/w3c/domts/level1/core/characterdatadeletedatanomodificationallowederr.java114
-rw-r--r--dom/src/test/java/org/w3c/domts/level1/core/characterdatadeletedatanomodificationallowederrEE.java101
-rw-r--r--dom/src/test/java/org/w3c/domts/level1/core/characterdatagetdata.java90
-rw-r--r--dom/src/test/java/org/w3c/domts/level1/core/characterdatagetlength.java92
-rw-r--r--dom/src/test/java/org/w3c/domts/level1/core/characterdataindexsizeerrdeletedatacountnegative.java107
-rw-r--r--dom/src/test/java/org/w3c/domts/level1/core/characterdataindexsizeerrdeletedataoffsetgreater.java104
-rw-r--r--dom/src/test/java/org/w3c/domts/level1/core/characterdataindexsizeerrdeletedataoffsetnegative.java108
-rw-r--r--dom/src/test/java/org/w3c/domts/level1/core/characterdataindexsizeerrinsertdataoffsetgreater.java103
-rw-r--r--dom/src/test/java/org/w3c/domts/level1/core/characterdataindexsizeerrinsertdataoffsetnegative.java107
-rw-r--r--dom/src/test/java/org/w3c/domts/level1/core/characterdataindexsizeerrreplacedatacountnegative.java108
-rw-r--r--dom/src/test/java/org/w3c/domts/level1/core/characterdataindexsizeerrreplacedataoffsetgreater.java104
-rw-r--r--dom/src/test/java/org/w3c/domts/level1/core/characterdataindexsizeerrreplacedataoffsetnegative.java109
-rw-r--r--dom/src/test/java/org/w3c/domts/level1/core/characterdataindexsizeerrsubstringcountnegative.java108
-rw-r--r--dom/src/test/java/org/w3c/domts/level1/core/characterdataindexsizeerrsubstringnegativeoffset.java108
-rw-r--r--dom/src/test/java/org/w3c/domts/level1/core/characterdataindexsizeerrsubstringoffsetgreater.java104
-rw-r--r--dom/src/test/java/org/w3c/domts/level1/core/characterdatainsertdatabeginning.java94
-rw-r--r--dom/src/test/java/org/w3c/domts/level1/core/characterdatainsertdataend.java96
-rw-r--r--dom/src/test/java/org/w3c/domts/level1/core/characterdatainsertdatamiddle.java96
-rw-r--r--dom/src/test/java/org/w3c/domts/level1/core/characterdatainsertdatanomodificationallowederr.java114
-rw-r--r--dom/src/test/java/org/w3c/domts/level1/core/characterdatainsertdatanomodificationallowederrEE.java99
-rw-r--r--dom/src/test/java/org/w3c/domts/level1/core/characterdatareplacedatabegining.java94
-rw-r--r--dom/src/test/java/org/w3c/domts/level1/core/characterdatareplacedataend.java96
-rw-r--r--dom/src/test/java/org/w3c/domts/level1/core/characterdatareplacedataexceedslengthofarg.java97
-rw-r--r--dom/src/test/java/org/w3c/domts/level1/core/characterdatareplacedataexceedslengthofdata.java95
-rw-r--r--dom/src/test/java/org/w3c/domts/level1/core/characterdatareplacedatamiddle.java96
-rw-r--r--dom/src/test/java/org/w3c/domts/level1/core/characterdatareplacedatanomodificationallowederr.java115
-rw-r--r--dom/src/test/java/org/w3c/domts/level1/core/characterdatareplacedatanomodificationallowederrEE.java101
-rw-r--r--dom/src/test/java/org/w3c/domts/level1/core/characterdatasetdatanomodificationallowederr.java114
-rw-r--r--dom/src/test/java/org/w3c/domts/level1/core/characterdatasetdatanomodificationallowederrEE.java99
-rw-r--r--dom/src/test/java/org/w3c/domts/level1/core/characterdatasetnodevalue.java92
-rw-r--r--dom/src/test/java/org/w3c/domts/level1/core/characterdatasubstringexceedsvalue.java94
-rw-r--r--dom/src/test/java/org/w3c/domts/level1/core/characterdatasubstringvalue.java93
-rw-r--r--dom/src/test/java/org/w3c/domts/level1/core/commentgetcomment.java102
-rw-r--r--dom/src/test/java/org/w3c/domts/level1/core/documentcreateattribute.java94
-rw-r--r--dom/src/test/java/org/w3c/domts/level1/core/documentcreatecdatasection.java93
-rw-r--r--dom/src/test/java/org/w3c/domts/level1/core/documentcreatecomment.java92
-rw-r--r--dom/src/test/java/org/w3c/domts/level1/core/documentcreatedocumentfragment.java96
-rw-r--r--dom/src/test/java/org/w3c/domts/level1/core/documentcreateelement.java93
-rw-r--r--dom/src/test/java/org/w3c/domts/level1/core/documentcreateelementcasesensitive.java95
-rw-r--r--dom/src/test/java/org/w3c/domts/level1/core/documentcreateelementdefaultattr.java106
-rw-r--r--dom/src/test/java/org/w3c/domts/level1/core/documentcreateentityreference.java97
-rw-r--r--dom/src/test/java/org/w3c/domts/level1/core/documentcreateentityreferenceknown.java100
-rw-r--r--dom/src/test/java/org/w3c/domts/level1/core/documentcreateprocessinginstruction.java100
-rw-r--r--dom/src/test/java/org/w3c/domts/level1/core/documentcreatetextnode.java92
-rw-r--r--dom/src/test/java/org/w3c/domts/level1/core/documentgetdoctype.java98
-rw-r--r--dom/src/test/java/org/w3c/domts/level1/core/documentgetdoctypenodtd.java88
-rw-r--r--dom/src/test/java/org/w3c/domts/level1/core/documentgetelementsbytagnamelength.java85
-rw-r--r--dom/src/test/java/org/w3c/domts/level1/core/documentgetelementsbytagnametotallength.java86
-rw-r--r--dom/src/test/java/org/w3c/domts/level1/core/documentgetelementsbytagnamevalue.java93
-rw-r--r--dom/src/test/java/org/w3c/domts/level1/core/documentgetimplementation.java86
-rw-r--r--dom/src/test/java/org/w3c/domts/level1/core/documentgetrootnode.java92
-rw-r--r--dom/src/test/java/org/w3c/domts/level1/core/documentinvalidcharacterexceptioncreateattribute.java98
-rw-r--r--dom/src/test/java/org/w3c/domts/level1/core/documentinvalidcharacterexceptioncreateelement.java98
-rw-r--r--dom/src/test/java/org/w3c/domts/level1/core/documentinvalidcharacterexceptioncreateentref.java110
-rw-r--r--dom/src/test/java/org/w3c/domts/level1/core/documentinvalidcharacterexceptioncreateentref1.java107
-rw-r--r--dom/src/test/java/org/w3c/domts/level1/core/documentinvalidcharacterexceptioncreatepi.java110
-rw-r--r--dom/src/test/java/org/w3c/domts/level1/core/documentinvalidcharacterexceptioncreatepi1.java107
-rw-r--r--dom/src/test/java/org/w3c/domts/level1/core/documenttypegetdoctype.java93
-rw-r--r--dom/src/test/java/org/w3c/domts/level1/core/documenttypegetentities.java120
-rw-r--r--dom/src/test/java/org/w3c/domts/level1/core/documenttypegetentitieslength.java93
-rw-r--r--dom/src/test/java/org/w3c/domts/level1/core/documenttypegetentitiestype.java95
-rw-r--r--dom/src/test/java/org/w3c/domts/level1/core/documenttypegetnotations.java102
-rw-r--r--dom/src/test/java/org/w3c/domts/level1/core/documenttypegetnotationstype.java94
-rw-r--r--dom/src/test/java/org/w3c/domts/level1/core/domimplementationfeaturenoversion.java82
-rw-r--r--dom/src/test/java/org/w3c/domts/level1/core/domimplementationfeaturenull.java90
-rw-r--r--dom/src/test/java/org/w3c/domts/level1/core/domimplementationfeaturexml.java81
-rw-r--r--dom/src/test/java/org/w3c/domts/level1/core/elementaddnewattribute.java91
-rw-r--r--dom/src/test/java/org/w3c/domts/level1/core/elementassociatedattribute.java94
-rw-r--r--dom/src/test/java/org/w3c/domts/level1/core/elementchangeattributevalue.java94
-rw-r--r--dom/src/test/java/org/w3c/domts/level1/core/elementcreatenewattribute.java98
-rw-r--r--dom/src/test/java/org/w3c/domts/level1/core/elementgetattributenode.java91
-rw-r--r--dom/src/test/java/org/w3c/domts/level1/core/elementgetattributenodenull.java90
-rw-r--r--dom/src/test/java/org/w3c/domts/level1/core/elementgetelementempty.java97
-rw-r--r--dom/src/test/java/org/w3c/domts/level1/core/elementgetelementsbytagname.java86
-rw-r--r--dom/src/test/java/org/w3c/domts/level1/core/elementgetelementsbytagnameaccessnodelist.java96
-rw-r--r--dom/src/test/java/org/w3c/domts/level1/core/elementgetelementsbytagnamenomatch.java84
-rw-r--r--dom/src/test/java/org/w3c/domts/level1/core/elementgetelementsbytagnamespecialvalue.java106
-rw-r--r--dom/src/test/java/org/w3c/domts/level1/core/elementgettagname.java92
-rw-r--r--dom/src/test/java/org/w3c/domts/level1/core/elementinuseattributeerr.java112
-rw-r--r--dom/src/test/java/org/w3c/domts/level1/core/elementinvalidcharacterexception.java99
-rw-r--r--dom/src/test/java/org/w3c/domts/level1/core/elementnormalize.java95
-rw-r--r--dom/src/test/java/org/w3c/domts/level1/core/elementnotfounderr.java104
-rw-r--r--dom/src/test/java/org/w3c/domts/level1/core/elementremoveattribute.java100
-rw-r--r--dom/src/test/java/org/w3c/domts/level1/core/elementremoveattributeaftercreate.java97
-rw-r--r--dom/src/test/java/org/w3c/domts/level1/core/elementremoveattributenode.java92
-rw-r--r--dom/src/test/java/org/w3c/domts/level1/core/elementremoveattributenodenomodificationallowederr.java122
-rw-r--r--dom/src/test/java/org/w3c/domts/level1/core/elementremoveattributenodenomodificationallowederrEE.java115
-rw-r--r--dom/src/test/java/org/w3c/domts/level1/core/elementremoveattributenomodificationallowederr.java117
-rw-r--r--dom/src/test/java/org/w3c/domts/level1/core/elementremoveattributenomodificationallowederrEE.java107
-rw-r--r--dom/src/test/java/org/w3c/domts/level1/core/elementremoveattributerestoredefaultvalue.java100
-rw-r--r--dom/src/test/java/org/w3c/domts/level1/core/elementreplaceattributewithself.java89
-rw-r--r--dom/src/test/java/org/w3c/domts/level1/core/elementreplaceexistingattribute.java97
-rw-r--r--dom/src/test/java/org/w3c/domts/level1/core/elementreplaceexistingattributegevalue.java95
-rw-r--r--dom/src/test/java/org/w3c/domts/level1/core/elementretrieveallattributes.java98
-rw-r--r--dom/src/test/java/org/w3c/domts/level1/core/elementretrieveattrvalue.java88
-rw-r--r--dom/src/test/java/org/w3c/domts/level1/core/elementretrievetagname.java91
-rw-r--r--dom/src/test/java/org/w3c/domts/level1/core/elementsetattributenodenomodificationallowederr.java116
-rw-r--r--dom/src/test/java/org/w3c/domts/level1/core/elementsetattributenodenomodificationallowederrEE.java117
-rw-r--r--dom/src/test/java/org/w3c/domts/level1/core/elementsetattributenodenull.java94
-rw-r--r--dom/src/test/java/org/w3c/domts/level1/core/elementsetattributenomodificationallowederr.java112
-rw-r--r--dom/src/test/java/org/w3c/domts/level1/core/elementsetattributenomodificationallowederrEE.java107
-rw-r--r--dom/src/test/java/org/w3c/domts/level1/core/elementwrongdocumenterr.java110
-rw-r--r--dom/src/test/java/org/w3c/domts/level1/core/entitygetentityname.java93
-rw-r--r--dom/src/test/java/org/w3c/domts/level1/core/entitygetpublicid.java101
-rw-r--r--dom/src/test/java/org/w3c/domts/level1/core/entitygetpublicidnull.java94
-rw-r--r--dom/src/test/java/org/w3c/domts/level1/core/hc_attrappendchild1.java100
-rw-r--r--dom/src/test/java/org/w3c/domts/level1/core/hc_attrappendchild2.java99
-rw-r--r--dom/src/test/java/org/w3c/domts/level1/core/hc_attrappendchild3.java106
-rw-r--r--dom/src/test/java/org/w3c/domts/level1/core/hc_attrappendchild4.java118
-rw-r--r--dom/src/test/java/org/w3c/domts/level1/core/hc_attrappendchild5.java103
-rw-r--r--dom/src/test/java/org/w3c/domts/level1/core/hc_attrappendchild6.java96
-rw-r--r--dom/src/test/java/org/w3c/domts/level1/core/hc_attrchildnodes1.java95
-rw-r--r--dom/src/test/java/org/w3c/domts/level1/core/hc_attrchildnodes2.java100
-rw-r--r--dom/src/test/java/org/w3c/domts/level1/core/hc_attrclonenode1.java100
-rw-r--r--dom/src/test/java/org/w3c/domts/level1/core/hc_attrcreatedocumentfragment.java105
-rw-r--r--dom/src/test/java/org/w3c/domts/level1/core/hc_attrcreatetextnode.java97
-rw-r--r--dom/src/test/java/org/w3c/domts/level1/core/hc_attrcreatetextnode2.java97
-rw-r--r--dom/src/test/java/org/w3c/domts/level1/core/hc_attreffectivevalue.java90
-rw-r--r--dom/src/test/java/org/w3c/domts/level1/core/hc_attrfirstchild.java96
-rw-r--r--dom/src/test/java/org/w3c/domts/level1/core/hc_attrgetvalue1.java89
-rw-r--r--dom/src/test/java/org/w3c/domts/level1/core/hc_attrgetvalue2.java111
-rw-r--r--dom/src/test/java/org/w3c/domts/level1/core/hc_attrhaschildnodes.java87
-rw-r--r--dom/src/test/java/org/w3c/domts/level1/core/hc_attrinsertbefore1.java106
-rw-r--r--dom/src/test/java/org/w3c/domts/level1/core/hc_attrinsertbefore2.java106
-rw-r--r--dom/src/test/java/org/w3c/domts/level1/core/hc_attrinsertbefore3.java112
-rw-r--r--dom/src/test/java/org/w3c/domts/level1/core/hc_attrinsertbefore4.java112
-rw-r--r--dom/src/test/java/org/w3c/domts/level1/core/hc_attrinsertbefore5.java119
-rw-r--r--dom/src/test/java/org/w3c/domts/level1/core/hc_attrinsertbefore6.java104
-rw-r--r--dom/src/test/java/org/w3c/domts/level1/core/hc_attrinsertbefore7.java126
-rw-r--r--dom/src/test/java/org/w3c/domts/level1/core/hc_attrlastchild.java96
-rw-r--r--dom/src/test/java/org/w3c/domts/level1/core/hc_attrname.java94
-rw-r--r--dom/src/test/java/org/w3c/domts/level1/core/hc_attrnextsiblingnull.java90
-rw-r--r--dom/src/test/java/org/w3c/domts/level1/core/hc_attrnormalize.java102
-rw-r--r--dom/src/test/java/org/w3c/domts/level1/core/hc_attrparentnodenull.java90
-rw-r--r--dom/src/test/java/org/w3c/domts/level1/core/hc_attrprevioussiblingnull.java90
-rw-r--r--dom/src/test/java/org/w3c/domts/level1/core/hc_attrremovechild1.java99
-rw-r--r--dom/src/test/java/org/w3c/domts/level1/core/hc_attrremovechild2.java98
-rw-r--r--dom/src/test/java/org/w3c/domts/level1/core/hc_attrreplacechild1.java102
-rw-r--r--dom/src/test/java/org/w3c/domts/level1/core/hc_attrreplacechild2.java108
-rw-r--r--dom/src/test/java/org/w3c/domts/level1/core/hc_attrsetvalue1.java100
-rw-r--r--dom/src/test/java/org/w3c/domts/level1/core/hc_attrsetvalue2.java103
-rw-r--r--dom/src/test/java/org/w3c/domts/level1/core/hc_attrspecifiedvalue.java93
-rw-r--r--dom/src/test/java/org/w3c/domts/level1/core/hc_attrspecifiedvaluechanged.java95
-rw-r--r--dom/src/test/java/org/w3c/domts/level1/core/hc_characterdataappenddata.java96
-rw-r--r--dom/src/test/java/org/w3c/domts/level1/core/hc_characterdataappenddatagetdata.java95
-rw-r--r--dom/src/test/java/org/w3c/domts/level1/core/hc_characterdatadeletedatabegining.java93
-rw-r--r--dom/src/test/java/org/w3c/domts/level1/core/hc_characterdatadeletedataend.java95
-rw-r--r--dom/src/test/java/org/w3c/domts/level1/core/hc_characterdatadeletedataexceedslength.java97
-rw-r--r--dom/src/test/java/org/w3c/domts/level1/core/hc_characterdatadeletedatagetlengthanddata.java103
-rw-r--r--dom/src/test/java/org/w3c/domts/level1/core/hc_characterdatadeletedatamiddle.java95
-rw-r--r--dom/src/test/java/org/w3c/domts/level1/core/hc_characterdatagetdata.java89
-rw-r--r--dom/src/test/java/org/w3c/domts/level1/core/hc_characterdatagetlength.java91
-rw-r--r--dom/src/test/java/org/w3c/domts/level1/core/hc_characterdataindexsizeerrdeletedatacountnegative.java107
-rw-r--r--dom/src/test/java/org/w3c/domts/level1/core/hc_characterdataindexsizeerrdeletedataoffsetgreater.java103
-rw-r--r--dom/src/test/java/org/w3c/domts/level1/core/hc_characterdataindexsizeerrdeletedataoffsetnegative.java107
-rw-r--r--dom/src/test/java/org/w3c/domts/level1/core/hc_characterdataindexsizeerrinsertdataoffsetgreater.java102
-rw-r--r--dom/src/test/java/org/w3c/domts/level1/core/hc_characterdataindexsizeerrinsertdataoffsetnegative.java106
-rw-r--r--dom/src/test/java/org/w3c/domts/level1/core/hc_characterdataindexsizeerrreplacedatacountnegative.java108
-rw-r--r--dom/src/test/java/org/w3c/domts/level1/core/hc_characterdataindexsizeerrreplacedataoffsetgreater.java103
-rw-r--r--dom/src/test/java/org/w3c/domts/level1/core/hc_characterdataindexsizeerrreplacedataoffsetnegative.java108
-rw-r--r--dom/src/test/java/org/w3c/domts/level1/core/hc_characterdataindexsizeerrsubstringcountnegative.java107
-rw-r--r--dom/src/test/java/org/w3c/domts/level1/core/hc_characterdataindexsizeerrsubstringnegativeoffset.java107
-rw-r--r--dom/src/test/java/org/w3c/domts/level1/core/hc_characterdataindexsizeerrsubstringoffsetgreater.java103
-rw-r--r--dom/src/test/java/org/w3c/domts/level1/core/hc_characterdatainsertdatabeginning.java93
-rw-r--r--dom/src/test/java/org/w3c/domts/level1/core/hc_characterdatainsertdataend.java95
-rw-r--r--dom/src/test/java/org/w3c/domts/level1/core/hc_characterdatainsertdatamiddle.java95
-rw-r--r--dom/src/test/java/org/w3c/domts/level1/core/hc_characterdatareplacedatabegining.java93
-rw-r--r--dom/src/test/java/org/w3c/domts/level1/core/hc_characterdatareplacedataend.java95
-rw-r--r--dom/src/test/java/org/w3c/domts/level1/core/hc_characterdatareplacedataexceedslengthofarg.java96
-rw-r--r--dom/src/test/java/org/w3c/domts/level1/core/hc_characterdatareplacedataexceedslengthofdata.java94
-rw-r--r--dom/src/test/java/org/w3c/domts/level1/core/hc_characterdatareplacedatamiddle.java95
-rw-r--r--dom/src/test/java/org/w3c/domts/level1/core/hc_characterdatasetnodevalue.java92
-rw-r--r--dom/src/test/java/org/w3c/domts/level1/core/hc_characterdatasubstringexceedsvalue.java93
-rw-r--r--dom/src/test/java/org/w3c/domts/level1/core/hc_characterdatasubstringvalue.java92
-rw-r--r--dom/src/test/java/org/w3c/domts/level1/core/hc_commentgetcomment.java106
-rw-r--r--dom/src/test/java/org/w3c/domts/level1/core/hc_documentcreateattribute.java93
-rw-r--r--dom/src/test/java/org/w3c/domts/level1/core/hc_documentcreatecomment.java91
-rw-r--r--dom/src/test/java/org/w3c/domts/level1/core/hc_documentcreatedocumentfragment.java95
-rw-r--r--dom/src/test/java/org/w3c/domts/level1/core/hc_documentcreateelement.java92
-rw-r--r--dom/src/test/java/org/w3c/domts/level1/core/hc_documentcreateelementcasesensitive.java103
-rw-r--r--dom/src/test/java/org/w3c/domts/level1/core/hc_documentcreatetextnode.java91
-rw-r--r--dom/src/test/java/org/w3c/domts/level1/core/hc_documentgetdoctype.java102
-rw-r--r--dom/src/test/java/org/w3c/domts/level1/core/hc_documentgetelementsbytagnamelength.java84
-rw-r--r--dom/src/test/java/org/w3c/domts/level1/core/hc_documentgetelementsbytagnametotallength.java186
-rw-r--r--dom/src/test/java/org/w3c/domts/level1/core/hc_documentgetelementsbytagnamevalue.java92
-rw-r--r--dom/src/test/java/org/w3c/domts/level1/core/hc_documentgetimplementation.java93
-rw-r--r--dom/src/test/java/org/w3c/domts/level1/core/hc_documentgetrootnode.java88
-rw-r--r--dom/src/test/java/org/w3c/domts/level1/core/hc_documentinvalidcharacterexceptioncreateattribute.java97
-rw-r--r--dom/src/test/java/org/w3c/domts/level1/core/hc_documentinvalidcharacterexceptioncreateattribute1.java90
-rw-r--r--dom/src/test/java/org/w3c/domts/level1/core/hc_documentinvalidcharacterexceptioncreateelement.java97
-rw-r--r--dom/src/test/java/org/w3c/domts/level1/core/hc_documentinvalidcharacterexceptioncreateelement1.java90
-rw-r--r--dom/src/test/java/org/w3c/domts/level1/core/hc_domimplementationfeaturenoversion.java93
-rw-r--r--dom/src/test/java/org/w3c/domts/level1/core/hc_domimplementationfeaturenull.java101
-rw-r--r--dom/src/test/java/org/w3c/domts/level1/core/hc_domimplementationfeaturexml.java92
-rw-r--r--dom/src/test/java/org/w3c/domts/level1/core/hc_elementaddnewattribute.java91
-rw-r--r--dom/src/test/java/org/w3c/domts/level1/core/hc_elementassociatedattribute.java91
-rw-r--r--dom/src/test/java/org/w3c/domts/level1/core/hc_elementchangeattributevalue.java93
-rw-r--r--dom/src/test/java/org/w3c/domts/level1/core/hc_elementcreatenewattribute.java98
-rw-r--r--dom/src/test/java/org/w3c/domts/level1/core/hc_elementgetattributenode.java87
-rw-r--r--dom/src/test/java/org/w3c/domts/level1/core/hc_elementgetattributenodenull.java89
-rw-r--r--dom/src/test/java/org/w3c/domts/level1/core/hc_elementgetelementempty.java97
-rw-r--r--dom/src/test/java/org/w3c/domts/level1/core/hc_elementgetelementsbytagname.java85
-rw-r--r--dom/src/test/java/org/w3c/domts/level1/core/hc_elementgetelementsbytagnameaccessnodelist.java108
-rw-r--r--dom/src/test/java/org/w3c/domts/level1/core/hc_elementgetelementsbytagnamenomatch.java83
-rw-r--r--dom/src/test/java/org/w3c/domts/level1/core/hc_elementgetelementsbytagnamespecialvalue.java105
-rw-r--r--dom/src/test/java/org/w3c/domts/level1/core/hc_elementgettagname.java88
-rw-r--r--dom/src/test/java/org/w3c/domts/level1/core/hc_elementinuseattributeerr.java104
-rw-r--r--dom/src/test/java/org/w3c/domts/level1/core/hc_elementinvalidcharacterexception.java97
-rw-r--r--dom/src/test/java/org/w3c/domts/level1/core/hc_elementinvalidcharacterexception1.java92
-rw-r--r--dom/src/test/java/org/w3c/domts/level1/core/hc_elementnormalize.java97
-rw-r--r--dom/src/test/java/org/w3c/domts/level1/core/hc_elementnormalize2.java99
-rw-r--r--dom/src/test/java/org/w3c/domts/level1/core/hc_elementnotfounderr.java103
-rw-r--r--dom/src/test/java/org/w3c/domts/level1/core/hc_elementremoveattribute.java87
-rw-r--r--dom/src/test/java/org/w3c/domts/level1/core/hc_elementremoveattributeaftercreate.java97
-rw-r--r--dom/src/test/java/org/w3c/domts/level1/core/hc_elementremoveattributenode.java92
-rw-r--r--dom/src/test/java/org/w3c/domts/level1/core/hc_elementreplaceattributewithself.java90
-rw-r--r--dom/src/test/java/org/w3c/domts/level1/core/hc_elementreplaceexistingattribute.java96
-rw-r--r--dom/src/test/java/org/w3c/domts/level1/core/hc_elementreplaceexistingattributegevalue.java95
-rw-r--r--dom/src/test/java/org/w3c/domts/level1/core/hc_elementretrieveallattributes.java108
-rw-r--r--dom/src/test/java/org/w3c/domts/level1/core/hc_elementretrieveattrvalue.java87
-rw-r--r--dom/src/test/java/org/w3c/domts/level1/core/hc_elementretrievetagname.java90
-rw-r--r--dom/src/test/java/org/w3c/domts/level1/core/hc_elementsetattributenodenull.java94
-rw-r--r--dom/src/test/java/org/w3c/domts/level1/core/hc_elementwrongdocumenterr.java108
-rw-r--r--dom/src/test/java/org/w3c/domts/level1/core/hc_entitiesremovenameditem1.java101
-rw-r--r--dom/src/test/java/org/w3c/domts/level1/core/hc_entitiessetnameditem1.java109
-rw-r--r--dom/src/test/java/org/w3c/domts/level1/core/hc_namednodemapchildnoderange.java106
-rw-r--r--dom/src/test/java/org/w3c/domts/level1/core/hc_namednodemapgetnameditem.java93
-rw-r--r--dom/src/test/java/org/w3c/domts/level1/core/hc_namednodemapinuseattributeerr.java109
-rw-r--r--dom/src/test/java/org/w3c/domts/level1/core/hc_namednodemapnotfounderr.java103
-rw-r--r--dom/src/test/java/org/w3c/domts/level1/core/hc_namednodemapnumberofnodes.java92
-rw-r--r--dom/src/test/java/org/w3c/domts/level1/core/hc_namednodemapremovenameditem.java97
-rw-r--r--dom/src/test/java/org/w3c/domts/level1/core/hc_namednodemapreturnattrnode.java97
-rw-r--r--dom/src/test/java/org/w3c/domts/level1/core/hc_namednodemapreturnfirstitem.java114
-rw-r--r--dom/src/test/java/org/w3c/domts/level1/core/hc_namednodemapreturnlastitem.java116
-rw-r--r--dom/src/test/java/org/w3c/domts/level1/core/hc_namednodemapreturnnull.java94
-rw-r--r--dom/src/test/java/org/w3c/domts/level1/core/hc_namednodemapsetnameditem.java103
-rw-r--r--dom/src/test/java/org/w3c/domts/level1/core/hc_namednodemapsetnameditemreturnvalue.java104
-rw-r--r--dom/src/test/java/org/w3c/domts/level1/core/hc_namednodemapsetnameditemthatexists.java106
-rw-r--r--dom/src/test/java/org/w3c/domts/level1/core/hc_namednodemapsetnameditemwithnewvalue.java99
-rw-r--r--dom/src/test/java/org/w3c/domts/level1/core/hc_namednodemapwrongdocumenterr.java111
-rw-r--r--dom/src/test/java/org/w3c/domts/level1/core/hc_nodeappendchild.java94
-rw-r--r--dom/src/test/java/org/w3c/domts/level1/core/hc_nodeappendchildchildexists.java125
-rw-r--r--dom/src/test/java/org/w3c/domts/level1/core/hc_nodeappendchilddocfragment.java125
-rw-r--r--dom/src/test/java/org/w3c/domts/level1/core/hc_nodeappendchildgetnodename.java95
-rw-r--r--dom/src/test/java/org/w3c/domts/level1/core/hc_nodeappendchildinvalidnodetype.java102
-rw-r--r--dom/src/test/java/org/w3c/domts/level1/core/hc_nodeappendchildnewchilddiffdocument.java107
-rw-r--r--dom/src/test/java/org/w3c/domts/level1/core/hc_nodeappendchildnodeancestor.java104
-rw-r--r--dom/src/test/java/org/w3c/domts/level1/core/hc_nodeattributenodeattribute.java91
-rw-r--r--dom/src/test/java/org/w3c/domts/level1/core/hc_nodeattributenodename.java88
-rw-r--r--dom/src/test/java/org/w3c/domts/level1/core/hc_nodeattributenodetype.java89
-rw-r--r--dom/src/test/java/org/w3c/domts/level1/core/hc_nodeattributenodevalue.java90
-rw-r--r--dom/src/test/java/org/w3c/domts/level1/core/hc_nodechildnodes.java114
-rw-r--r--dom/src/test/java/org/w3c/domts/level1/core/hc_nodechildnodesappendchild.java124
-rw-r--r--dom/src/test/java/org/w3c/domts/level1/core/hc_nodechildnodesempty.java93
-rw-r--r--dom/src/test/java/org/w3c/domts/level1/core/hc_nodecloneattributescopied.java113
-rw-r--r--dom/src/test/java/org/w3c/domts/level1/core/hc_nodeclonefalsenocopytext.java94
-rw-r--r--dom/src/test/java/org/w3c/domts/level1/core/hc_nodeclonegetparentnull.java90
-rw-r--r--dom/src/test/java/org/w3c/domts/level1/core/hc_nodeclonenodefalse.java97
-rw-r--r--dom/src/test/java/org/w3c/domts/level1/core/hc_nodeclonenodetrue.java113
-rw-r--r--dom/src/test/java/org/w3c/domts/level1/core/hc_nodeclonetruecopytext.java93
-rw-r--r--dom/src/test/java/org/w3c/domts/level1/core/hc_nodecommentnodeattributes.java100
-rw-r--r--dom/src/test/java/org/w3c/domts/level1/core/hc_nodecommentnodename.java100
-rw-r--r--dom/src/test/java/org/w3c/domts/level1/core/hc_nodecommentnodetype.java99
-rw-r--r--dom/src/test/java/org/w3c/domts/level1/core/hc_nodecommentnodevalue.java99
-rw-r--r--dom/src/test/java/org/w3c/domts/level1/core/hc_nodedocumentfragmentnodename.java86
-rw-r--r--dom/src/test/java/org/w3c/domts/level1/core/hc_nodedocumentfragmentnodetype.java86
-rw-r--r--dom/src/test/java/org/w3c/domts/level1/core/hc_nodedocumentfragmentnodevalue.java92
-rw-r--r--dom/src/test/java/org/w3c/domts/level1/core/hc_nodedocumentnodeattribute.java83
-rw-r--r--dom/src/test/java/org/w3c/domts/level1/core/hc_nodedocumentnodename.java83
-rw-r--r--dom/src/test/java/org/w3c/domts/level1/core/hc_nodedocumentnodetype.java82
-rw-r--r--dom/src/test/java/org/w3c/domts/level1/core/hc_nodedocumentnodevalue.java83
-rw-r--r--dom/src/test/java/org/w3c/domts/level1/core/hc_nodeelementnodeattributes.java109
-rw-r--r--dom/src/test/java/org/w3c/domts/level1/core/hc_nodeelementnodename.java90
-rw-r--r--dom/src/test/java/org/w3c/domts/level1/core/hc_nodeelementnodetype.java84
-rw-r--r--dom/src/test/java/org/w3c/domts/level1/core/hc_nodeelementnodevalue.java81
-rw-r--r--dom/src/test/java/org/w3c/domts/level1/core/hc_nodegetfirstchild.java97
-rw-r--r--dom/src/test/java/org/w3c/domts/level1/core/hc_nodegetfirstchildnull.java88
-rw-r--r--dom/src/test/java/org/w3c/domts/level1/core/hc_nodegetlastchild.java89
-rw-r--r--dom/src/test/java/org/w3c/domts/level1/core/hc_nodegetlastchildnull.java88
-rw-r--r--dom/src/test/java/org/w3c/domts/level1/core/hc_nodegetnextsibling.java89
-rw-r--r--dom/src/test/java/org/w3c/domts/level1/core/hc_nodegetnextsiblingnull.java89
-rw-r--r--dom/src/test/java/org/w3c/domts/level1/core/hc_nodegetownerdocument.java93
-rw-r--r--dom/src/test/java/org/w3c/domts/level1/core/hc_nodegetownerdocumentnull.java82
-rw-r--r--dom/src/test/java/org/w3c/domts/level1/core/hc_nodegetprevioussibling.java89
-rw-r--r--dom/src/test/java/org/w3c/domts/level1/core/hc_nodegetprevioussiblingnull.java89
-rw-r--r--dom/src/test/java/org/w3c/domts/level1/core/hc_nodehaschildnodes.java87
-rw-r--r--dom/src/test/java/org/w3c/domts/level1/core/hc_nodehaschildnodesfalse.java90
-rw-r--r--dom/src/test/java/org/w3c/domts/level1/core/hc_nodeinsertbefore.java119
-rw-r--r--dom/src/test/java/org/w3c/domts/level1/core/hc_nodeinsertbeforedocfragment.java112
-rw-r--r--dom/src/test/java/org/w3c/domts/level1/core/hc_nodeinsertbeforeinvalidnodetype.java108
-rw-r--r--dom/src/test/java/org/w3c/domts/level1/core/hc_nodeinsertbeforenewchilddiffdocument.java109
-rw-r--r--dom/src/test/java/org/w3c/domts/level1/core/hc_nodeinsertbeforenewchildexists.java119
-rw-r--r--dom/src/test/java/org/w3c/domts/level1/core/hc_nodeinsertbeforenodeancestor.java106
-rw-r--r--dom/src/test/java/org/w3c/domts/level1/core/hc_nodeinsertbeforenodename.java98
-rw-r--r--dom/src/test/java/org/w3c/domts/level1/core/hc_nodeinsertbeforerefchildnonexistent.java106
-rw-r--r--dom/src/test/java/org/w3c/domts/level1/core/hc_nodeinsertbeforerefchildnull.java102
-rw-r--r--dom/src/test/java/org/w3c/domts/level1/core/hc_nodelistindexequalzero.java101
-rw-r--r--dom/src/test/java/org/w3c/domts/level1/core/hc_nodelistindexgetlength.java96
-rw-r--r--dom/src/test/java/org/w3c/domts/level1/core/hc_nodelistindexgetlengthofemptylist.java93
-rw-r--r--dom/src/test/java/org/w3c/domts/level1/core/hc_nodelistindexnotzero.java100
-rw-r--r--dom/src/test/java/org/w3c/domts/level1/core/hc_nodelistreturnfirstitem.java96
-rw-r--r--dom/src/test/java/org/w3c/domts/level1/core/hc_nodelistreturnlastitem.java100
-rw-r--r--dom/src/test/java/org/w3c/domts/level1/core/hc_nodelisttraverselist.java114
-rw-r--r--dom/src/test/java/org/w3c/domts/level1/core/hc_nodeparentnode.java89
-rw-r--r--dom/src/test/java/org/w3c/domts/level1/core/hc_nodeparentnodenull.java86
-rw-r--r--dom/src/test/java/org/w3c/domts/level1/core/hc_noderemovechild.java94
-rw-r--r--dom/src/test/java/org/w3c/domts/level1/core/hc_noderemovechildgetnodename.java99
-rw-r--r--dom/src/test/java/org/w3c/domts/level1/core/hc_noderemovechildnode.java124
-rw-r--r--dom/src/test/java/org/w3c/domts/level1/core/hc_noderemovechildoldchildnonexistent.java102
-rw-r--r--dom/src/test/java/org/w3c/domts/level1/core/hc_nodereplacechild.java99
-rw-r--r--dom/src/test/java/org/w3c/domts/level1/core/hc_nodereplacechildinvalidnodetype.java108
-rw-r--r--dom/src/test/java/org/w3c/domts/level1/core/hc_nodereplacechildnewchilddiffdocument.java109
-rw-r--r--dom/src/test/java/org/w3c/domts/level1/core/hc_nodereplacechildnewchildexists.java121
-rw-r--r--dom/src/test/java/org/w3c/domts/level1/core/hc_nodereplacechildnodeancestor.java106
-rw-r--r--dom/src/test/java/org/w3c/domts/level1/core/hc_nodereplacechildnodename.java99
-rw-r--r--dom/src/test/java/org/w3c/domts/level1/core/hc_nodereplacechildoldchildnonexistent.java104
-rw-r--r--dom/src/test/java/org/w3c/domts/level1/core/hc_nodetextnodeattribute.java89
-rw-r--r--dom/src/test/java/org/w3c/domts/level1/core/hc_nodetextnodename.java85
-rw-r--r--dom/src/test/java/org/w3c/domts/level1/core/hc_nodetextnodetype.java89
-rw-r--r--dom/src/test/java/org/w3c/domts/level1/core/hc_nodetextnodevalue.java90
-rw-r--r--dom/src/test/java/org/w3c/domts/level1/core/hc_nodevalue01.java85
-rw-r--r--dom/src/test/java/org/w3c/domts/level1/core/hc_nodevalue02.java85
-rw-r--r--dom/src/test/java/org/w3c/domts/level1/core/hc_nodevalue03.java101
-rw-r--r--dom/src/test/java/org/w3c/domts/level1/core/hc_nodevalue04.java92
-rw-r--r--dom/src/test/java/org/w3c/domts/level1/core/hc_nodevalue05.java85
-rw-r--r--dom/src/test/java/org/w3c/domts/level1/core/hc_nodevalue06.java83
-rw-r--r--dom/src/test/java/org/w3c/domts/level1/core/hc_nodevalue07.java100
-rw-r--r--dom/src/test/java/org/w3c/domts/level1/core/hc_nodevalue08.java100
-rw-r--r--dom/src/test/java/org/w3c/domts/level1/core/hc_notationsremovenameditem1.java101
-rw-r--r--dom/src/test/java/org/w3c/domts/level1/core/hc_notationssetnameditem1.java109
-rw-r--r--dom/src/test/java/org/w3c/domts/level1/core/hc_textindexsizeerrnegativeoffset.java107
-rw-r--r--dom/src/test/java/org/w3c/domts/level1/core/hc_textindexsizeerroffsetoutofbounds.java103
-rw-r--r--dom/src/test/java/org/w3c/domts/level1/core/hc_textparseintolistofelements.java125
-rw-r--r--dom/src/test/java/org/w3c/domts/level1/core/hc_textsplittextfour.java94
-rw-r--r--dom/src/test/java/org/w3c/domts/level1/core/hc_textsplittextone.java97
-rw-r--r--dom/src/test/java/org/w3c/domts/level1/core/hc_textsplittextthree.java96
-rw-r--r--dom/src/test/java/org/w3c/domts/level1/core/hc_textsplittexttwo.java95
-rw-r--r--dom/src/test/java/org/w3c/domts/level1/core/hc_textwithnomarkup.java94
-rw-r--r--dom/src/test/java/org/w3c/domts/level1/core/namednodemapchildnoderange.java95
-rw-r--r--dom/src/test/java/org/w3c/domts/level1/core/namednodemapgetnameditem.java95
-rw-r--r--dom/src/test/java/org/w3c/domts/level1/core/namednodemapinuseattributeerr.java110
-rw-r--r--dom/src/test/java/org/w3c/domts/level1/core/namednodemapnotfounderr.java103
-rw-r--r--dom/src/test/java/org/w3c/domts/level1/core/namednodemapnumberofnodes.java92
-rw-r--r--dom/src/test/java/org/w3c/domts/level1/core/namednodemapremovenameditem.java107
-rw-r--r--dom/src/test/java/org/w3c/domts/level1/core/namednodemapremovenameditemgetvalue.java109
-rw-r--r--dom/src/test/java/org/w3c/domts/level1/core/namednodemapremovenameditemreturnnodevalue.java96
-rw-r--r--dom/src/test/java/org/w3c/domts/level1/core/namednodemapreturnattrnode.java100
-rw-r--r--dom/src/test/java/org/w3c/domts/level1/core/namednodemapreturnfirstitem.java97
-rw-r--r--dom/src/test/java/org/w3c/domts/level1/core/namednodemapreturnlastitem.java97
-rw-r--r--dom/src/test/java/org/w3c/domts/level1/core/namednodemapreturnnull.java93
-rw-r--r--dom/src/test/java/org/w3c/domts/level1/core/namednodemapsetnameditem.java105
-rw-r--r--dom/src/test/java/org/w3c/domts/level1/core/namednodemapsetnameditemreturnvalue.java104
-rw-r--r--dom/src/test/java/org/w3c/domts/level1/core/namednodemapsetnameditemthatexists.java107
-rw-r--r--dom/src/test/java/org/w3c/domts/level1/core/namednodemapsetnameditemwithnewvalue.java99
-rw-r--r--dom/src/test/java/org/w3c/domts/level1/core/namednodemapwrongdocumenterr.java111
-rw-r--r--dom/src/test/java/org/w3c/domts/level1/core/nodeappendchild.java98
-rw-r--r--dom/src/test/java/org/w3c/domts/level1/core/nodeappendchildchildexists.java110
-rw-r--r--dom/src/test/java/org/w3c/domts/level1/core/nodeappendchilddocfragment.java121
-rw-r--r--dom/src/test/java/org/w3c/domts/level1/core/nodeappendchildgetnodename.java95
-rw-r--r--dom/src/test/java/org/w3c/domts/level1/core/nodeappendchildinvalidnodetype.java103
-rw-r--r--dom/src/test/java/org/w3c/domts/level1/core/nodeappendchildnewchilddiffdocument.java108
-rw-r--r--dom/src/test/java/org/w3c/domts/level1/core/nodeappendchildnodeancestor.java104
-rw-r--r--dom/src/test/java/org/w3c/domts/level1/core/nodeappendchildnomodificationallowederr.java116
-rw-r--r--dom/src/test/java/org/w3c/domts/level1/core/nodeappendchildnomodificationallowederrEE.java100
-rw-r--r--dom/src/test/java/org/w3c/domts/level1/core/nodeattributenodeattribute.java92
-rw-r--r--dom/src/test/java/org/w3c/domts/level1/core/nodeattributenodename.java91
-rw-r--r--dom/src/test/java/org/w3c/domts/level1/core/nodeattributenodetype.java90
-rw-r--r--dom/src/test/java/org/w3c/domts/level1/core/nodeattributenodevalue.java91
-rw-r--r--dom/src/test/java/org/w3c/domts/level1/core/nodecdatasectionnodeattribute.java97
-rw-r--r--dom/src/test/java/org/w3c/domts/level1/core/nodecdatasectionnodename.java98
-rw-r--r--dom/src/test/java/org/w3c/domts/level1/core/nodecdatasectionnodetype.java102
-rw-r--r--dom/src/test/java/org/w3c/domts/level1/core/nodecdatasectionnodevalue.java105
-rw-r--r--dom/src/test/java/org/w3c/domts/level1/core/nodechildnodes.java105
-rw-r--r--dom/src/test/java/org/w3c/domts/level1/core/nodechildnodesappendchild.java93
-rw-r--r--dom/src/test/java/org/w3c/domts/level1/core/nodechildnodesempty.java95
-rw-r--r--dom/src/test/java/org/w3c/domts/level1/core/nodecloneattributescopied.java105
-rw-r--r--dom/src/test/java/org/w3c/domts/level1/core/nodeclonefalsenocopytext.java95
-rw-r--r--dom/src/test/java/org/w3c/domts/level1/core/nodeclonegetparentnull.java91
-rw-r--r--dom/src/test/java/org/w3c/domts/level1/core/nodeclonenodefalse.java98
-rw-r--r--dom/src/test/java/org/w3c/domts/level1/core/nodeclonenodetrue.java135
-rw-r--r--dom/src/test/java/org/w3c/domts/level1/core/nodeclonetruecopytext.java91
-rw-r--r--dom/src/test/java/org/w3c/domts/level1/core/nodecommentnodeattributes.java100
-rw-r--r--dom/src/test/java/org/w3c/domts/level1/core/nodecommentnodename.java96
-rw-r--r--dom/src/test/java/org/w3c/domts/level1/core/nodecommentnodetype.java96
-rw-r--r--dom/src/test/java/org/w3c/domts/level1/core/nodecommentnodevalue.java96
-rw-r--r--dom/src/test/java/org/w3c/domts/level1/core/nodedocumentfragmentnodename.java87
-rw-r--r--dom/src/test/java/org/w3c/domts/level1/core/nodedocumentfragmentnodetype.java87
-rw-r--r--dom/src/test/java/org/w3c/domts/level1/core/nodedocumentfragmentnodevalue.java93
-rw-r--r--dom/src/test/java/org/w3c/domts/level1/core/nodedocumentnodeattribute.java81
-rw-r--r--dom/src/test/java/org/w3c/domts/level1/core/nodedocumentnodename.java84
-rw-r--r--dom/src/test/java/org/w3c/domts/level1/core/nodedocumentnodetype.java83
-rw-r--r--dom/src/test/java/org/w3c/domts/level1/core/nodedocumentnodevalue.java84
-rw-r--r--dom/src/test/java/org/w3c/domts/level1/core/nodedocumenttypenodename.java90
-rw-r--r--dom/src/test/java/org/w3c/domts/level1/core/nodedocumenttypenodetype.java83
-rw-r--r--dom/src/test/java/org/w3c/domts/level1/core/nodedocumenttypenodevalue.java82
-rw-r--r--dom/src/test/java/org/w3c/domts/level1/core/nodeelementnodeattributes.java103
-rw-r--r--dom/src/test/java/org/w3c/domts/level1/core/nodeelementnodename.java94
-rw-r--r--dom/src/test/java/org/w3c/domts/level1/core/nodeelementnodetype.java85
-rw-r--r--dom/src/test/java/org/w3c/domts/level1/core/nodeelementnodevalue.java82
-rw-r--r--dom/src/test/java/org/w3c/domts/level1/core/nodeentitynodeattributes.java89
-rw-r--r--dom/src/test/java/org/w3c/domts/level1/core/nodeentitynodename.java88
-rw-r--r--dom/src/test/java/org/w3c/domts/level1/core/nodeentitynodetype.java89
-rw-r--r--dom/src/test/java/org/w3c/domts/level1/core/nodeentitynodevalue.java89
-rw-r--r--dom/src/test/java/org/w3c/domts/level1/core/nodeentityreferencenodeattributes.java93
-rw-r--r--dom/src/test/java/org/w3c/domts/level1/core/nodeentityreferencenodename.java98
-rw-r--r--dom/src/test/java/org/w3c/domts/level1/core/nodeentityreferencenodetype.java96
-rw-r--r--dom/src/test/java/org/w3c/domts/level1/core/nodeentityreferencenodevalue.java98
-rw-r--r--dom/src/test/java/org/w3c/domts/level1/core/nodeentitysetnodevalue.java90
-rw-r--r--dom/src/test/java/org/w3c/domts/level1/core/nodegetfirstchild.java91
-rw-r--r--dom/src/test/java/org/w3c/domts/level1/core/nodegetfirstchildnull.java94
-rw-r--r--dom/src/test/java/org/w3c/domts/level1/core/nodegetlastchild.java91
-rw-r--r--dom/src/test/java/org/w3c/domts/level1/core/nodegetlastchildnull.java94
-rw-r--r--dom/src/test/java/org/w3c/domts/level1/core/nodegetnextsibling.java91
-rw-r--r--dom/src/test/java/org/w3c/domts/level1/core/nodegetnextsiblingnull.java90
-rw-r--r--dom/src/test/java/org/w3c/domts/level1/core/nodegetownerdocument.java100
-rw-r--r--dom/src/test/java/org/w3c/domts/level1/core/nodegetownerdocumentnull.java80
-rw-r--r--dom/src/test/java/org/w3c/domts/level1/core/nodegetprevioussibling.java91
-rw-r--r--dom/src/test/java/org/w3c/domts/level1/core/nodegetprevioussiblingnull.java90
-rw-r--r--dom/src/test/java/org/w3c/domts/level1/core/nodehaschildnodes.java88
-rw-r--r--dom/src/test/java/org/w3c/domts/level1/core/nodehaschildnodesfalse.java95
-rw-r--r--dom/src/test/java/org/w3c/domts/level1/core/nodeinsertbefore.java140
-rw-r--r--dom/src/test/java/org/w3c/domts/level1/core/nodeinsertbeforedocfragment.java112
-rw-r--r--dom/src/test/java/org/w3c/domts/level1/core/nodeinsertbeforeinvalidnodetype.java107
-rw-r--r--dom/src/test/java/org/w3c/domts/level1/core/nodeinsertbeforenewchilddiffdocument.java109
-rw-r--r--dom/src/test/java/org/w3c/domts/level1/core/nodeinsertbeforenewchildexists.java142
-rw-r--r--dom/src/test/java/org/w3c/domts/level1/core/nodeinsertbeforenodeancestor.java108
-rw-r--r--dom/src/test/java/org/w3c/domts/level1/core/nodeinsertbeforenodename.java98
-rw-r--r--dom/src/test/java/org/w3c/domts/level1/core/nodeinsertbeforenomodificationallowederr.java118
-rw-r--r--dom/src/test/java/org/w3c/domts/level1/core/nodeinsertbeforenomodificationallowederrEE.java102
-rw-r--r--dom/src/test/java/org/w3c/domts/level1/core/nodeinsertbeforerefchildnonexistent.java106
-rw-r--r--dom/src/test/java/org/w3c/domts/level1/core/nodeinsertbeforerefchildnull.java102
-rw-r--r--dom/src/test/java/org/w3c/domts/level1/core/nodelistindexequalzero.java92
-rw-r--r--dom/src/test/java/org/w3c/domts/level1/core/nodelistindexgetlength.java89
-rw-r--r--dom/src/test/java/org/w3c/domts/level1/core/nodelistindexgetlengthofemptylist.java95
-rw-r--r--dom/src/test/java/org/w3c/domts/level1/core/nodelistindexnotzero.java100
-rw-r--r--dom/src/test/java/org/w3c/domts/level1/core/nodelistreturnfirstitem.java96
-rw-r--r--dom/src/test/java/org/w3c/domts/level1/core/nodelistreturnlastitem.java98
-rw-r--r--dom/src/test/java/org/w3c/domts/level1/core/nodelisttraverselist.java128
-rw-r--r--dom/src/test/java/org/w3c/domts/level1/core/nodenotationnodeattributes.java92
-rw-r--r--dom/src/test/java/org/w3c/domts/level1/core/nodenotationnodename.java93
-rw-r--r--dom/src/test/java/org/w3c/domts/level1/core/nodenotationnodetype.java92
-rw-r--r--dom/src/test/java/org/w3c/domts/level1/core/nodenotationnodevalue.java93
-rw-r--r--dom/src/test/java/org/w3c/domts/level1/core/nodeparentnode.java97
-rw-r--r--dom/src/test/java/org/w3c/domts/level1/core/nodeparentnodenull.java86
-rw-r--r--dom/src/test/java/org/w3c/domts/level1/core/nodeprocessinginstructionnodeattributes.java87
-rw-r--r--dom/src/test/java/org/w3c/domts/level1/core/nodeprocessinginstructionnodename.java88
-rw-r--r--dom/src/test/java/org/w3c/domts/level1/core/nodeprocessinginstructionnodetype.java88
-rw-r--r--dom/src/test/java/org/w3c/domts/level1/core/nodeprocessinginstructionnodevalue.java89
-rw-r--r--dom/src/test/java/org/w3c/domts/level1/core/nodeprocessinginstructionsetnodevalue.java89
-rw-r--r--dom/src/test/java/org/w3c/domts/level1/core/noderemovechild.java94
-rw-r--r--dom/src/test/java/org/w3c/domts/level1/core/noderemovechildgetnodename.java101
-rw-r--r--dom/src/test/java/org/w3c/domts/level1/core/noderemovechildnode.java107
-rw-r--r--dom/src/test/java/org/w3c/domts/level1/core/noderemovechildnomodificationallowederr.java114
-rw-r--r--dom/src/test/java/org/w3c/domts/level1/core/noderemovechildnomodificationallowederrEE.java101
-rw-r--r--dom/src/test/java/org/w3c/domts/level1/core/noderemovechildoldchildnonexistent.java103
-rw-r--r--dom/src/test/java/org/w3c/domts/level1/core/nodereplacechild.java99
-rw-r--r--dom/src/test/java/org/w3c/domts/level1/core/nodereplacechildinvalidnodetype.java107
-rw-r--r--dom/src/test/java/org/w3c/domts/level1/core/nodereplacechildnewchilddiffdocument.java109
-rw-r--r--dom/src/test/java/org/w3c/domts/level1/core/nodereplacechildnewchildexists.java139
-rw-r--r--dom/src/test/java/org/w3c/domts/level1/core/nodereplacechildnodeancestor.java108
-rw-r--r--dom/src/test/java/org/w3c/domts/level1/core/nodereplacechildnodename.java104
-rw-r--r--dom/src/test/java/org/w3c/domts/level1/core/nodereplacechildnomodificationallowederr.java115
-rw-r--r--dom/src/test/java/org/w3c/domts/level1/core/nodereplacechildnomodificationallowederrEE.java102
-rw-r--r--dom/src/test/java/org/w3c/domts/level1/core/nodereplacechildoldchildnonexistent.java105
-rw-r--r--dom/src/test/java/org/w3c/domts/level1/core/nodesetnodevaluenomodificationallowederr.java117
-rw-r--r--dom/src/test/java/org/w3c/domts/level1/core/nodesetnodevaluenomodificationallowederrEE.java96
-rw-r--r--dom/src/test/java/org/w3c/domts/level1/core/nodetextnodeattribute.java90
-rw-r--r--dom/src/test/java/org/w3c/domts/level1/core/nodetextnodename.java91
-rw-r--r--dom/src/test/java/org/w3c/domts/level1/core/nodetextnodetype.java90
-rw-r--r--dom/src/test/java/org/w3c/domts/level1/core/nodetextnodevalue.java91
-rw-r--r--dom/src/test/java/org/w3c/domts/level1/core/nodevalue01.java85
-rw-r--r--dom/src/test/java/org/w3c/domts/level1/core/nodevalue02.java85
-rw-r--r--dom/src/test/java/org/w3c/domts/level1/core/nodevalue03.java86
-rw-r--r--dom/src/test/java/org/w3c/domts/level1/core/nodevalue04.java86
-rw-r--r--dom/src/test/java/org/w3c/domts/level1/core/nodevalue05.java85
-rw-r--r--dom/src/test/java/org/w3c/domts/level1/core/nodevalue06.java83
-rw-r--r--dom/src/test/java/org/w3c/domts/level1/core/nodevalue07.java92
-rw-r--r--dom/src/test/java/org/w3c/domts/level1/core/nodevalue08.java92
-rw-r--r--dom/src/test/java/org/w3c/domts/level1/core/nodevalue09.java85
-rw-r--r--dom/src/test/java/org/w3c/domts/level1/core/notationgetnotationname.java90
-rw-r--r--dom/src/test/java/org/w3c/domts/level1/core/notationgetpublicid.java89
-rw-r--r--dom/src/test/java/org/w3c/domts/level1/core/notationgetpublicidnull.java94
-rw-r--r--dom/src/test/java/org/w3c/domts/level1/core/notationgetsystemid.java94
-rw-r--r--dom/src/test/java/org/w3c/domts/level1/core/notationgetsystemidnull.java90
-rw-r--r--dom/src/test/java/org/w3c/domts/level1/core/processinginstructiongetdata.java92
-rw-r--r--dom/src/test/java/org/w3c/domts/level1/core/processinginstructiongettarget.java91
-rw-r--r--dom/src/test/java/org/w3c/domts/level1/core/processinginstructionsetdatanomodificationallowederr.java112
-rw-r--r--dom/src/test/java/org/w3c/domts/level1/core/processinginstructionsetdatanomodificationallowederrEE.java110
-rw-r--r--dom/src/test/java/org/w3c/domts/level1/core/textindexsizeerrnegativeoffset.java108
-rw-r--r--dom/src/test/java/org/w3c/domts/level1/core/textindexsizeerroffsetoutofbounds.java104
-rw-r--r--dom/src/test/java/org/w3c/domts/level1/core/textparseintolistofelements.java126
-rw-r--r--dom/src/test/java/org/w3c/domts/level1/core/textsplittextfour.java95
-rw-r--r--dom/src/test/java/org/w3c/domts/level1/core/textsplittextnomodificationallowederr.java117
-rw-r--r--dom/src/test/java/org/w3c/domts/level1/core/textsplittextnomodificationallowederrEE.java97
-rw-r--r--dom/src/test/java/org/w3c/domts/level1/core/textsplittextone.java98
-rw-r--r--dom/src/test/java/org/w3c/domts/level1/core/textsplittextthree.java97
-rw-r--r--dom/src/test/java/org/w3c/domts/level1/core/textsplittexttwo.java96
-rw-r--r--dom/src/test/java/org/w3c/domts/level1/core/textwithnomarkup.java95
-rw-r--r--dom/src/test/java/org/w3c/domts/level1/html/TestDefaultLS.java51
-rw-r--r--dom/src/test/java/org/w3c/domts/level1/html/TestDefaultLSAltConfig.java51
-rw-r--r--dom/src/test/java/org/w3c/domts/level1/html/TestXercesHTML.java43
-rw-r--r--dom/src/test/java/org/w3c/domts/level2/core/TestBatik.java43
-rw-r--r--dom/src/test/java/org/w3c/domts/level2/core/TestCrimson.java48
-rw-r--r--dom/src/test/java/org/w3c/domts/level2/core/TestCrimsonAltConfig.java48
-rw-r--r--dom/src/test/java/org/w3c/domts/level2/core/TestDOM4J.java43
-rw-r--r--dom/src/test/java/org/w3c/domts/level2/core/TestDefaultLS.java50
-rw-r--r--dom/src/test/java/org/w3c/domts/level2/core/TestDefaultLSAltConfig.java51
-rw-r--r--dom/src/test/java/org/w3c/domts/level2/core/TestDefaultParser.java53
-rw-r--r--dom/src/test/java/org/w3c/domts/level2/core/TestDefaultParserAltConfig.java56
-rw-r--r--dom/src/test/java/org/w3c/domts/level2/core/TestGNUJAXP.java51
-rw-r--r--dom/src/test/java/org/w3c/domts/level2/core/TestGNUJAXPAltConfig.java49
-rw-r--r--dom/src/test/java/org/w3c/domts/level2/core/TestJTidy.java41
-rw-r--r--dom/src/test/java/org/w3c/domts/level2/core/TestOracle.java63
-rw-r--r--dom/src/test/java/org/w3c/domts/level2/core/TestOracleAltConfig.java62
-rw-r--r--dom/src/test/java/org/w3c/domts/level2/core/TestXerces.java49
-rw-r--r--dom/src/test/java/org/w3c/domts/level2/core/TestXercesAltConfig.java48
-rw-r--r--dom/src/test/java/org/w3c/domts/level2/core/alltests.java350
-rw-r--r--dom/src/test/java/org/w3c/domts/level2/core/attrgetownerelement01.java106
-rw-r--r--dom/src/test/java/org/w3c/domts/level2/core/attrgetownerelement02.java100
-rw-r--r--dom/src/test/java/org/w3c/domts/level2/core/attrgetownerelement03.java101
-rw-r--r--dom/src/test/java/org/w3c/domts/level2/core/attrgetownerelement04.java102
-rw-r--r--dom/src/test/java/org/w3c/domts/level2/core/attrgetownerelement05.java109
-rw-r--r--dom/src/test/java/org/w3c/domts/level2/core/createAttributeNS01.java101
-rw-r--r--dom/src/test/java/org/w3c/domts/level2/core/createAttributeNS02.java101
-rw-r--r--dom/src/test/java/org/w3c/domts/level2/core/createAttributeNS03.java132
-rw-r--r--dom/src/test/java/org/w3c/domts/level2/core/createAttributeNS04.java103
-rw-r--r--dom/src/test/java/org/w3c/domts/level2/core/createAttributeNS05.java92
-rw-r--r--dom/src/test/java/org/w3c/domts/level2/core/createAttributeNS06.java93
-rw-r--r--dom/src/test/java/org/w3c/domts/level2/core/createDocument01.java107
-rw-r--r--dom/src/test/java/org/w3c/domts/level2/core/createDocument02.java105
-rw-r--r--dom/src/test/java/org/w3c/domts/level2/core/createDocument03.java104
-rw-r--r--dom/src/test/java/org/w3c/domts/level2/core/createDocument04.java107
-rw-r--r--dom/src/test/java/org/w3c/domts/level2/core/createDocument05.java137
-rw-r--r--dom/src/test/java/org/w3c/domts/level2/core/createDocument06.java108
-rw-r--r--dom/src/test/java/org/w3c/domts/level2/core/createDocument07.java101
-rw-r--r--dom/src/test/java/org/w3c/domts/level2/core/createDocument08.java92
-rw-r--r--dom/src/test/java/org/w3c/domts/level2/core/createDocumentType01.java105
-rw-r--r--dom/src/test/java/org/w3c/domts/level2/core/createDocumentType02.java136
-rw-r--r--dom/src/test/java/org/w3c/domts/level2/core/createDocumentType03.java100
-rw-r--r--dom/src/test/java/org/w3c/domts/level2/core/createDocumentType04.java93
-rw-r--r--dom/src/test/java/org/w3c/domts/level2/core/createElementNS01.java101
-rw-r--r--dom/src/test/java/org/w3c/domts/level2/core/createElementNS02.java101
-rw-r--r--dom/src/test/java/org/w3c/domts/level2/core/createElementNS03.java134
-rw-r--r--dom/src/test/java/org/w3c/domts/level2/core/createElementNS04.java103
-rw-r--r--dom/src/test/java/org/w3c/domts/level2/core/createElementNS05.java92
-rw-r--r--dom/src/test/java/org/w3c/domts/level2/core/createElementNS06.java95
-rw-r--r--dom/src/test/java/org/w3c/domts/level2/core/documentcreateattributeNS01.java95
-rw-r--r--dom/src/test/java/org/w3c/domts/level2/core/documentcreateattributeNS02.java111
-rw-r--r--dom/src/test/java/org/w3c/domts/level2/core/documentcreateattributeNS03.java125
-rw-r--r--dom/src/test/java/org/w3c/domts/level2/core/documentcreateattributeNS04.java120
-rw-r--r--dom/src/test/java/org/w3c/domts/level2/core/documentcreateattributeNS05.java104
-rw-r--r--dom/src/test/java/org/w3c/domts/level2/core/documentcreateattributeNS06.java104
-rw-r--r--dom/src/test/java/org/w3c/domts/level2/core/documentcreateattributeNS07.java111
-rw-r--r--dom/src/test/java/org/w3c/domts/level2/core/documentcreateelementNS01.java115
-rw-r--r--dom/src/test/java/org/w3c/domts/level2/core/documentcreateelementNS02.java110
-rw-r--r--dom/src/test/java/org/w3c/domts/level2/core/documentcreateelementNS05.java111
-rw-r--r--dom/src/test/java/org/w3c/domts/level2/core/documentcreateelementNS06.java105
-rw-r--r--dom/src/test/java/org/w3c/domts/level2/core/documentgetelementbyid01.java101
-rw-r--r--dom/src/test/java/org/w3c/domts/level2/core/documentgetelementsbytagnameNS01.java97
-rw-r--r--dom/src/test/java/org/w3c/domts/level2/core/documentgetelementsbytagnameNS02.java103
-rw-r--r--dom/src/test/java/org/w3c/domts/level2/core/documentgetelementsbytagnameNS03.java88
-rw-r--r--dom/src/test/java/org/w3c/domts/level2/core/documentgetelementsbytagnameNS04.java97
-rw-r--r--dom/src/test/java/org/w3c/domts/level2/core/documentgetelementsbytagnameNS05.java90
-rw-r--r--dom/src/test/java/org/w3c/domts/level2/core/documentimportnode01.java111
-rw-r--r--dom/src/test/java/org/w3c/domts/level2/core/documentimportnode02.java117
-rw-r--r--dom/src/test/java/org/w3c/domts/level2/core/documentimportnode03.java113
-rw-r--r--dom/src/test/java/org/w3c/domts/level2/core/documentimportnode04.java119
-rw-r--r--dom/src/test/java/org/w3c/domts/level2/core/documentimportnode05.java113
-rw-r--r--dom/src/test/java/org/w3c/domts/level2/core/documentimportnode06.java102
-rw-r--r--dom/src/test/java/org/w3c/domts/level2/core/documentimportnode07.java105
-rw-r--r--dom/src/test/java/org/w3c/domts/level2/core/documentimportnode08.java109
-rw-r--r--dom/src/test/java/org/w3c/domts/level2/core/documentimportnode09.java106
-rw-r--r--dom/src/test/java/org/w3c/domts/level2/core/documentimportnode10.java106
-rw-r--r--dom/src/test/java/org/w3c/domts/level2/core/documentimportnode11.java105
-rw-r--r--dom/src/test/java/org/w3c/domts/level2/core/documentimportnode12.java108
-rw-r--r--dom/src/test/java/org/w3c/domts/level2/core/documentimportnode13.java104
-rw-r--r--dom/src/test/java/org/w3c/domts/level2/core/documentimportnode14.java111
-rw-r--r--dom/src/test/java/org/w3c/domts/level2/core/documentimportnode15.java103
-rw-r--r--dom/src/test/java/org/w3c/domts/level2/core/documentimportnode17.java103
-rw-r--r--dom/src/test/java/org/w3c/domts/level2/core/documentimportnode18.java106
-rw-r--r--dom/src/test/java/org/w3c/domts/level2/core/documentimportnode19.java136
-rw-r--r--dom/src/test/java/org/w3c/domts/level2/core/documentimportnode20.java134
-rw-r--r--dom/src/test/java/org/w3c/domts/level2/core/documentimportnode21.java144
-rw-r--r--dom/src/test/java/org/w3c/domts/level2/core/documentimportnode22.java144
-rw-r--r--dom/src/test/java/org/w3c/domts/level2/core/documenttypeinternalSubset01.java92
-rw-r--r--dom/src/test/java/org/w3c/domts/level2/core/documenttypepublicid01.java92
-rw-r--r--dom/src/test/java/org/w3c/domts/level2/core/documenttypesystemid01.java92
-rw-r--r--dom/src/test/java/org/w3c/domts/level2/core/domimplementationcreatedocument03.java127
-rw-r--r--dom/src/test/java/org/w3c/domts/level2/core/domimplementationcreatedocument04.java116
-rw-r--r--dom/src/test/java/org/w3c/domts/level2/core/domimplementationcreatedocument05.java115
-rw-r--r--dom/src/test/java/org/w3c/domts/level2/core/domimplementationcreatedocument07.java112
-rw-r--r--dom/src/test/java/org/w3c/domts/level2/core/domimplementationcreatedocumenttype01.java109
-rw-r--r--dom/src/test/java/org/w3c/domts/level2/core/domimplementationcreatedocumenttype02.java127
-rw-r--r--dom/src/test/java/org/w3c/domts/level2/core/domimplementationcreatedocumenttype04.java131
-rw-r--r--dom/src/test/java/org/w3c/domts/level2/core/domimplementationfeaturecore.java106
-rw-r--r--dom/src/test/java/org/w3c/domts/level2/core/domimplementationfeaturexmlversion2.java106
-rw-r--r--dom/src/test/java/org/w3c/domts/level2/core/domimplementationhasfeature01.java116
-rw-r--r--dom/src/test/java/org/w3c/domts/level2/core/domimplementationhasfeature02.java88
-rw-r--r--dom/src/test/java/org/w3c/domts/level2/core/elementgetattributenodens01.java115
-rw-r--r--dom/src/test/java/org/w3c/domts/level2/core/elementgetattributenodens02.java98
-rw-r--r--dom/src/test/java/org/w3c/domts/level2/core/elementgetattributenodens03.java101
-rw-r--r--dom/src/test/java/org/w3c/domts/level2/core/elementgetattributens02.java99
-rw-r--r--dom/src/test/java/org/w3c/domts/level2/core/elementgetelementsbytagnamens02.java108
-rw-r--r--dom/src/test/java/org/w3c/domts/level2/core/elementgetelementsbytagnamens04.java112
-rw-r--r--dom/src/test/java/org/w3c/domts/level2/core/elementgetelementsbytagnamens05.java109
-rw-r--r--dom/src/test/java/org/w3c/domts/level2/core/elementhasattribute01.java106
-rw-r--r--dom/src/test/java/org/w3c/domts/level2/core/elementhasattribute02.java97
-rw-r--r--dom/src/test/java/org/w3c/domts/level2/core/elementhasattribute03.java95
-rw-r--r--dom/src/test/java/org/w3c/domts/level2/core/elementhasattribute04.java92
-rw-r--r--dom/src/test/java/org/w3c/domts/level2/core/elementhasattributens01.java98
-rw-r--r--dom/src/test/java/org/w3c/domts/level2/core/elementhasattributens02.java101
-rw-r--r--dom/src/test/java/org/w3c/domts/level2/core/elementhasattributens03.java106
-rw-r--r--dom/src/test/java/org/w3c/domts/level2/core/elementremoveattributens01.java100
-rw-r--r--dom/src/test/java/org/w3c/domts/level2/core/elementsetattributenodens01.java117
-rw-r--r--dom/src/test/java/org/w3c/domts/level2/core/elementsetattributenodens02.java110
-rw-r--r--dom/src/test/java/org/w3c/domts/level2/core/elementsetattributenodens03.java113
-rw-r--r--dom/src/test/java/org/w3c/domts/level2/core/elementsetattributenodens04.java109
-rw-r--r--dom/src/test/java/org/w3c/domts/level2/core/elementsetattributenodens05.java109
-rw-r--r--dom/src/test/java/org/w3c/domts/level2/core/elementsetattributenodens06.java114
-rw-r--r--dom/src/test/java/org/w3c/domts/level2/core/elementsetattributens01.java100
-rw-r--r--dom/src/test/java/org/w3c/domts/level2/core/elementsetattributens02.java103
-rw-r--r--dom/src/test/java/org/w3c/domts/level2/core/elementsetattributens03.java106
-rw-r--r--dom/src/test/java/org/w3c/domts/level2/core/elementsetattributens04.java111
-rw-r--r--dom/src/test/java/org/w3c/domts/level2/core/elementsetattributens05.java98
-rw-r--r--dom/src/test/java/org/w3c/domts/level2/core/elementsetattributens08.java109
-rw-r--r--dom/src/test/java/org/w3c/domts/level2/core/elementsetattributensurinull.java116
-rw-r--r--dom/src/test/java/org/w3c/domts/level2/core/getAttributeNS01.java102
-rw-r--r--dom/src/test/java/org/w3c/domts/level2/core/getAttributeNS02.java103
-rw-r--r--dom/src/test/java/org/w3c/domts/level2/core/getAttributeNS03.java96
-rw-r--r--dom/src/test/java/org/w3c/domts/level2/core/getAttributeNS04.java101
-rw-r--r--dom/src/test/java/org/w3c/domts/level2/core/getAttributeNS05.java99
-rw-r--r--dom/src/test/java/org/w3c/domts/level2/core/getAttributeNodeNS01.java96
-rw-r--r--dom/src/test/java/org/w3c/domts/level2/core/getAttributeNodeNS02.java101
-rw-r--r--dom/src/test/java/org/w3c/domts/level2/core/getElementById01.java96
-rw-r--r--dom/src/test/java/org/w3c/domts/level2/core/getElementById02.java88
-rw-r--r--dom/src/test/java/org/w3c/domts/level2/core/getElementsByTagNameNS01.java90
-rw-r--r--dom/src/test/java/org/w3c/domts/level2/core/getElementsByTagNameNS02.java104
-rw-r--r--dom/src/test/java/org/w3c/domts/level2/core/getElementsByTagNameNS03.java121
-rw-r--r--dom/src/test/java/org/w3c/domts/level2/core/getElementsByTagNameNS04.java112
-rw-r--r--dom/src/test/java/org/w3c/domts/level2/core/getElementsByTagNameNS05.java92
-rw-r--r--dom/src/test/java/org/w3c/domts/level2/core/getElementsByTagNameNS06.java96
-rw-r--r--dom/src/test/java/org/w3c/domts/level2/core/getElementsByTagNameNS07.java96
-rw-r--r--dom/src/test/java/org/w3c/domts/level2/core/getElementsByTagNameNS08.java88
-rw-r--r--dom/src/test/java/org/w3c/domts/level2/core/getElementsByTagNameNS09.java108
-rw-r--r--dom/src/test/java/org/w3c/domts/level2/core/getElementsByTagNameNS10.java124
-rw-r--r--dom/src/test/java/org/w3c/domts/level2/core/getElementsByTagNameNS11.java114
-rw-r--r--dom/src/test/java/org/w3c/domts/level2/core/getElementsByTagNameNS12.java91
-rw-r--r--dom/src/test/java/org/w3c/domts/level2/core/getElementsByTagNameNS13.java97
-rw-r--r--dom/src/test/java/org/w3c/domts/level2/core/getElementsByTagNameNS14.java97
-rw-r--r--dom/src/test/java/org/w3c/domts/level2/core/getNamedItemNS01.java103
-rw-r--r--dom/src/test/java/org/w3c/domts/level2/core/getNamedItemNS02.java99
-rw-r--r--dom/src/test/java/org/w3c/domts/level2/core/getNamedItemNS03.java91
-rw-r--r--dom/src/test/java/org/w3c/domts/level2/core/getNamedItemNS04.java91
-rw-r--r--dom/src/test/java/org/w3c/domts/level2/core/hasAttribute01.java89
-rw-r--r--dom/src/test/java/org/w3c/domts/level2/core/hasAttribute02.java96
-rw-r--r--dom/src/test/java/org/w3c/domts/level2/core/hasAttribute03.java89
-rw-r--r--dom/src/test/java/org/w3c/domts/level2/core/hasAttribute04.java96
-rw-r--r--dom/src/test/java/org/w3c/domts/level2/core/hasAttributeNS01.java94
-rw-r--r--dom/src/test/java/org/w3c/domts/level2/core/hasAttributeNS02.java93
-rw-r--r--dom/src/test/java/org/w3c/domts/level2/core/hasAttributeNS03.java94
-rw-r--r--dom/src/test/java/org/w3c/domts/level2/core/hasAttributeNS04.java101
-rw-r--r--dom/src/test/java/org/w3c/domts/level2/core/hasAttributeNS05.java99
-rw-r--r--dom/src/test/java/org/w3c/domts/level2/core/hasAttributes01.java89
-rw-r--r--dom/src/test/java/org/w3c/domts/level2/core/hasAttributes02.java89
-rw-r--r--dom/src/test/java/org/w3c/domts/level2/core/hc_entitiesremovenameditemns1.java104
-rw-r--r--dom/src/test/java/org/w3c/domts/level2/core/hc_entitiessetnameditemns1.java106
-rw-r--r--dom/src/test/java/org/w3c/domts/level2/core/hc_namednodemapinvalidtype1.java95
-rw-r--r--dom/src/test/java/org/w3c/domts/level2/core/hc_nodedocumentfragmentnormalize1.java92
-rw-r--r--dom/src/test/java/org/w3c/domts/level2/core/hc_nodedocumentfragmentnormalize2.java87
-rw-r--r--dom/src/test/java/org/w3c/domts/level2/core/hc_notationsremovenameditemns1.java104
-rw-r--r--dom/src/test/java/org/w3c/domts/level2/core/hc_notationssetnameditemns1.java106
-rw-r--r--dom/src/test/java/org/w3c/domts/level2/core/importNode01.java132
-rw-r--r--dom/src/test/java/org/w3c/domts/level2/core/importNode02.java104
-rw-r--r--dom/src/test/java/org/w3c/domts/level2/core/importNode03.java105
-rw-r--r--dom/src/test/java/org/w3c/domts/level2/core/importNode04.java106
-rw-r--r--dom/src/test/java/org/w3c/domts/level2/core/importNode05.java111
-rw-r--r--dom/src/test/java/org/w3c/domts/level2/core/importNode06.java108
-rw-r--r--dom/src/test/java/org/w3c/domts/level2/core/importNode07.java116
-rw-r--r--dom/src/test/java/org/w3c/domts/level2/core/importNode08.java105
-rw-r--r--dom/src/test/java/org/w3c/domts/level2/core/importNode09.java117
-rw-r--r--dom/src/test/java/org/w3c/domts/level2/core/importNode10.java108
-rw-r--r--dom/src/test/java/org/w3c/domts/level2/core/importNode11.java106
-rw-r--r--dom/src/test/java/org/w3c/domts/level2/core/importNode12.java114
-rw-r--r--dom/src/test/java/org/w3c/domts/level2/core/importNode13.java111
-rw-r--r--dom/src/test/java/org/w3c/domts/level2/core/importNode14.java109
-rw-r--r--dom/src/test/java/org/w3c/domts/level2/core/importNode15.java105
-rw-r--r--dom/src/test/java/org/w3c/domts/level2/core/importNode16.java104
-rw-r--r--dom/src/test/java/org/w3c/domts/level2/core/importNode17.java102
-rw-r--r--dom/src/test/java/org/w3c/domts/level2/core/internalSubset01.java90
-rw-r--r--dom/src/test/java/org/w3c/domts/level2/core/isSupported01.java94
-rw-r--r--dom/src/test/java/org/w3c/domts/level2/core/isSupported02.java94
-rw-r--r--dom/src/test/java/org/w3c/domts/level2/core/isSupported04.java96
-rw-r--r--dom/src/test/java/org/w3c/domts/level2/core/isSupported05.java96
-rw-r--r--dom/src/test/java/org/w3c/domts/level2/core/isSupported06.java96
-rw-r--r--dom/src/test/java/org/w3c/domts/level2/core/isSupported07.java96
-rw-r--r--dom/src/test/java/org/w3c/domts/level2/core/isSupported09.java96
-rw-r--r--dom/src/test/java/org/w3c/domts/level2/core/isSupported10.java96
-rw-r--r--dom/src/test/java/org/w3c/domts/level2/core/isSupported11.java96
-rw-r--r--dom/src/test/java/org/w3c/domts/level2/core/isSupported12.java122
-rw-r--r--dom/src/test/java/org/w3c/domts/level2/core/isSupported13.java84
-rw-r--r--dom/src/test/java/org/w3c/domts/level2/core/isSupported14.java86
-rw-r--r--dom/src/test/java/org/w3c/domts/level2/core/localName01.java102
-rw-r--r--dom/src/test/java/org/w3c/domts/level2/core/localName02.java91
-rw-r--r--dom/src/test/java/org/w3c/domts/level2/core/localName03.java95
-rw-r--r--dom/src/test/java/org/w3c/domts/level2/core/localName04.java98
-rw-r--r--dom/src/test/java/org/w3c/domts/level2/core/namednodemapgetnameditemns01.java108
-rw-r--r--dom/src/test/java/org/w3c/domts/level2/core/namednodemapgetnameditemns02.java101
-rw-r--r--dom/src/test/java/org/w3c/domts/level2/core/namednodemapgetnameditemns03.java105
-rw-r--r--dom/src/test/java/org/w3c/domts/level2/core/namednodemapgetnameditemns04.java106
-rw-r--r--dom/src/test/java/org/w3c/domts/level2/core/namednodemapgetnameditemns05.java99
-rw-r--r--dom/src/test/java/org/w3c/domts/level2/core/namednodemapgetnameditemns06.java109
-rw-r--r--dom/src/test/java/org/w3c/domts/level2/core/namednodemapremovenameditemns01.java98
-rw-r--r--dom/src/test/java/org/w3c/domts/level2/core/namednodemapremovenameditemns02.java109
-rw-r--r--dom/src/test/java/org/w3c/domts/level2/core/namednodemapremovenameditemns03.java106
-rw-r--r--dom/src/test/java/org/w3c/domts/level2/core/namednodemapremovenameditemns04.java102
-rw-r--r--dom/src/test/java/org/w3c/domts/level2/core/namednodemapremovenameditemns05.java131
-rw-r--r--dom/src/test/java/org/w3c/domts/level2/core/namednodemapremovenameditemns06.java107
-rw-r--r--dom/src/test/java/org/w3c/domts/level2/core/namednodemapremovenameditemns07.java107
-rw-r--r--dom/src/test/java/org/w3c/domts/level2/core/namednodemapremovenameditemns08.java110
-rw-r--r--dom/src/test/java/org/w3c/domts/level2/core/namednodemapremovenameditemns09.java102
-rw-r--r--dom/src/test/java/org/w3c/domts/level2/core/namednodemapsetnameditemns01.java106
-rw-r--r--dom/src/test/java/org/w3c/domts/level2/core/namednodemapsetnameditemns02.java104
-rw-r--r--dom/src/test/java/org/w3c/domts/level2/core/namednodemapsetnameditemns03.java125
-rw-r--r--dom/src/test/java/org/w3c/domts/level2/core/namednodemapsetnameditemns04.java120
-rw-r--r--dom/src/test/java/org/w3c/domts/level2/core/namednodemapsetnameditemns05.java125
-rw-r--r--dom/src/test/java/org/w3c/domts/level2/core/namednodemapsetnameditemns06.java110
-rw-r--r--dom/src/test/java/org/w3c/domts/level2/core/namednodemapsetnameditemns07.java116
-rw-r--r--dom/src/test/java/org/w3c/domts/level2/core/namednodemapsetnameditemns08.java112
-rw-r--r--dom/src/test/java/org/w3c/domts/level2/core/namednodemapsetnameditemns09.java118
-rw-r--r--dom/src/test/java/org/w3c/domts/level2/core/namednodemapsetnameditemns10.java116
-rw-r--r--dom/src/test/java/org/w3c/domts/level2/core/namednodemapsetnameditemns11.java117
-rw-r--r--dom/src/test/java/org/w3c/domts/level2/core/namespaceURI01.java102
-rw-r--r--dom/src/test/java/org/w3c/domts/level2/core/namespaceURI02.java100
-rw-r--r--dom/src/test/java/org/w3c/domts/level2/core/namespaceURI03.java97
-rw-r--r--dom/src/test/java/org/w3c/domts/level2/core/namespaceURI04.java90
-rw-r--r--dom/src/test/java/org/w3c/domts/level2/core/nodegetlocalname03.java109
-rw-r--r--dom/src/test/java/org/w3c/domts/level2/core/nodegetnamespaceuri03.java113
-rw-r--r--dom/src/test/java/org/w3c/domts/level2/core/nodegetownerdocument01.java98
-rw-r--r--dom/src/test/java/org/w3c/domts/level2/core/nodegetownerdocument02.java106
-rw-r--r--dom/src/test/java/org/w3c/domts/level2/core/nodegetprefix03.java109
-rw-r--r--dom/src/test/java/org/w3c/domts/level2/core/nodehasattributes01.java92
-rw-r--r--dom/src/test/java/org/w3c/domts/level2/core/nodehasattributes02.java99
-rw-r--r--dom/src/test/java/org/w3c/domts/level2/core/nodehasattributes03.java88
-rw-r--r--dom/src/test/java/org/w3c/domts/level2/core/nodehasattributes04.java111
-rw-r--r--dom/src/test/java/org/w3c/domts/level2/core/nodeissupported01.java116
-rw-r--r--dom/src/test/java/org/w3c/domts/level2/core/nodeissupported02.java116
-rw-r--r--dom/src/test/java/org/w3c/domts/level2/core/nodeissupported03.java101
-rw-r--r--dom/src/test/java/org/w3c/domts/level2/core/nodeissupported04.java89
-rw-r--r--dom/src/test/java/org/w3c/domts/level2/core/nodeissupported05.java101
-rw-r--r--dom/src/test/java/org/w3c/domts/level2/core/nodenormalize01.java193
-rw-r--r--dom/src/test/java/org/w3c/domts/level2/core/nodesetprefix01.java103
-rw-r--r--dom/src/test/java/org/w3c/domts/level2/core/nodesetprefix02.java108
-rw-r--r--dom/src/test/java/org/w3c/domts/level2/core/nodesetprefix03.java100
-rw-r--r--dom/src/test/java/org/w3c/domts/level2/core/nodesetprefix04.java108
-rw-r--r--dom/src/test/java/org/w3c/domts/level2/core/nodesetprefix05.java110
-rw-r--r--dom/src/test/java/org/w3c/domts/level2/core/nodesetprefix06.java95
-rw-r--r--dom/src/test/java/org/w3c/domts/level2/core/nodesetprefix07.java96
-rw-r--r--dom/src/test/java/org/w3c/domts/level2/core/nodesetprefix08.java98
-rw-r--r--dom/src/test/java/org/w3c/domts/level2/core/nodesetprefix09.java94
-rw-r--r--dom/src/test/java/org/w3c/domts/level2/core/normalize01.java102
-rw-r--r--dom/src/test/java/org/w3c/domts/level2/core/ownerDocument01.java86
-rw-r--r--dom/src/test/java/org/w3c/domts/level2/core/ownerElement01.java96
-rw-r--r--dom/src/test/java/org/w3c/domts/level2/core/ownerElement02.java89
-rw-r--r--dom/src/test/java/org/w3c/domts/level2/core/prefix01.java91
-rw-r--r--dom/src/test/java/org/w3c/domts/level2/core/prefix02.java96
-rw-r--r--dom/src/test/java/org/w3c/domts/level2/core/prefix03.java97
-rw-r--r--dom/src/test/java/org/w3c/domts/level2/core/prefix04.java90
-rw-r--r--dom/src/test/java/org/w3c/domts/level2/core/prefix05.java106
-rw-r--r--dom/src/test/java/org/w3c/domts/level2/core/prefix06.java107
-rw-r--r--dom/src/test/java/org/w3c/domts/level2/core/prefix07.java100
-rw-r--r--dom/src/test/java/org/w3c/domts/level2/core/prefix08.java122
-rw-r--r--dom/src/test/java/org/w3c/domts/level2/core/prefix09.java110
-rw-r--r--dom/src/test/java/org/w3c/domts/level2/core/prefix10.java102
-rw-r--r--dom/src/test/java/org/w3c/domts/level2/core/prefix11.java103
-rw-r--r--dom/src/test/java/org/w3c/domts/level2/core/publicId01.java89
-rw-r--r--dom/src/test/java/org/w3c/domts/level2/core/removeAttributeNS01.java123
-rw-r--r--dom/src/test/java/org/w3c/domts/level2/core/removeAttributeNS02.java118
-rw-r--r--dom/src/test/java/org/w3c/domts/level2/core/removeNamedItemNS01.java105
-rw-r--r--dom/src/test/java/org/w3c/domts/level2/core/removeNamedItemNS02.java109
-rw-r--r--dom/src/test/java/org/w3c/domts/level2/core/removeNamedItemNS03.java130
-rw-r--r--dom/src/test/java/org/w3c/domts/level2/core/setAttributeNS01.java103
-rw-r--r--dom/src/test/java/org/w3c/domts/level2/core/setAttributeNS02.java102
-rw-r--r--dom/src/test/java/org/w3c/domts/level2/core/setAttributeNS03.java121
-rw-r--r--dom/src/test/java/org/w3c/domts/level2/core/setAttributeNS04.java116
-rw-r--r--dom/src/test/java/org/w3c/domts/level2/core/setAttributeNS05.java102
-rw-r--r--dom/src/test/java/org/w3c/domts/level2/core/setAttributeNS06.java104
-rw-r--r--dom/src/test/java/org/w3c/domts/level2/core/setAttributeNS07.java105
-rw-r--r--dom/src/test/java/org/w3c/domts/level2/core/setAttributeNS09.java111
-rw-r--r--dom/src/test/java/org/w3c/domts/level2/core/setAttributeNS10.java96
-rw-r--r--dom/src/test/java/org/w3c/domts/level2/core/setAttributeNodeNS01.java118
-rw-r--r--dom/src/test/java/org/w3c/domts/level2/core/setAttributeNodeNS02.java127
-rw-r--r--dom/src/test/java/org/w3c/domts/level2/core/setAttributeNodeNS03.java100
-rw-r--r--dom/src/test/java/org/w3c/domts/level2/core/setAttributeNodeNS04.java106
-rw-r--r--dom/src/test/java/org/w3c/domts/level2/core/setAttributeNodeNS05.java114
-rw-r--r--dom/src/test/java/org/w3c/domts/level2/core/setNamedItemNS01.java118
-rw-r--r--dom/src/test/java/org/w3c/domts/level2/core/setNamedItemNS02.java114
-rw-r--r--dom/src/test/java/org/w3c/domts/level2/core/setNamedItemNS03.java105
-rw-r--r--dom/src/test/java/org/w3c/domts/level2/core/setNamedItemNS04.java132
-rw-r--r--dom/src/test/java/org/w3c/domts/level2/core/setNamedItemNS05.java103
-rw-r--r--dom/src/test/java/org/w3c/domts/level2/core/systemId01.java90
-rw-r--r--dom/src/test/java/org/w3c/domts/level2/events/TestBatik.java43
-rw-r--r--dom/src/test/java/org/w3c/domts/level2/events/TestDefaultLS.java51
-rw-r--r--dom/src/test/java/org/w3c/domts/level2/events/TestDefaultLSAltConfig.java51
-rw-r--r--dom/src/test/java/org/w3c/domts/level2/events/TestDefaultParser.java43
-rw-r--r--dom/src/test/java/org/w3c/domts/level2/events/TestDefaultParserAltConfig.java43
-rw-r--r--dom/src/test/java/org/w3c/domts/level2/events/TestOracle.java63
-rw-r--r--dom/src/test/java/org/w3c/domts/level2/events/TestOracleAltConfig.java62
-rw-r--r--dom/src/test/java/org/w3c/domts/level2/events/TestXerces.java49
-rw-r--r--dom/src/test/java/org/w3c/domts/level2/events/TestXercesAltConfig.java48
-rw-r--r--dom/src/test/java/org/w3c/domts/level2/html/TestDefaultLS.java51
-rw-r--r--dom/src/test/java/org/w3c/domts/level2/html/TestDefaultLSAltConfig.java51
-rw-r--r--dom/src/test/java/org/w3c/domts/level2/html/TestXercesHTML.java43
-rw-r--r--dom/src/test/java/org/w3c/domts/level3/core/TestBatik.java45
-rw-r--r--dom/src/test/java/org/w3c/domts/level3/core/TestDefaultLS.java57
-rw-r--r--dom/src/test/java/org/w3c/domts/level3/core/TestDefaultLSAltConfig.java57
-rw-r--r--dom/src/test/java/org/w3c/domts/level3/core/TestDefaultParser.java53
-rw-r--r--dom/src/test/java/org/w3c/domts/level3/core/TestDefaultParserAltConfig.java56
-rw-r--r--dom/src/test/java/org/w3c/domts/level3/core/TestOracle.java63
-rw-r--r--dom/src/test/java/org/w3c/domts/level3/core/TestOracleAltConfig.java62
-rw-r--r--dom/src/test/java/org/w3c/domts/level3/core/TestXerces.java58
-rw-r--r--dom/src/test/java/org/w3c/domts/level3/core/TestXercesAltConfig.java58
-rw-r--r--dom/src/test/java/org/w3c/domts/level3/ls/TestBatik.java45
-rw-r--r--dom/src/test/java/org/w3c/domts/level3/ls/TestDefaultLS.java57
-rw-r--r--dom/src/test/java/org/w3c/domts/level3/ls/TestDefaultParser.java53
-rw-r--r--dom/src/test/java/org/w3c/domts/level3/ls/TestOracle.java66
-rw-r--r--dom/src/test/java/org/w3c/domts/level3/ls/TestXerces.java56
-rw-r--r--dom/src/test/java/org/w3c/domts/level3/validation/TestBatik.java45
-rw-r--r--dom/src/test/java/org/w3c/domts/level3/validation/TestDefaultLS.java57
-rw-r--r--dom/src/test/java/org/w3c/domts/level3/validation/TestDefaultLSAltConfig.java57
-rw-r--r--dom/src/test/java/org/w3c/domts/level3/validation/TestDefaultParser.java53
-rw-r--r--dom/src/test/java/org/w3c/domts/level3/validation/TestDefaultParserAltConfig.java56
-rw-r--r--dom/src/test/java/org/w3c/domts/level3/validation/TestOracle.java63
-rw-r--r--dom/src/test/java/org/w3c/domts/level3/validation/TestOracleAltConfig.java62
-rw-r--r--dom/src/test/java/org/w3c/domts/level3/xpath/TestBatik.java45
-rw-r--r--dom/src/test/java/org/w3c/domts/level3/xpath/TestDefaultLS.java57
-rw-r--r--dom/src/test/java/org/w3c/domts/level3/xpath/TestDefaultLSAltConfig.java57
-rw-r--r--dom/src/test/java/org/w3c/domts/level3/xpath/TestDefaultParser.java53
-rw-r--r--dom/src/test/java/org/w3c/domts/level3/xpath/TestDefaultParserAltConfig.java56
-rw-r--r--dom/src/test/java/org/w3c/domts/level3/xpath/TestXalan.java48
-rw-r--r--dom/src/test/java/org/w3c/domts/level3/xpath/TestXalanAltConfig.java47
-rw-r--r--dom/src/test/java/tests/api/org/w3c/dom/AllTests.java36
-rw-r--r--dom/src/test/java/tests/api/org/w3c/dom/AllTests_Level1.java53
-rw-r--r--dom/src/test/java/tests/api/org/w3c/dom/AllTests_Level2.java53
-rw-r--r--dom/src/test/java/tests/dom/AllTests.java31
-rw-r--r--dom/src/test/resources/META-INF/MANIFEST.MF16
-rw-r--r--dom/src/test/resources/build.xml106
-rw-r--r--dom/src/test/resources/hc_nodtdstaff.html10
-rw-r--r--dom/src/test/resources/hc_nodtdstaff.svg10
-rw-r--r--dom/src/test/resources/hc_nodtdstaff.xhtml10
-rw-r--r--dom/src/test/resources/hc_nodtdstaff.xml10
-rw-r--r--dom/src/test/resources/hc_staff.html48
-rw-r--r--dom/src/test/resources/hc_staff.svg72
-rw-r--r--dom/src/test/resources/hc_staff.xhtml60
-rw-r--r--dom/src/test/resources/hc_staff.xml60
-rw-r--r--dom/src/test/resources/internalSubset01.js0
-rw-r--r--dom/src/test/resources/nodtdstaff.svg11
-rw-r--r--dom/src/test/resources/nodtdstaff.xml11
-rw-r--r--dom/src/test/resources/staff.dtd17
-rw-r--r--dom/src/test/resources/staff.svg72
-rw-r--r--dom/src/test/resources/staff.xml57
-rw-r--r--dom/src/test/resources/staff2.dtd24
-rw-r--r--dom/src/test/resources/staff2.svg13
-rw-r--r--dom/src/test/resources/staff2.xml13
-rw-r--r--dom/src/test/resources/staffNS.dtd45
-rw-r--r--dom/src/test/resources/staffNS.svg73
-rw-r--r--dom/src/test/resources/staffNS.xml59
-rw-r--r--dom/src/test/resources/svgtest.js0
-rw-r--r--dom/src/test/resources/svgunit.js0
-rw-r--r--dom/src/test/resources/xhtml1-strict.dtd65
951 files changed, 93288 insertions, 0 deletions
diff --git a/dom/src/test/java/README b/dom/src/test/java/README
new file mode 100644
index 0000000..0b9d9d4
--- /dev/null
+++ b/dom/src/test/java/README
@@ -0,0 +1,10 @@
+all classes under org.w3c.domts are from the official w3c test suite.
+Level 1 Core tests and Level 2 Core tests from
+http://www.w3.org/DOM/Test/
+
+additions made:
+all additions under org.w3c.dom.* and org.w3c.dom.events.*
+
+
+removals:
+org/w3c/domts/JUnitRunner.java
diff --git a/dom/src/test/java/org/w3c/dom/DOMError.java b/dom/src/test/java/org/w3c/dom/DOMError.java
new file mode 100644
index 0000000..e70ec6b
--- /dev/null
+++ b/dom/src/test/java/org/w3c/dom/DOMError.java
@@ -0,0 +1,85 @@
+/*
+ * Copyright (C) 2008 Google Inc.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.w3c.dom;
+public interface DOMError {
+ // ErrorSeverity
+ /**
+ * The severity of the error described by the <code>DOMError</code> is
+ * warning. A <code>SEVERITY_WARNING</code> will not cause the
+ * processing to stop, unless <code>DOMErrorHandler.handleError()</code>
+ * returns <code>false</code>.
+ */
+ public static final short SEVERITY_WARNING = 1;
+ /**
+ * The severity of the error described by the <code>DOMError</code> is
+ * error. A <code>SEVERITY_ERROR</code> may not cause the processing to
+ * stop if the error can be recovered, unless
+ * <code>DOMErrorHandler.handleError()</code> returns <code>false</code>.
+ */
+ public static final short SEVERITY_ERROR = 2;
+ /**
+ * The severity of the error described by the <code>DOMError</code> is
+ * fatal error. A <code>SEVERITY_FATAL_ERROR</code> will cause the
+ * normal processing to stop. The return value of
+ * <code>DOMErrorHandler.handleError()</code> is ignored unless the
+ * implementation chooses to continue, in which case the behavior
+ * becomes undefined.
+ */
+ public static final short SEVERITY_FATAL_ERROR = 3;
+
+ /**
+ * The severity of the error, either <code>SEVERITY_WARNING</code>,
+ * <code>SEVERITY_ERROR</code>, or <code>SEVERITY_FATAL_ERROR</code>.
+ */
+ public short getSeverity();
+
+ /**
+ * An implementation specific string describing the error that occurred.
+ */
+ public String getMessage();
+
+ /**
+ * A <code>DOMString</code> indicating which related data is expected in
+ * <code>relatedData</code>. Users should refer to the specification of
+ * the error in order to find its <code>DOMString</code> type and
+ * <code>relatedData</code> definitions if any.
+ * <p ><b>Note:</b> As an example,
+ * <code>Document.normalizeDocument()</code> does generate warnings when
+ * the "split-cdata-sections" parameter is in use. Therefore, the method
+ * generates a <code>SEVERITY_WARNING</code> with <code>type</code>
+ * <code>"cdata-sections-splitted"</code> and the first
+ * <code>CDATASection</code> node in document order resulting from the
+ * split is returned by the <code>relatedData</code> attribute.
+ */
+ public String getType();
+
+ /**
+ * The related platform dependent exception if any.
+ */
+ public Object getRelatedException();
+
+ /**
+ * The related <code>DOMError.type</code> dependent data if any.
+ */
+ public Object getRelatedData();
+
+ /**
+ * The location of the error.
+ */
+ public DOMLocator getLocation();
+
+} \ No newline at end of file
diff --git a/dom/src/test/java/org/w3c/dom/DOMErrorHandler.java b/dom/src/test/java/org/w3c/dom/DOMErrorHandler.java
new file mode 100644
index 0000000..7b1366a
--- /dev/null
+++ b/dom/src/test/java/org/w3c/dom/DOMErrorHandler.java
@@ -0,0 +1,34 @@
+/*
+ * Copyright (C) 2008 Google Inc.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.w3c.dom;
+public interface DOMErrorHandler {
+ /**
+ * This method is called on the error handler when an error occurs.
+ * <br> If an exception is thrown from this method, it is considered to be
+ * equivalent of returning <code>true</code>.
+ * @param error The error object that describes the error. This object
+ * may be reused by the DOM implementation across multiple calls to
+ * the <code>handleError</code> method.
+ * @return If the <code>handleError</code> method returns
+ * <code>false</code>, the DOM implementation should stop the current
+ * processing when possible. If the method returns <code>true</code>,
+ * the processing may continue depending on
+ * <code>DOMError.severity</code>.
+ */
+ public boolean handleError(DOMError error);
+
+} \ No newline at end of file
diff --git a/dom/src/test/java/org/w3c/dom/DOMLocator.java b/dom/src/test/java/org/w3c/dom/DOMLocator.java
new file mode 100644
index 0000000..876636f
--- /dev/null
+++ b/dom/src/test/java/org/w3c/dom/DOMLocator.java
@@ -0,0 +1,62 @@
+/*
+ * Copyright (C) 2008 Google Inc.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.w3c.dom;
+
+/**
+ * <code>DOMLocator</code> is an interface that describes a location (e.g.
+ * where an error occurred).
+ * <p>See also the <a href='http://www.w3.org/TR/2004/REC-DOM-Level-3-Core-20040407'>Document Object Model (DOM) Level 3 Core Specification</a>.
+ * @since DOM Level 3
+ */
+public interface DOMLocator {
+ /**
+ * The line number this locator is pointing to, or <code>-1</code> if
+ * there is no column number available.
+ */
+ public int getLineNumber();
+
+ /**
+ * The column number this locator is pointing to, or <code>-1</code> if
+ * there is no column number available.
+ */
+ public int getColumnNumber();
+
+ /**
+ * The byte offset into the input source this locator is pointing to or
+ * <code>-1</code> if there is no byte offset available.
+ */
+ public int getByteOffset();
+
+ /**
+ * The UTF-16, as defined in [Unicode] and Amendment 1 of [ISO/IEC 10646], offset into the input source this locator is pointing to or
+ * <code>-1</code> if there is no UTF-16 offset available.
+ */
+ public int getUtf16Offset();
+
+ /**
+ * The node this locator is pointing to, or <code>null</code> if no node
+ * is available.
+ */
+ public Node getRelatedNode();
+
+ /**
+ * The URI this locator is pointing to, or <code>null</code> if no URI is
+ * available.
+ */
+ public String getUri();
+
+}
diff --git a/dom/src/test/java/org/w3c/dom/UserDataHandler.java b/dom/src/test/java/org/w3c/dom/UserDataHandler.java
new file mode 100644
index 0000000..0901f4a
--- /dev/null
+++ b/dom/src/test/java/org/w3c/dom/UserDataHandler.java
@@ -0,0 +1,65 @@
+/*
+ * Copyright (C) 2008 Google Inc.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.w3c.dom;
+public interface UserDataHandler {
+ // OperationType
+ /**
+ * The node is cloned, using <code>Node.cloneNode()</code>.
+ */
+ public static final short NODE_CLONED = 1;
+ /**
+ * The node is imported, using <code>Document.importNode()</code>.
+ */
+ public static final short NODE_IMPORTED = 2;
+ /**
+ * The node is deleted.
+ * <p ><b>Note:</b> This may not be supported or may not be reliable in
+ * certain environments, such as Java, where the implementation has no
+ * real control over when objects are actually deleted.
+ */
+ public static final short NODE_DELETED = 3;
+ /**
+ * The node is renamed, using <code>Document.renameNode()</code>.
+ */
+ public static final short NODE_RENAMED = 4;
+ /**
+ * The node is adopted, using <code>Document.adoptNode()</code>.
+ */
+ public static final short NODE_ADOPTED = 5;
+
+ /**
+ * This method is called whenever the node for which this handler is
+ * registered is imported or cloned.
+ * <br> DOM applications must not raise exceptions in a
+ * <code>UserDataHandler</code>. The effect of throwing exceptions from
+ * the handler is DOM implementation dependent.
+ * @param operation Specifies the type of operation that is being
+ * performed on the node.
+ * @param key Specifies the key for which this handler is being called.
+ * @param data Specifies the data for which this handler is being called.
+ * @param src Specifies the node being cloned, adopted, imported, or
+ * renamed. This is <code>null</code> when the node is being deleted.
+ * @param dst Specifies the node newly created if any, or
+ * <code>null</code>.
+ */
+ public void handle(short operation,
+ String key,
+ Object data,
+ Node src,
+ Node dst);
+
+}
diff --git a/dom/src/test/java/org/w3c/dom/events/Event.java b/dom/src/test/java/org/w3c/dom/events/Event.java
new file mode 100644
index 0000000..f2baad6
--- /dev/null
+++ b/dom/src/test/java/org/w3c/dom/events/Event.java
@@ -0,0 +1,141 @@
+/*
+ * Copyright (c) 2000 World Wide Web Consortium,
+ * (Massachusetts Institute of Technology, Institut National de
+ * Recherche en Informatique et en Automatique, Keio University). All
+ * Rights Reserved. This program is distributed under the W3C's Software
+ * Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+ */
+
+package org.w3c.dom.events;
+
+/**
+ * The <code>Event</code> interface is used to provide contextual information
+ * about an event to the handler processing the event. An object which
+ * implements the <code>Event</code> interface is generally passed as the
+ * first parameter to an event handler. More specific context information is
+ * passed to event handlers by deriving additional interfaces from
+ * <code>Event</code> which contain information directly relating to the
+ * type of event they accompany. These derived interfaces are also
+ * implemented by the object passed to the event listener.
+ * <p>See also the <a href='http://www.w3.org/TR/2000/REC-DOM-Level-2-Events-20001113'>Document Object Model (DOM) Level 2 Events Specification</a>.
+ * @since DOM Level 2
+ */
+public interface Event {
+ // PhaseType
+ /**
+ * The current event phase is the capturing phase.
+ */
+ public static final short CAPTURING_PHASE = 1;
+ /**
+ * The event is currently being evaluated at the target
+ * <code>EventTarget</code>.
+ */
+ public static final short AT_TARGET = 2;
+ /**
+ * The current event phase is the bubbling phase.
+ */
+ public static final short BUBBLING_PHASE = 3;
+
+ /**
+ * The name of the event (case-insensitive). The name must be an XML name.
+ */
+ public String getType();
+
+ /**
+ * Used to indicate the <code>EventTarget</code> to which the event was
+ * originally dispatched.
+ */
+ public EventTarget getTarget();
+
+ /**
+ * Used to indicate the <code>EventTarget</code> whose
+ * <code>EventListeners</code> are currently being processed. This is
+ * particularly useful during capturing and bubbling.
+ */
+ public EventTarget getCurrentTarget();
+
+ /**
+ * Used to indicate which phase of event flow is currently being
+ * evaluated.
+ */
+ public short getEventPhase();
+
+ /**
+ * Used to indicate whether or not an event is a bubbling event. If the
+ * event can bubble the value is true, else the value is false.
+ */
+ public boolean getBubbles();
+
+ /**
+ * Used to indicate whether or not an event can have its default action
+ * prevented. If the default action can be prevented the value is true,
+ * else the value is false.
+ */
+ public boolean getCancelable();
+
+ /**
+ * Used to specify the time (in milliseconds relative to the epoch) at
+ * which the event was created. Due to the fact that some systems may
+ * not provide this information the value of <code>timeStamp</code> may
+ * be not available for all events. When not available, a value of 0
+ * will be returned. Examples of epoch time are the time of the system
+ * start or 0:0:0 UTC 1st January 1970.
+ */
+ public long getTimeStamp();
+
+ /**
+ * The <code>stopPropagation</code> method is used prevent further
+ * propagation of an event during event flow. If this method is called
+ * by any <code>EventListener</code> the event will cease propagating
+ * through the tree. The event will complete dispatch to all listeners
+ * on the current <code>EventTarget</code> before event flow stops. This
+ * method may be used during any stage of event flow.
+ */
+ public void stopPropagation();
+
+ /**
+ * If an event is cancelable, the <code>preventDefault</code> method is
+ * used to signify that the event is to be canceled, meaning any default
+ * action normally taken by the implementation as a result of the event
+ * will not occur. If, during any stage of event flow, the
+ * <code>preventDefault</code> method is called the event is canceled.
+ * Any default action associated with the event will not occur. Calling
+ * this method for a non-cancelable event has no effect. Once
+ * <code>preventDefault</code> has been called it will remain in effect
+ * throughout the remainder of the event's propagation. This method may
+ * be used during any stage of event flow.
+ */
+ public void preventDefault();
+
+ /**
+ * The <code>initEvent</code> method is used to initialize the value of an
+ * <code>Event</code> created through the <code>DocumentEvent</code>
+ * interface. This method may only be called before the
+ * <code>Event</code> has been dispatched via the
+ * <code>dispatchEvent</code> method, though it may be called multiple
+ * times during that phase if necessary. If called multiple times the
+ * final invocation takes precedence. If called from a subclass of
+ * <code>Event</code> interface only the values specified in the
+ * <code>initEvent</code> method are modified, all other attributes are
+ * left unchanged.
+ * @param eventTypeArgSpecifies the event type. This type may be any
+ * event type currently defined in this specification or a new event
+ * type.. The string must be an XML name. Any new event type must not
+ * begin with any upper, lower, or mixed case version of the string
+ * "DOM". This prefix is reserved for future DOM event sets. It is
+ * also strongly recommended that third parties adding their own
+ * events use their own prefix to avoid confusion and lessen the
+ * probability of conflicts with other new events.
+ * @param canBubbleArgSpecifies whether or not the event can bubble.
+ * @param cancelableArgSpecifies whether or not the event's default
+ * action can be prevented.
+ */
+ public void initEvent(String eventTypeArg,
+ boolean canBubbleArg,
+ boolean cancelableArg);
+
+}
diff --git a/dom/src/test/java/org/w3c/dom/events/EventException.java b/dom/src/test/java/org/w3c/dom/events/EventException.java
new file mode 100644
index 0000000..7a6ff26
--- /dev/null
+++ b/dom/src/test/java/org/w3c/dom/events/EventException.java
@@ -0,0 +1,36 @@
+/*
+ * Copyright (c) 2000 World Wide Web Consortium,
+ * (Massachusetts Institute of Technology, Institut National de
+ * Recherche en Informatique et en Automatique, Keio University). All
+ * Rights Reserved. This program is distributed under the W3C's Software
+ * Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+ */
+
+package org.w3c.dom.events;
+
+/**
+ * Event operations may throw an <code>EventException</code> as specified in
+ * their method descriptions.
+ * <p>See also the <a href='http://www.w3.org/TR/2000/REC-DOM-Level-2-Events-20001113'>Document Object Model (DOM) Level 2 Events Specification</a>.
+ * @since DOM Level 2
+ */
+public class EventException extends RuntimeException {
+ public EventException(short code, String message) {
+ super(message);
+ this.code = code;
+ }
+ public short code;
+ // EventExceptionCode
+ /**
+ * If the <code>Event</code>'s type was not specified by initializing the
+ * event before the method was called. Specification of the Event's type
+ * as <code>null</code> or an empty string will also trigger this
+ * exception.
+ */
+ public static final short UNSPECIFIED_EVENT_TYPE_ERR = 0;
+
+}
diff --git a/dom/src/test/java/org/w3c/dom/events/EventListener.java b/dom/src/test/java/org/w3c/dom/events/EventListener.java
new file mode 100644
index 0000000..52e60cb
--- /dev/null
+++ b/dom/src/test/java/org/w3c/dom/events/EventListener.java
@@ -0,0 +1,41 @@
+/*
+ * Copyright (c) 2000 World Wide Web Consortium,
+ * (Massachusetts Institute of Technology, Institut National de
+ * Recherche en Informatique et en Automatique, Keio University). All
+ * Rights Reserved. This program is distributed under the W3C's Software
+ * Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+ */
+
+package org.w3c.dom.events;
+
+/**
+ * The <code>EventListener</code> interface is the primary method for
+ * handling events. Users implement the <code>EventListener</code> interface
+ * and register their listener on an <code>EventTarget</code> using the
+ * <code>AddEventListener</code> method. The users should also remove their
+ * <code>EventListener</code> from its <code>EventTarget</code> after they
+ * have completed using the listener.
+ * <p> When a <code>Node</code> is copied using the <code>cloneNode</code>
+ * method the <code>EventListener</code>s attached to the source
+ * <code>Node</code> are not attached to the copied <code>Node</code>. If
+ * the user wishes the same <code>EventListener</code>s to be added to the
+ * newly created copy the user must add them manually.
+ * <p>See also the <a href='http://www.w3.org/TR/2000/REC-DOM-Level-2-Events-20001113'>Document Object Model (DOM) Level 2 Events Specification</a>.
+ * @since DOM Level 2
+ */
+public interface EventListener {
+ /**
+ * This method is called whenever an event occurs of the type for which
+ * the <code> EventListener</code> interface was registered.
+ * @param evt The <code>Event</code> contains contextual information
+ * about the event. It also contains the <code>stopPropagation</code>
+ * and <code>preventDefault</code> methods which are used in
+ * determining the event's flow and default action.
+ */
+ public void handleEvent(Event evt);
+
+}
diff --git a/dom/src/test/java/org/w3c/dom/events/EventTarget.java b/dom/src/test/java/org/w3c/dom/events/EventTarget.java
new file mode 100644
index 0000000..65e6286
--- /dev/null
+++ b/dom/src/test/java/org/w3c/dom/events/EventTarget.java
@@ -0,0 +1,102 @@
+/*
+ * Copyright (c) 2000 World Wide Web Consortium,
+ * (Massachusetts Institute of Technology, Institut National de
+ * Recherche en Informatique et en Automatique, Keio University). All
+ * Rights Reserved. This program is distributed under the W3C's Software
+ * Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+ */
+
+package org.w3c.dom.events;
+
+/**
+ * The <code>EventTarget</code> interface is implemented by all
+ * <code>Nodes</code> in an implementation which supports the DOM Event
+ * Model. Therefore, this interface can be obtained by using
+ * binding-specific casting methods on an instance of the <code>Node</code>
+ * interface. The interface allows registration and removal of
+ * <code>EventListeners</code> on an <code>EventTarget</code> and dispatch
+ * of events to that <code>EventTarget</code>.
+ * <p>See also the <a href='http://www.w3.org/TR/2000/REC-DOM-Level-2-Events-20001113'>Document Object Model (DOM) Level 2 Events Specification</a>.
+ * @since DOM Level 2
+ */
+public interface EventTarget {
+ /**
+ * This method allows the registration of event listeners on the event
+ * target. If an <code>EventListener</code> is added to an
+ * <code>EventTarget</code> while it is processing an event, it will not
+ * be triggered by the current actions but may be triggered during a
+ * later stage of event flow, such as the bubbling phase.
+ * <br> If multiple identical <code>EventListener</code>s are registered
+ * on the same <code>EventTarget</code> with the same parameters the
+ * duplicate instances are discarded. They do not cause the
+ * <code>EventListener</code> to be called twice and since they are
+ * discarded they do not need to be removed with the
+ * <code>removeEventListener</code> method.
+ * @param typeThe event type for which the user is registering
+ * @param listenerThe <code>listener</code> parameter takes an interface
+ * implemented by the user which contains the methods to be called
+ * when the event occurs.
+ * @param useCaptureIf true, <code>useCapture</code> indicates that the
+ * user wishes to initiate capture. After initiating capture, all
+ * events of the specified type will be dispatched to the registered
+ * <code>EventListener</code> before being dispatched to any
+ * <code>EventTargets</code> beneath them in the tree. Events which
+ * are bubbling upward through the tree will not trigger an
+ * <code>EventListener</code> designated to use capture.
+ */
+ public void addEventListener(String type,
+ EventListener listener,
+ boolean useCapture);
+
+ /**
+ * This method allows the removal of event listeners from the event
+ * target. If an <code>EventListener</code> is removed from an
+ * <code>EventTarget</code> while it is processing an event, it will not
+ * be triggered by the current actions. <code>EventListener</code>s can
+ * never be invoked after being removed.
+ * <br>Calling <code>removeEventListener</code> with arguments which do
+ * not identify any currently registered <code>EventListener</code> on
+ * the <code>EventTarget</code> has no effect.
+ * @param typeSpecifies the event type of the <code>EventListener</code>
+ * being removed.
+ * @param listenerThe <code>EventListener</code> parameter indicates the
+ * <code>EventListener </code> to be removed.
+ * @param useCaptureSpecifies whether the <code>EventListener</code>
+ * being removed was registered as a capturing listener or not. If a
+ * listener was registered twice, one with capture and one without,
+ * each must be removed separately. Removal of a capturing listener
+ * does not affect a non-capturing version of the same listener, and
+ * vice versa.
+ */
+ public void removeEventListener(String type,
+ EventListener listener,
+ boolean useCapture);
+
+ /**
+ * This method allows the dispatch of events into the implementations
+ * event model. Events dispatched in this manner will have the same
+ * capturing and bubbling behavior as events dispatched directly by the
+ * implementation. The target of the event is the
+ * <code> EventTarget</code> on which <code>dispatchEvent</code> is
+ * called.
+ * @param evtSpecifies the event type, behavior, and contextual
+ * information to be used in processing the event.
+ * @return The return value of <code>dispatchEvent</code> indicates
+ * whether any of the listeners which handled the event called
+ * <code>preventDefault</code>. If <code>preventDefault</code> was
+ * called the value is false, else the value is true.
+ * @exception EventException
+ * UNSPECIFIED_EVENT_TYPE_ERR: Raised if the <code>Event</code>'s type
+ * was not specified by initializing the event before
+ * <code>dispatchEvent</code> was called. Specification of the
+ * <code>Event</code>'s type as <code>null</code> or an empty string
+ * will also trigger this exception.
+ */
+ public boolean dispatchEvent(Event evt)
+ throws EventException;
+
+}
diff --git a/dom/src/test/java/org/w3c/domts/BatikTestDocumentBuilderFactory.java b/dom/src/test/java/org/w3c/domts/BatikTestDocumentBuilderFactory.java
new file mode 100644
index 0000000..8e5c682
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/BatikTestDocumentBuilderFactory.java
@@ -0,0 +1,239 @@
+/*
+ * Copyright (c) 2001-2004 World Wide Web Consortium,
+ * (Massachusetts Institute of Technology, Institut National de
+ * Recherche en Informatique et en Automatique, Keio University). All
+ * Rights Reserved. This program is distributed under the W3C's Software
+ * Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+ */
+
+package org.w3c.domts;
+
+import java.lang.reflect.Constructor;
+import java.lang.reflect.InvocationTargetException;
+import java.lang.reflect.Method;
+
+import javax.xml.parsers.SAXParser;
+import javax.xml.parsers.SAXParserFactory;
+
+import org.w3c.dom.DOMImplementation;
+import org.w3c.dom.Document;
+
+/**
+ * This class implements the generic parser and configuation
+ * abstract class for the DOM implementation of Batik.
+ *
+ * @author Curt Arnold
+ */
+public class BatikTestDocumentBuilderFactory
+ extends DOMTestDocumentBuilderFactory {
+
+ /** dom factory. */
+ private Object domFactory;
+
+ /** xml reader. */
+ private org.xml.sax.XMLReader xmlReader;
+
+ /** reflective method to create document in Batik. **/
+ private Method createDocument;
+
+ /** dom implementation from Batik. **/
+ private DOMImplementation domImpl;
+
+ /**
+ * Creates a Batik implementation of DOMTestDocumentBuilderFactory.
+ * @param settings array of settings, may be null.
+ * @throws DOMTestIncompatibleException
+ * If implementation does not support the specified settings
+ */
+ public BatikTestDocumentBuilderFactory(
+ DocumentBuilderSetting[] settings) throws DOMTestIncompatibleException {
+ super(settings);
+ domImpl = null;
+
+ //
+ // get the JAXP specified SAX parser's class name
+ //
+ SAXParserFactory saxFactory = SAXParserFactory.newInstance();
+ try {
+ SAXParser saxParser = saxFactory.newSAXParser();
+ xmlReader = saxParser.getXMLReader();
+ } catch (Exception ex) {
+ throw new DOMTestIncompatibleException(ex, null);
+ }
+ String xmlReaderClassName = xmlReader.getClass().getName();
+
+ //
+ // can't change settings, so if not the same as
+ // the default SAX parser then throw an exception
+ //
+ // for(int i = 0; i < settings.length; i++) {
+ // if(!settings[i].hasSetting(this)) {
+ // TODO
+ // throw new DOMTestIncompatibleException(null,settings[i]);
+ // }
+ // }
+ //
+ // try loading Batik reflectively
+ //
+ try {
+ ClassLoader classLoader = ClassLoader.getSystemClassLoader();
+ Class domFactoryClass =
+ classLoader.loadClass(
+ "org.apache.batik.dom.svg.SAXSVGDocumentFactory");
+
+ Constructor domFactoryConstructor =
+ domFactoryClass.getConstructor(new Class[] {String.class});
+ domFactory =
+ domFactoryConstructor.newInstance(
+ new Object[] {xmlReaderClassName});
+ createDocument =
+ domFactoryClass.getMethod(
+ "createDocument",
+ new Class[] {String.class, java.io.InputStream.class});
+ } catch (InvocationTargetException ex) {
+ throw new DOMTestIncompatibleException(
+ ex.getTargetException(),
+ null);
+ } catch (Exception ex) {
+ throw new DOMTestIncompatibleException(ex, null);
+ }
+ }
+
+ /**
+ * Create new instance of document builder factory
+ * reflecting specified settings.
+ * @param newSettings new settings
+ * @return New instance
+ * @throws DOMTestIncompatibleException
+ * if settings are not supported by implementation
+ */
+ public DOMTestDocumentBuilderFactory newInstance(
+ DocumentBuilderSetting[] newSettings)
+ throws DOMTestIncompatibleException {
+ if (newSettings == null) {
+ return this;
+ }
+ DocumentBuilderSetting[] mergedSettings = mergeSettings(newSettings);
+ return new BatikTestDocumentBuilderFactory(mergedSettings);
+ }
+
+ /**
+ * Loads specified URL.
+ * @param url url to load
+ * @return DOM document
+ * @throws DOMTestLoadException if unable to load document
+ */
+ public Document load(java.net.URL url) throws DOMTestLoadException {
+ try {
+ java.io.InputStream stream = url.openStream();
+ return (org.w3c.dom.Document) createDocument.invoke(
+ domFactory,
+ new Object[] {url.toString(), stream});
+ } catch (InvocationTargetException ex) {
+ ex.printStackTrace();
+ throw new DOMTestLoadException(ex.getTargetException());
+ } catch (Exception ex) {
+ ex.printStackTrace();
+ throw new DOMTestLoadException(ex);
+ }
+ }
+
+ /**
+ * Gets DOMImplementation.
+ * @return DOM implementation, may be null
+ */
+ public DOMImplementation getDOMImplementation() {
+ //
+ // get DOM implementation
+ //
+ if (domImpl == null) {
+ try {
+ Class svgDomImplClass =
+ ClassLoader.getSystemClassLoader().loadClass(
+ "org.apache.batik.dom.svg.SVGDOMImplementation");
+ Method getImpl =
+ svgDomImplClass.getMethod(
+ "getDOMImplementation",
+ new Class[0]);
+ domImpl =
+ (DOMImplementation) getImpl.invoke(null, new Object[0]);
+ } catch (Exception ex) {
+ return null;
+ }
+ }
+ return domImpl;
+ }
+
+ /**
+ * Determines if the implementation supports the specified feature.
+ * @param feature Feature
+ * @param version Version
+ * @return true if implementation supports the feature
+ */
+ public boolean hasFeature(String feature, String version) {
+ return getDOMImplementation().hasFeature(feature, version);
+ }
+
+ /**
+ * Adds any specialized extension required by the implementation.
+ * @param testFileName file name from test
+ * @return possibly modified file name
+ */
+ public String addExtension(String testFileName) {
+ return testFileName + ".svg";
+ }
+
+ /**
+ * Indicates whether the implementation combines text and cdata nodes.
+ * @return true if coalescing
+ */
+ public boolean isCoalescing() {
+ return false;
+ }
+
+ /**
+ * Indicates whether the implementation expands entity references.
+ * @return true if expanding entity references
+ */
+ public boolean isExpandEntityReferences() {
+ return false;
+ }
+
+ /**
+ * Indicates whether the implementation ignores
+ * element content whitespace.
+ * @return true if ignoring element content whitespace
+ */
+ public boolean isIgnoringElementContentWhitespace() {
+ return false;
+ }
+
+ /**
+ * Indicates whether the implementation is namespace aware.
+ * @return true if namespace aware
+ */
+ public boolean isNamespaceAware() {
+ return true;
+ }
+
+ /**
+ * Indicates whether the implementation is validating.
+ * @return true if validating
+ */
+ public boolean isValidating() {
+ return false;
+ }
+
+ /**
+ * Gets content type.
+ * @return content type, "image/svg+xml"
+ */
+ public String getContentType() {
+ return "image/svg+xml";
+ }
+
+}
diff --git a/dom/src/test/java/org/w3c/domts/DOM4JTestDocumentBuilderFactory.java b/dom/src/test/java/org/w3c/domts/DOM4JTestDocumentBuilderFactory.java
new file mode 100644
index 0000000..8d6acdd
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/DOM4JTestDocumentBuilderFactory.java
@@ -0,0 +1,154 @@
+/*
+ * Copyright (c) 2001-2004 World Wide Web Consortium,
+ * (Massachusetts Institute of Technology, Institut National de
+ * Recherche en Informatique et en Automatique, Keio University). All
+ * Rights Reserved. This program is distributed under the W3C's Software
+ * Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+ */
+
+/*
+ $Log: DOM4JTestDocumentBuilderFactory.java,v $
+ Revision 1.2 2004/03/11 01:44:21 dom-ts-4
+ Checkstyle fixes (bug 592)
+
+ Revision 1.1 2002/02/03 07:47:51 dom-ts-4
+ More missing files
+
+ */
+
+package org.w3c.domts;
+
+import java.lang.reflect.Constructor;
+import java.lang.reflect.InvocationTargetException;
+import java.lang.reflect.Method;
+
+import org.w3c.dom.DOMImplementation;
+import org.w3c.dom.Document;
+import org.xml.sax.XMLReader;
+
+/**
+ * This class implements the generic parser and configuation
+ * abstract class for JAXP supporting parsers.
+ */
+public class DOM4JTestDocumentBuilderFactory
+ extends DOMTestDocumentBuilderFactory {
+
+ private final Object domFactory;
+ private final Object saxReader;
+ private final org.xml.sax.XMLReader xmlReader;
+ private org.w3c.dom.DOMImplementation domImpl;
+ private final Method readMethod;
+
+ /**
+ * Creates a JAXP implementation of DOMTestDocumentBuilderFactory.
+ * @param factory null for default JAXP provider. If not null,
+ * factory will be mutated in constructor and should be released
+ * by calling code upon return.
+ * @param XMLReader if null use default XMLReader. If provided,
+ * it may be mutated and should be released by the caller immediately
+ * after the constructor.
+ * @param settings array of settings, may be null.
+ */
+ public DOM4JTestDocumentBuilderFactory(DocumentBuilderSetting[] settings) throws
+ DOMTestIncompatibleException {
+ super(settings);
+ try {
+ //
+ // The following reflection code is trying to accomplish
+ //
+ //domFactory = org.dom4j.dom.DOMDocumentFactory.getInstance();
+ //domImpl = (DOMImplementation) domFactory;
+ //saxReader = new org.dom4j.io.SAXReader(domFactory);
+ //xmlReader = saxReader.getXMLReader();
+
+ ClassLoader classLoader = ClassLoader.getSystemClassLoader();
+ Class domFactoryClass = classLoader.loadClass(
+ "org.dom4j.dom.DOMDocumentFactory");
+ Method getInstance = domFactoryClass.getMethod("getInstance", new Class[] {});
+ domFactory = getInstance.invoke(null, new Object[] {});
+ domImpl = (DOMImplementation) domFactory;
+ Class saxReaderClass = classLoader.loadClass("org.dom4j.io.SAXReader");
+ Constructor saxReaderConstructor = saxReaderClass.getConstructor(
+ new Class[] {classLoader.loadClass("org.dom4j.DocumentFactory")});
+ saxReader = saxReaderConstructor.newInstance(new Object[] {domFactory});
+
+ Method getReaderMethod = saxReaderClass.getMethod("getXMLReader",
+ new Class[] {});
+ xmlReader = (XMLReader) getReaderMethod.invoke(saxReader, new Object[0]);
+
+ readMethod = saxReaderClass.getMethod("read", new Class[] {java.net.URL.class});
+ }
+ catch (InvocationTargetException ex) {
+ throw new DOMTestIncompatibleException(ex.getTargetException(), null);
+ }
+ catch (Exception ex) {
+ throw new DOMTestIncompatibleException(ex, null);
+ }
+ //
+ // TODO: Process settings
+ //
+ }
+
+ public DOMTestDocumentBuilderFactory newInstance(DocumentBuilderSetting[]
+ newSettings) throws DOMTestIncompatibleException {
+ if (newSettings == null) {
+ return this;
+ }
+ DocumentBuilderSetting[] mergedSettings = mergeSettings(newSettings);
+ return new DOM4JTestDocumentBuilderFactory(mergedSettings);
+ }
+
+ public Document load(java.net.URL url) throws DOMTestLoadException {
+ if (url == null) {
+ throw new NullPointerException("url");
+ }
+ if (saxReader == null) {
+ throw new NullPointerException("saxReader");
+ }
+ try {
+ return (org.w3c.dom.Document) readMethod.invoke(saxReader,
+ new Object[] {url});
+ }
+ catch (InvocationTargetException ex) {
+ ex.getTargetException().printStackTrace();
+ throw new DOMTestLoadException(ex.getTargetException());
+ }
+ catch (Exception ex) {
+ ex.printStackTrace();
+ throw new DOMTestLoadException(ex);
+ }
+ }
+
+ public DOMImplementation getDOMImplementation() {
+ return domImpl;
+ }
+
+ public boolean hasFeature(String feature, String version) {
+ return domImpl.hasFeature(feature, version);
+ }
+
+ public boolean isCoalescing() {
+ return false;
+ }
+
+ public boolean isExpandEntityReferences() {
+ return false;
+ }
+
+ public boolean isIgnoringElementContentWhitespace() {
+ return false;
+ }
+
+ public boolean isNamespaceAware() {
+ return true;
+ }
+
+ public boolean isValidating() {
+ return false;
+ }
+
+}
diff --git a/dom/src/test/java/org/w3c/domts/DOMErrorImpl.java b/dom/src/test/java/org/w3c/domts/DOMErrorImpl.java
new file mode 100644
index 0000000..8cc2115
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/DOMErrorImpl.java
@@ -0,0 +1,68 @@
+/*
+ * Copyright (c) 2004 World Wide Web Consortium,
+ * (Massachusetts Institute of Technology, Institut National de
+ * Recherche en Informatique et en Automatique, Keio University). All
+ * Rights Reserved. This program is distributed under the W3C's Software
+ * Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+ */
+
+package org.w3c.domts;
+
+import org.w3c.dom.DOMError;
+import org.w3c.dom.DOMLocator;
+
+/**
+ * This is a utility implementation of EventListener
+ * that captures all events and provides access
+ * to lists of all events by mode
+ */
+public class DOMErrorImpl
+ implements DOMError {
+ private final short severity;
+ private final String message;
+ private final String type;
+ private final Object relatedException;
+ private final Object relatedData;
+ private final DOMLocator location;
+
+ /**
+ * Public constructor
+ *
+ */
+ public DOMErrorImpl(DOMError src) {
+ this.severity = src.getSeverity();
+ this.message = src.getMessage();
+ this.type = src.getType();
+ this.relatedException = src.getRelatedException();
+ this.relatedData = src.getRelatedData();
+ this.location = new DOMLocatorImpl(src.getLocation());
+ }
+
+ public final short getSeverity() {
+ return severity;
+ }
+
+ public final String getMessage() {
+ return message;
+ }
+
+ public final String getType() {
+ return type;
+ }
+
+ public final Object getRelatedException() {
+ return relatedException;
+ }
+
+ public final Object getRelatedData() {
+ return relatedData;
+ }
+
+ public final DOMLocator getLocation() {
+ return location;
+ }
+}
diff --git a/dom/src/test/java/org/w3c/domts/DOMErrorMonitor.java b/dom/src/test/java/org/w3c/domts/DOMErrorMonitor.java
new file mode 100644
index 0000000..134dd03
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/DOMErrorMonitor.java
@@ -0,0 +1,66 @@
+/*
+ * Copyright (c) 2004 World Wide Web Consortium,
+ * (Massachusetts Institute of Technology, Institut National de
+ * Recherche en Informatique et en Automatique, Keio University). All
+ * Rights Reserved. This program is distributed under the W3C's Software
+ * Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+ */
+
+package org.w3c.domts;
+
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Iterator;
+
+import org.w3c.dom.DOMError;
+import org.w3c.dom.DOMErrorHandler;
+
+/**
+ * This is a utility implementation of EventListener
+ * that captures all events and provides access
+ * to lists of all events by mode
+ */
+public class DOMErrorMonitor
+ implements DOMErrorHandler {
+ private final List errors = new ArrayList();
+
+ /**
+ * Public constructor
+ *
+ */
+ public DOMErrorMonitor() {
+ }
+
+ /**
+ * Implementation of DOMErrorHandler.handleError that
+ * adds copy of error to list for later retrieval.
+ *
+ */
+ public boolean handleError(DOMError error) {
+ errors.add(new DOMErrorImpl(error));
+ return true;
+ }
+
+ /**
+ * Gets list of errors
+ *
+ * @return return errors
+ */
+ public List getAllErrors() {
+ return new ArrayList(errors);
+ }
+
+ public void assertLowerSeverity(DOMTestCase testCase, String id, int severity) {
+ Iterator iter = errors.iterator();
+ while (iter.hasNext()) {
+ DOMError error = (DOMError) iter.next();
+ if (error.getSeverity() >= severity) {
+ testCase.fail(id + error.getMessage());
+ }
+ }
+ }
+}
diff --git a/dom/src/test/java/org/w3c/domts/DOMLocatorImpl.java b/dom/src/test/java/org/w3c/domts/DOMLocatorImpl.java
new file mode 100644
index 0000000..89a0c58
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/DOMLocatorImpl.java
@@ -0,0 +1,84 @@
+/*
+ * Copyright (c) 2004 World Wide Web Consortium,
+ * (Massachusetts Institute of Technology, Institut National de
+ * Recherche en Informatique et en Automatique, Keio University). All
+ * Rights Reserved. This program is distributed under the W3C's Software
+ * Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+ */
+package org.w3c.domts;
+
+import org.w3c.dom.DOMLocator;
+import org.w3c.dom.Node;
+
+/**
+ * Implementation of DOMLocator
+ *
+ */
+public class DOMLocatorImpl
+ implements DOMLocator {
+ private final int lineNumber;
+ private final int columnNumber;
+ private final int byteOffset;
+ private final int utf16Offset;
+ private final Node relatedNode;
+ private final String uri;
+
+ public DOMLocatorImpl(DOMLocator src) {
+ this.lineNumber = src.getLineNumber();
+ this.columnNumber = src.getColumnNumber();
+ this.byteOffset = src.getByteOffset();
+ this.utf16Offset = src.getUtf16Offset();
+ this.relatedNode = src.getRelatedNode();
+ this.uri = src.getUri();
+ }
+
+ /*
+ * Line number
+ * @see org.w3c.dom.DOMLocator#getLineNumber()
+ */
+ public int getLineNumber() {
+ return lineNumber;
+ }
+
+ /*
+ * Column number
+ * @see org.w3c.dom.DOMLocator#getColumnNumber()
+ */
+ public int getColumnNumber() {
+ return columnNumber;
+ }
+
+ /*
+ * Byte offset
+ * @see org.w3c.dom.DOMLocator#getByteOffset()
+ */
+ public int getByteOffset() {
+ return byteOffset;
+ }
+
+ /* UTF-16 offset
+ * @see org.w3c.dom.DOMLocator#getUtf16Offset()
+ */
+ public int getUtf16Offset() {
+ return utf16Offset;
+ }
+
+ /* Related node
+ * @see org.w3c.dom.DOMLocator#getRelatedNode()
+ */
+ public Node getRelatedNode() {
+ return relatedNode;
+ }
+
+ /* URI
+ * @see org.w3c.dom.DOMLocator#getUri()
+ */
+ public String getUri() {
+ return uri;
+ }
+
+}
diff --git a/dom/src/test/java/org/w3c/domts/DOMTest.java b/dom/src/test/java/org/w3c/domts/DOMTest.java
new file mode 100644
index 0000000..b39ea67
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/DOMTest.java
@@ -0,0 +1,289 @@
+/*
+ * Copyright (c) 2001-2003 World Wide Web Consortium, (Massachusetts Institute
+ * of Technology, Institut National de Recherche en Informatique et en
+ * Automatique, Keio University). All Rights Reserved. This program is
+ * distributed under the W3C's Software Intellectual Property License. This
+ * program 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 W3C License
+ * http://www.w3.org/Consortium/Legal/ for more details.
+ */
+
+
+package org.w3c.domts;
+
+import java.io.File;
+import java.io.IOException;
+import java.io.InputStream;
+import java.lang.reflect.Method;
+import java.net.MalformedURLException;
+import java.net.URL;
+
+import org.w3c.dom.DOMImplementation;
+import org.w3c.dom.Document;
+
+/**
+ * This is an abstract base class for generated DOM tests
+ *
+ */
+public abstract class DOMTest /* wBM: implements EventListener */ {
+ private DOMTestDocumentBuilderFactory factory;
+ private int mutationCount = 0;
+
+ /**
+ * This is the appropriate constructor for tests that make no requirements
+ * on the parser configuration.
+ *
+ * @param factory
+ * must not be null
+ */
+ public DOMTest(DOMTestDocumentBuilderFactory factory) {
+ if (factory == null) {
+ throw new NullPointerException("factory");
+ }
+ this.factory = factory;
+ }
+
+ /**
+ * This constructor is used by tests that must create a modified document
+ * factory to meet requirements on the parser configuration. setFactory
+ * should be called within the test's constructor.
+ */
+ public DOMTest() {
+ factory = null;
+ }
+
+ /**
+ * Should only be called in the constructor of a derived type.
+ */
+ protected void setFactory(DOMTestDocumentBuilderFactory factory) {
+ this.factory = factory;
+ }
+
+ public boolean hasFeature(String feature, String version) {
+ return factory.hasFeature(feature, version);
+ }
+
+ public boolean hasSetting(DocumentBuilderSetting setting) {
+ return setting.hasSetting(factory);
+ }
+
+ protected DOMTestDocumentBuilderFactory getFactory() {
+ return factory;
+ }
+
+ public DOMImplementation getImplementation() {
+ return factory.getDOMImplementation();
+ }
+
+ private URL resolveURI(String baseURI) throws DOMTestLoadException {
+ String docURI = factory.addExtension(baseURI);
+
+ URL resolvedURI = null;
+ try {
+ resolvedURI = new URL(docURI);
+ if (resolvedURI.getProtocol() != null) {
+ return resolvedURI;
+ }
+ }
+ catch (MalformedURLException ex) {
+ // throw new DOMTestLoadException(ex);
+ }
+ //
+ // build a URL for a test file in the JAR
+ //
+ resolvedURI = getClass().getResource("/" + docURI);
+ if (resolvedURI == null) {
+ //
+ // see if it is an absolute URI
+ //
+ int firstSlash = docURI.indexOf('/');
+ try {
+ if (firstSlash == 0
+ || (firstSlash >= 1
+ && docURI.charAt(firstSlash - 1) == ':')) {
+ resolvedURI = new URL(docURI);
+ }
+ else {
+ //
+ // try the files/level?/spec directory
+ //
+ String filename = getClass().getPackage().getName();
+ filename =
+ "tests/"
+ + filename.substring(14).replace('.', '/')
+ + "/files/"
+ + docURI;
+ resolvedURI = new java.io.File(filename).toURL();
+ }
+ }
+ catch (MalformedURLException ex) {
+ throw new DOMTestLoadException(ex);
+ }
+ }
+
+ if (resolvedURI == null) {
+ throw new DOMTestLoadException(
+ new java.io.FileNotFoundException(docURI));
+ }
+ return resolvedURI;
+ }
+
+ public String getResourceURI(String href, String scheme, String contentType) throws
+ DOMTestLoadException {
+ if (scheme == null) {
+ throw new NullPointerException("scheme");
+ }
+ if ("file".equals(scheme)) {
+ return resolveURI(href).toString();
+ }
+ if ("http".equals(scheme)) {
+ StringBuffer httpURL = new StringBuffer(
+ System.getProperty("org.w3c.domts.httpbase",
+ "http://localhost:8080/webdav/"));
+ httpURL.append(href);
+ if ("application/pdf".equals(contentType)) {
+ httpURL.append(".pdf");
+ }
+ else {
+ httpURL.append(".xml");
+ }
+ return httpURL.toString();
+ }
+ throw new DOMTestLoadException(new Exception("Unrecognized URI scheme " +
+ scheme));
+ }
+
+ public String createTempURI(String scheme) throws DOMTestLoadException {
+ if (scheme == null) {
+ throw new NullPointerException("scheme");
+ }
+ if ("file".equals(scheme)) {
+ try {
+ File tempFile = File.createTempFile("domts", ".xml");
+ try {
+ //
+ // if available use JDK 1.4's File.toURI().toString()
+ //
+ Method method = File.class.getMethod("toURI", null);
+ Object uri = method.invoke(tempFile, null);
+ return uri.toString();
+ }
+ catch (NoSuchMethodException ex) {
+ //
+ // File.toURL is not as robust
+ //
+ URL url = tempFile.toURL();
+ return url.toString();
+ }
+ }
+ catch (Exception ex) {
+ throw new DOMTestLoadException(ex);
+ }
+ }
+ if ("http".equals(scheme)) {
+ String httpBase = System.getProperty("org.w3c.domts.httpbase",
+ "http://localhost:8080/webdav/");
+ java.lang.StringBuffer buf = new StringBuffer(httpBase);
+ if (!httpBase.endsWith("/")) {
+ buf.append("/");
+ }
+ buf.append("tmp");
+ buf.append( (new java.util.Random()).nextInt(Integer.MAX_VALUE));
+ buf.append(".xml");
+ return buf.toString();
+ }
+ throw new DOMTestLoadException(new Exception("Unrecognized URI scheme " +
+ scheme));
+ }
+
+ public Document load(String docURI, boolean willBeModified) throws
+ DOMTestLoadException {
+ Document doc = factory.load(resolveURI(docURI));
+ //
+ // if will be modified is false and doc is an EventTarget
+ //
+ /*
+ * wBM: if (!willBeModified && doc instanceof EventTarget) {
+ * ((EventTarget) doc).addEventListener("DOMSubtreeModified", this,
+ * false); }
+ */
+ return doc;
+ }
+
+ public void preload(String contentType, String docURI, boolean willBeModified) throws
+ DOMTestIncompatibleException {
+ if ("text/html".equals(contentType) ||
+ "application/xhtml+xml".equals(contentType)) {
+ if (docURI.startsWith("staff") || docURI.equals("datatype_normalization")) {
+ throw DOMTestIncompatibleException.incompatibleLoad(docURI, contentType);
+ }
+ }
+ }
+
+ public Object createXPathEvaluator(Document doc) {
+ return factory.createXPathEvaluator(doc);
+ }
+
+ public InputStream createStream(String bytes) throws DOMTestLoadException,
+ IOException {
+ int byteCount = bytes.length() / 2;
+ byte[] array = new byte[byteCount];
+ for (int i = 0; i < byteCount; i++) {
+ array[i] = Byte.parseByte(bytes.substring(i * 2, i * 2 + 2), 16);
+ }
+ return new java.io.ByteArrayInputStream(array);
+ }
+
+ abstract public String getTargetURI();
+
+ public final boolean isCoalescing() {
+ return factory.isCoalescing();
+ }
+
+ public final boolean isExpandEntityReferences() {
+ return factory.isExpandEntityReferences();
+ }
+
+ public final boolean isIgnoringElementContentWhitespace() {
+ return factory.isIgnoringElementContentWhitespace();
+ }
+
+ public final boolean isNamespaceAware() {
+ return factory.isNamespaceAware();
+ }
+
+ public final boolean isValidating() {
+ return factory.isValidating();
+ }
+
+ public final boolean isSigned() {
+ return true;
+ }
+
+ public final boolean isHasNullString() {
+ return true;
+ }
+
+ public final String getContentType() {
+ return factory.getContentType();
+ }
+
+ /**
+ * Implementation of EventListener.handleEvent
+ *
+ * This method is called when a mutation is reported for a document that
+ * was declared to not be modified during testing
+ *
+ * @param evt
+ * mutation event
+ */
+ /*
+ * wBM: public final void handleEvent(Event evt) { mutationCount++; }
+ */
+
+ public final int getMutationCount() {
+ return mutationCount;
+ }
+
+}
diff --git a/dom/src/test/java/org/w3c/domts/DOMTestCase.java b/dom/src/test/java/org/w3c/domts/DOMTestCase.java
new file mode 100644
index 0000000..1508772
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/DOMTestCase.java
@@ -0,0 +1,983 @@
+/*
+ * Copyright (c) 2001-2004 World Wide Web Consortium, (Massachusetts Institute
+ * of Technology, Institut National de Recherche en Informatique et en
+ * Automatique, Keio University). All Rights Reserved. This program is
+ * distributed under the W3C's Software Intellectual Property License. This
+ * program 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 W3C License
+ * http://www.w3.org/Consortium/Legal/ for more details.
+ */
+
+package org.w3c.domts;
+
+import java.lang.reflect.Constructor;
+import java.lang.reflect.InvocationTargetException;
+import java.lang.reflect.Method;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.List;
+import java.util.Iterator;
+
+import org.w3c.dom.NamedNodeMap;
+import org.w3c.dom.NodeList;
+
+/**
+ * This is an abstract base class for generated DOM tests
+ */
+public abstract class DOMTestCase
+ extends DOMTest {
+ private DOMTestFramework framework;
+
+ /**
+ * This constructor is for DOMTestCase's that make specific demands for
+ * parser configuration. setFactory should be called before the end of the
+ * tests constructor to set the factory.
+ */
+ public DOMTestCase() {
+ framework = null;
+ }
+
+ /**
+ * This constructor is for DOMTestCase's that do not add any requirements
+ * for parser configuration.
+ *
+ * @param factory
+ * document factory to be used by test, may not be null.
+ */
+ public DOMTestCase(DOMTestDocumentBuilderFactory factory) {
+ super(factory);
+ framework = null;
+ }
+
+ /**
+ * This method is called by the main() for each test and locates the
+ * appropriate test framework and runs the specified test
+ *
+ * @param testClass
+ * test class
+ * @param args
+ * arguments to test class
+ */
+ public static void doMain(Class testClass, String[] args) {
+ //
+ // Attempt to load JUnitRunner
+ //
+ ClassLoader loader = ClassLoader.getSystemClassLoader();
+ try {
+ Class runnerClass = loader.loadClass("org.w3c.domts.JUnitRunner");
+ Constructor runnerFactory =
+ runnerClass.getConstructor(new Class[] {Class.class});
+ //
+ // create the JUnitRunner
+ //
+ Object junitRun =
+ runnerFactory.newInstance(new Object[] {testClass});
+ //
+ // find and call its execute method method
+ //
+ Class argsClass = loader.loadClass("[Ljava.lang.String;");
+ Method execMethod =
+ runnerClass.getMethod("execute", new Class[] {argsClass});
+ execMethod.invoke(junitRun, new Object[] {args});
+ }
+ catch (InvocationTargetException ex) {
+ ex.getTargetException().printStackTrace();
+ }
+ catch (Exception ex) {
+ System.out.println(
+ "junit-run.jar and junit.jar \n must be in same directory or on classpath.");
+ ex.printStackTrace();
+ }
+ }
+
+ /**
+ * Body of test
+ *
+ * @throws Throwable
+ */
+ abstract public void runTest() throws Throwable;
+
+ /**
+ * Sets test framework to be used by test.
+ *
+ * @param framework
+ */
+ public void setFramework(DOMTestFramework framework) {
+ this.framework = framework;
+ }
+
+ /**
+ * Wait
+ *
+ * @param millisecond
+ * milliseconds to wait
+ */
+ public void wait(int millisecond) {
+ framework.wait(millisecond);
+ }
+
+ /**
+ * Fail test
+ *
+ * @param assertID
+ * identifier of assertion
+ */
+ public void fail(String assertID) {
+ framework.fail(this, assertID);
+ }
+
+ /**
+ * Asserts that actual==true
+ *
+ * @param assertID
+ * identifier of assertion
+ * @param actual
+ * actual value
+ */
+ public void assertTrue(String assertID, boolean actual) {
+ framework.assertTrue(this, assertID, actual);
+ }
+
+ /**
+ * Asserts that actual==true
+ *
+ * @param assertID
+ * identifier of assertion
+ * @param actual
+ * actual value
+ */
+ public void assertTrue(String assertID, Object actual) {
+ framework.assertTrue(this, assertID, ( (Boolean) actual).booleanValue());
+ }
+
+ /**
+ * Asserts that actual==false
+ *
+ * @param assertID
+ * identifier of assertion
+ * @param actual
+ * actual value
+ */
+ public void assertFalse(String assertID, boolean actual) {
+ framework.assertFalse(this, assertID, actual);
+ }
+
+ /**
+ * Asserts that actual==false
+ *
+ * @param assertID
+ * identifier of assertion
+ * @param actual
+ * actual value
+ */
+ public void assertFalse(String assertID, Object actual) {
+ framework.assertFalse(
+ this,
+ assertID,
+ ( (Boolean) actual).booleanValue());
+ }
+
+ /**
+ * Asserts that actual == null
+ *
+ * @param assertID
+ * identifier of assertion
+ * @param actual
+ * actual value
+ */
+ public void assertNull(String assertID, Object actual) {
+ framework.assertNull(this, assertID, actual);
+ }
+
+ /**
+ * Asserts that actual != null
+ *
+ * @param assertID
+ * identifier of assertion
+ * @param actual
+ * actual value
+ */
+ public void assertNotNull(String assertID, Object actual) {
+ framework.assertNotNull(this, assertID, actual);
+ }
+
+ /**
+ * Asserts that actual and expected are the same object
+ *
+ * @param assertID
+ * identifier of assertion
+ * @param actual
+ * actual value
+ */
+ public void assertSame(String assertID, Object expected, Object actual) {
+ framework.assertSame(this, assertID, expected, actual);
+ }
+
+ /**
+ * Asserts that obj is an instance of cls
+ *
+ * @param assertID
+ * identifier of assertion
+ * @param obj
+ * object
+ * @param cls
+ * class, may not be null.
+ */
+ public void assertInstanceOf(String assertID, Class cls, Object obj) {
+ framework.assertInstanceOf(this, assertID, obj, cls);
+ }
+
+ /**
+ * Asserts that the length of the collection is the expected size.
+ *
+ * @param assertID
+ * identifier of assertion
+ * @param expectedSize
+ * expected size
+ * @param collection
+ * collection
+ */
+ public void assertSize(
+ String assertID,
+ int expectedSize,
+ NodeList collection) {
+ framework.assertSize(this, assertID, expectedSize, collection);
+ }
+
+ /**
+ * Asserts that the length of the collection is the expected size.
+ *
+ * @param assertID
+ * identifier of assertion
+ * @param expectedSize
+ * expected size
+ * @param collection
+ * collection
+ */
+ public void assertSize(
+ String assertID,
+ int expectedSize,
+ NamedNodeMap collection) {
+ framework.assertSize(this, assertID, expectedSize, collection);
+ }
+
+ /**
+ * Asserts that the length of the collection is the expected size.
+ *
+ * @param assertID
+ * identifier of assertion
+ * @param expectedSize
+ * expected size
+ * @param collection
+ * collection
+ */
+ public void assertSize(
+ String assertID,
+ int expectedSize,
+ Collection collection) {
+ framework.assertSize(this, assertID, expectedSize, collection);
+ }
+
+ /**
+ * Asserts that expected.equalsIgnoreCase(actual) is true
+ *
+ * @param assertID
+ * identifier of assertion
+ * @param actual
+ * actual value
+ * @param expected
+ * Expected value, may not be null.
+ */
+ public void assertEqualsIgnoreCase(
+ String assertID,
+ String expected,
+ String actual) {
+ framework.assertEqualsIgnoreCase(this, assertID, expected, actual);
+ }
+
+ /**
+ * Asserts that each entry in actual is matched with an entry in expected
+ * that only differs by case. Order is not significant.
+ *
+ * @param assertID
+ * identifier of assertion
+ * @param actual
+ * actual value
+ * @param expected
+ * Expected value, may not be null.
+ */
+ public void assertEqualsIgnoreCase(
+ String assertID,
+ Collection expected,
+ Collection actual) {
+ framework.assertEqualsIgnoreCase(this, assertID, expected, actual);
+ }
+
+ /**
+ * Asserts that each entry in actual is matched with an entry in expected
+ * that only differs by case. Order is significant.
+ *
+ * @param assertID
+ * identifier of assertion
+ * @param actual
+ * actual value
+ * @param expected
+ * Expected value, may not be null.
+ */
+ public void assertEqualsIgnoreCase(
+ String assertID,
+ List expected,
+ List actual) {
+ framework.assertEqualsIgnoreCase(this, assertID, expected, actual);
+ }
+
+ /**
+ * Asserts that expected.equalsIgnoreCase(actual) is true
+ *
+ * @param assertID
+ * identifier of assertion
+ * @param actual
+ * actual value
+ * @param expected
+ * Expected value, may not be null.
+ */
+ public void assertEqualsAutoCase(
+ String context,
+ String assertID,
+ String expected,
+ String actual) {
+ String contentType = getContentType();
+ //
+ // if the content type is HTML (not XHTML)
+ //
+ if ("text/html".equals(contentType)) {
+ //
+ // if the context is attribute, then use case-insentive comparison
+ //
+ if ("attribute".equals(context)) {
+ framework.assertEqualsIgnoreCase(this, assertID, expected, actual);
+ }
+ else {
+ //
+ // otherwise should be compared against uppercased expectation
+ framework.assertEquals(this, assertID, expected.toUpperCase(), actual);
+ }
+ }
+ else {
+ framework.assertEquals(this, assertID, expected, actual);
+ }
+ }
+
+ /**
+ * Creates an equivalent list where every member has
+ * been uppercased
+ *
+ */
+ private List toUpperCase(Collection expected) {
+ List upperd = new ArrayList(expected.size());
+ Iterator iter = expected.iterator();
+ while (iter.hasNext()) {
+ upperd.add(iter.next().toString().toUpperCase());
+ }
+ return upperd;
+ }
+
+ /**
+ * Asserts that each entry in actual is matched with an entry in expected
+ * that only differs by case. Order is not significant.
+ *
+ * @param assertID
+ * identifier of assertion
+ * @param actual
+ * actual value
+ * @param expected
+ * Expected value, may not be null.
+ */
+ public void assertEqualAutoCase(
+ String context,
+ String assertID,
+ Collection expected,
+ Collection actual) {
+ String contentType = getContentType();
+ if ("text/html".equals(contentType)) {
+ if ("attribute".equals(context)) {
+ assertEqualsIgnoreCase(assertID, expected, actual);
+ }
+ else {
+ framework.assertEquals(this, assertID, toUpperCase(expected), actual);
+ }
+
+ }
+ else {
+ framework.assertEquals(this, assertID, expected, actual);
+ }
+ }
+
+ /**
+ * Asserts that each entry in actual is matched with an entry in expected
+ * that only differs by case. Order is significant.
+ *
+ * @param assertID
+ * identifier of assertion
+ * @param actual
+ * actual value
+ * @param expected
+ * Expected value, may not be null.
+ */
+ public void assertEqualsAutoCase(
+ String context,
+ String assertID,
+ List expected,
+ List actual) {
+ String contentType = getContentType();
+ if ("text/html".equals(contentType)) {
+ if ("attribute".equals(context)) {
+ assertEqualsIgnoreCase(assertID, expected, actual);
+ }
+ else {
+ framework.assertEquals(this, assertID, toUpperCase(expected), actual);
+ }
+
+ }
+ else {
+ framework.assertEquals(this, assertID, expected, actual);
+ }
+ }
+
+ /**
+ * Asserts that expected.equals(actual) is true
+ *
+ * @param assertID
+ * identifier of assertion
+ * @param actual
+ * actual value
+ * @param expected
+ * Expected value, may not be null.
+ */
+ public void assertEquals(String assertID, String expected, String actual) {
+ framework.assertEquals(this, assertID, expected, actual);
+ }
+
+ /**
+ * Asserts that values of expected and actual are equal.
+ *
+ * @param assertID
+ * identifier of assertion
+ * @param actual
+ * actual value
+ * @param expected
+ * Expected value, may not be null.
+ */
+ public void assertEquals(String assertID, int expected, int actual) {
+ framework.assertEquals(this, assertID, expected, actual);
+ }
+
+ /**
+ * Asserts that values of expected and actual are equal.
+ *
+ * @param assertID
+ * identifier of assertion
+ * @param actual
+ * actual value
+ * @param expected
+ * Expected value, may not be null.
+ */
+ public void assertEquals(String assertID, double expected, double actual) {
+ framework.assertEquals(this, assertID, expected, actual);
+ }
+
+ /**
+ * Asserts that values of expected and actual are equal.
+ *
+ * @param assertID
+ * identifier of assertion
+ * @param actual
+ * actual value
+ * @param expected
+ * Expected value, may not be null.
+ */
+ public void assertEquals(
+ String assertID,
+ boolean expected,
+ boolean actual) {
+ framework.assertEquals(this, assertID, expected, actual);
+ }
+
+ /**
+ * Asserts that each entry in actual exactly matches with an entry in
+ * expected. Order is not significant.
+ *
+ * @param assertID
+ * identifier of assertion
+ * @param actual
+ * actual value
+ * @param expected
+ * Expected value, may not be null.
+ */
+ public void assertEquals(
+ String assertID,
+ Collection expected,
+ NodeList actual) {
+ Collection actualList = new ArrayList();
+ int actualLen = actual.getLength();
+ for (int i = 0; i < actualLen; i++) {
+ actualList.add(actual.item(i));
+ }
+ framework.assertEquals(this, assertID, expected, actualList);
+ }
+
+ /**
+ * Asserts that each entry in actual exactly matches with an entry in
+ * expected. Order is not significant.
+ *
+ * @param assertID
+ * identifier of assertion
+ * @param actual
+ * actual value
+ * @param expected
+ * Expected value, may not be null.
+ */
+ public void assertEquals(
+ String assertID,
+ Collection expected,
+ Collection actual) {
+ framework.assertEquals(this, assertID, expected, actual);
+ }
+
+ /**
+ * Asserts that expected.equalsIgnoreCase(actual) is false
+ *
+ * @param assertID
+ * identifier of assertion
+ * @param actual
+ * actual value
+ * @param expected
+ * Expected value, may not be null.
+ */
+ public void assertNotEqualsIgnoreCase(
+ String assertID,
+ String expected,
+ String actual) {
+ framework.assertNotEqualsIgnoreCase(this, assertID, expected, actual);
+ }
+
+ /**
+ * Asserts that expected.equalsIgnoreCase(actual) is false
+ *
+ * @param assertID
+ * identifier of assertion
+ * @param actual
+ * actual value
+ * @param expected
+ * Expected value, may not be null.
+ */
+ public void assertNotEqualsAutoCase(
+ String context,
+ String assertID,
+ String expected,
+ String actual) {
+ String contentType = getContentType();
+ if ("text/html".equals(contentType)) {
+ if ("attribute".equals(context)) {
+ framework.assertNotEqualsIgnoreCase(this, assertID, expected, actual);
+ }
+ else {
+ framework.assertNotEquals(this, assertID, expected.toUpperCase(),
+ actual);
+ }
+ }
+ framework.assertNotEquals(this, assertID, expected, actual);
+ }
+
+ /**
+ * Asserts that values of expected and actual are not equal.
+ *
+ * @param assertID
+ * identifier of assertion
+ * @param actual
+ * actual value
+ * @param expected
+ * Expected value, may not be null.
+ */
+ public void assertNotEquals(
+ String assertID,
+ String expected,
+ String actual) {
+ framework.assertNotEquals(this, assertID, expected, actual);
+ }
+
+ /**
+ * Asserts that values of expected and actual are not equal.
+ *
+ * @param assertID
+ * identifier of assertion
+ * @param actual
+ * actual value
+ * @param expected
+ * Expected value, may not be null.
+ */
+ public void assertNotEquals(String assertID, int expected, int actual) {
+ framework.assertNotEquals(this, assertID, expected, actual);
+ }
+
+ /**
+ * Asserts that values of expected and actual are not equal.
+ *
+ * @param assertID
+ * identifier of assertion
+ * @param actual
+ * actual value
+ * @param expected
+ * Expected value, may not be null.
+ */
+ public void assertNotEquals(
+ String assertID,
+ double expected,
+ double actual) {
+ framework.assertNotEquals(this, assertID, expected, actual);
+ }
+
+ /**
+ * Asserts aspects of a URI
+ *
+ * @param assertID
+ * identifier of assertion
+ * @param scheme
+ * Expected scheme, for example, "file". If null, scheme is
+ * ignored.
+ * @param path
+ * Expected path, for example, "/DOM/Test". If null, path is
+ * ignored.
+ * @param host
+ * Expected host, for example, "www.w3.org". If null, host is
+ * ignored.
+ * @param file
+ * Expected file, for example, "staff.xml". If null, file is
+ * ignored.
+ * @param name
+ * Expected name, for example, "staff". If null, name is
+ * ignored.
+ * @param name
+ * Expected name, for example, "staff". If null, name is
+ * ignored.
+ * @param isAbsolute
+ * if Boolean.TRUE, URI must be absolute. Null indicates no
+ * assertion.
+ * @param actual
+ * URI to be tested.
+ */
+ public void assertURIEquals(
+ String assertID,
+ String scheme,
+ String path,
+ String host,
+ String file,
+ String name,
+ String query,
+ String fragment,
+ Boolean isAbsolute,
+ String actual) {
+ //
+ // URI must be non-null
+ assertNotNull(assertID, actual);
+
+ String uri = actual;
+
+ int lastPound = actual.lastIndexOf("#");
+ String actualFragment = "";
+ if (lastPound != -1) {
+ //
+ // substring before pound
+ //
+ uri = actual.substring(0, lastPound);
+ actualFragment = actual.substring(lastPound + 1);
+ }
+ if (fragment != null) {
+ assertEquals(assertID, fragment, actualFragment);
+
+ }
+ int lastQuestion = uri.lastIndexOf("?");
+ String actualQuery = "";
+ if (lastQuestion != -1) {
+ //
+ // substring before pound
+ //
+ uri = actual.substring(0, lastQuestion);
+ actualQuery = actual.substring(lastQuestion + 1);
+ }
+ if (query != null) {
+ assertEquals(assertID, query, actualQuery);
+
+ }
+ int firstColon = uri.indexOf(":");
+ int firstSlash = uri.indexOf("/");
+ String actualPath = uri;
+ String actualScheme = "";
+ if (firstColon != -1 && firstColon < firstSlash) {
+ actualScheme = uri.substring(0, firstColon);
+ actualPath = uri.substring(firstColon + 1);
+ }
+
+ if (scheme != null) {
+ assertEquals(assertID, scheme, actualScheme);
+ }
+
+ if (path != null) {
+ assertEquals(assertID, path, actualPath);
+ }
+
+ if (host != null) {
+ String actualHost = "";
+ if (actualPath.startsWith("//")) {
+ int termSlash = actualPath.indexOf("/", 2);
+ actualHost = actualPath.substring(0, termSlash);
+ }
+ assertEquals(assertID, host, actualHost);
+ }
+
+ String actualFile = actualPath;
+ if (file != null || name != null) {
+ int finalSlash = actualPath.lastIndexOf("/");
+ if (finalSlash != -1) {
+ actualFile = actualPath.substring(finalSlash + 1);
+ }
+ if (file != null) {
+ assertEquals(assertID, file, actualFile);
+ }
+ }
+
+ if (name != null) {
+ String actualName = actualFile;
+ int finalPeriod = actualFile.lastIndexOf(".");
+ if (finalPeriod != -1) {
+ actualName = actualFile.substring(0, finalPeriod);
+ }
+ assertEquals(assertID, name, actualName);
+ }
+
+ if (isAbsolute != null) {
+ //
+ // Jar URL's will have any actual path like file:/c:/somedrive...
+ assertEquals(
+ assertID,
+ isAbsolute.booleanValue(),
+ actualPath.startsWith("/") || actualPath.startsWith("file:/"));
+ }
+ }
+
+ /**
+ * Compares the identity of actual and expected.
+ *
+ * @param expected
+ * expected
+ * @param actual
+ * actual
+ * @return true if actual and expected are the same object.
+ */
+ public boolean same(Object expected, Object actual) {
+ return framework.same(expected, actual);
+ }
+
+ /**
+ * Compares the value of actual and expected ignoring case.
+ *
+ * @param expected
+ * expected
+ * @param actual
+ * actual
+ * @return true if actual and expected are equal ignoring case.
+ */
+ public boolean equalsIgnoreCase(String expected, String actual) {
+ return framework.equalsIgnoreCase(expected, actual);
+ }
+
+ /**
+ * Compares the values in actual and expected ignoring case and order.
+ *
+ * @param expected
+ * expected
+ * @param actual
+ * actual
+ * @return true if actual and expected are equal ignoring case.
+ */
+ public boolean equalsIgnoreCase(Collection expected, Collection actual) {
+ return framework.equalsIgnoreCase(expected, actual);
+ }
+
+ /**
+ * Compares the values in actual and expected ignoring case.
+ *
+ * @param expected
+ * expected
+ * @param actual
+ * actual
+ * @return true if actual and expected are equal ignoring case.
+ */
+ public boolean equalsIgnoreCase(List expected, List actual) {
+ return framework.equalsIgnoreCase(expected, actual);
+ }
+
+ /**
+ * Compares the value of actual and expected ignoring case.
+ *
+ * @param expected
+ * expected
+ * @param actual
+ * actual
+ * @return true if actual and expected are equal ignoring case.
+ */
+ public boolean equalsAutoCase(String context, String expected, String actual) {
+ if ("text/html".equals(getContentType())) {
+ if ("attribute".equals(context)) {
+ return framework.equalsIgnoreCase(expected, actual);
+ }
+ else {
+ return framework.equals(expected.toUpperCase(), actual);
+ }
+ }
+ return framework.equals(expected, actual);
+ }
+
+ /**
+ * Compares the values in actual and expected ignoring case and order.
+ *
+ * @param expected
+ * expected
+ * @param actual
+ * actual
+ * @return true if actual and expected are equal ignoring case.
+ */
+ public boolean equalsAutoCase(String context, Collection expected,
+ Collection actual) {
+ if ("text/html".equals(getContentType())) {
+ if ("attribute".equals(context)) {
+ return framework.equalsIgnoreCase(expected, actual);
+ }
+ else {
+ return framework.equals(toUpperCase(expected), actual);
+ }
+ }
+ return framework.equals(expected, actual);
+ }
+
+ /**
+ * Compares the values in actual and expected ignoring case.
+ *
+ * @param expected
+ * expected
+ * @param actual
+ * actual
+ * @return true if actual and expected are equal ignoring case.
+ */
+ public boolean equalsAutoCase(String context, List expected, List actual) {
+ if ("text/html".equals(getContentType())) {
+ if ("attribute".equals(context)) {
+ return framework.equalsIgnoreCase(expected, actual);
+ }
+ else {
+ return framework.equals(toUpperCase(expected), actual);
+ }
+ }
+ return framework.equals(expected, actual);
+ }
+
+ /**
+ * Compares the values of actual and expected.
+ *
+ * @param expected
+ * expected
+ * @param actual
+ * actual
+ * @return true if actual and expected are equal.
+ */
+ public boolean equals(String expected, String actual) {
+ return framework.equals(expected, actual);
+ }
+
+ /**
+ * Compares the values of actual and expected.
+ *
+ * @param expected
+ * expected
+ * @param actual
+ * actual
+ * @return true if actual and expected are equal.
+ */
+ public boolean equals(int expected, int actual) {
+ return framework.equals(expected, actual);
+ }
+
+ /**
+ * Compares the values of actual and expected.
+ *
+ * @param expected
+ * expected
+ * @param actual
+ * actual
+ * @return true if actual and expected are equal.
+ */
+ public boolean equals(double expected, double actual) {
+ return framework.equals(expected, actual);
+ }
+
+ /**
+ * Compares the values in actual and expected ignoring order.
+ *
+ * @param expected
+ * expected
+ * @param actual
+ * actual
+ * @return true if actual and expected are equal.
+ */
+ public boolean equals(Collection expected, Collection actual) {
+ return framework.equals(expected, actual);
+ }
+
+ /**
+ * Compares the values in actual and expected.
+ *
+ * @param expected
+ * expected
+ * @param actual
+ * actual
+ * @return true if actual and expected are equal.
+ */
+ public boolean equals(List expected, List actual) {
+ return framework.equals(expected, actual);
+ }
+
+ /**
+ * Gets the size of the collection
+ *
+ * @param collection
+ * collection, may not be null.
+ * @return size of collection
+ */
+ public int size(Collection collection) {
+ return framework.size(collection);
+ }
+
+ /**
+ * Gets the size of the collection
+ *
+ * @param collection
+ * collection, may not be null.
+ * @return size of collection
+ */
+ public int size(NamedNodeMap collection) {
+ return framework.size(collection);
+ }
+
+ /**
+ * Gets the size of the collection
+ *
+ * @param collection
+ * collection, may not be null.
+ * @return size of collection
+ */
+ public int size(NodeList collection) {
+ return framework.size(collection);
+ }
+
+}
diff --git a/dom/src/test/java/org/w3c/domts/DOMTestDocumentBuilderFactory.java b/dom/src/test/java/org/w3c/domts/DOMTestDocumentBuilderFactory.java
new file mode 100644
index 0000000..b24e70e
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/DOMTestDocumentBuilderFactory.java
@@ -0,0 +1,192 @@
+/*
+ * Copyright (c) 2001-2004 World Wide Web Consortium,
+ * (Massachusetts Institute of Technology, Institut National de
+ * Recherche en Informatique et en Automatique, Keio University). All
+ * Rights Reserved. This program is distributed under the W3C's Software
+ * Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+ */
+
+package org.w3c.domts;
+
+import java.lang.reflect.Method;
+import java.util.ArrayList;
+import java.util.List;
+
+import org.w3c.dom.DOMImplementation;
+import org.w3c.dom.Document;
+
+/**
+ * This class represents a particular parser and configuration
+ * (such as entity-expanding, non-validating, whitespace ignoring)
+ * for a test session. Individual tests or suites within a
+ * session can override the session properties on a call to
+ * createBuilderFactory.
+ *
+ * @author Curt Arnold
+ */
+public abstract class DOMTestDocumentBuilderFactory {
+ /**
+ * Parser configuration
+ */
+ private final DocumentBuilderSetting[] settings;
+
+ /**
+ * Constructor
+ * @param properties Array of parser settings, may be null.
+ */
+ public DOMTestDocumentBuilderFactory(DocumentBuilderSetting[] settings) throws
+ DOMTestIncompatibleException {
+ if (settings == null) {
+ this.settings = new DocumentBuilderSetting[0];
+ }
+ else {
+ this.settings = (DocumentBuilderSetting[]) settings.clone();
+ }
+ }
+
+ /**
+ * Returns an instance of DOMTestDocumentBuilderFactory
+ * with the settings from the argument list
+ * and any non-revoked settings from the current object.
+ * @param settings array of settings, may be null.
+ */
+ public abstract DOMTestDocumentBuilderFactory newInstance(
+ DocumentBuilderSetting[] settings) throws DOMTestIncompatibleException;
+
+ public abstract DOMImplementation getDOMImplementation();
+
+ public abstract boolean hasFeature(String feature, String version);
+
+ public abstract Document load(java.net.URL url) throws DOMTestLoadException;
+
+ /**
+ * Creates XPath evaluator
+ * @param doc DOM document, may not be null
+ */
+ public Object createXPathEvaluator(Document doc) {
+ try {
+ Method getFeatureMethod = doc.getClass().getMethod("getFeature",
+ new Class[] {String.class, String.class});
+ if (getFeatureMethod != null) {
+ return getFeatureMethod.invoke(doc, new Object[] {"XPath", null});
+ }
+ }
+ catch (Exception ex) {
+ }
+ return doc;
+ }
+
+ /**
+ * Merges the settings from the specific test case or suite
+ * with the existing (typically session) settings.
+ * @param settings new settings, may be null which will
+ * return clone of existing settings.
+ */
+ protected DocumentBuilderSetting[] mergeSettings(DocumentBuilderSetting[]
+ newSettings) {
+ if (newSettings == null) {
+ return (DocumentBuilderSetting[]) settings.clone();
+ }
+ List mergedSettings = new ArrayList(settings.length + newSettings.length);
+ //
+ // all new settings are respected
+ //
+ for (int i = 0; i < newSettings.length; i++) {
+ mergedSettings.add(newSettings[i]);
+ }
+ //
+ // for all previous settings, take only those that
+ // do not conflict with existing settings
+ for (int i = 0; i < settings.length; i++) {
+ DocumentBuilderSetting setting = settings[i];
+ boolean hasConflict = false;
+ for (int j = 0; j < newSettings.length; j++) {
+ DocumentBuilderSetting newSetting = newSettings[j];
+ if (newSetting.hasConflict(setting) || setting.hasConflict(newSetting)) {
+ hasConflict = true;
+ break;
+ }
+ }
+ if (!hasConflict) {
+ mergedSettings.add(setting);
+ }
+ }
+
+ DocumentBuilderSetting[] mergedArray =
+ new DocumentBuilderSetting[mergedSettings.size()];
+ for (int i = 0; i < mergedSettings.size(); i++) {
+ mergedArray[i] = (DocumentBuilderSetting) mergedSettings.get(i);
+ }
+ return mergedArray;
+ }
+
+ public String addExtension(String testFileName) {
+ String contentType = getContentType();
+ if ("text/html".equals(contentType)) {
+ return testFileName + ".html";
+ }
+ if ("image/svg+xml".equals(contentType)) {
+ return testFileName + ".svg";
+ }
+ if ("application/xhtml+xml".equals(contentType)) {
+ return testFileName + ".xhtml";
+ }
+ return testFileName + ".xml";
+ }
+
+ public abstract boolean isCoalescing();
+
+ public abstract boolean isExpandEntityReferences();
+
+ public abstract boolean isIgnoringElementContentWhitespace();
+
+ public abstract boolean isNamespaceAware();
+
+ public abstract boolean isValidating();
+
+ public String getContentType() {
+ return System.getProperty("org.w3c.domts.contentType", "text/xml");
+ }
+
+ /**
+ * Creates an array of all determinable settings for the DocumentBuilder
+ * including those at implementation defaults.
+ * @param builder must not be null
+ */
+ public final DocumentBuilderSetting[] getActualSettings() {
+
+ DocumentBuilderSetting[] allSettings = new DocumentBuilderSetting[] {
+ DocumentBuilderSetting.coalescing,
+ DocumentBuilderSetting.expandEntityReferences,
+ DocumentBuilderSetting.hasNullString,
+ DocumentBuilderSetting.ignoringElementContentWhitespace,
+ DocumentBuilderSetting.namespaceAware,
+ DocumentBuilderSetting.signed,
+ DocumentBuilderSetting.validating,
+ DocumentBuilderSetting.notCoalescing,
+ DocumentBuilderSetting.notExpandEntityReferences,
+ DocumentBuilderSetting.notHasNullString,
+ DocumentBuilderSetting.notIgnoringElementContentWhitespace,
+ DocumentBuilderSetting.notNamespaceAware,
+ DocumentBuilderSetting.notSigned,
+ DocumentBuilderSetting.notValidating
+ };
+
+ List list = new ArrayList(allSettings.length / 2);
+ for (int i = 0; i < allSettings.length; i++) {
+ if (allSettings[i].hasSetting(this)) {
+ list.add(allSettings[i]);
+ }
+ }
+ DocumentBuilderSetting[] settings = new DocumentBuilderSetting[list.size()];
+ for (int i = 0; i < settings.length; i++) {
+ settings[i] = (DocumentBuilderSetting) list.get(i);
+ }
+ return settings;
+ }
+
+}
diff --git a/dom/src/test/java/org/w3c/domts/DOMTestFramework.java b/dom/src/test/java/org/w3c/domts/DOMTestFramework.java
new file mode 100644
index 0000000..c836f4b
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/DOMTestFramework.java
@@ -0,0 +1,177 @@
+/*
+ * Copyright (c) 2001-2004 World Wide Web Consortium,
+ * (Massachusetts Institute of Technology, Institut National de
+ * Recherche en Informatique et en Automatique, Keio University). All
+ * Rights Reserved. This program is distributed under the W3C's Software
+ * Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+ */
+
+package org.w3c.domts;
+
+import java.util.Collection;
+import java.util.List;
+
+import javax.xml.parsers.DocumentBuilder;
+
+import org.w3c.dom.NamedNodeMap;
+import org.w3c.dom.NodeList;
+
+/**
+ * This interface provides services typically provided by a test framework
+ */
+public interface DOMTestFramework {
+ boolean hasFeature(
+ DocumentBuilder docBuilder,
+ String feature,
+ String version);
+
+ void wait(int millisecond);
+
+ void fail(DOMTestCase test, String assertID);
+
+ void assertTrue(DOMTestCase test, String assertID, boolean actual);
+
+ void assertFalse(DOMTestCase test, String assertID, boolean actual);
+
+ void assertNull(DOMTestCase test, String assertID, Object actual);
+
+ void assertNotNull(DOMTestCase test, String assertID, Object actual);
+
+ void assertSame(
+ DOMTestCase test,
+ String assertID,
+ Object expected,
+ Object actual);
+
+ void assertInstanceOf(
+ DOMTestCase test,
+ String assertID,
+ Object obj,
+ Class cls);
+
+ void assertSize(
+ DOMTestCase test,
+ String assertID,
+ int expectedSize,
+ NodeList collection);
+
+ void assertSize(
+ DOMTestCase test,
+ String assertID,
+ int expectedSize,
+ NamedNodeMap collection);
+
+ void assertSize(
+ DOMTestCase test,
+ String assertID,
+ int expectedSize,
+ Collection collection);
+
+ void assertEqualsIgnoreCase(
+ DOMTestCase test,
+ String assertID,
+ String expected,
+ String actual);
+
+ void assertEqualsIgnoreCase(
+ DOMTestCase test,
+ String assertID,
+ Collection expected,
+ Collection actual);
+
+ void assertEqualsIgnoreCase(
+ DOMTestCase test,
+ String assertID,
+ List expected,
+ List actual);
+
+ void assertEquals(
+ DOMTestCase test,
+ String assertID,
+ String expected,
+ String actual);
+
+ void assertEquals(
+ DOMTestCase test,
+ String assertID,
+ int expected,
+ int actual);
+
+ void assertEquals(
+ DOMTestCase test,
+ String assertID,
+ boolean expected,
+ boolean actual);
+
+ void assertEquals(
+ DOMTestCase test,
+ String assertID,
+ double expected,
+ double actual);
+
+ void assertEquals(
+ DOMTestCase test,
+ String assertID,
+ Collection expected,
+ Collection actual);
+
+ void assertNotEqualsIgnoreCase(
+ DOMTestCase test,
+ String assertID,
+ String expected,
+ String actual);
+
+ void assertNotEquals(
+ DOMTestCase test,
+ String assertID,
+ String expected,
+ String actual);
+
+ void assertNotEquals(
+ DOMTestCase test,
+ String assertID,
+ int expected,
+ int actual);
+
+ void assertNotEquals(
+ DOMTestCase test,
+ String assertID,
+ boolean expected,
+ boolean actual);
+
+ void assertNotEquals(
+ DOMTestCase test,
+ String assertID,
+ double expected,
+ double actual);
+
+ boolean same(Object expected, Object actual);
+
+ boolean equalsIgnoreCase(String expected, String actual);
+
+ boolean equalsIgnoreCase(Collection expected, Collection actual);
+
+ boolean equalsIgnoreCase(List expected, List actual);
+
+ boolean equals(String expected, String actual);
+
+ boolean equals(int expected, int actual);
+
+ boolean equals(boolean expected, boolean actual);
+
+ boolean equals(double expected, double actual);
+
+ boolean equals(Collection expected, Collection actual);
+
+ boolean equals(List expected, List actual);
+
+ int size(Collection collection);
+
+ int size(NamedNodeMap collection);
+
+ int size(NodeList collection);
+}
diff --git a/dom/src/test/java/org/w3c/domts/DOMTestIncompatibleException.java b/dom/src/test/java/org/w3c/domts/DOMTestIncompatibleException.java
new file mode 100644
index 0000000..2a1c0e0
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/DOMTestIncompatibleException.java
@@ -0,0 +1,76 @@
+/*
+ * Copyright (c) 2001-2004 World Wide Web Consortium,
+ * (Massachusetts Institute of Technology, Institut National de
+ * Recherche en Informatique et en Automatique, Keio University). All
+ * Rights Reserved. This program is distributed under the W3C's Software
+ * Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+ */
+
+
+package org.w3c.domts;
+
+
+/**
+ * This exception represents a mismatch between the
+ * requirements of the test (for example, entity preserving)
+ * and the capabilities of the parser under test.
+ * @author Curt Arnold
+ */
+public class DOMTestIncompatibleException
+ extends Exception {
+ private final String msg;
+
+ private DOMTestIncompatibleException(String msg) {
+ this.msg = msg;
+ }
+
+ /**
+ * Constructor from a ParserConfigurationException
+ * or reflection exception
+ */
+ public DOMTestIncompatibleException(Throwable ex,
+ DocumentBuilderSetting setting) {
+ if (ex != null) {
+ msg = ex.toString();
+ }
+ else {
+ if (setting != null) {
+ msg = setting.toString();
+ }
+ else {
+ msg = super.toString();
+ }
+ }
+ }
+
+ public static DOMTestIncompatibleException incompatibleFeature(String feature,
+ String version) {
+ StringBuffer buf = new StringBuffer(
+ "Implementation does not support feature \"");
+ buf.append(feature);
+ buf.append("\" version=\"");
+ buf.append(version);
+ buf.append("\".");
+ return new DOMTestIncompatibleException(buf.toString());
+ }
+
+ public static DOMTestIncompatibleException incompatibleLoad(String href,
+ String contentType) {
+ StringBuffer buf = new StringBuffer(
+ "Document is incompatible with content type, \"");
+ buf.append(href);
+ buf.append("\" not available for =\"");
+ buf.append(contentType);
+ buf.append("\".");
+ return new DOMTestIncompatibleException(buf.toString());
+ }
+
+ public String toString() {
+ return msg;
+ }
+
+}
diff --git a/dom/src/test/java/org/w3c/domts/DOMTestInnerClass.java b/dom/src/test/java/org/w3c/domts/DOMTestInnerClass.java
new file mode 100644
index 0000000..2c9d9ba
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/DOMTestInnerClass.java
@@ -0,0 +1,193 @@
+/*
+ * Copyright (c) 2001-2004 World Wide Web Consortium,
+ * (Massachusetts Institute of Technology, Institut National de
+ * Recherche en Informatique et en Automatique, Keio University). All
+ * Rights Reserved. This program is distributed under the W3C's Software
+ * Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+ */
+
+package org.w3c.domts;
+
+import java.util.Collection;
+import java.util.List;
+
+import org.w3c.dom.DOMImplementation;
+import org.w3c.dom.NamedNodeMap;
+import org.w3c.dom.NodeList;
+
+/**
+ * This class provides access to DOMTestCase methods (like
+ * assertEquals) for inner classes
+ */
+public class DOMTestInnerClass {
+ private final DOMTestCase test;
+
+ public DOMTestInnerClass(DOMTestCase test) {
+ this.test = test;
+ }
+
+ public void wait(int millisecond) {
+ test.wait(millisecond);
+ }
+
+ public void assertTrue(String assertID, boolean actual) {
+ test.assertTrue(assertID, actual);
+ }
+
+ public void assertFalse(String assertID, boolean actual) {
+ test.assertFalse(assertID, actual);
+ }
+
+ public void assertNull(String assertID, Object actual) {
+ test.assertNull(assertID, actual);
+ }
+
+ public void assertNotNull(String assertID, Object actual) {
+ test.assertNotNull(assertID, actual);
+ }
+
+ public void assertSame(String assertID, Object expected, Object actual) {
+ test.assertSame(assertID, expected, actual);
+ }
+
+ public void assertInstanceOf(String assertID, Class cls, Object obj) {
+ test.assertInstanceOf(assertID, cls, obj);
+ }
+
+ public void assertSize(String assertID, int expectedSize, NodeList collection) {
+ test.assertSize(assertID, expectedSize, collection);
+ }
+
+ public void assertSize(String assertID, int expectedSize,
+ NamedNodeMap collection) {
+ test.assertSize(assertID, expectedSize, collection);
+ }
+
+ public void assertSize(String assertID, int expectedSize,
+ Collection collection) {
+ test.assertSize(assertID, expectedSize, collection);
+ }
+
+ public void assertEqualsIgnoreCase(String assertID, String expected,
+ String actual) {
+ test.assertEqualsIgnoreCase(assertID, expected, actual);
+ }
+
+ public void assertEqualsIgnoreCase(String assertID, Collection expected,
+ Collection actual) {
+ test.assertEqualsIgnoreCase(assertID, expected, actual);
+ }
+
+ public void assertEqualsIgnoreCase(String assertID, List expected,
+ List actual) {
+ test.assertEqualsIgnoreCase(assertID, expected, actual);
+ }
+
+ public void assertEquals(String assertID, String expected, String actual) {
+ test.assertEquals(assertID, expected, actual);
+ }
+
+ public void assertEquals(String assertID, int expected, int actual) {
+ test.assertEquals(assertID, expected, actual);
+ }
+
+ public void assertEquals(String assertID, double expected, double actual) {
+ test.assertEquals(assertID, expected, actual);
+ }
+
+ public void assertEquals(String assertID, boolean expected, boolean actual) {
+ test.assertEquals(assertID, expected, actual);
+ }
+
+ public void assertEquals(String assertID, Collection expected,
+ NodeList actual) {
+ test.assertEquals(assertID, expected, actual);
+ }
+
+ public void assertEquals(String assertID, Collection expected,
+ Collection actual) {
+ test.assertEquals(assertID, expected, actual);
+ }
+
+ public void assertNotEqualsIgnoreCase(String assertID, String expected,
+ String actual) {
+ test.assertNotEqualsIgnoreCase(assertID, expected, actual);
+ }
+
+ public void assertNotEquals(String assertID, String expected, String actual) {
+ test.assertNotEquals(assertID, expected, actual);
+ }
+
+ public void assertNotEquals(String assertID, int expected, int actual) {
+ test.assertNotEquals(assertID, expected, actual);
+ }
+
+ public void assertNotEquals(String assertID, double expected, double actual) {
+ test.assertNotEquals(assertID, expected, actual);
+ }
+
+ public void assertURIEquals(String assertID, String scheme, String path,
+ String host, String file, String name,
+ String query, String fragment, Boolean isAbsolute,
+ String actual) {
+ test.assertURIEquals(assertID, scheme, path, host, file, name, query,
+ fragment, isAbsolute, actual);
+ }
+
+ public boolean same(Object expected, Object actual) {
+ return test.same(expected, actual);
+ }
+
+ public boolean equalsIgnoreCase(String expected, String actual) {
+ return test.equalsIgnoreCase(expected, actual);
+ }
+
+ public boolean equalsIgnoreCase(Collection expected, Collection actual) {
+ return test.equalsIgnoreCase(expected, actual);
+ }
+
+ public boolean equalsIgnoreCase(List expected, List actual) {
+ return test.equalsIgnoreCase(expected, actual);
+ }
+
+ public boolean equals(String expected, String actual) {
+ return test.equals(expected, actual);
+ }
+
+ public boolean equals(int expected, int actual) {
+ return test.equals(expected, actual);
+ }
+
+ public boolean equals(double expected, double actual) {
+ return test.equals(expected, actual);
+ }
+
+ public boolean equals(Collection expected, Collection actual) {
+ return test.equals(expected, actual);
+ }
+
+ public boolean equals(List expected, List actual) {
+ return test.equals(expected, actual);
+ }
+
+ public int size(Collection collection) {
+ return test.size(collection);
+ }
+
+ public int size(NamedNodeMap collection) {
+ return test.size(collection);
+ }
+
+ public int size(NodeList collection) {
+ return test.size(collection);
+ }
+
+ public DOMImplementation getImplementation() {
+ return test.getImplementation();
+ }
+
+}
diff --git a/dom/src/test/java/org/w3c/domts/DOMTestLoadException.java b/dom/src/test/java/org/w3c/domts/DOMTestLoadException.java
new file mode 100644
index 0000000..7d320ba
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/DOMTestLoadException.java
@@ -0,0 +1,40 @@
+/*
+ * Copyright (c) 2001-2004 World Wide Web Consortium,
+ * (Massachusetts Institute of Technology, Institut National de
+ * Recherche en Informatique et en Automatique, Keio University). All
+ * Rights Reserved. This program is distributed under the W3C's Software
+ * Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+ */
+
+package org.w3c.domts;
+
+
+/**
+ * Encapsulates a concrete load exception such as
+ * a SAX exception
+ * @author Curt Arnold
+ * @date 2 Feb 2002
+ */
+public class DOMTestLoadException
+ extends Exception {
+ private final Throwable innerException;
+
+ /**
+ * Constructor
+ * @param innerException should not be null
+ */
+ public DOMTestLoadException(Throwable innerException) {
+ this.innerException = innerException;
+ }
+
+ public String toString() {
+ if (innerException != null) {
+ return innerException.toString();
+ }
+ return super.toString();
+ }
+}
diff --git a/dom/src/test/java/org/w3c/domts/DOMTestSink.java b/dom/src/test/java/org/w3c/domts/DOMTestSink.java
new file mode 100644
index 0000000..9c641a7
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/DOMTestSink.java
@@ -0,0 +1,27 @@
+/*
+ * Copyright (c) 2001-2004 World Wide Web Consortium,
+ * (Massachusetts Institute of Technology, Institut National de
+ * Recherche en Informatique et en Automatique, Keio University). All
+ * Rights Reserved. This program is distributed under the W3C's Software
+ * Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+ */
+
+/*
+ $Log: DOMTestSink.java,v $
+ Revision 1.2 2004/03/11 01:44:21 dom-ts-4
+ Checkstyle fixes (bug 592)
+
+ Revision 1.1 2001/07/23 04:52:20 dom-ts-4
+ Initial test running using JUnit.
+
+ */
+
+package org.w3c.domts;
+
+public interface DOMTestSink {
+ public void addTest(Class test);
+}
diff --git a/dom/src/test/java/org/w3c/domts/DOMTestSuite.java b/dom/src/test/java/org/w3c/domts/DOMTestSuite.java
new file mode 100644
index 0000000..94a76b8
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/DOMTestSuite.java
@@ -0,0 +1,62 @@
+/*
+ * Copyright (c) 2001-2004 World Wide Web Consortium,
+ * (Massachusetts Institute of Technology, Institut National de
+ * Recherche en Informatique et en Automatique, Keio University). All
+ * Rights Reserved. This program is distributed under the W3C's Software
+ * Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+ */
+
+/*
+ $Log: DOMTestSuite.java,v $
+ Revision 1.4 2004/03/11 01:44:21 dom-ts-4
+ Checkstyle fixes (bug 592)
+
+ Revision 1.3 2002/02/03 04:22:35 dom-ts-4
+ DOM4J and Batik support added.
+ Rework of parser settings
+
+ Revision 1.2 2001/07/23 04:52:20 dom-ts-4
+ Initial test running using JUnit.
+
+ */
+
+package org.w3c.domts;
+
+/**
+ * Abstract base class for all test suites
+ * (that is any collection of DOMTest's)
+ *
+ * @author Curt Arnold
+ */
+public abstract class DOMTestSuite
+ extends DOMTest {
+ /**
+ * This constructor is used for suites that
+ * assert one or more implementation attributes or
+ * features. setLibrary should be called before
+ * the completion of the constructor in the derived class.
+ */
+ protected DOMTestSuite() {
+ }
+
+ /**
+ * This constructor is used for suites that make no
+ * additional requirements on the parser configuration.
+ * @param factory may not be null
+ */
+ protected DOMTestSuite(DOMTestDocumentBuilderFactory factory) {
+ super(factory);
+ }
+
+ /**
+ * Adds a test to the test suite. This method can
+ * only be run after the test suite has been attached
+ * to a test framework since each framework implements
+ * test suites in different manners.
+ */
+ abstract public void build(DOMTestSink sink);
+}
diff --git a/dom/src/test/java/org/w3c/domts/DocumentBuilderSetting.java b/dom/src/test/java/org/w3c/domts/DocumentBuilderSetting.java
new file mode 100644
index 0000000..7aaf652
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/DocumentBuilderSetting.java
@@ -0,0 +1,282 @@
+/*
+ * Copyright (c) 2001-2004 World Wide Web Consortium, (Massachusetts Institute
+ * of Technology, Institut National de Recherche en Informatique et en
+ * Automatique, Keio University). All Rights Reserved. This program is
+ * distributed under the W3C's Software Intellectual Property License. This
+ * program 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 W3C License
+ * http://www.w3.org/Consortium/Legal/ for more details.
+ */
+
+package org.w3c.domts;
+
+import javax.xml.parsers.DocumentBuilderFactory;
+
+/**
+ * This class is an parser setting, such as non-validating or entity-expanding.
+ *
+ * @author Curt Arnold @date 2 Feb 2002
+ */
+public final class DocumentBuilderSetting {
+ /**
+ * property name.
+ */
+ private final String property;
+
+ /**
+ * property value.
+ */
+ private final boolean value;
+
+ /**
+ * strategy used to set or get property value.
+ */
+ private final DocumentBuilderSettingStrategy strategy;
+
+ /**
+ * coalescing = true.
+ */
+ public static final DocumentBuilderSetting coalescing =
+ new DocumentBuilderSetting(
+ "coalescing",
+ true,
+ DocumentBuilderSettingStrategy.coalescing);
+
+ /**
+ * coalescing = false.
+ */
+ public static final DocumentBuilderSetting notCoalescing =
+ new DocumentBuilderSetting(
+ "coalescing",
+ false,
+ DocumentBuilderSettingStrategy.coalescing);
+
+ /**
+ * expandEntityReferences = false.
+ */
+ public static final DocumentBuilderSetting expandEntityReferences =
+ new DocumentBuilderSetting(
+ "expandEntityReferences",
+ true,
+ DocumentBuilderSettingStrategy.expandEntityReferences);
+
+ /**
+ * expandEntityReferences = true.
+ */
+ public static final DocumentBuilderSetting notExpandEntityReferences =
+ new DocumentBuilderSetting(
+ "expandEntityReferences",
+ false,
+ DocumentBuilderSettingStrategy.expandEntityReferences);
+
+ /**
+ * ignoringElementContentWhitespace = true.
+ */
+ public static final DocumentBuilderSetting ignoringElementContentWhitespace =
+ new DocumentBuilderSetting(
+ "ignoringElementContentWhitespace",
+ true,
+ DocumentBuilderSettingStrategy.ignoringElementContentWhitespace);
+
+ /**
+ * ignoringElementContentWhitespace = false.
+ */
+ public static final DocumentBuilderSetting
+ notIgnoringElementContentWhitespace =
+ new DocumentBuilderSetting(
+ "ignoringElementContentWhitespace",
+ false,
+ DocumentBuilderSettingStrategy.ignoringElementContentWhitespace);
+
+ /**
+ * namespaceAware = true.
+ */
+ public static final DocumentBuilderSetting namespaceAware =
+ new DocumentBuilderSetting(
+ "namespaceAware",
+ true,
+ DocumentBuilderSettingStrategy.namespaceAware);
+
+ /**
+ * namespaceAware = false.
+ */
+ public static final DocumentBuilderSetting notNamespaceAware =
+ new DocumentBuilderSetting(
+ "namespaceAware",
+ false,
+ DocumentBuilderSettingStrategy.namespaceAware);
+
+ /**
+ * validating = true.
+ */
+ public static final DocumentBuilderSetting validating =
+ new DocumentBuilderSetting(
+ "validating",
+ true,
+ DocumentBuilderSettingStrategy.validating);
+
+ /**
+ * validating = false.
+ */
+ public static final DocumentBuilderSetting notValidating =
+ new DocumentBuilderSetting(
+ "validating",
+ false,
+ DocumentBuilderSettingStrategy.validating);
+
+ /**
+ * signed = true.
+ */
+ public static final DocumentBuilderSetting signed =
+ new DocumentBuilderSetting(
+ "signed",
+ true,
+ DocumentBuilderSettingStrategy.signed);
+
+ /**
+ * signed = false.
+ */
+ public static final DocumentBuilderSetting notSigned =
+ new DocumentBuilderSetting(
+ "signed",
+ false,
+ DocumentBuilderSettingStrategy.signed);
+
+ /**
+ * hasNullString = true.
+ */
+ public static final DocumentBuilderSetting hasNullString =
+ new DocumentBuilderSetting(
+ "hasNullString",
+ true,
+ DocumentBuilderSettingStrategy.hasNullString);
+
+ /**
+ * hasNullString = false.
+ */
+ public static final DocumentBuilderSetting notHasNullString =
+ new DocumentBuilderSetting(
+ "hasNullString",
+ false,
+ DocumentBuilderSettingStrategy.hasNullString);
+
+ /**
+ * Schema validating enabled.
+ */
+ public static final DocumentBuilderSetting schemaValidating =
+ new DocumentBuilderSetting(
+ "schemaValidating",
+ true,
+ DocumentBuilderSettingStrategy.schemaValidating);
+
+ /**
+ * Schema validating disabled.
+ */
+ public static final DocumentBuilderSetting notSchemaValidating =
+ new DocumentBuilderSetting(
+ "schemaValidating",
+ false,
+ DocumentBuilderSettingStrategy.schemaValidating);
+
+ /**
+ * Comments ignored.
+ */
+ public static final DocumentBuilderSetting ignoringComments =
+ new DocumentBuilderSetting(
+ "ignoringComments",
+ true,
+ DocumentBuilderSettingStrategy.ignoringComments);
+
+ /**
+ * Comments preserved.
+ */
+ public static final DocumentBuilderSetting notIgnoringComments =
+ new DocumentBuilderSetting(
+ "ignoringComments",
+ false,
+ DocumentBuilderSettingStrategy.ignoringComments);
+
+ /**
+ * Protected constructor, use static members for supported settings.
+ * @param property property name, follows JAXP.
+ * @param value property value
+ * @param strategy strategy, may not be null
+ */
+ protected DocumentBuilderSetting(
+ String property,
+ boolean value,
+ DocumentBuilderSettingStrategy strategy) {
+ if (property == null) {
+ throw new NullPointerException("property");
+ }
+ this.property = property;
+ this.value = value;
+ this.strategy = strategy;
+ }
+
+ /**
+ * Returns true if the settings have a conflict or are identical.
+ *
+ * @param other
+ * other setting, may not be null.
+ * @return true if this setting and the specified setting conflict
+ */
+ public final boolean hasConflict(DocumentBuilderSetting other) {
+ if (other == null) {
+ throw new NullPointerException("other");
+ }
+ if (other == this) {
+ return true;
+ }
+ return strategy.hasConflict(other.strategy);
+ }
+
+ /**
+ * Determines current value of setting.
+ * @param factory DOMTestDocumentBuilderFactory factory
+ * @return boolean true if property enabled.
+ */
+ public final boolean hasSetting(DOMTestDocumentBuilderFactory factory) {
+ return strategy.hasSetting(factory) == value;
+ }
+
+ /**
+ * Attempts to change builder to have this setting.
+ * @param factory DocumentBuilderFactory Factory for DOM builders
+ * @throws DOMTestIncompatibleException
+ * if factory does not support the setting
+ */
+ public final void applySetting(DocumentBuilderFactory factory) throws
+ DOMTestIncompatibleException {
+ strategy.applySetting(factory, value);
+ }
+
+ /**
+ * Gets the property name.
+ * @return property name
+ */
+ public final String getProperty() {
+ return property;
+ }
+
+ /**
+ * Gets the property value.
+ * @return property value
+ */
+ public final boolean getValue() {
+ return value;
+ }
+
+ /**
+ * Gets a string representation of the setting.
+ * @return string representation
+ */
+ public final String toString() {
+ StringBuffer builder = new StringBuffer(property);
+ builder.append('=');
+ builder.append(String.valueOf(value));
+ return builder.toString();
+ }
+
+}
diff --git a/dom/src/test/java/org/w3c/domts/DocumentBuilderSettingStrategy.java b/dom/src/test/java/org/w3c/domts/DocumentBuilderSettingStrategy.java
new file mode 100644
index 0000000..6df1a92
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/DocumentBuilderSettingStrategy.java
@@ -0,0 +1,199 @@
+/*
+ * Copyright (c) 2001-2004 World Wide Web Consortium, (Massachusetts Institute of
+ * Technology, Institut National de Recherche en Informatique et en
+ * Automatique, Keio University). All Rights Reserved. This program is
+ * distributed under the W3C's Software Intellectual Property License. This
+ * program 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 W3C License
+ * http://www.w3.org/Consortium/Legal/ for more details.
+ */
+
+package org.w3c.domts;
+
+import java.lang.reflect.Method;
+
+import javax.xml.parsers.DocumentBuilderFactory;
+
+/**
+ * This class is a strategy that provides the mapping from an abstract setting
+ * (such as DocumentBuilderSetting.validating) to a specific DOM implementation
+ *
+ * @author Curt Arnold @date 2 Feb 2002
+ */
+public abstract class DocumentBuilderSettingStrategy {
+ protected DocumentBuilderSettingStrategy() {
+ }
+
+ private static final String JAXP_SCHEMA_LANGUAGE =
+ "http://java.sun.com/xml/jaxp/properties/schemaLanguage";
+ private static final String W3C_XML_SCHEMA =
+ "http://www.w3.org/2001/XMLSchema";
+
+ public boolean hasConflict(DocumentBuilderSettingStrategy other) {
+ return (other == this);
+ }
+
+ public abstract void applySetting(
+ DocumentBuilderFactory factory,
+ boolean value) throws DOMTestIncompatibleException;
+
+ public abstract boolean hasSetting(DOMTestDocumentBuilderFactory factory);
+
+ public static final DocumentBuilderSettingStrategy coalescing =
+ new DocumentBuilderSettingStrategy() {
+ public void applySetting(DocumentBuilderFactory factory, boolean value)
+ throws DOMTestIncompatibleException {
+ factory.setCoalescing(value);
+ }
+
+ public boolean hasSetting(DOMTestDocumentBuilderFactory factory) {
+ return factory.isCoalescing();
+ }
+
+ };
+
+ public static final DocumentBuilderSettingStrategy
+ expandEntityReferences =
+ new DocumentBuilderSettingStrategy() {
+ public void applySetting(DocumentBuilderFactory factory, boolean value)
+ throws DOMTestIncompatibleException {
+ factory.setExpandEntityReferences(value);
+ }
+
+ public boolean hasSetting(DOMTestDocumentBuilderFactory factory) {
+ return factory.isExpandEntityReferences();
+ }
+ };
+
+ public static final DocumentBuilderSettingStrategy
+ ignoringElementContentWhitespace =
+ new DocumentBuilderSettingStrategy() {
+ public void applySetting(DocumentBuilderFactory factory, boolean value)
+ throws DOMTestIncompatibleException {
+ factory.setIgnoringElementContentWhitespace(value);
+ }
+
+ public boolean hasSetting(DOMTestDocumentBuilderFactory factory) {
+ return factory.isIgnoringElementContentWhitespace();
+ }
+ };
+
+ public static final DocumentBuilderSettingStrategy ignoringComments =
+ new DocumentBuilderSettingStrategy() {
+ public void applySetting(DocumentBuilderFactory factory, boolean value)
+ throws DOMTestIncompatibleException {
+ if (value) {
+ throw new DOMTestIncompatibleException(
+ new Exception("ignoreComments=true not supported"),
+ DocumentBuilderSetting.ignoringComments);
+ }
+ }
+
+ public boolean hasSetting(DOMTestDocumentBuilderFactory factory) {
+ return false;
+ }
+ };
+
+ public static final DocumentBuilderSettingStrategy namespaceAware =
+ new DocumentBuilderSettingStrategy() {
+ public void applySetting(DocumentBuilderFactory factory, boolean value) throws
+ DOMTestIncompatibleException {
+ factory.setNamespaceAware(value);
+ }
+
+ public boolean hasSetting(DOMTestDocumentBuilderFactory factory) {
+ return factory.isNamespaceAware();
+ }
+ };
+
+ public static final DocumentBuilderSettingStrategy validating =
+ new DocumentBuilderSettingStrategy() {
+ public void applySetting(DocumentBuilderFactory factory, boolean value) throws
+ DOMTestIncompatibleException {
+ factory.setValidating(value);
+ }
+
+ public boolean hasSetting(DOMTestDocumentBuilderFactory factory) {
+ return factory.isValidating();
+ }
+ };
+
+ public static final DocumentBuilderSettingStrategy signed =
+ new DocumentBuilderSettingStrategy() {
+ public void applySetting(DocumentBuilderFactory factory, boolean value) throws
+ DOMTestIncompatibleException {
+ if (!value) {
+ throw new DOMTestIncompatibleException(
+ null,
+ DocumentBuilderSetting.notSigned);
+ }
+ }
+
+ public boolean hasSetting(DOMTestDocumentBuilderFactory factory) {
+ return true;
+ }
+ };
+
+ public static final DocumentBuilderSettingStrategy hasNullString =
+ new DocumentBuilderSettingStrategy() {
+ public void applySetting(DocumentBuilderFactory factory, boolean value) throws
+ DOMTestIncompatibleException {
+ if (!value) {
+ throw new DOMTestIncompatibleException(
+ null,
+ DocumentBuilderSetting.notHasNullString);
+ }
+ }
+
+ public boolean hasSetting(DOMTestDocumentBuilderFactory factory) {
+ return true;
+ }
+ };
+
+ public static final DocumentBuilderSettingStrategy schemaValidating =
+ new DocumentBuilderSettingStrategy() {
+ public void applySetting(DocumentBuilderFactory factory, boolean value) throws
+ DOMTestIncompatibleException {
+ if (value) {
+ factory.setNamespaceAware(true);
+ factory.setValidating(true);
+ factory.setAttribute(JAXP_SCHEMA_LANGUAGE, W3C_XML_SCHEMA);
+ }
+ else {
+ factory.setAttribute(JAXP_SCHEMA_LANGUAGE,
+ "http://www.w3.org/TR/REC-xml");
+ }
+ }
+
+ public boolean hasSetting(DOMTestDocumentBuilderFactory factory) {
+ try {
+ if (factory.isValidating()) {
+ Method getAttrMethod = factory.getClass().getMethod("getAttribute",
+ new Class[] {String.class});
+ String val = (String) getAttrMethod.invoke(factory,
+ new Object[] {JAXP_SCHEMA_LANGUAGE});
+ return W3C_XML_SCHEMA.equals(val);
+ }
+ }
+ catch (Exception ex) {
+ }
+ return false;
+ }
+
+ //
+ // schema validating conflicts with namespaceAware
+ // and validating
+ //
+ public boolean hasConflict(DocumentBuilderSettingStrategy other) {
+ if (other == this ||
+ other == DocumentBuilderSettingStrategy.namespaceAware ||
+ other == DocumentBuilderSettingStrategy.validating) {
+ return true;
+ }
+ return false;
+ }
+
+ };
+
+}
diff --git a/dom/src/test/java/org/w3c/domts/EventMonitor.java b/dom/src/test/java/org/w3c/domts/EventMonitor.java
new file mode 100644
index 0000000..909ca4e
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/EventMonitor.java
@@ -0,0 +1,68 @@
+/*
+ * Copyright (c) 2001-2004 World Wide Web Consortium,
+ * (Massachusetts Institute of Technology, Institut National de
+ * Recherche en Informatique et en Automatique, Keio University). All
+ * Rights Reserved. This program is distributed under the W3C's Software
+ * Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+ */
+
+package org.w3c.domts;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.w3c.dom.events.Event;
+import org.w3c.dom.events.EventListener;
+
+/**
+ * This is a utility implementation of EventListener
+ * that captures all events and provides access
+ * to lists of all events by mode
+ */
+public class EventMonitor
+ implements EventListener {
+ private final List atEvents = new ArrayList();
+ private final List bubbledEvents = new ArrayList();
+ private final List capturedEvents = new ArrayList();
+ private final List allEvents = new ArrayList();
+
+ public EventMonitor() {
+ }
+
+ public void handleEvent(Event evt) {
+ switch (evt.getEventPhase()) {
+ case Event.CAPTURING_PHASE:
+ capturedEvents.add(evt);
+ break;
+
+ case Event.BUBBLING_PHASE:
+ bubbledEvents.add(evt);
+ break;
+
+ case Event.AT_TARGET:
+ atEvents.add(evt);
+ break;
+ }
+ allEvents.add(evt);
+ }
+
+ public List getAllEvents() {
+ return new ArrayList(allEvents);
+ }
+
+ public List getBubbledEvents() {
+ return new ArrayList(bubbledEvents);
+ }
+
+ public List getAtEvents() {
+ return new ArrayList(atEvents);
+ }
+
+ public List getCapturedEvents() {
+ return new ArrayList(capturedEvents);
+ }
+}
diff --git a/dom/src/test/java/org/w3c/domts/JAXPDOMTestDocumentBuilderFactory.java b/dom/src/test/java/org/w3c/domts/JAXPDOMTestDocumentBuilderFactory.java
new file mode 100644
index 0000000..c2d105e
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/JAXPDOMTestDocumentBuilderFactory.java
@@ -0,0 +1,183 @@
+/*
+ * Copyright (c) 2001-2004 World Wide Web Consortium,
+ * (Massachusetts Institute of Technology, Institut National de
+ * Recherche en Informatique et en Automatique, Keio University). All
+ * Rights Reserved. This program is distributed under the W3C's Software
+ * Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+ */
+
+package org.w3c.domts;
+
+import javax.xml.parsers.DocumentBuilder;
+import javax.xml.parsers.DocumentBuilderFactory;
+import javax.xml.parsers.ParserConfigurationException;
+
+import org.w3c.dom.DOMImplementation;
+import org.w3c.dom.Document;
+import org.xml.sax.SAXException;
+import org.xml.sax.SAXParseException;
+
+/**
+ * This class implements the generic parser and configuation
+ * abstract class for JAXP supporting parsers.
+ */
+public class JAXPDOMTestDocumentBuilderFactory
+ extends DOMTestDocumentBuilderFactory {
+
+ private DocumentBuilderFactory factory;
+ private DocumentBuilder builder;
+
+ /**
+ * Creates a JAXP implementation of DOMTestDocumentBuilderFactory.
+ * @param factory null for default JAXP provider. If not null,
+ * factory will be mutated in constructor and should be released
+ * by calling code upon return.
+ * @param settings array of settings, may be null.
+ */
+ public JAXPDOMTestDocumentBuilderFactory(
+ DocumentBuilderFactory baseFactory,
+ DocumentBuilderSetting[] settings) throws DOMTestIncompatibleException {
+ super(settings);
+ if (baseFactory == null) {
+ factory = DocumentBuilderFactory.newInstance();
+ }
+ else {
+ factory = baseFactory;
+ }
+ //
+ // apply settings to selected document builder
+ // may throw exception if incompatible
+ if (settings != null) {
+ for (int i = 0; i < settings.length; i++) {
+ settings[i].applySetting(factory);
+ }
+ }
+ try {
+ this.builder = factory.newDocumentBuilder();
+ }
+ catch (ParserConfigurationException ex) {
+ throw new DOMTestIncompatibleException(ex, null);
+ }
+ }
+
+ protected DOMTestDocumentBuilderFactory createInstance(DocumentBuilderFactory
+ newFactory,
+ DocumentBuilderSetting[] mergedSettings) throws
+ DOMTestIncompatibleException {
+ return new JAXPDOMTestDocumentBuilderFactory(newFactory, mergedSettings);
+ }
+
+ public DOMTestDocumentBuilderFactory newInstance(DocumentBuilderSetting[]
+ newSettings) throws DOMTestIncompatibleException {
+ if (newSettings == null) {
+ return this;
+ }
+ DocumentBuilderSetting[] mergedSettings = mergeSettings(newSettings);
+ DocumentBuilderFactory newFactory = factory.newInstance();
+ return createInstance(newFactory, mergedSettings);
+ }
+
+ private class LoadErrorHandler
+ implements org.xml.sax.ErrorHandler {
+ private SAXException parseException;
+ private int errorCount;
+ private int warningCount;
+ public LoadErrorHandler() {
+ parseException = null;
+ errorCount = 0;
+ warningCount = 0;
+ }
+
+ public void error(SAXParseException ex) {
+ errorCount++;
+ if (parseException == null) {
+ parseException = ex;
+ }
+ }
+
+ public void warning(SAXParseException ex) {
+ warningCount++;
+ }
+
+ public void fatalError(SAXParseException ex) {
+ if (parseException == null) {
+ parseException = ex;
+ }
+ }
+
+ public SAXException getFirstException() {
+ return parseException;
+ }
+ }
+
+ public Document load(java.net.URL url) throws DOMTestLoadException {
+ Document doc = null;
+ Exception parseException = null;
+ try {
+ LoadErrorHandler errorHandler = new LoadErrorHandler();
+ builder.setErrorHandler(errorHandler);
+ doc = builder.parse(url.openStream(), url.toString());
+ parseException = errorHandler.getFirstException();
+ }
+ catch (Exception ex) {
+ parseException = ex;
+ }
+ builder.setErrorHandler(null);
+ if (parseException != null) {
+ throw new DOMTestLoadException(parseException);
+ }
+ return doc;
+ }
+
+ public DOMImplementation getDOMImplementation() {
+ return builder.getDOMImplementation();
+ }
+
+ public boolean hasFeature(String feature, String version) {
+ return builder.getDOMImplementation().hasFeature(feature, version);
+ }
+
+ public boolean isCoalescing() {
+ return factory.isCoalescing();
+ }
+
+ public boolean isExpandEntityReferences() {
+ return factory.isExpandEntityReferences();
+ }
+
+ public boolean isIgnoringElementContentWhitespace() {
+ return factory.isIgnoringElementContentWhitespace();
+ }
+
+ public boolean isNamespaceAware() {
+ return factory.isNamespaceAware();
+ }
+
+ public boolean isValidating() {
+ return factory.isValidating();
+ }
+
+ public static DocumentBuilderSetting[] getConfiguration1() {
+ return new DocumentBuilderSetting[] {
+ DocumentBuilderSetting.notCoalescing,
+ DocumentBuilderSetting.notExpandEntityReferences,
+ DocumentBuilderSetting.notIgnoringElementContentWhitespace,
+ DocumentBuilderSetting.notNamespaceAware,
+ DocumentBuilderSetting.notValidating};
+ }
+
+ public static DocumentBuilderSetting[] getConfiguration2() {
+ return new DocumentBuilderSetting[] {
+ DocumentBuilderSetting.notCoalescing,
+ DocumentBuilderSetting.expandEntityReferences,
+ DocumentBuilderSetting.ignoringElementContentWhitespace,
+ DocumentBuilderSetting.namespaceAware,
+ DocumentBuilderSetting.validating};
+
+ }
+
+}
diff --git a/dom/src/test/java/org/w3c/domts/JTidyDOMImplementation.java b/dom/src/test/java/org/w3c/domts/JTidyDOMImplementation.java
new file mode 100644
index 0000000..60a6c8a
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/JTidyDOMImplementation.java
@@ -0,0 +1,131 @@
+/*
+ * Copyright (c) 2002 World Wide Web Consortium,
+ * (Massachusetts Institute of Technology, Institut National de
+ * Recherche en Informatique et en Automatique, Keio University). All
+ * Rights Reserved. This program is distributed under the W3C's Software
+ * Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+ */
+
+package org.w3c.domts;
+
+import org.w3c.dom.DOMException;
+import org.w3c.dom.DOMImplementation;
+import org.w3c.dom.Document;
+import org.w3c.dom.DocumentType;
+
+/**
+ * JTidy does not implement DOMImplementation
+ * we do it here to keep the test exclusion logic
+ * from falling apart.
+ */
+public class JTidyDOMImplementation
+ implements DOMImplementation {
+
+ /**
+ * Test if the DOM implementation implements a specific feature.
+ * @param feature The name of the feature to test (case-insensitive). The
+ * values used by DOM features are defined throughout the DOM Level 2
+ * specifications and listed in the section. The name must be an XML
+ * name. To avoid possible conflicts, as a convention, names referring
+ * to features defined outside the DOM specification should be made
+ * unique.
+ * @param version This is the version number of the feature to test. In
+ * Level 2, the string can be either "2.0" or "1.0". If the version is
+ * not specified, supporting any version of the feature causes the
+ * method to return <code>true</code>.
+ * @return <code>true</code> if the feature is implemented in the
+ * specified version, <code>false</code> otherwise.
+ */
+ public boolean hasFeature(String feature,
+ String version) {
+ if (feature.equals("Core")) {
+ return version == null || version.equals("1.0") || version.equals("2.0");
+ }
+ return false;
+ }
+
+ /**
+ * Creates an empty <code>DocumentType</code> node. Entity declarations
+ * and notations are not made available. Entity reference expansions and
+ * default attribute additions do not occur. It is expected that a
+ * future version of the DOM will provide a way for populating a
+ * <code>DocumentType</code>.
+ * @param qualifiedName The qualified name of the document type to be
+ * created.
+ * @param publicId The external subset public identifier.
+ * @param systemId The external subset system identifier.
+ * @return A new <code>DocumentType</code> node with
+ * <code>Node.ownerDocument</code> set to <code>null</code>.
+ * @exception DOMException
+ * INVALID_CHARACTER_ERR: Raised if the specified qualified name
+ * contains an illegal character.
+ * <br>NAMESPACE_ERR: Raised if the <code>qualifiedName</code> is
+ * malformed.
+ * <br>NOT_SUPPORTED_ERR: May be raised by DOM implementations which do
+ * not support the <code>"XML"</code> feature, if they choose not to
+ * support this method. Other features introduced in the future, by
+ * the DOM WG or in extensions defined by other groups, may also
+ * demand support for this method; please consult the definition of
+ * the feature to see if it requires this method.
+ * @since DOM Level 2
+ */
+ public DocumentType createDocumentType(String qualifiedName,
+ String publicId,
+ String systemId) throws DOMException {
+ throw new DOMException(DOMException.NOT_SUPPORTED_ERR, "Not Implemented");
+ }
+
+ /**
+ * Creates a DOM Document object of the specified type with its document
+ * element.
+ * @param namespaceURI The namespace URI of the document element to
+ * create.
+ * @param qualifiedName The qualified name of the document element to be
+ * created.
+ * @param doctype The type of document to be created or <code>null</code>.
+ * When <code>doctype</code> is not <code>null</code>, its
+ * <code>Node.ownerDocument</code> attribute is set to the document
+ * being created.
+ * @return A new <code>Document</code> object.
+ * @exception DOMException
+ * INVALID_CHARACTER_ERR: Raised if the specified qualified name
+ * contains an illegal character.
+ * <br>NAMESPACE_ERR: Raised if the <code>qualifiedName</code> is
+ * malformed, if the <code>qualifiedName</code> has a prefix and the
+ * <code>namespaceURI</code> is <code>null</code>, or if the
+ * <code>qualifiedName</code> has a prefix that is "xml" and the
+ * <code>namespaceURI</code> is different from "
+ * http://www.w3.org/XML/1998/namespace" , or if the DOM
+ * implementation does not support the <code>"XML"</code> feature but
+ * a non-null namespace URI was provided, since namespaces were
+ * defined by XML.
+ * <br>WRONG_DOCUMENT_ERR: Raised if <code>doctype</code> has already
+ * been used with a different document or was created from a different
+ * implementation.
+ * <br>NOT_SUPPORTED_ERR: May be raised by DOM implementations which do
+ * not support the "XML" feature, if they choose not to support this
+ * method. Other features introduced in the future, by the DOM WG or
+ * in extensions defined by other groups, may also demand support for
+ * this method; please consult the definition of the feature to see if
+ * it requires this method.
+ * @since DOM Level 2
+ */
+ public Document createDocument(String namespaceURI,
+ String qualifiedName,
+ DocumentType doctype) throws DOMException {
+ throw new DOMException(DOMException.NOT_SUPPORTED_ERR, "Not Implemented");
+ }
+
+ public DOMImplementation getInterface(String feature) {
+ return this;
+ }
+
+ public Object getFeature(String feature, String version) {
+ return null;
+ }
+
+}
diff --git a/dom/src/test/java/org/w3c/domts/JTidyDocumentBuilderFactory.java b/dom/src/test/java/org/w3c/domts/JTidyDocumentBuilderFactory.java
new file mode 100644
index 0000000..7b8f454
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/JTidyDocumentBuilderFactory.java
@@ -0,0 +1,135 @@
+/*
+ * Copyright (c) 2002-2004 World Wide Web Consortium,
+ * (Massachusetts Institute of Technology, Institut National de
+ * Recherche en Informatique et en Automatique, Keio University). All
+ * Rights Reserved. This program is distributed under the W3C's Software
+ * Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+ */
+
+package org.w3c.domts;
+
+import java.lang.reflect.Constructor;
+import java.lang.reflect.InvocationTargetException;
+import java.lang.reflect.Method;
+
+import org.w3c.dom.DOMImplementation;
+import org.w3c.dom.Document;
+
+/**
+ * This class implements the generic parser builder
+ * for JTidy (http://sf.net/projects/JTidy) which reads HTML
+ * and supports the fundamental DOM interfaces but not either HTML L1 DOM
+ * or HTML L2 DOM
+ */
+public class JTidyDocumentBuilderFactory
+ extends DOMTestDocumentBuilderFactory {
+
+ private final Constructor tidyConstructor;
+ private final Method parseDOMMethod;
+ private final DOMImplementation domImpl;
+ private static final Class[] NO_CLASSES = new Class[0];
+ private static final Object[] NO_OBJECTS = new Object[0];
+
+ /**
+ * Creates a implementation of DOMTestDocumentBuilderFactory
+ * using JTidy's HTML parser and DOM implementation
+ * @param settings array of settings, may be null.
+ */
+ public JTidyDocumentBuilderFactory(
+ DocumentBuilderSetting[] settings) throws DOMTestIncompatibleException {
+ super(settings);
+
+ try {
+ ClassLoader classLoader = ClassLoader.getSystemClassLoader();
+ Class tidyClass = classLoader.loadClass("org.w3c.tidy.Tidy");
+
+ tidyConstructor =
+ tidyClass.getConstructor(NO_CLASSES);
+
+ parseDOMMethod =
+ tidyClass.getMethod("parseDOM",
+ new Class[] {java.io.InputStream.class,
+ java.io.OutputStream.class});
+
+ //
+ // JTidy doesn't implement DOMImplementation so
+ // we will do it here
+ domImpl = new JTidyDOMImplementation();
+
+ }
+ catch (Exception ex) {
+ throw new DOMTestIncompatibleException(ex, null);
+ }
+
+ //
+ // apply settings to selected document builder
+ // may throw exception if incompatible
+ if (settings != null) {
+ for (int i = 0; i < settings.length; i++) {
+// settings[i].applySetting(factory);
+ }
+ }
+ }
+
+ public DOMTestDocumentBuilderFactory newInstance(DocumentBuilderSetting[]
+ newSettings) throws DOMTestIncompatibleException {
+ if (newSettings == null) {
+ return this;
+ }
+ DocumentBuilderSetting[] mergedSettings = mergeSettings(newSettings);
+ return new JTidyDocumentBuilderFactory(mergedSettings);
+ }
+
+ public Document load(java.net.URL url) throws DOMTestLoadException {
+ Document doc = null;
+ try {
+ java.io.InputStream stream = url.openStream();
+ Object tidyObj = tidyConstructor.newInstance(new Object[0]);
+ doc = (Document) parseDOMMethod.invoke(tidyObj,
+ new Object[] {stream, null});
+ }
+ catch (InvocationTargetException ex) {
+ throw new DOMTestLoadException(ex.getTargetException());
+ }
+ catch (Exception ex) {
+ throw new DOMTestLoadException(ex);
+ }
+ return doc;
+ }
+
+ public DOMImplementation getDOMImplementation() {
+ return domImpl;
+ }
+
+ public boolean hasFeature(String feature, String version) {
+ return domImpl.hasFeature(feature, version);
+ }
+
+ public String getContentType() {
+ return "text/html";
+ }
+
+ public boolean isCoalescing() {
+ return false;
+ }
+
+ public boolean isExpandEntityReferences() {
+ return false;
+ }
+
+ public boolean isIgnoringElementContentWhitespace() {
+ return false;
+ }
+
+ public boolean isNamespaceAware() {
+ return false;
+ }
+
+ public boolean isValidating() {
+ return false;
+ }
+}
diff --git a/dom/src/test/java/org/w3c/domts/JUnitTestCaseAdapter.java b/dom/src/test/java/org/w3c/domts/JUnitTestCaseAdapter.java
new file mode 100644
index 0000000..6180147
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/JUnitTestCaseAdapter.java
@@ -0,0 +1,368 @@
+/*
+ * Copyright (c) 2001-2003 World Wide Web Consortium,
+ * (Massachusetts Institute of Technology, Institut National de
+ * Recherche en Informatique et en Automatique, Keio University). All
+ * Rights Reserved. This program is distributed under the W3C's Software
+ * Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+ */
+
+
+package org.w3c.domts;
+
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Iterator;
+import java.util.List;
+
+import javax.xml.parsers.DocumentBuilder;
+
+import junit.framework.TestCase;
+
+import org.w3c.dom.NamedNodeMap;
+import org.w3c.dom.Node;
+import org.w3c.dom.NodeList;
+
+
+public class JUnitTestCaseAdapter extends TestCase implements DOMTestFramework {
+
+ private DOMTestCase test;
+
+ public JUnitTestCaseAdapter(DOMTestCase test) {
+ super(test.getTargetURI());
+ test.setFramework(this);
+ this.test = test;
+ }
+
+ protected void runTest() throws Throwable {
+ test.runTest();
+ int mutationCount = test.getMutationCount();
+ if (mutationCount != 0) {
+ fail("Document loaded with willBeModified='false' was modified in course of test.");
+ }
+ }
+
+ public boolean hasFeature(DocumentBuilder docBuilder,
+ String feature,
+ String version) {
+ return docBuilder.getDOMImplementation().hasFeature(feature,version);
+ }
+
+ public void wait(int millisecond) {
+ }
+
+ public void fail(DOMTestCase test, String assertID) {
+ fail(assertID);
+ }
+
+ public void assertTrue(DOMTestCase test, String assertID, boolean actual) {
+ assertTrue(assertID,actual);
+ }
+
+ public void assertFalse(DOMTestCase test, String assertID, boolean actual) {
+ if(actual) {
+ assertEquals(assertID,String.valueOf(false), String.valueOf(actual));
+ }
+ }
+
+ public void assertNull(DOMTestCase test, String assertID, Object actual) {
+ assertNull(assertID,actual);
+ }
+
+ public void assertNotNull(DOMTestCase test, String assertID, Object actual) {
+ assertNotNull(assertID,actual);
+ }
+
+ public void assertSame(DOMTestCase test, String assertID, Object expected, Object actual) {
+ boolean same = (expected == actual);
+ //
+ // if the not the same but both are not null
+ // might still really be the same
+ //
+ if(!same) {
+ if(expected == null || actual == null ||
+ !(expected instanceof Node) || !(actual instanceof Node)) {
+ assertEquals(assertID,expected,actual);
+ }
+ else {
+ //
+ // could do something with isSame
+ //
+ assertEquals(assertID,expected,actual);
+ }
+ }
+ }
+
+ public void assertInstanceOf(DOMTestCase test, String assertID, Object obj, Class cls) {
+ assertTrue(assertID,cls.isInstance(obj));
+ }
+
+ public void assertSize(DOMTestCase test, String assertID, int expectedSize, NodeList collection) {
+ assertEquals(assertID,expectedSize, collection.getLength());
+ }
+
+ public void assertSize(DOMTestCase test, String assertID, int expectedSize, NamedNodeMap collection) {
+ assertEquals(assertID, expectedSize, collection.getLength());
+ }
+
+ public void assertSize(DOMTestCase test, String assertID, int expectedSize, Collection collection) {
+ assertEquals(assertID, expectedSize, collection.size());
+ }
+
+ public void assertEqualsIgnoreCase(DOMTestCase test, String assertID, String expected, String actual) {
+ if (!expected.equalsIgnoreCase(actual)) {
+ assertEquals(assertID,expected, actual);
+ }
+ }
+
+ public void assertEqualsIgnoreCase(DOMTestCase test, String assertID, Collection expected, Collection actual) {
+ int size = expected.size();
+ assertNotNull(assertID,expected);
+ assertNotNull(assertID,actual);
+ assertEquals(assertID,size, actual.size());
+ boolean equals = (expected != null && actual != null && size == actual.size());
+ if(equals) {
+ List expectedArray = new ArrayList(expected);
+ String expectedString;
+ String actualString;
+ Iterator actualIter = actual.iterator();
+ Iterator expectedIter;
+ while(actualIter.hasNext() && equals) {
+ actualString = (String) actualIter.next();
+ expectedIter = expectedArray.iterator();
+ equals = false;
+ while(expectedIter.hasNext() && !equals) {
+ expectedString = (String) expectedIter.next();
+ if(actualString.equalsIgnoreCase(expectedString)) {
+ equals = true;
+ expectedArray.remove(expectedString);
+ }
+ }
+ }
+ }
+ assertTrue(assertID,equals);
+ }
+
+ public void assertEqualsIgnoreCase(DOMTestCase test, String assertID, List expected, List actual) {
+ int size = expected.size();
+ assertNotNull(assertID,expected);
+ assertNotNull(assertID,actual);
+ assertEquals(assertID,size, actual.size());
+ boolean equals = (expected != null && actual != null && size == actual.size());
+ if(equals) {
+ String expectedString;
+ String actualString;
+ for(int i = 0; i < size; i++) {
+ expectedString = (String) expected.get(i);
+ actualString = (String) actual.get(i);
+ if(!expectedString.equalsIgnoreCase(actualString)) {
+ assertEquals(assertID,expectedString,actualString);
+ break;
+ }
+ }
+ }
+ }
+
+ public void assertEquals(DOMTestCase test, String assertID, String expected, String actual) {
+ assertEquals(assertID,expected,actual);
+ }
+
+ public void assertEquals(DOMTestCase test, String assertID, int expected, int actual) {
+ assertEquals(assertID,expected,actual);
+ }
+
+ public void assertEquals(DOMTestCase test, String assertID, boolean expected, boolean actual) {
+ assertEquals(assertID,expected,actual);
+ }
+
+ public void assertEquals(DOMTestCase test, String assertID, double expected, double actual) {
+ assertEquals(assertID, expected, actual, 0.0);
+ }
+
+ public void assertEquals(DOMTestCase test, String assertID, Collection expected, Collection actual) {
+ int size = expected.size();
+ assertNotNull(assertID,expected);
+ assertNotNull(assertID,actual);
+ assertEquals(assertID,size, actual.size());
+ boolean equals = (expected != null && actual != null && size == actual.size());
+ if(equals) {
+ List expectedArray = new ArrayList(expected);
+ Object expectedObj;
+ Object actualObj;
+ Iterator actualIter = actual.iterator();
+ Iterator expectedIter;
+ while(actualIter.hasNext() && equals) {
+ actualObj = actualIter.next();
+ expectedIter = expectedArray.iterator();
+ equals = false;
+ while(expectedIter.hasNext() && !equals) {
+ expectedObj = expectedIter.next();
+ if(expectedObj == actualObj || expectedObj.equals(actualObj)) {
+ equals = true;
+ expectedArray.remove(expectedObj);
+ }
+ }
+ }
+ }
+ assertTrue(assertID,equals);
+ }
+
+ public void assertNotEqualsIgnoreCase(DOMTestCase test, String assertID, String expected, String actual) {
+ if(expected.equalsIgnoreCase(actual)) {
+ assertTrue(assertID, !expected.equalsIgnoreCase(actual));
+ }
+ }
+
+ public void assertNotEquals(DOMTestCase test, String assertID, String expected, String actual) {
+ assertTrue(assertID, !expected.equals(actual));
+ }
+
+ public void assertNotEquals(DOMTestCase test, String assertID, int expected, int actual) {
+ assertTrue(assertID,expected !=actual);
+ }
+
+ public void assertNotEquals(DOMTestCase test, String assertID, boolean expected, boolean actual) {
+ assertTrue(assertID,expected !=actual);
+ }
+
+
+ public void assertNotEquals(DOMTestCase test, String assertID, double expected, double actual) {
+ if(expected == actual) {
+ assertTrue(assertID,expected != actual);
+ }
+ }
+
+
+ public boolean same(Object expected, Object actual) {
+ boolean equals = (expected == actual);
+ if(!equals && expected != null && expected instanceof Node &&
+ actual != null && actual instanceof Node) {
+ //
+ // can use Node.isSame eventually
+ }
+ return equals;
+ }
+
+ public boolean equalsIgnoreCase(String expected, String actual) {
+ return expected.equalsIgnoreCase(actual);
+ }
+
+ public boolean equalsIgnoreCase(Collection expected, Collection actual) {
+ int size = expected.size();
+ boolean equals = (expected != null && actual != null && size == actual.size());
+ if(equals) {
+ List expectedArray = new ArrayList(expected);
+ String expectedString;
+ String actualString;
+ Iterator actualIter = actual.iterator();
+ Iterator expectedIter;
+ while(actualIter.hasNext() && equals) {
+ actualString = (String) actualIter.next();
+ expectedIter = expectedArray.iterator();
+ equals = false;
+ while(expectedIter.hasNext() && !equals) {
+ expectedString = (String) expectedIter.next();
+ if(actualString.equalsIgnoreCase(expectedString)) {
+ equals = true;
+ expectedArray.remove(expectedString);
+ }
+ }
+ }
+ }
+ return equals;
+ }
+
+ public boolean equalsIgnoreCase(List expected, List actual) {
+ int size = expected.size();
+ boolean equals = (expected != null && actual != null && size == actual.size());
+ if(equals) {
+ String expectedString;
+ String actualString;
+ for(int i = 0; i < size; i++) {
+ expectedString = (String) expected.get(i);
+ actualString = (String) actual.get(i);
+ if(!expectedString.equalsIgnoreCase(actualString)) {
+ equals = false;
+ break;
+ }
+ }
+ }
+ return equals;
+ }
+
+ public boolean equals(String expected, String actual) {
+ return expected.equals(actual);
+ }
+
+ public boolean equals(int expected, int actual) {
+ return expected == actual;
+ }
+
+ public boolean equals(boolean expected, boolean actual) {
+ return expected == actual;
+ }
+
+ public boolean equals(double expected, double actual) {
+ return expected == actual;
+ }
+
+ public boolean equals(Collection expected, Collection actual) {
+ int size = expected.size();
+ boolean equals = (expected != null && actual != null && size == actual.size());
+ if(equals) {
+ List expectedArray = new ArrayList(expected);
+ Object expectedObj;
+ Object actualObj;
+ Iterator actualIter = actual.iterator();
+ Iterator expectedIter;
+ while(actualIter.hasNext() && equals) {
+ actualObj = actualIter.next();
+ expectedIter = expectedArray.iterator();
+ equals = false;
+ while(expectedIter.hasNext() && !equals) {
+ expectedObj = expectedIter.next();
+ if(expectedObj != actualObj && expectedObj.equals(actualObj)) {
+ equals = true;
+ expectedArray.remove(expectedObj);
+ }
+ }
+ }
+ }
+ return equals;
+ }
+
+ public boolean equals(List expected, List actual) {
+ int size = expected.size();
+ boolean equals = (expected != null && actual != null && size == actual.size());
+ if(equals) {
+ Object expectedObj;
+ Object actualObj;
+ for(int i = 0; i < size; i++) {
+ expectedObj = expected.get(i);
+ actualObj = actual.get(i);
+ if(!expectedObj.equals(actualObj)) {
+ equals = false;
+ break;
+ }
+ }
+ }
+ return equals;
+ }
+
+ public int size(Collection collection) {
+ return collection.size();
+ }
+
+ public int size(NamedNodeMap collection) {
+ return collection.getLength();
+ }
+
+ public int size(NodeList collection) {
+ return collection.getLength();
+ }
+
+
+} \ No newline at end of file
diff --git a/dom/src/test/java/org/w3c/domts/JUnitTestSuiteAdapter.java b/dom/src/test/java/org/w3c/domts/JUnitTestSuiteAdapter.java
new file mode 100644
index 0000000..62fcad3
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/JUnitTestSuiteAdapter.java
@@ -0,0 +1,64 @@
+/*
+ * Copyright (c) 2001-2004 World Wide Web Consortium,
+ * (Massachusetts Institute of Technology, Institut National de
+ * Recherche en Informatique et en Automatique, Keio University). All
+ * Rights Reserved. This program is distributed under the W3C's Software
+ * Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+ */
+
+package org.w3c.domts;
+
+import java.lang.reflect.Constructor;
+import java.lang.reflect.InvocationTargetException;
+
+import junit.framework.TestCase;
+import junit.framework.TestSuite;
+
+public class JUnitTestSuiteAdapter extends TestSuite implements DOMTestSink {
+
+ private DOMTestSuite test;
+
+ public JUnitTestSuiteAdapter(DOMTestSuite test) {
+ super(test.getTargetURI());
+ this.test = test;
+ test.build(this);
+ }
+
+ public void addTest(Class testclass) {
+ DOMTestDocumentBuilderFactory factory = test.getFactory();
+ try {
+ Constructor testConstructor = testclass.getConstructor(
+ new Class[] { DOMTestDocumentBuilderFactory.class } );
+ //
+ // since this is done with reflection
+ // any exception on construction is wrapped with
+ // an InvocationTargetException and must be unwrapped
+ Object domtest;
+ try {
+ domtest = testConstructor.newInstance(new Object[] { factory });
+ } catch(InvocationTargetException ex) {
+ throw ex.getTargetException();
+ }
+
+ if(domtest instanceof DOMTestCase) {
+ TestCase test = new JUnitTestCaseAdapter((DOMTestCase) domtest);
+ addTest(test);
+ }
+ else {
+ if(domtest instanceof DOMTestSuite) {
+ TestSuite test = new JUnitTestSuiteAdapter((DOMTestSuite) domtest);
+ addTest(test);
+ }
+ }
+ }
+ catch(Throwable ex) {
+ if(!(ex instanceof DOMTestIncompatibleException)) {
+ ex.printStackTrace();
+ }
+ }
+ }
+}
diff --git a/dom/src/test/java/org/w3c/domts/LSDocumentBuilderFactory.java b/dom/src/test/java/org/w3c/domts/LSDocumentBuilderFactory.java
new file mode 100644
index 0000000..7ed0f54
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/LSDocumentBuilderFactory.java
@@ -0,0 +1,414 @@
+/*
+ * Copyright (c) 2001-2004 World Wide Web Consortium,
+ * (Massachusetts Institute of Technology, Institut National de
+ * Recherche en Informatique et en Automatique, Keio University). All
+ * Rights Reserved. This program is distributed under the W3C's Software
+ * Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+ */
+
+package org.w3c.domts;
+
+import java.lang.reflect.InvocationTargetException;
+import java.lang.reflect.Method;
+import java.util.HashMap;
+import java.util.Map;
+
+import org.w3c.dom.DOMImplementation;
+import org.w3c.dom.Document;
+
+/**
+ * This class implements the generic parser and configuation
+ * abstract class for the DOM L3 implementations
+ *
+ * @author Curt Arnold
+ */
+public class LSDocumentBuilderFactory
+ extends DOMTestDocumentBuilderFactory {
+
+ private final Object parser;
+ private final Method parseURIMethod;
+ private final DOMImplementation impl;
+
+ /**
+ *
+ * Abstract class for a strategy to map a DocumentBuilderSetting
+ * to an action on LSParser.
+ */
+ private static abstract class LSStrategy {
+
+ /**
+ * Constructor.
+ */
+ protected LSStrategy() {
+ }
+
+ /**
+ * Applies setting to LSParser
+ *
+ * @param setting setting
+ * @param parser parser
+ * @throws DOMTestIncompatibleException if parser does not support setting
+ */
+ public abstract void applySetting(DocumentBuilderSetting setting,
+ Object parser) throws
+ DOMTestIncompatibleException;
+
+ /**
+ * Gets state of setting for parser
+ *
+ * @param parser parser
+ * @return state of setting
+ */
+ public abstract boolean hasSetting(Object parser);
+
+ }
+
+ /**
+ * Represents a fixed setting, for example, all Java implementations
+ * supported signed values.
+ *
+ */
+ private static class LSFixedStrategy
+ extends LSStrategy {
+ private final boolean fixedValue;
+
+ /**
+ * Constructor
+ *
+ * @param settingName setting name
+ * @param fixedValue fixed value
+ */
+ public LSFixedStrategy(boolean fixedValue) {
+ this.fixedValue = fixedValue;
+ }
+
+ /**
+ * Apply setting. Throws exception if requested setting
+ * does not match fixed value.
+ */
+ public void applySetting(DocumentBuilderSetting setting, Object parser) throws
+ DOMTestIncompatibleException {
+ if (setting.getValue() != fixedValue) {
+ throw new DOMTestIncompatibleException(null, setting);
+ }
+ }
+
+ /**
+ * Gets fixed value for setting
+ */
+ public boolean hasSetting(Object parser) {
+ return fixedValue;
+ }
+ }
+
+ /**
+ * A strategy for a setting that can be applied by setting a DOMConfiguration
+ * parameter.
+ *
+ */
+ private static class LSParameterStrategy
+ extends LSStrategy {
+ private final String lsParameter;
+ private final boolean inverse;
+
+ /**
+ * Constructor
+ *
+ * @param lsParameter corresponding DOMConfiguration parameter
+ * @param inverse if true, DOMConfiguration value is the inverse
+ * of the setting value
+ */
+ public LSParameterStrategy(String lsParameter, boolean inverse) {
+ this.lsParameter = lsParameter;
+ this.inverse = inverse;
+ }
+
+ protected static void setParameter(DocumentBuilderSetting setting,
+ Object parser,
+ String parameter,
+ Object value) throws
+ DOMTestIncompatibleException {
+ try {
+ Method domConfigMethod = parser.getClass().getMethod("getDomConfig",
+ new Class[0]);
+ Object domConfig = domConfigMethod.invoke(parser, new Object[0]);
+ Method setParameterMethod = domConfig.getClass().getMethod(
+ "setParameter", new Class[] {String.class, Object.class});
+ setParameterMethod.invoke(domConfig, new Object[] {parameter, value});
+
+ }
+ catch (InvocationTargetException ex) {
+ throw new DOMTestIncompatibleException(ex.getTargetException(), setting);
+ }
+ catch (Exception ex) {
+ throw new DOMTestIncompatibleException(ex, setting);
+ }
+ }
+
+ protected static Object getParameter(Object parser,
+ String parameter) throws Exception {
+ Method domConfigMethod = parser.getClass().getMethod("getDomConfig",
+ new Class[0]);
+ Object domConfig = domConfigMethod.invoke(parser, new Object[0]);
+ Method getParameterMethod = domConfig.getClass().getMethod("getParameter",
+ new Class[] {String.class});
+ return getParameterMethod.invoke(domConfig, new Object[] {parameter});
+ }
+
+ /**
+ * Apply setting
+ */
+ public void applySetting(DocumentBuilderSetting setting, Object parser) throws
+ DOMTestIncompatibleException {
+ if (inverse) {
+ setParameter(setting, parser, lsParameter,
+ new Boolean(!setting.getValue()));
+ }
+ else {
+ setParameter(setting, parser, lsParameter, new Boolean(setting.getValue()));
+ }
+ }
+
+ /**
+ * Get value of setting
+ */
+ public boolean hasSetting(Object parser) {
+ try {
+ if (inverse) {
+ return! ( (Boolean) getParameter(parser, lsParameter)).booleanValue();
+ }
+ else {
+ return ( (Boolean) getParameter(parser, lsParameter)).booleanValue();
+ }
+ }
+ catch (Exception ex) {
+ return false;
+ }
+ }
+ }
+
+ /**
+ * A strategy for the validation settings which require
+ * two DOMConfigurure parameters being set, 'validate' and 'schema-type'
+ *
+ */
+ private static class LSValidateStrategy
+ extends LSParameterStrategy {
+ private final String schemaType;
+
+ /**
+ * Constructor
+ * @param schemaType schema type
+ */
+ public LSValidateStrategy(String schemaType) {
+ super("validate", false);
+ this.schemaType = schemaType;
+ }
+
+ /**
+ * Apply setting
+ */
+ public void applySetting(DocumentBuilderSetting setting, Object parser) throws
+ DOMTestIncompatibleException {
+ super.applySetting(setting, parser);
+ setParameter(null, parser, "schema-type", schemaType);
+ }
+
+ /**
+ * Get setting value
+ */
+ public boolean hasSetting(Object parser) {
+ if (super.hasSetting(parser)) {
+ try {
+ String parserSchemaType = (String) getParameter(parser, "schema-type");
+ if (schemaType == null || schemaType.equals(parserSchemaType)) {
+ return true;
+ }
+ }
+ catch (Exception ex) {
+ }
+ }
+ return false;
+ }
+
+ }
+
+ /**
+ * Strategies for mapping DocumentBuilderSettings to
+ * actions on LSParser
+ */
+ private static final Map strategies;
+
+ static {
+ strategies = new HashMap();
+ strategies.put("coalescing", new LSParameterStrategy("cdata-sections", true));
+ strategies.put("expandEntityReferences", new LSParameterStrategy("entities", true));
+ strategies.put("ignoringElementContentWhitespace",
+ new LSParameterStrategy("element-content-whitespace", true));
+ strategies.put("namespaceAware", new LSParameterStrategy("namespaces", false));
+ strategies.put("validating",
+ new LSValidateStrategy("http://www.w3.org/TR/REC-xml"));
+ strategies.put("schemaValidating",
+ new LSValidateStrategy("http://www.w3.org/2001/XMLSchema"));
+ strategies.put("ignoringComments", new LSParameterStrategy("comments", true));
+ strategies.put("signed", new LSFixedStrategy(true));
+ strategies.put("hasNullString", new LSFixedStrategy(true));
+ }
+
+ /**
+ * Creates a LS implementation of DOMTestDocumentBuilderFactory.
+ * @param settings array of settings, may be null.
+ * @throws DOMTestIncompatibleException
+ * Thrown if implementation does not support the specified settings
+ */
+ public LSDocumentBuilderFactory(DocumentBuilderSetting[] settings) throws
+ DOMTestIncompatibleException {
+ super(settings);
+
+ try {
+ Class domImplRegistryClass = Class.forName(
+ "org.w3c.dom.bootstrap.DOMImplementationRegistry");
+ Method newInstanceMethod = domImplRegistryClass.getMethod("newInstance", null);
+ Object domRegistry = newInstanceMethod.invoke(null, null);
+ Method getDOMImplementationMethod = domImplRegistryClass.getMethod(
+ "getDOMImplementation", new Class[] {String.class});
+ impl = (DOMImplementation) getDOMImplementationMethod.invoke(domRegistry,
+ new Object[] {"LS"});
+ Method createLSParserMethod = impl.getClass().getMethod("createLSParser",
+ new Class[] {short.class, String.class});
+ parser = createLSParserMethod.invoke(impl,
+ new Object[] {new Short( (short) 1), null});
+ parseURIMethod = parser.getClass().getMethod("parseURI",
+ new Class[] {String.class});
+ }
+ catch (InvocationTargetException ex) {
+ throw new DOMTestIncompatibleException(ex.getTargetException(), null);
+ }
+ catch (Exception ex) {
+ throw new DOMTestIncompatibleException(ex, null);
+ }
+
+ if (settings != null) {
+ for (int i = 0; i < settings.length; i++) {
+ Object strategy = strategies.get(settings[i].getProperty());
+ if (strategy == null) {
+ throw new DOMTestIncompatibleException(null, settings[i]);
+ }
+ else {
+ ( (LSStrategy) strategy).applySetting(settings[i], parser);
+ }
+ }
+ }
+ }
+
+ /**
+ * Create new instance of document builder factory
+ * reflecting specified settings
+ * @param newSettings new settings
+ * @return New instance
+ * @throws DOMTestIncompatibleException
+ * if settings are not supported by implementation
+ */
+ public DOMTestDocumentBuilderFactory newInstance(
+ DocumentBuilderSetting[] newSettings) throws DOMTestIncompatibleException {
+ if (newSettings == null) {
+ return this;
+ }
+ DocumentBuilderSetting[] mergedSettings = mergeSettings(newSettings);
+ return new LSDocumentBuilderFactory(mergedSettings);
+ }
+
+ /**
+ * Loads specified URL
+ * @param url url to load
+ * @return DOM document
+ * @throws DOMTestLoadException if unable to load document
+ */
+ public Document load(java.net.URL url) throws DOMTestLoadException {
+ try {
+ return (Document) parseURIMethod.invoke(parser,
+ new Object[] {url.toString()});
+ }
+ catch (InvocationTargetException ex) {
+ throw new DOMTestLoadException(ex.getTargetException());
+ }
+ catch (Exception ex) {
+ throw new DOMTestLoadException(ex);
+ }
+ }
+
+ /**
+ * Gets DOMImplementation
+ * @return DOM implementation, may be null
+ */
+ public DOMImplementation getDOMImplementation() {
+ return impl;
+ }
+
+ /**
+ * Determines if the implementation supports the specified feature
+ * @param feature Feature
+ * @param version Version
+ * @return true if implementation supports the feature
+ */
+ public boolean hasFeature(String feature, String version) {
+ return getDOMImplementation().hasFeature(feature, version);
+ }
+
+ private boolean hasProperty(String parameter) {
+ try {
+ return ( (Boolean) LSParameterStrategy.getParameter(parser, parameter)).
+ booleanValue();
+ }
+ catch (Exception ex) {
+ return true;
+ }
+
+ }
+
+ /**
+ * Indicates whether the implementation combines text and cdata nodes.
+ * @return true if coalescing
+ */
+ public boolean isCoalescing() {
+ return!hasProperty("cdata-sections");
+ }
+
+ /**
+ * Indicates whether the implementation expands entity references.
+ * @return true if expanding entity references
+ */
+ public boolean isExpandEntityReferences() {
+ return!hasProperty("entities");
+ }
+
+ /**
+ * Indicates whether the implementation ignores
+ * element content whitespace.
+ * @return true if ignoring element content whitespace
+ */
+ public boolean isIgnoringElementContentWhitespace() {
+ return!hasProperty("element-content-whitespace");
+ }
+
+ /**
+ * Indicates whether the implementation is namespace aware.
+ * @return true if namespace aware
+ */
+ public boolean isNamespaceAware() {
+ return hasProperty("namespaces");
+ }
+
+ /**
+ * Indicates whether the implementation is validating.
+ * @return true if validating
+ */
+ public boolean isValidating() {
+ return hasProperty("validate");
+ }
+
+}
diff --git a/dom/src/test/java/org/w3c/domts/UserDataMonitor.java b/dom/src/test/java/org/w3c/domts/UserDataMonitor.java
new file mode 100644
index 0000000..d7e35bb
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/UserDataMonitor.java
@@ -0,0 +1,69 @@
+/*
+ * Copyright (c) 2004 World Wide Web Consortium, (Massachusetts Institute of
+ * Technology, Institut National de Recherche en Informatique et en
+ * Automatique, Keio University). All Rights Reserved. This program is
+ * distributed under the W3C's Software Intellectual Property License. This
+ * program 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 W3C License
+ * http://www.w3.org/Consortium/Legal/ for more details.
+ */
+
+package org.w3c.domts;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.w3c.dom.Node;
+import org.w3c.dom.UserDataHandler;
+
+/**
+ * This is a utility implementation of UserDataHandler that captures all
+ * notifications
+ */
+public class UserDataMonitor
+ implements UserDataHandler {
+ private final List notifications = new ArrayList();
+
+ /**
+ * Public constructor
+ *
+ */
+ public UserDataMonitor() {
+ }
+
+ /**
+ * Implementation of UserDataHandler.handle. Creates a UserDataNotification
+ * for later testing
+ *
+ * @param operation
+ * See org.w3c.dom.UserDataHandler
+ * @param key
+ * See org.w3c.dom.UserDataHandler
+ * @param data
+ * See org.w3c.dom.UserDataHandler
+ * @param src
+ * See org.w3c.dom.UserDataHandler
+ * @param dst
+ * See org.w3c.dom.UserDataHandler
+ */
+ public void handle(
+ short operation,
+ String key,
+ Object data,
+ Node src,
+ Node dst) {
+ notifications.add(
+ new UserDataNotification(operation, key, data, src, dst));
+ }
+
+ /**
+ * Gets list of notifications
+ *
+ * @return List of notifications, may not be null.
+ */
+ public final List getAllNotifications() {
+ return new ArrayList(notifications);
+ }
+
+}
diff --git a/dom/src/test/java/org/w3c/domts/UserDataNotification.java b/dom/src/test/java/org/w3c/domts/UserDataNotification.java
new file mode 100644
index 0000000..d422901
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/UserDataNotification.java
@@ -0,0 +1,88 @@
+/*
+ * Copyright (c) 2004 World Wide Web Consortium, (Massachusetts Institute of
+ * Technology, Institut National de Recherche en Informatique et en
+ * Automatique, Keio University). All Rights Reserved. This program is
+ * distributed under the W3C's Software Intellectual Property License. This
+ * program 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 W3C License
+ * http://www.w3.org/Consortium/Legal/ for more details.
+ */
+
+package org.w3c.domts;
+
+import org.w3c.dom.Node;
+
+/**
+ * This class captures the parameters to one invocation of
+ * UserDataHandler.handle.
+ *
+ */
+public class UserDataNotification {
+ private final short operation;
+ private final String key;
+ private final Object data;
+ private final Node src;
+ private final Node dst;
+
+ /**
+ * Public constructor
+ *
+ */
+ public UserDataNotification(short operation,
+ String key,
+ Object data,
+ Node src,
+ Node dst) {
+ this.operation = operation;
+ this.key = key;
+ this.data = data;
+ this.src = src;
+ this.dst = dst;
+ }
+
+ /**
+ * Get value of operation parameter
+ *
+ * @return value of operation parameter
+ */
+ public final short getOperation() {
+ return operation;
+ }
+
+ /**
+ * Gets value of key parameter
+ *
+ * @return value of key parameter
+ */
+ public final String getKey() {
+ return key;
+ }
+
+ /**
+ * Gets value of data parameter
+ *
+ * @return value of data parameter
+ */
+ public final Object getData() {
+ return data;
+ }
+
+ /**
+ * Gets value of src parameter
+ *
+ * @return value of src parameter
+ */
+ public final Node getSrc() {
+ return src;
+ }
+
+ /**
+ * Gets value of dst parameter
+ *
+ * @return value of dst parameter
+ */
+ public final Node getDst() {
+ return dst;
+ }
+}
diff --git a/dom/src/test/java/org/w3c/domts/XalanDOMTestDocumentBuilderFactory.java b/dom/src/test/java/org/w3c/domts/XalanDOMTestDocumentBuilderFactory.java
new file mode 100644
index 0000000..cb60658
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/XalanDOMTestDocumentBuilderFactory.java
@@ -0,0 +1,79 @@
+/*
+ * Copyright (c) 2001-2003 World Wide Web Consortium,
+ * (Massachusetts Institute of Technology, Institut National de
+ * Recherche en Informatique et en Automatique, Keio University). All
+ * Rights Reserved. This program is distributed under the W3C's Software
+ * Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+ */
+
+/*
+ $Log: XalanDOMTestDocumentBuilderFactory.java,v $
+ Revision 1.2 2004/03/11 01:44:21 dom-ts-4
+ Checkstyle fixes (bug 592)
+
+ Revision 1.1 2003/04/24 05:02:05 dom-ts-4
+ Xalan-J support for L3 XPath
+ http://www.w3.org/Bugs/Public/show_bug.cgi?id=191
+
+ Revision 1.1 2002/02/03 07:47:51 dom-ts-4
+ More missing files
+
+ */
+
+package org.w3c.domts;
+
+import java.lang.reflect.Constructor;
+
+import javax.xml.parsers.DocumentBuilderFactory;
+
+import org.w3c.dom.Document;
+
+/**
+ *
+ * This class uses Xalan-J to add XPath support
+ * to the current JAXP DOM implementation
+ */
+public class XalanDOMTestDocumentBuilderFactory
+ extends JAXPDOMTestDocumentBuilderFactory {
+
+ /**
+ * Creates a JAXP implementation of DOMTestDocumentBuilderFactory.
+ * @param factory null for default JAXP provider. If not null,
+ * factory will be mutated in constructor and should be released
+ * by calling code upon return.
+ * @param settings array of settings, may be null.
+ */
+ public XalanDOMTestDocumentBuilderFactory(
+ DocumentBuilderFactory baseFactory,
+ DocumentBuilderSetting[] settings) throws DOMTestIncompatibleException {
+ super(baseFactory, settings);
+ }
+
+ protected DOMTestDocumentBuilderFactory createInstance(DocumentBuilderFactory
+ newFactory,
+ DocumentBuilderSetting[] mergedSettings) throws
+ DOMTestIncompatibleException {
+ return new XalanDOMTestDocumentBuilderFactory(newFactory, mergedSettings);
+ }
+
+ /**
+ * Creates XPath evaluator
+ * @param doc DOM document, may not be null
+ */
+ public Object createXPathEvaluator(Document doc) {
+ try {
+ Class xpathClass = Class.forName(
+ "org.apache.xpath.domapi.XPathEvaluatorImpl");
+ Constructor constructor = xpathClass.getConstructor(new Class[] {Document.class});
+ return constructor.newInstance(new Object[] {doc});
+ }
+ catch (Exception ex) {
+ }
+ return doc;
+ }
+
+}
diff --git a/dom/src/test/java/org/w3c/domts/XercesHTML2DocumentBuilderFactory.java b/dom/src/test/java/org/w3c/domts/XercesHTML2DocumentBuilderFactory.java
new file mode 100644
index 0000000..bf65723
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/XercesHTML2DocumentBuilderFactory.java
@@ -0,0 +1,261 @@
+/*
+ * Copyright (c) 2002 World Wide Web Consortium,
+ * (Massachusetts Institute of Technology, Institut National de
+ * Recherche en Informatique et en Automatique, Keio University). All
+ * Rights Reserved. This program is distributed under the W3C's Software
+ * Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+ */
+
+package org.w3c.domts;
+
+import java.lang.reflect.Constructor;
+import java.lang.reflect.InvocationTargetException;
+import java.lang.reflect.Method;
+
+import javax.xml.parsers.ParserConfigurationException;
+import javax.xml.parsers.SAXParser;
+import javax.xml.parsers.SAXParserFactory;
+
+import org.w3c.dom.DOMImplementation;
+import org.w3c.dom.Document;
+import org.xml.sax.AttributeList;
+import org.xml.sax.Attributes;
+import org.xml.sax.DocumentHandler;
+import org.xml.sax.SAXException;
+import org.xml.sax.helpers.DefaultHandler;
+
+/**
+ * This class implements the generic parser and configuation
+ * class for the HTML DOM L2 implementation in Xerces-J
+ */
+public class XercesHTML2DocumentBuilderFactory
+ extends DOMTestDocumentBuilderFactory {
+
+ private SAXParserFactory factory;
+ private Constructor htmlBuilderConstructor;
+ private Method getHTMLDocumentMethod;
+ private DOMImplementation domImpl;
+ private static final Class[] NO_CLASSES = new Class[0];
+ private static final Object[] NO_OBJECTS = new Object[0];
+
+ /**
+ * Creates a implementation of DOMTestDocumentBuilderFactory
+ * using org.apache.html.dom.HTMLBuilder
+ * @param settings array of settings, may be null.
+ */
+ public XercesHTML2DocumentBuilderFactory(DocumentBuilderSetting[] settings) throws
+ DOMTestIncompatibleException {
+ super(settings);
+
+ try {
+ ClassLoader classLoader = ClassLoader.getSystemClassLoader();
+ Class htmlBuilderClass =
+ classLoader.loadClass("org.apache.html2.dom.HTMLBuilder");
+
+ htmlBuilderConstructor =
+ htmlBuilderClass.getConstructor(NO_CLASSES);
+
+ getHTMLDocumentMethod =
+ htmlBuilderClass.getMethod("getHTMLDocument", NO_CLASSES);
+
+ Class htmlDOMImpl =
+ classLoader.loadClass(
+ "org.apache.html2.dom.HTMLDOMImplementationImpl");
+ Method method =
+ htmlDOMImpl.getMethod("getHTMLDOMImplementation", NO_CLASSES);
+ domImpl = (DOMImplementation) method.invoke(null, NO_OBJECTS);
+
+ Class saxFactoryClass =
+ classLoader.loadClass(
+ "org.apache.xerces.jaxp.SAXParserFactoryImpl");
+ factory = (SAXParserFactory) saxFactoryClass.newInstance();
+ }
+ catch (InvocationTargetException ex) {
+ throw new DOMTestIncompatibleException(
+ ex.getTargetException(),
+ null);
+ }
+ catch (Exception ex) {
+ throw new DOMTestIncompatibleException(ex, null);
+ }
+
+ //
+ // apply settings to selected document builder
+ // may throw exception if incompatible
+ if (settings != null) {
+ for (int i = 0; i < settings.length; i++) {
+ // settings[i].applySetting(factory);
+ }
+ }
+ try {
+ factory.newSAXParser();
+ }
+ catch (ParserConfigurationException ex) {
+ throw new DOMTestIncompatibleException(ex, null);
+ }
+ catch (SAXException ex) {
+ throw new DOMTestIncompatibleException(ex, null);
+ }
+ }
+
+ public DOMTestDocumentBuilderFactory newInstance(DocumentBuilderSetting[]
+ newSettings) throws DOMTestIncompatibleException {
+ if (newSettings == null) {
+ return this;
+ }
+ DocumentBuilderSetting[] mergedSettings = mergeSettings(newSettings);
+ return new XercesHTML2DocumentBuilderFactory(mergedSettings);
+ }
+
+ private class HTMLHandler
+ extends DefaultHandler
+ implements AttributeList {
+ private final DocumentHandler htmlBuilder;
+ private final Method getHTMLDocumentMethod;
+ private Attributes currentAttributes;
+
+ public HTMLHandler(
+ Constructor htmlBuilderConstructor,
+ Method getHTMLDocumentMethod) throws Exception {
+ htmlBuilder =
+ (DocumentHandler) htmlBuilderConstructor.newInstance(
+ new Object[0]);
+ this.getHTMLDocumentMethod = getHTMLDocumentMethod;
+ }
+
+ public void startDocument() throws SAXException {
+ htmlBuilder.startDocument();
+ }
+
+ public void endDocument() throws SAXException {
+ htmlBuilder.endDocument();
+ }
+
+ public void startElement(
+ String uri,
+ String localName,
+ String qName,
+ Attributes attributes) throws SAXException {
+ currentAttributes = attributes;
+ htmlBuilder.startElement(qName, this);
+ }
+
+ public void endElement(String uri, String localName, String qName) throws
+ SAXException {
+ htmlBuilder.endElement(qName);
+ }
+
+ public void characters(char ch[], int start, int length) throws
+ SAXException {
+ htmlBuilder.characters(ch, start, length);
+ }
+
+ public void ignorableWhitespace(char ch[], int start, int length) throws
+ SAXException {
+ htmlBuilder.ignorableWhitespace(ch, start, length);
+ }
+
+ public void processingInstruction(String target, String data) throws
+ SAXException {
+ htmlBuilder.processingInstruction(target, data);
+ }
+
+ public Document getHTMLDocument() throws Exception {
+ return (Document) getHTMLDocumentMethod.invoke(
+ htmlBuilder,
+ NO_OBJECTS);
+ }
+
+ public int getLength() {
+ return currentAttributes.getLength();
+ }
+
+ public String getName(int i) {
+ return currentAttributes.getQName(i);
+ }
+
+ public String getType(int i) {
+ return currentAttributes.getType(i);
+ }
+
+ public String getValue(int i) {
+ return currentAttributes.getValue(i);
+ }
+
+ public String getType(String name) {
+ return currentAttributes.getType(name);
+ }
+
+ public String getValue(String name) {
+ return currentAttributes.getValue(name);
+ }
+
+ }
+
+ public Document load(java.net.URL url) throws DOMTestLoadException {
+ Document doc = null;
+ try {
+ SAXParser parser = factory.newSAXParser();
+ HTMLHandler handler =
+ new HTMLHandler(htmlBuilderConstructor, getHTMLDocumentMethod);
+ parser.parse(url.toString(), handler);
+ doc = handler.getHTMLDocument();
+ }
+ catch (Exception ex) {
+ throw new DOMTestLoadException(ex);
+ }
+ return doc;
+ }
+
+ public DOMImplementation getDOMImplementation() {
+ return domImpl;
+ }
+
+ public boolean hasFeature(String feature, String version) {
+ return domImpl.hasFeature(feature, version);
+ }
+
+ public boolean isCoalescing() {
+ return false;
+ }
+
+ public boolean isExpandEntityReferences() {
+ return false;
+ }
+
+ public boolean isIgnoringElementContentWhitespace() {
+ return false;
+ }
+
+ public boolean isNamespaceAware() {
+ return factory.isNamespaceAware();
+ }
+
+ public boolean isValidating() {
+ return factory.isValidating();
+ }
+
+ public static DocumentBuilderSetting[] getConfiguration1() {
+ return new DocumentBuilderSetting[] {
+ DocumentBuilderSetting.notCoalescing,
+ DocumentBuilderSetting.notExpandEntityReferences,
+ DocumentBuilderSetting.notIgnoringElementContentWhitespace,
+ DocumentBuilderSetting.notNamespaceAware,
+ DocumentBuilderSetting.notValidating};
+ }
+
+ public static DocumentBuilderSetting[] getConfiguration2() {
+ return new DocumentBuilderSetting[] {
+ DocumentBuilderSetting.notCoalescing,
+ DocumentBuilderSetting.expandEntityReferences,
+ DocumentBuilderSetting.ignoringElementContentWhitespace,
+ DocumentBuilderSetting.namespaceAware,
+ DocumentBuilderSetting.validating};
+
+ }
+
+}
diff --git a/dom/src/test/java/org/w3c/domts/XercesHTMLDocumentBuilderFactory.java b/dom/src/test/java/org/w3c/domts/XercesHTMLDocumentBuilderFactory.java
new file mode 100644
index 0000000..b6b537b
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/XercesHTMLDocumentBuilderFactory.java
@@ -0,0 +1,261 @@
+/*
+ * Copyright (c) 2002 World Wide Web Consortium,
+ * (Massachusetts Institute of Technology, Institut National de
+ * Recherche en Informatique et en Automatique, Keio University). All
+ * Rights Reserved. This program is distributed under the W3C's Software
+ * Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+ */
+
+package org.w3c.domts;
+
+import java.lang.reflect.Constructor;
+import java.lang.reflect.InvocationTargetException;
+import java.lang.reflect.Method;
+
+import javax.xml.parsers.ParserConfigurationException;
+import javax.xml.parsers.SAXParser;
+import javax.xml.parsers.SAXParserFactory;
+
+import org.w3c.dom.DOMImplementation;
+import org.w3c.dom.Document;
+import org.xml.sax.AttributeList;
+import org.xml.sax.Attributes;
+import org.xml.sax.DocumentHandler;
+import org.xml.sax.SAXException;
+import org.xml.sax.helpers.DefaultHandler;
+
+/**
+ * This class implements the generic parser and configuation
+ * abstract class the HTML DOM implementation in Xerces-J
+ */
+public class XercesHTMLDocumentBuilderFactory
+ extends DOMTestDocumentBuilderFactory {
+
+ private SAXParserFactory factory;
+ private Constructor htmlBuilderConstructor;
+ private Method getHTMLDocumentMethod;
+ private DOMImplementation domImpl;
+ private static final Class[] NO_CLASSES = new Class[0];
+ private static final Object[] NO_OBJECTS = new Object[0];
+
+ /**
+ * Creates a implementation of DOMTestDocumentBuilderFactory
+ * using org.apache.html.dom.HTMLBuilder
+ * @param settings array of settings, may be null.
+ */
+ public XercesHTMLDocumentBuilderFactory(DocumentBuilderSetting[] settings) throws
+ DOMTestIncompatibleException {
+ super(settings);
+
+ try {
+ ClassLoader classLoader = ClassLoader.getSystemClassLoader();
+ Class htmlBuilderClass =
+ classLoader.loadClass("org.apache.html.dom.HTMLBuilder");
+
+ htmlBuilderConstructor =
+ htmlBuilderClass.getConstructor(NO_CLASSES);
+
+ getHTMLDocumentMethod =
+ htmlBuilderClass.getMethod("getHTMLDocument", NO_CLASSES);
+
+ Class htmlDOMImpl =
+ classLoader.loadClass(
+ "org.apache.html.dom.HTMLDOMImplementationImpl");
+ Method method =
+ htmlDOMImpl.getMethod("getHTMLDOMImplementation", NO_CLASSES);
+ domImpl = (DOMImplementation) method.invoke(null, NO_OBJECTS);
+
+ Class saxFactoryClass =
+ classLoader.loadClass(
+ "org.apache.xerces.jaxp.SAXParserFactoryImpl");
+ factory = (SAXParserFactory) saxFactoryClass.newInstance();
+ }
+ catch (InvocationTargetException ex) {
+ throw new DOMTestIncompatibleException(
+ ex.getTargetException(),
+ null);
+ }
+ catch (Exception ex) {
+ throw new DOMTestIncompatibleException(ex, null);
+ }
+
+ //
+ // apply settings to selected document builder
+ // may throw exception if incompatible
+ if (settings != null) {
+ for (int i = 0; i < settings.length; i++) {
+ // settings[i].applySetting(factory);
+ }
+ }
+ try {
+ factory.newSAXParser();
+ }
+ catch (ParserConfigurationException ex) {
+ throw new DOMTestIncompatibleException(ex, null);
+ }
+ catch (SAXException ex) {
+ throw new DOMTestIncompatibleException(ex, null);
+ }
+ }
+
+ public DOMTestDocumentBuilderFactory newInstance(DocumentBuilderSetting[]
+ newSettings) throws DOMTestIncompatibleException {
+ if (newSettings == null) {
+ return this;
+ }
+ DocumentBuilderSetting[] mergedSettings = mergeSettings(newSettings);
+ return new XercesHTMLDocumentBuilderFactory(mergedSettings);
+ }
+
+ private class HTMLHandler
+ extends DefaultHandler
+ implements AttributeList {
+ private final DocumentHandler htmlBuilder;
+ private final Method getHTMLDocumentMethod;
+ private Attributes currentAttributes;
+
+ public HTMLHandler(
+ Constructor htmlBuilderConstructor,
+ Method getHTMLDocumentMethod) throws Exception {
+ htmlBuilder =
+ (DocumentHandler) htmlBuilderConstructor.newInstance(
+ new Object[0]);
+ this.getHTMLDocumentMethod = getHTMLDocumentMethod;
+ }
+
+ public void startDocument() throws SAXException {
+ htmlBuilder.startDocument();
+ }
+
+ public void endDocument() throws SAXException {
+ htmlBuilder.endDocument();
+ }
+
+ public void startElement(
+ String uri,
+ String localName,
+ String qName,
+ Attributes attributes) throws SAXException {
+ currentAttributes = attributes;
+ htmlBuilder.startElement(qName, this);
+ }
+
+ public void endElement(String uri, String localName, String qName) throws
+ SAXException {
+ htmlBuilder.endElement(qName);
+ }
+
+ public void characters(char ch[], int start, int length) throws
+ SAXException {
+ htmlBuilder.characters(ch, start, length);
+ }
+
+ public void ignorableWhitespace(char ch[], int start, int length) throws
+ SAXException {
+ htmlBuilder.ignorableWhitespace(ch, start, length);
+ }
+
+ public void processingInstruction(String target, String data) throws
+ SAXException {
+ htmlBuilder.processingInstruction(target, data);
+ }
+
+ public Document getHTMLDocument() throws Exception {
+ return (Document) getHTMLDocumentMethod.invoke(
+ htmlBuilder,
+ NO_OBJECTS);
+ }
+
+ public int getLength() {
+ return currentAttributes.getLength();
+ }
+
+ public String getName(int i) {
+ return currentAttributes.getQName(i);
+ }
+
+ public String getType(int i) {
+ return currentAttributes.getType(i);
+ }
+
+ public String getValue(int i) {
+ return currentAttributes.getValue(i);
+ }
+
+ public String getType(String name) {
+ return currentAttributes.getType(name);
+ }
+
+ public String getValue(String name) {
+ return currentAttributes.getValue(name);
+ }
+
+ }
+
+ public Document load(java.net.URL url) throws DOMTestLoadException {
+ Document doc = null;
+ try {
+ SAXParser parser = factory.newSAXParser();
+ HTMLHandler handler =
+ new HTMLHandler(htmlBuilderConstructor, getHTMLDocumentMethod);
+ parser.parse(url.toString(), handler);
+ doc = handler.getHTMLDocument();
+ }
+ catch (Exception ex) {
+ throw new DOMTestLoadException(ex);
+ }
+ return doc;
+ }
+
+ public DOMImplementation getDOMImplementation() {
+ return domImpl;
+ }
+
+ public boolean hasFeature(String feature, String version) {
+ return domImpl.hasFeature(feature, version);
+ }
+
+ public boolean isCoalescing() {
+ return false;
+ }
+
+ public boolean isExpandEntityReferences() {
+ return false;
+ }
+
+ public boolean isIgnoringElementContentWhitespace() {
+ return false;
+ }
+
+ public boolean isNamespaceAware() {
+ return factory.isNamespaceAware();
+ }
+
+ public boolean isValidating() {
+ return factory.isValidating();
+ }
+
+ public static DocumentBuilderSetting[] getConfiguration1() {
+ return new DocumentBuilderSetting[] {
+ DocumentBuilderSetting.notCoalescing,
+ DocumentBuilderSetting.notExpandEntityReferences,
+ DocumentBuilderSetting.notIgnoringElementContentWhitespace,
+ DocumentBuilderSetting.notNamespaceAware,
+ DocumentBuilderSetting.notValidating};
+ }
+
+ public static DocumentBuilderSetting[] getConfiguration2() {
+ return new DocumentBuilderSetting[] {
+ DocumentBuilderSetting.notCoalescing,
+ DocumentBuilderSetting.expandEntityReferences,
+ DocumentBuilderSetting.ignoringElementContentWhitespace,
+ DocumentBuilderSetting.namespaceAware,
+ DocumentBuilderSetting.validating};
+
+ }
+
+}
diff --git a/dom/src/test/java/org/w3c/domts/level1/core/TestBatik.java b/dom/src/test/java/org/w3c/domts/level1/core/TestBatik.java
new file mode 100644
index 0000000..581b344
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level1/core/TestBatik.java
@@ -0,0 +1,43 @@
+/*
+ * Copyright (c) 2001-2004 World Wide Web Consortium,
+ * (Massachusetts Institute of Technology, Institut National de
+ * Recherche en Informatique et en Automatique, Keio University). All
+ * Rights Reserved. This program is distributed under the W3C's Software
+ * Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+ */
+
+
+package org.w3c.domts.level1.core;
+
+import java.lang.reflect.Constructor;
+
+import junit.framework.TestSuite;
+
+import org.w3c.domts.BatikTestDocumentBuilderFactory;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+import org.w3c.domts.DOMTestSuite;
+import org.w3c.domts.DocumentBuilderSetting;
+import org.w3c.domts.JUnitTestSuiteAdapter;
+
+public class TestBatik extends TestSuite {
+
+ public static TestSuite suite() throws Exception
+ {
+ Class testClass = ClassLoader.getSystemClassLoader().loadClass("org.w3c.domts.level1.core.alltests");
+ Constructor testConstructor = testClass.getConstructor(new Class[] { DOMTestDocumentBuilderFactory.class });
+
+ DOMTestDocumentBuilderFactory factory =
+ new BatikTestDocumentBuilderFactory(new DocumentBuilderSetting[0]);
+
+ Object test = testConstructor.newInstance(new Object[] { factory });
+
+ return new JUnitTestSuiteAdapter((DOMTestSuite) test);
+ }
+
+
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level1/core/TestCrimson.java b/dom/src/test/java/org/w3c/domts/level1/core/TestCrimson.java
new file mode 100644
index 0000000..4963b64
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level1/core/TestCrimson.java
@@ -0,0 +1,48 @@
+/*
+ * Copyright (c) 2001-2004 World Wide Web Consortium,
+ * (Massachusetts Institute of Technology, Institut National de
+ * Recherche en Informatique et en Automatique, Keio University). All
+ * Rights Reserved. This program is distributed under the W3C's Software
+ * Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+ */
+
+
+package org.w3c.domts.level1.core;
+
+import java.lang.reflect.Constructor;
+
+import javax.xml.parsers.DocumentBuilderFactory;
+
+import junit.framework.TestSuite;
+
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+import org.w3c.domts.DOMTestSuite;
+import org.w3c.domts.JAXPDOMTestDocumentBuilderFactory;
+import org.w3c.domts.JUnitTestSuiteAdapter;
+
+public class TestCrimson extends TestSuite {
+
+ public static TestSuite suite() throws Exception
+ {
+ Class testClass = ClassLoader.getSystemClassLoader().loadClass("org.w3c.domts.level1.core.alltests");
+ Constructor testConstructor = testClass.getConstructor(new Class[] { DOMTestDocumentBuilderFactory.class });
+
+ DocumentBuilderFactory crimsonFactory = (DocumentBuilderFactory)
+ ClassLoader.getSystemClassLoader().loadClass("org.apache.crimson.jaxp.DocumentBuilderFactoryImpl").newInstance();
+
+ DOMTestDocumentBuilderFactory factory =
+ new JAXPDOMTestDocumentBuilderFactory(crimsonFactory,
+ JAXPDOMTestDocumentBuilderFactory.getConfiguration1());
+
+ Object test = testConstructor.newInstance(new Object[] { factory });
+
+ return new JUnitTestSuiteAdapter((DOMTestSuite) test);
+ }
+
+
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level1/core/TestCrimsonAltConfig.java b/dom/src/test/java/org/w3c/domts/level1/core/TestCrimsonAltConfig.java
new file mode 100644
index 0000000..124d8ce
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level1/core/TestCrimsonAltConfig.java
@@ -0,0 +1,48 @@
+/*
+ * Copyright (c) 2001-2004 World Wide Web Consortium,
+ * (Massachusetts Institute of Technology, Institut National de
+ * Recherche en Informatique et en Automatique, Keio University). All
+ * Rights Reserved. This program is distributed under the W3C's Software
+ * Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+ */
+
+
+package org.w3c.domts.level1.core;
+
+import java.lang.reflect.Constructor;
+
+import javax.xml.parsers.DocumentBuilderFactory;
+
+import junit.framework.TestSuite;
+
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+import org.w3c.domts.DOMTestSuite;
+import org.w3c.domts.JAXPDOMTestDocumentBuilderFactory;
+import org.w3c.domts.JUnitTestSuiteAdapter;
+
+public class TestCrimsonAltConfig extends TestSuite {
+
+ public static TestSuite suite() throws Exception
+ {
+ Class testClass = ClassLoader.getSystemClassLoader().loadClass("org.w3c.domts.level1.core.alltests");
+ Constructor testConstructor = testClass.getConstructor(new Class[] { DOMTestDocumentBuilderFactory.class });
+
+ DocumentBuilderFactory crimsonFactory = (DocumentBuilderFactory)
+ ClassLoader.getSystemClassLoader().loadClass("org.apache.crimson.jaxp.DocumentBuilderFactoryImpl").newInstance();
+
+ DOMTestDocumentBuilderFactory factory =
+ new JAXPDOMTestDocumentBuilderFactory(crimsonFactory,
+ JAXPDOMTestDocumentBuilderFactory.getConfiguration2());
+
+ Object test = testConstructor.newInstance(new Object[] { factory });
+
+ return new JUnitTestSuiteAdapter((DOMTestSuite) test);
+ }
+
+
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level1/core/TestDOM4J.java b/dom/src/test/java/org/w3c/domts/level1/core/TestDOM4J.java
new file mode 100644
index 0000000..c368d44
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level1/core/TestDOM4J.java
@@ -0,0 +1,43 @@
+/*
+ * Copyright (c) 2001-2004 World Wide Web Consortium,
+ * (Massachusetts Institute of Technology, Institut National de
+ * Recherche en Informatique et en Automatique, Keio University). All
+ * Rights Reserved. This program is distributed under the W3C's Software
+ * Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+ */
+
+
+package org.w3c.domts.level1.core;
+
+import java.lang.reflect.Constructor;
+
+import junit.framework.TestSuite;
+
+import org.w3c.domts.DOM4JTestDocumentBuilderFactory;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+import org.w3c.domts.DOMTestSuite;
+import org.w3c.domts.DocumentBuilderSetting;
+import org.w3c.domts.JUnitTestSuiteAdapter;
+
+public class TestDOM4J extends TestSuite {
+
+ public static TestSuite suite() throws Exception
+ {
+ Class testClass = ClassLoader.getSystemClassLoader().loadClass("org.w3c.domts.level1.core.alltests");
+ Constructor testConstructor = testClass.getConstructor(new Class[] { DOMTestDocumentBuilderFactory.class });
+
+ DOMTestDocumentBuilderFactory factory =
+ new DOM4JTestDocumentBuilderFactory(new DocumentBuilderSetting[0]);
+
+ Object test = testConstructor.newInstance(new Object[] { factory });
+
+ return new JUnitTestSuiteAdapter((DOMTestSuite) test);
+ }
+
+
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level1/core/TestDefaultLS.java b/dom/src/test/java/org/w3c/domts/level1/core/TestDefaultLS.java
new file mode 100644
index 0000000..6890a72
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level1/core/TestDefaultLS.java
@@ -0,0 +1,51 @@
+/*
+ * Copyright (c) 2001-2004 World Wide Web Consortium, (Massachusetts Institute
+ * of Technology, Institut National de Recherche en Informatique et en
+ * Automatique, Keio University). All Rights Reserved. This program is
+ * distributed under the W3C's Software Intellectual Property License. This
+ * program 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 W3C License
+ * http://www.w3.org/Consortium/Legal/ for more details.
+ */
+
+package org.w3c.domts.level1.core;
+
+import java.lang.reflect.Constructor;
+
+import junit.framework.TestSuite;
+
+
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+import org.w3c.domts.DOMTestSuite;
+import org.w3c.domts.LSDocumentBuilderFactory;
+import org.w3c.domts.JAXPDOMTestDocumentBuilderFactory;
+import org.w3c.domts.JUnitTestSuiteAdapter;
+
+/**
+ * Test suite that runs all DOM L1 Core tests using the
+ * Default LS parser in default configuration.
+ *
+ * @author Curt Arnold
+ *
+ */
+public class TestDefaultLS extends TestSuite {
+
+ public static TestSuite suite() throws Exception {
+ Class testClass =
+ ClassLoader.getSystemClassLoader().loadClass(
+ "org.w3c.domts.level1.core.alltests");
+ Constructor testConstructor =
+ testClass.getConstructor(
+ new Class[] { DOMTestDocumentBuilderFactory.class });
+
+ DOMTestDocumentBuilderFactory factory =
+ new LSDocumentBuilderFactory(
+ JAXPDOMTestDocumentBuilderFactory.getConfiguration1());
+
+ Object test = testConstructor.newInstance(new Object[] { factory });
+
+ return new JUnitTestSuiteAdapter((DOMTestSuite) test);
+ }
+
+}
diff --git a/dom/src/test/java/org/w3c/domts/level1/core/TestDefaultLSAltConfig.java b/dom/src/test/java/org/w3c/domts/level1/core/TestDefaultLSAltConfig.java
new file mode 100644
index 0000000..1e8e264
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level1/core/TestDefaultLSAltConfig.java
@@ -0,0 +1,51 @@
+/*
+ * Copyright (c) 2001-2004 World Wide Web Consortium, (Massachusetts Institute
+ * of Technology, Institut National de Recherche en Informatique et en
+ * Automatique, Keio University). All Rights Reserved. This program is
+ * distributed under the W3C's Software Intellectual Property License. This
+ * program 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 W3C License
+ * http://www.w3.org/Consortium/Legal/ for more details.
+ */
+
+package org.w3c.domts.level1.core;
+
+import java.lang.reflect.Constructor;
+
+import junit.framework.TestSuite;
+
+
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+import org.w3c.domts.DOMTestSuite;
+import org.w3c.domts.LSDocumentBuilderFactory;
+import org.w3c.domts.JAXPDOMTestDocumentBuilderFactory;
+import org.w3c.domts.JUnitTestSuiteAdapter;
+
+/**
+ * Test suite that runs all DOM L1 Core tests using the
+ * Default LS parser in an alternate configuration.
+ *
+ * @author Curt Arnold
+ *
+ */
+public class TestDefaultLSAltConfig extends TestSuite {
+
+ public static TestSuite suite() throws Exception {
+ Class testClass =
+ ClassLoader.getSystemClassLoader().loadClass(
+ "org.w3c.domts.level1.core.alltests");
+ Constructor testConstructor =
+ testClass.getConstructor(
+ new Class[] { DOMTestDocumentBuilderFactory.class });
+
+ DOMTestDocumentBuilderFactory factory =
+ new LSDocumentBuilderFactory(
+ JAXPDOMTestDocumentBuilderFactory.getConfiguration2());
+
+ Object test = testConstructor.newInstance(new Object[] { factory });
+
+ return new JUnitTestSuiteAdapter((DOMTestSuite) test);
+ }
+
+}
diff --git a/dom/src/test/java/org/w3c/domts/level1/core/TestDefaultParser.java b/dom/src/test/java/org/w3c/domts/level1/core/TestDefaultParser.java
new file mode 100644
index 0000000..fb43dfb
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level1/core/TestDefaultParser.java
@@ -0,0 +1,43 @@
+/*
+ * Copyright (c) 2001-2004 World Wide Web Consortium,
+ * (Massachusetts Institute of Technology, Institut National de
+ * Recherche en Informatique et en Automatique, Keio University). All
+ * Rights Reserved. This program is distributed under the W3C's Software
+ * Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+ */
+
+
+package org.w3c.domts.level1.core;
+
+import java.lang.reflect.Constructor;
+
+import junit.framework.TestSuite;
+
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+import org.w3c.domts.DOMTestSuite;
+import org.w3c.domts.JAXPDOMTestDocumentBuilderFactory;
+import org.w3c.domts.JUnitTestSuiteAdapter;
+
+public class TestDefaultParser extends TestSuite {
+
+ public static TestSuite suite() throws Exception
+ {
+ Class testClass = ClassLoader.getSystemClassLoader().loadClass("org.w3c.domts.level1.core.alltests");
+ Constructor testConstructor = testClass.getConstructor(new Class[] { DOMTestDocumentBuilderFactory.class });
+
+ DOMTestDocumentBuilderFactory factory =
+ new JAXPDOMTestDocumentBuilderFactory(null,
+ JAXPDOMTestDocumentBuilderFactory.getConfiguration1());
+
+ Object test = testConstructor.newInstance(new Object[] { factory });
+
+ return new JUnitTestSuiteAdapter((DOMTestSuite) test);
+ }
+
+
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level1/core/TestDefaultParserAltConfig.java b/dom/src/test/java/org/w3c/domts/level1/core/TestDefaultParserAltConfig.java
new file mode 100644
index 0000000..3c19b10
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level1/core/TestDefaultParserAltConfig.java
@@ -0,0 +1,43 @@
+/*
+ * Copyright (c) 2001-2004 World Wide Web Consortium,
+ * (Massachusetts Institute of Technology, Institut National de
+ * Recherche en Informatique et en Automatique, Keio University). All
+ * Rights Reserved. This program is distributed under the W3C's Software
+ * Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+ */
+
+
+package org.w3c.domts.level1.core;
+
+import java.lang.reflect.Constructor;
+
+import junit.framework.TestSuite;
+
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+import org.w3c.domts.DOMTestSuite;
+import org.w3c.domts.JAXPDOMTestDocumentBuilderFactory;
+import org.w3c.domts.JUnitTestSuiteAdapter;
+
+public class TestDefaultParserAltConfig extends TestSuite {
+
+ public static TestSuite suite() throws Exception
+ {
+ Class testClass = ClassLoader.getSystemClassLoader().loadClass("org.w3c.domts.level1.core.alltests");
+ Constructor testConstructor = testClass.getConstructor(new Class[] { DOMTestDocumentBuilderFactory.class });
+
+ DOMTestDocumentBuilderFactory factory =
+ new JAXPDOMTestDocumentBuilderFactory(null,
+ JAXPDOMTestDocumentBuilderFactory.getConfiguration2());
+
+ Object test = testConstructor.newInstance(new Object[] { factory });
+
+ return new JUnitTestSuiteAdapter((DOMTestSuite) test);
+ }
+
+
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level1/core/TestGNUJAXP.java b/dom/src/test/java/org/w3c/domts/level1/core/TestGNUJAXP.java
new file mode 100644
index 0000000..dcebe88
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level1/core/TestGNUJAXP.java
@@ -0,0 +1,51 @@
+/*
+ * Copyright (c) 2001-2004 World Wide Web Consortium,
+ * (Massachusetts Institute of Technology, Institut National de
+ * Recherche en Informatique et en Automatique, Keio University). All
+ * Rights Reserved. This program is distributed under the W3C's Software
+ * Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+ */
+
+
+package org.w3c.domts.level1.core;
+
+import java.lang.reflect.Constructor;
+
+import javax.xml.parsers.DocumentBuilderFactory;
+
+import junit.framework.TestSuite;
+
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+import org.w3c.domts.DOMTestSuite;
+import org.w3c.domts.JAXPDOMTestDocumentBuilderFactory;
+import org.w3c.domts.JUnitTestSuiteAdapter;
+
+public class TestGNUJAXP extends TestSuite {
+
+ public static TestSuite suite() throws Exception
+ {
+ Class testClass = ClassLoader.getSystemClassLoader().loadClass("org.w3c.domts.level1.core.alltests");
+ Constructor testConstructor = testClass.getConstructor(new Class[] { DOMTestDocumentBuilderFactory.class });
+
+
+ DocumentBuilderFactory gnujaxpFactory = (DocumentBuilderFactory)
+ ClassLoader.getSystemClassLoader().
+ loadClass("gnu.xml.dom.JAXPFactory").newInstance();
+
+ DOMTestDocumentBuilderFactory factory =
+ new JAXPDOMTestDocumentBuilderFactory(gnujaxpFactory,
+ JAXPDOMTestDocumentBuilderFactory.getConfiguration1());
+
+
+ Object test = testConstructor.newInstance(new Object[] { factory });
+
+ return new JUnitTestSuiteAdapter((DOMTestSuite) test);
+ }
+
+
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level1/core/TestGNUJAXPAltConfig.java b/dom/src/test/java/org/w3c/domts/level1/core/TestGNUJAXPAltConfig.java
new file mode 100644
index 0000000..5900db1
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level1/core/TestGNUJAXPAltConfig.java
@@ -0,0 +1,49 @@
+/*
+ * Copyright (c) 2001-2004 World Wide Web Consortium,
+ * (Massachusetts Institute of Technology, Institut National de
+ * Recherche en Informatique et en Automatique, Keio University). All
+ * Rights Reserved. This program is distributed under the W3C's Software
+ * Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+ */
+
+
+package org.w3c.domts.level1.core;
+
+import java.lang.reflect.Constructor;
+
+import javax.xml.parsers.DocumentBuilderFactory;
+
+import junit.framework.TestSuite;
+
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+import org.w3c.domts.DOMTestSuite;
+import org.w3c.domts.JAXPDOMTestDocumentBuilderFactory;
+import org.w3c.domts.JUnitTestSuiteAdapter;
+
+public class TestGNUJAXPAltConfig extends TestSuite {
+
+ public static TestSuite suite() throws Exception
+ {
+ Class testClass = ClassLoader.getSystemClassLoader().loadClass("org.w3c.domts.level1.core.alltests");
+ Constructor testConstructor = testClass.getConstructor(new Class[] { DOMTestDocumentBuilderFactory.class });
+
+ DocumentBuilderFactory gnujaxpFactory = (DocumentBuilderFactory)
+ ClassLoader.getSystemClassLoader().
+ loadClass("gnu.xml.dom.JAXPFactory").newInstance();
+
+ DOMTestDocumentBuilderFactory factory =
+ new JAXPDOMTestDocumentBuilderFactory(gnujaxpFactory,
+ JAXPDOMTestDocumentBuilderFactory.getConfiguration2());
+
+ Object test = testConstructor.newInstance(new Object[] { factory });
+
+ return new JUnitTestSuiteAdapter((DOMTestSuite) test);
+ }
+
+
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level1/core/TestJTidy.java b/dom/src/test/java/org/w3c/domts/level1/core/TestJTidy.java
new file mode 100644
index 0000000..12ecf3f
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level1/core/TestJTidy.java
@@ -0,0 +1,41 @@
+/*
+ * Copyright (c) 2001-2004 World Wide Web Consortium,
+ * (Massachusetts Institute of Technology, Institut National de
+ * Recherche en Informatique et en Automatique, Keio University). All
+ * Rights Reserved. This program is distributed under the W3C's Software
+ * Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+ */
+
+
+package org.w3c.domts.level1.core;
+
+import java.lang.reflect.Constructor;
+
+import junit.framework.TestSuite;
+
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+import org.w3c.domts.DOMTestSuite;
+import org.w3c.domts.DocumentBuilderSetting;
+import org.w3c.domts.JTidyDocumentBuilderFactory;
+import org.w3c.domts.JUnitTestSuiteAdapter;
+
+public class TestJTidy extends TestSuite {
+
+ public static TestSuite suite() throws Exception
+ {
+ Class testClass = ClassLoader.getSystemClassLoader().loadClass("org.w3c.domts.level1.core.alltests");
+ Constructor testConstructor = testClass.getConstructor(new Class[] { DOMTestDocumentBuilderFactory.class });
+
+ DOMTestDocumentBuilderFactory factory =
+ new JTidyDocumentBuilderFactory(new DocumentBuilderSetting[0]);
+
+ Object test = testConstructor.newInstance(new Object[] { factory });
+
+ return new JUnitTestSuiteAdapter((DOMTestSuite) test);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level1/core/TestOracle.java b/dom/src/test/java/org/w3c/domts/level1/core/TestOracle.java
new file mode 100644
index 0000000..96c9f36
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level1/core/TestOracle.java
@@ -0,0 +1,50 @@
+/*
+ * Copyright (c) 2001-2004 World Wide Web Consortium,
+ * (Massachusetts Institute of Technology, Institut National de
+ * Recherche en Informatique et en Automatique, Keio University). All
+ * Rights Reserved. This program is distributed under the W3C's Software
+ * Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+ */
+
+
+package org.w3c.domts.level1.core;
+
+import java.lang.reflect.Constructor;
+
+import javax.xml.parsers.DocumentBuilderFactory;
+
+import junit.framework.TestSuite;
+
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+import org.w3c.domts.DOMTestSuite;
+import org.w3c.domts.JAXPDOMTestDocumentBuilderFactory;
+import org.w3c.domts.JUnitTestSuiteAdapter;
+
+public class TestOracle extends TestSuite {
+
+ public static TestSuite suite() throws Exception
+ {
+ Class testClass = ClassLoader.getSystemClassLoader().loadClass("org.w3c.domts.level1.core.alltests");
+ Constructor testConstructor = testClass.getConstructor(new Class[] { DOMTestDocumentBuilderFactory.class });
+
+ DocumentBuilderFactory oracleFactory = (DocumentBuilderFactory)
+ ClassLoader.getSystemClassLoader().
+ loadClass("oracle.xml.jaxp.JXDocumentBuilderFactory").newInstance();
+
+ DOMTestDocumentBuilderFactory factory =
+ new JAXPDOMTestDocumentBuilderFactory(oracleFactory,
+ JAXPDOMTestDocumentBuilderFactory.getConfiguration1());
+
+
+ Object test = testConstructor.newInstance(new Object[] { factory });
+
+ return new JUnitTestSuiteAdapter((DOMTestSuite) test);
+ }
+
+
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level1/core/TestOracleAltConfig.java b/dom/src/test/java/org/w3c/domts/level1/core/TestOracleAltConfig.java
new file mode 100644
index 0000000..968abd0
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level1/core/TestOracleAltConfig.java
@@ -0,0 +1,49 @@
+/*
+ * Copyright (c) 2001-2004 World Wide Web Consortium,
+ * (Massachusetts Institute of Technology, Institut National de
+ * Recherche en Informatique et en Automatique, Keio University). All
+ * Rights Reserved. This program is distributed under the W3C's Software
+ * Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+ */
+
+
+package org.w3c.domts.level1.core;
+
+import java.lang.reflect.Constructor;
+
+import javax.xml.parsers.DocumentBuilderFactory;
+
+import junit.framework.TestSuite;
+
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+import org.w3c.domts.DOMTestSuite;
+import org.w3c.domts.JAXPDOMTestDocumentBuilderFactory;
+import org.w3c.domts.JUnitTestSuiteAdapter;
+
+public class TestOracleAltConfig extends TestSuite {
+
+ public static TestSuite suite() throws Exception
+ {
+ Class testClass = ClassLoader.getSystemClassLoader().loadClass("org.w3c.domts.level1.core.alltests");
+ Constructor testConstructor = testClass.getConstructor(new Class[] { DOMTestDocumentBuilderFactory.class });
+
+ DocumentBuilderFactory oracleFactory = (DocumentBuilderFactory)
+ ClassLoader.getSystemClassLoader().
+ loadClass("oracle.xml.jaxp.JXDocumentBuilderFactory").newInstance();
+
+ DOMTestDocumentBuilderFactory factory =
+ new JAXPDOMTestDocumentBuilderFactory(oracleFactory,
+ JAXPDOMTestDocumentBuilderFactory.getConfiguration2());
+
+ Object test = testConstructor.newInstance(new Object[] { factory });
+
+ return new JUnitTestSuiteAdapter((DOMTestSuite) test);
+ }
+
+
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level1/core/TestXerces.java b/dom/src/test/java/org/w3c/domts/level1/core/TestXerces.java
new file mode 100644
index 0000000..268bad0
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level1/core/TestXerces.java
@@ -0,0 +1,49 @@
+/*
+ * Copyright (c) 2001-2004 World Wide Web Consortium,
+ * (Massachusetts Institute of Technology, Institut National de
+ * Recherche en Informatique et en Automatique, Keio University). All
+ * Rights Reserved. This program is distributed under the W3C's Software
+ * Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+ */
+
+
+package org.w3c.domts.level1.core;
+
+import java.lang.reflect.Constructor;
+
+import javax.xml.parsers.DocumentBuilderFactory;
+
+import junit.framework.TestSuite;
+
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+import org.w3c.domts.DOMTestSuite;
+import org.w3c.domts.JAXPDOMTestDocumentBuilderFactory;
+import org.w3c.domts.JUnitTestSuiteAdapter;
+
+public class TestXerces extends TestSuite {
+
+ public static TestSuite suite() throws Exception
+ {
+ Class testClass = ClassLoader.getSystemClassLoader().loadClass("org.w3c.domts.level1.core.alltests");
+ Constructor testConstructor = testClass.getConstructor(new Class[] { DOMTestDocumentBuilderFactory.class });
+
+ DocumentBuilderFactory xercesFactory = (DocumentBuilderFactory)
+ ClassLoader.getSystemClassLoader().loadClass("org.apache.xerces.jaxp.DocumentBuilderFactoryImpl").newInstance();
+
+ DOMTestDocumentBuilderFactory factory =
+ new JAXPDOMTestDocumentBuilderFactory(xercesFactory,
+ JAXPDOMTestDocumentBuilderFactory.getConfiguration1());
+
+
+ Object test = testConstructor.newInstance(new Object[] { factory });
+
+ return new JUnitTestSuiteAdapter((DOMTestSuite) test);
+ }
+
+
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level1/core/TestXercesAltConfig.java b/dom/src/test/java/org/w3c/domts/level1/core/TestXercesAltConfig.java
new file mode 100644
index 0000000..74b3c4c
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level1/core/TestXercesAltConfig.java
@@ -0,0 +1,48 @@
+/*
+ * Copyright (c) 2001-2004 World Wide Web Consortium,
+ * (Massachusetts Institute of Technology, Institut National de
+ * Recherche en Informatique et en Automatique, Keio University). All
+ * Rights Reserved. This program is distributed under the W3C's Software
+ * Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+ */
+
+
+package org.w3c.domts.level1.core;
+
+import java.lang.reflect.Constructor;
+
+import javax.xml.parsers.DocumentBuilderFactory;
+
+import junit.framework.TestSuite;
+
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+import org.w3c.domts.DOMTestSuite;
+import org.w3c.domts.JAXPDOMTestDocumentBuilderFactory;
+import org.w3c.domts.JUnitTestSuiteAdapter;
+
+public class TestXercesAltConfig extends TestSuite {
+
+ public static TestSuite suite() throws Exception
+ {
+ Class testClass = ClassLoader.getSystemClassLoader().loadClass("org.w3c.domts.level1.core.alltests");
+ Constructor testConstructor = testClass.getConstructor(new Class[] { DOMTestDocumentBuilderFactory.class });
+
+ DocumentBuilderFactory xercesFactory = (DocumentBuilderFactory)
+ ClassLoader.getSystemClassLoader().loadClass("org.apache.xerces.jaxp.DocumentBuilderFactoryImpl").newInstance();
+
+ DOMTestDocumentBuilderFactory factory =
+ new JAXPDOMTestDocumentBuilderFactory(xercesFactory,
+ JAXPDOMTestDocumentBuilderFactory.getConfiguration2());
+
+ Object test = testConstructor.newInstance(new Object[] { factory });
+
+ return new JUnitTestSuiteAdapter((DOMTestSuite) test);
+ }
+
+
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level1/core/alltests.java b/dom/src/test/java/org/w3c/domts/level1/core/alltests.java
new file mode 100644
index 0000000..d5a7516
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level1/core/alltests.java
@@ -0,0 +1,595 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+Copyright (c) 2001-2004 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+*/
+
+package org.w3c.domts.level1.core;
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestSuite;
+import org.w3c.domts.DOMTestSink;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+/**
+ *
+* @author DOM Test Suite Project
+*/
+public class alltests extends DOMTestSuite {
+
+ /**
+ * Constructor
+ * @param factory document factory, may not be null
+ * @throws Exception Thrown if test is not compatible with settings
+ */
+ public alltests(DOMTestDocumentBuilderFactory factory) throws Exception {
+ super(factory);
+
+ setFactory(factory);
+ }
+
+ /**
+ * Build test suite by adding each test to the test sink
+ * @param sink test sink
+ */
+ public void build(DOMTestSink sink) {
+ sink.addTest(attrcreatedocumentfragment.class);
+ sink.addTest(attrcreatetextnode.class);
+ sink.addTest(attrcreatetextnode2.class);
+ sink.addTest(attrdefaultvalue.class);
+ sink.addTest(attreffectivevalue.class);
+// sink.addTest(attrentityreplacement.class);
+ sink.addTest(attrname.class);
+ sink.addTest(attrnextsiblingnull.class);
+ sink.addTest(attrnotspecifiedvalue.class);
+ sink.addTest(attrparentnodenull.class);
+ sink.addTest(attrprevioussiblingnull.class);
+// sink.addTest(attrsetvaluenomodificationallowederr.class);
+// sink.addTest(attrsetvaluenomodificationallowederrEE.class);
+ sink.addTest(attrspecifiedvalue.class);
+ sink.addTest(attrspecifiedvaluechanged.class);
+ sink.addTest(attrspecifiedvalueremove.class);
+ sink.addTest(cdatasectiongetdata.class);
+// sink.addTest(cdatasectionnormalize.class);
+ sink.addTest(characterdataappenddata.class);
+ sink.addTest(characterdataappenddatagetdata.class);
+// sink.addTest(characterdataappenddatanomodificationallowederr.class);
+// sink.addTest(characterdataappenddatanomodificationallowederrEE.class);
+ sink.addTest(characterdatadeletedatabegining.class);
+ sink.addTest(characterdatadeletedataend.class);
+ sink.addTest(characterdatadeletedataexceedslength.class);
+ sink.addTest(characterdatadeletedatagetlengthanddata.class);
+ sink.addTest(characterdatadeletedatamiddle.class);
+// sink.addTest(characterdatadeletedatanomodificationallowederr.class);
+// sink.addTest(characterdatadeletedatanomodificationallowederrEE.class);
+ sink.addTest(characterdatagetdata.class);
+ sink.addTest(characterdatagetlength.class);
+// sink.addTest(characterdataindexsizeerrdeletedatacountnegative.class);
+// sink.addTest(characterdataindexsizeerrdeletedataoffsetgreater.class);
+// sink.addTest(characterdataindexsizeerrdeletedataoffsetnegative.class);
+// sink.addTest(characterdataindexsizeerrinsertdataoffsetgreater.class);
+// sink.addTest(characterdataindexsizeerrinsertdataoffsetnegative.class);
+// sink.addTest(characterdataindexsizeerrreplacedatacountnegative.class);
+// sink.addTest(characterdataindexsizeerrreplacedataoffsetgreater.class);
+// sink.addTest(characterdataindexsizeerrreplacedataoffsetnegative.class);
+// sink.addTest(characterdataindexsizeerrsubstringcountnegative.class);
+// sink.addTest(characterdataindexsizeerrsubstringnegativeoffset.class);
+// sink.addTest(characterdataindexsizeerrsubstringoffsetgreater.class);
+ sink.addTest(characterdatainsertdatabeginning.class);
+ sink.addTest(characterdatainsertdataend.class);
+ sink.addTest(characterdatainsertdatamiddle.class);
+// sink.addTest(characterdatainsertdatanomodificationallowederr.class);
+// sink.addTest(characterdatainsertdatanomodificationallowederrEE.class);
+ sink.addTest(characterdatareplacedatabegining.class);
+ sink.addTest(characterdatareplacedataend.class);
+ sink.addTest(characterdatareplacedataexceedslengthofarg.class);
+ sink.addTest(characterdatareplacedataexceedslengthofdata.class);
+ sink.addTest(characterdatareplacedatamiddle.class);
+// sink.addTest(characterdatareplacedatanomodificationallowederr.class);
+// sink.addTest(characterdatareplacedatanomodificationallowederrEE.class);
+// sink.addTest(characterdatasetdatanomodificationallowederr.class);
+// sink.addTest(characterdatasetdatanomodificationallowederrEE.class);
+// sink.addTest(characterdatasetnodevalue.class);
+// sink.addTest(characterdatasubstringexceedsvalue.class);
+ sink.addTest(characterdatasubstringvalue.class);
+ sink.addTest(commentgetcomment.class);
+// sink.addTest(documentcreateattribute.class);
+ sink.addTest(documentcreatecdatasection.class);
+ sink.addTest(documentcreatecomment.class);
+ sink.addTest(documentcreatedocumentfragment.class);
+ sink.addTest(documentcreateelement.class);
+ sink.addTest(documentcreateelementcasesensitive.class);
+ sink.addTest(documentcreateelementdefaultattr.class);
+ sink.addTest(documentcreateentityreference.class);
+// sink.addTest(documentcreateentityreferenceknown.class);
+ sink.addTest(documentcreateprocessinginstruction.class);
+ sink.addTest(documentcreatetextnode.class);
+ sink.addTest(documentgetdoctype.class);
+ sink.addTest(documentgetdoctypenodtd.class);
+ sink.addTest(documentgetelementsbytagnamelength.class);
+// sink.addTest(documentgetelementsbytagnametotallength.class);
+ sink.addTest(documentgetelementsbytagnamevalue.class);
+ sink.addTest(documentgetimplementation.class);
+ sink.addTest(documentgetrootnode.class);
+ sink.addTest(documentinvalidcharacterexceptioncreateattribute.class);
+ sink.addTest(documentinvalidcharacterexceptioncreateelement.class);
+// sink.addTest(documentinvalidcharacterexceptioncreateentref.class);
+// sink.addTest(documentinvalidcharacterexceptioncreateentref1.class);
+// sink.addTest(documentinvalidcharacterexceptioncreatepi.class);
+// sink.addTest(documentinvalidcharacterexceptioncreatepi1.class);
+ sink.addTest(documenttypegetdoctype.class);
+// sink.addTest(documenttypegetentities.class);
+// sink.addTest(documenttypegetentitieslength.class);
+// sink.addTest(documenttypegetentitiestype.class);
+// sink.addTest(documenttypegetnotations.class);
+// sink.addTest(documenttypegetnotationstype.class);
+ sink.addTest(domimplementationfeaturenoversion.class);
+ sink.addTest(domimplementationfeaturenull.class);
+ sink.addTest(domimplementationfeaturexml.class);
+ sink.addTest(elementaddnewattribute.class);
+ sink.addTest(elementassociatedattribute.class);
+ sink.addTest(elementchangeattributevalue.class);
+// sink.addTest(elementcreatenewattribute.class);
+ sink.addTest(elementgetattributenode.class);
+ sink.addTest(elementgetattributenodenull.class);
+// sink.addTest(elementgetelementempty.class);
+ sink.addTest(elementgetelementsbytagname.class);
+ sink.addTest(elementgetelementsbytagnameaccessnodelist.class);
+ sink.addTest(elementgetelementsbytagnamenomatch.class);
+// sink.addTest(elementgetelementsbytagnamespecialvalue.class);
+ sink.addTest(elementgettagname.class);
+ sink.addTest(elementinuseattributeerr.class);
+ sink.addTest(elementinvalidcharacterexception.class);
+ sink.addTest(elementnormalize.class);
+ sink.addTest(elementnotfounderr.class);
+ sink.addTest(elementremoveattribute.class);
+ sink.addTest(elementremoveattributeaftercreate.class);
+ sink.addTest(elementremoveattributenode.class);
+// sink.addTest(elementremoveattributenodenomodificationallowederr.class);
+// sink.addTest(elementremoveattributenodenomodificationallowederrEE.class);
+// sink.addTest(elementremoveattributenomodificationallowederr.class);
+// sink.addTest(elementremoveattributenomodificationallowederrEE.class);
+ sink.addTest(elementremoveattributerestoredefaultvalue.class);
+// sink.addTest(elementreplaceattributewithself.class);
+// sink.addTest(elementreplaceexistingattribute.class);
+ sink.addTest(elementreplaceexistingattributegevalue.class);
+ sink.addTest(elementretrieveallattributes.class);
+ sink.addTest(elementretrieveattrvalue.class);
+ sink.addTest(elementretrievetagname.class);
+// sink.addTest(elementsetattributenodenomodificationallowederr.class);
+// sink.addTest(elementsetattributenodenomodificationallowederrEE.class);
+ sink.addTest(elementsetattributenodenull.class);
+// sink.addTest(elementsetattributenomodificationallowederr.class);
+// sink.addTest(elementsetattributenomodificationallowederrEE.class);
+ sink.addTest(elementwrongdocumenterr.class);
+// sink.addTest(entitygetentityname.class);
+// sink.addTest(entitygetpublicid.class);
+// sink.addTest(entitygetpublicidnull.class);
+ sink.addTest(namednodemapchildnoderange.class);
+ sink.addTest(namednodemapgetnameditem.class);
+ sink.addTest(namednodemapinuseattributeerr.class);
+ sink.addTest(namednodemapnotfounderr.class);
+ sink.addTest(namednodemapnumberofnodes.class);
+ sink.addTest(namednodemapremovenameditem.class);
+ sink.addTest(namednodemapremovenameditemgetvalue.class);
+ sink.addTest(namednodemapremovenameditemreturnnodevalue.class);
+ sink.addTest(namednodemapreturnattrnode.class);
+ sink.addTest(namednodemapreturnfirstitem.class);
+ sink.addTest(namednodemapreturnlastitem.class);
+ sink.addTest(namednodemapreturnnull.class);
+ sink.addTest(namednodemapsetnameditem.class);
+ sink.addTest(namednodemapsetnameditemreturnvalue.class);
+// sink.addTest(namednodemapsetnameditemthatexists.class);
+ sink.addTest(namednodemapsetnameditemwithnewvalue.class);
+ sink.addTest(namednodemapwrongdocumenterr.class);
+ sink.addTest(nodeappendchild.class);
+// sink.addTest(nodeappendchildchildexists.class);
+// sink.addTest(nodeappendchilddocfragment.class);
+ sink.addTest(nodeappendchildgetnodename.class);
+// sink.addTest(nodeappendchildinvalidnodetype.class);
+ sink.addTest(nodeappendchildnewchilddiffdocument.class);
+ sink.addTest(nodeappendchildnodeancestor.class);
+// sink.addTest(nodeappendchildnomodificationallowederr.class);
+// sink.addTest(nodeappendchildnomodificationallowederrEE.class);
+ sink.addTest(nodeattributenodeattribute.class);
+ sink.addTest(nodeattributenodename.class);
+ sink.addTest(nodeattributenodetype.class);
+ sink.addTest(nodeattributenodevalue.class);
+ sink.addTest(nodecdatasectionnodeattribute.class);
+ sink.addTest(nodecdatasectionnodename.class);
+ sink.addTest(nodecdatasectionnodetype.class);
+ sink.addTest(nodecdatasectionnodevalue.class);
+ sink.addTest(nodechildnodes.class);
+// sink.addTest(nodechildnodesappendchild.class);
+ sink.addTest(nodechildnodesempty.class);
+// sink.addTest(nodecloneattributescopied.class);
+// sink.addTest(nodeclonefalsenocopytext.class);
+// sink.addTest(nodeclonegetparentnull.class);
+// sink.addTest(nodeclonenodefalse.class);
+// sink.addTest(nodeclonenodetrue.class);
+// sink.addTest(nodeclonetruecopytext.class);
+ sink.addTest(nodecommentnodeattributes.class);
+ sink.addTest(nodecommentnodename.class);
+ sink.addTest(nodecommentnodetype.class);
+ sink.addTest(nodecommentnodevalue.class);
+ sink.addTest(nodedocumentfragmentnodename.class);
+ sink.addTest(nodedocumentfragmentnodetype.class);
+ sink.addTest(nodedocumentfragmentnodevalue.class);
+ sink.addTest(nodedocumentnodeattribute.class);
+ sink.addTest(nodedocumentnodename.class);
+ sink.addTest(nodedocumentnodetype.class);
+ sink.addTest(nodedocumentnodevalue.class);
+ sink.addTest(nodedocumenttypenodename.class);
+ sink.addTest(nodedocumenttypenodetype.class);
+ sink.addTest(nodedocumenttypenodevalue.class);
+ sink.addTest(nodeelementnodeattributes.class);
+ sink.addTest(nodeelementnodename.class);
+ sink.addTest(nodeelementnodetype.class);
+ sink.addTest(nodeelementnodevalue.class);
+// sink.addTest(nodeentitynodeattributes.class);
+// sink.addTest(nodeentitynodename.class);
+// sink.addTest(nodeentitynodetype.class);
+// sink.addTest(nodeentitynodevalue.class);
+// sink.addTest(nodeentitysetnodevalue.class);
+ sink.addTest(nodeentityreferencenodeattributes.class);
+ sink.addTest(nodeentityreferencenodename.class);
+ sink.addTest(nodeentityreferencenodetype.class);
+ sink.addTest(nodeentityreferencenodevalue.class);
+ sink.addTest(nodegetfirstchild.class);
+ sink.addTest(nodegetfirstchildnull.class);
+ sink.addTest(nodegetlastchild.class);
+ sink.addTest(nodegetlastchildnull.class);
+ sink.addTest(nodegetnextsibling.class);
+ sink.addTest(nodegetnextsiblingnull.class);
+ sink.addTest(nodegetownerdocument.class);
+ sink.addTest(nodegetownerdocumentnull.class);
+ sink.addTest(nodegetprevioussibling.class);
+ sink.addTest(nodegetprevioussiblingnull.class);
+ sink.addTest(nodehaschildnodes.class);
+ sink.addTest(nodehaschildnodesfalse.class);
+// sink.addTest(nodeinsertbefore.class);
+// sink.addTest(nodeinsertbeforedocfragment.class);
+// sink.addTest(nodeinsertbeforeinvalidnodetype.class);
+ sink.addTest(nodeinsertbeforenewchilddiffdocument.class);
+ sink.addTest(nodeinsertbeforenewchildexists.class);
+ sink.addTest(nodeinsertbeforenodeancestor.class);
+ sink.addTest(nodeinsertbeforenodename.class);
+// sink.addTest(nodeinsertbeforenomodificationallowederr.class);
+// sink.addTest(nodeinsertbeforenomodificationallowederrEE.class);
+// sink.addTest(nodeinsertbeforerefchildnonexistent.class);
+// sink.addTest(nodeinsertbeforerefchildnull.class);
+ sink.addTest(nodelistindexequalzero.class);
+ sink.addTest(nodelistindexgetlength.class);
+ sink.addTest(nodelistindexgetlengthofemptylist.class);
+ sink.addTest(nodelistindexnotzero.class);
+ sink.addTest(nodelistreturnfirstitem.class);
+ sink.addTest(nodelistreturnlastitem.class);
+ sink.addTest(nodelisttraverselist.class);
+// sink.addTest(nodenotationnodeattributes.class);
+// sink.addTest(nodenotationnodename.class);
+// sink.addTest(nodenotationnodetype.class);
+// sink.addTest(nodenotationnodevalue.class);
+ sink.addTest(nodeparentnode.class);
+ sink.addTest(nodeparentnodenull.class);
+ sink.addTest(nodeprocessinginstructionnodeattributes.class);
+ sink.addTest(nodeprocessinginstructionnodename.class);
+ sink.addTest(nodeprocessinginstructionnodetype.class);
+ sink.addTest(nodeprocessinginstructionnodevalue.class);
+// sink.addTest(nodeprocessinginstructionsetnodevalue.class);
+ sink.addTest(noderemovechild.class);
+ sink.addTest(noderemovechildgetnodename.class);
+// sink.addTest(noderemovechildnode.class);
+// sink.addTest(noderemovechildnomodificationallowederr.class);
+// sink.addTest(noderemovechildnomodificationallowederrEE.class);
+// sink.addTest(noderemovechildoldchildnonexistent.class);
+// sink.addTest(nodereplacechild.class);
+// sink.addTest(nodereplacechildinvalidnodetype.class);
+ sink.addTest(nodereplacechildnewchilddiffdocument.class);
+// sink.addTest(nodereplacechildnewchildexists.class);
+ sink.addTest(nodereplacechildnodeancestor.class);
+ sink.addTest(nodereplacechildnodename.class);
+// sink.addTest(nodereplacechildnomodificationallowederr.class);
+// sink.addTest(nodereplacechildnomodificationallowederrEE.class);
+// sink.addTest(nodereplacechildoldchildnonexistent.class);
+// sink.addTest(nodesetnodevaluenomodificationallowederr.class);
+// sink.addTest(nodesetnodevaluenomodificationallowederrEE.class);
+ sink.addTest(nodetextnodeattribute.class);
+ sink.addTest(nodetextnodename.class);
+ sink.addTest(nodetextnodetype.class);
+ sink.addTest(nodetextnodevalue.class);
+// sink.addTest(notationgetnotationname.class);
+// sink.addTest(notationgetpublicid.class);
+// sink.addTest(notationgetpublicidnull.class);
+// sink.addTest(notationgetsystemid.class);
+// sink.addTest(notationgetsystemidnull.class);
+ sink.addTest(processinginstructiongetdata.class);
+ sink.addTest(processinginstructiongettarget.class);
+// sink.addTest(processinginstructionsetdatanomodificationallowederr.class);
+// sink.addTest(processinginstructionsetdatanomodificationallowederrEE.class);
+// sink.addTest(textindexsizeerrnegativeoffset.class);
+// sink.addTest(textindexsizeerroffsetoutofbounds.class);
+// sink.addTest(textparseintolistofelements.class);
+ sink.addTest(textsplittextfour.class);
+// sink.addTest(textsplittextnomodificationallowederr.class);
+// sink.addTest(textsplittextnomodificationallowederrEE.class);
+ sink.addTest(textsplittextone.class);
+ sink.addTest(textsplittextthree.class);
+// sink.addTest(textsplittexttwo.class);
+ sink.addTest(textwithnomarkup.class);
+ sink.addTest(nodevalue01.class);
+// sink.addTest(nodevalue02.class);
+ sink.addTest(nodevalue03.class);
+ sink.addTest(nodevalue04.class);
+ sink.addTest(nodevalue05.class);
+ sink.addTest(nodevalue06.class);
+// sink.addTest(nodevalue07.class);
+// sink.addTest(nodevalue08.class);
+// sink.addTest(nodevalue09.class);
+ sink.addTest(hc_attrcreatedocumentfragment.class);
+ sink.addTest(hc_attrcreatetextnode.class);
+ sink.addTest(hc_attrcreatetextnode2.class);
+ sink.addTest(hc_attreffectivevalue.class);
+ sink.addTest(hc_attrname.class);
+ sink.addTest(hc_attrnextsiblingnull.class);
+ sink.addTest(hc_attrparentnodenull.class);
+ sink.addTest(hc_attrprevioussiblingnull.class);
+ sink.addTest(hc_attrspecifiedvalue.class);
+ sink.addTest(hc_attrspecifiedvaluechanged.class);
+ sink.addTest(hc_characterdataappenddata.class);
+ sink.addTest(hc_characterdataappenddatagetdata.class);
+ sink.addTest(hc_characterdatadeletedatabegining.class);
+ sink.addTest(hc_characterdatadeletedataend.class);
+ sink.addTest(hc_characterdatadeletedataexceedslength.class);
+ sink.addTest(hc_characterdatadeletedatagetlengthanddata.class);
+ sink.addTest(hc_characterdatadeletedatamiddle.class);
+ sink.addTest(hc_characterdatagetdata.class);
+ sink.addTest(hc_characterdatagetlength.class);
+// sink.addTest(hc_characterdataindexsizeerrdeletedatacountnegative.class);
+// sink.addTest(hc_characterdataindexsizeerrdeletedataoffsetgreater.class);
+// sink.addTest(hc_characterdataindexsizeerrdeletedataoffsetnegative.class);
+// sink.addTest(hc_characterdataindexsizeerrinsertdataoffsetgreater.class);
+// sink.addTest(hc_characterdataindexsizeerrinsertdataoffsetnegative.class);
+// sink.addTest(hc_characterdataindexsizeerrreplacedatacountnegative.class);
+// sink.addTest(hc_characterdataindexsizeerrreplacedataoffsetgreater.class);
+// sink.addTest(hc_characterdataindexsizeerrreplacedataoffsetnegative.class);
+// sink.addTest(hc_characterdataindexsizeerrsubstringcountnegative.class);
+// sink.addTest(hc_characterdataindexsizeerrsubstringnegativeoffset.class);
+// sink.addTest(hc_characterdataindexsizeerrsubstringoffsetgreater.class);
+ sink.addTest(hc_characterdatainsertdatabeginning.class);
+ sink.addTest(hc_characterdatainsertdataend.class);
+ sink.addTest(hc_characterdatainsertdatamiddle.class);
+ sink.addTest(hc_characterdatareplacedatabegining.class);
+ sink.addTest(hc_characterdatareplacedataend.class);
+ sink.addTest(hc_characterdatareplacedataexceedslengthofarg.class);
+ sink.addTest(hc_characterdatareplacedataexceedslengthofdata.class);
+ sink.addTest(hc_characterdatareplacedatamiddle.class);
+// sink.addTest(hc_characterdatasetnodevalue.class);
+// sink.addTest(hc_characterdatasubstringexceedsvalue.class);
+ sink.addTest(hc_characterdatasubstringvalue.class);
+ sink.addTest(hc_commentgetcomment.class);
+// sink.addTest(hc_documentcreateattribute.class);
+ sink.addTest(hc_documentcreatecomment.class);
+ sink.addTest(hc_documentcreatedocumentfragment.class);
+ sink.addTest(hc_documentcreateelement.class);
+ sink.addTest(hc_documentcreateelementcasesensitive.class);
+ sink.addTest(hc_documentcreatetextnode.class);
+ sink.addTest(hc_documentgetdoctype.class);
+ sink.addTest(hc_documentgetelementsbytagnamelength.class);
+ sink.addTest(hc_documentgetelementsbytagnametotallength.class);
+ sink.addTest(hc_documentgetelementsbytagnamevalue.class);
+ sink.addTest(hc_documentgetimplementation.class);
+ sink.addTest(hc_documentgetrootnode.class);
+ sink.addTest(hc_documentinvalidcharacterexceptioncreateattribute.class);
+ sink.addTest(hc_documentinvalidcharacterexceptioncreateattribute1.class);
+ sink.addTest(hc_documentinvalidcharacterexceptioncreateelement.class);
+ sink.addTest(hc_documentinvalidcharacterexceptioncreateelement1.class);
+ sink.addTest(hc_domimplementationfeaturenoversion.class);
+ sink.addTest(hc_domimplementationfeaturenull.class);
+ sink.addTest(hc_domimplementationfeaturexml.class);
+ sink.addTest(hc_elementaddnewattribute.class);
+ sink.addTest(hc_elementassociatedattribute.class);
+ sink.addTest(hc_elementchangeattributevalue.class);
+// sink.addTest(hc_elementcreatenewattribute.class);
+ sink.addTest(hc_elementgetattributenode.class);
+ sink.addTest(hc_elementgetattributenodenull.class);
+// sink.addTest(hc_elementgetelementempty.class);
+ sink.addTest(hc_elementgetelementsbytagname.class);
+ sink.addTest(hc_elementgetelementsbytagnameaccessnodelist.class);
+ sink.addTest(hc_elementgetelementsbytagnamenomatch.class);
+// sink.addTest(hc_elementgetelementsbytagnamespecialvalue.class);
+ sink.addTest(hc_elementgettagname.class);
+ sink.addTest(hc_elementinuseattributeerr.class);
+ sink.addTest(hc_elementinvalidcharacterexception.class);
+ sink.addTest(hc_elementinvalidcharacterexception1.class);
+ sink.addTest(hc_elementnormalize.class);
+// sink.addTest(hc_elementnormalize2.class);
+ sink.addTest(hc_elementnotfounderr.class);
+ sink.addTest(hc_elementremoveattribute.class);
+ sink.addTest(hc_elementremoveattributeaftercreate.class);
+ sink.addTest(hc_elementremoveattributenode.class);
+// sink.addTest(hc_elementreplaceattributewithself.class);
+// sink.addTest(hc_elementreplaceexistingattribute.class);
+ sink.addTest(hc_elementreplaceexistingattributegevalue.class);
+// sink.addTest(hc_elementretrieveallattributes.class);
+ sink.addTest(hc_elementretrieveattrvalue.class);
+ sink.addTest(hc_elementretrievetagname.class);
+ sink.addTest(hc_elementsetattributenodenull.class);
+ sink.addTest(hc_elementwrongdocumenterr.class);
+// sink.addTest(hc_entitiesremovenameditem1.class);
+// sink.addTest(hc_entitiessetnameditem1.class);
+// sink.addTest(hc_namednodemapchildnoderange.class);
+ sink.addTest(hc_namednodemapgetnameditem.class);
+ sink.addTest(hc_namednodemapinuseattributeerr.class);
+ sink.addTest(hc_namednodemapnotfounderr.class);
+// sink.addTest(hc_namednodemapnumberofnodes.class);
+ sink.addTest(hc_namednodemapremovenameditem.class);
+ sink.addTest(hc_namednodemapreturnattrnode.class);
+// sink.addTest(hc_namednodemapreturnfirstitem.class);
+// sink.addTest(hc_namednodemapreturnlastitem.class);
+ sink.addTest(hc_namednodemapreturnnull.class);
+ sink.addTest(hc_namednodemapsetnameditem.class);
+ sink.addTest(hc_namednodemapsetnameditemreturnvalue.class);
+// sink.addTest(hc_namednodemapsetnameditemthatexists.class);
+ sink.addTest(hc_namednodemapsetnameditemwithnewvalue.class);
+ sink.addTest(hc_namednodemapwrongdocumenterr.class);
+ sink.addTest(hc_nodeappendchild.class);
+// sink.addTest(hc_nodeappendchildchildexists.class);
+// sink.addTest(hc_nodeappendchilddocfragment.class);
+ sink.addTest(hc_nodeappendchildgetnodename.class);
+// sink.addTest(hc_nodeappendchildinvalidnodetype.class);
+ sink.addTest(hc_nodeappendchildnewchilddiffdocument.class);
+ sink.addTest(hc_nodeappendchildnodeancestor.class);
+ sink.addTest(hc_nodeattributenodeattribute.class);
+ sink.addTest(hc_nodeattributenodename.class);
+ sink.addTest(hc_nodeattributenodetype.class);
+ sink.addTest(hc_nodeattributenodevalue.class);
+ sink.addTest(hc_nodechildnodes.class);
+// sink.addTest(hc_nodechildnodesappendchild.class);
+ sink.addTest(hc_nodechildnodesempty.class);
+// sink.addTest(hc_nodecloneattributescopied.class);
+// sink.addTest(hc_nodeclonefalsenocopytext.class);
+// sink.addTest(hc_nodeclonegetparentnull.class);
+// sink.addTest(hc_nodeclonenodefalse.class);
+// sink.addTest(hc_nodeclonenodetrue.class);
+// sink.addTest(hc_nodeclonetruecopytext.class);
+ sink.addTest(hc_nodecommentnodeattributes.class);
+ sink.addTest(hc_nodecommentnodename.class);
+ sink.addTest(hc_nodecommentnodetype.class);
+ sink.addTest(hc_nodecommentnodevalue.class);
+ sink.addTest(hc_nodedocumentfragmentnodename.class);
+ sink.addTest(hc_nodedocumentfragmentnodetype.class);
+ sink.addTest(hc_nodedocumentfragmentnodevalue.class);
+ sink.addTest(hc_nodedocumentnodeattribute.class);
+ sink.addTest(hc_nodedocumentnodename.class);
+ sink.addTest(hc_nodedocumentnodetype.class);
+ sink.addTest(hc_nodedocumentnodevalue.class);
+// sink.addTest(hc_nodeelementnodeattributes.class);
+ sink.addTest(hc_nodeelementnodename.class);
+ sink.addTest(hc_nodeelementnodetype.class);
+ sink.addTest(hc_nodeelementnodevalue.class);
+ sink.addTest(hc_nodegetfirstchild.class);
+ sink.addTest(hc_nodegetfirstchildnull.class);
+ sink.addTest(hc_nodegetlastchild.class);
+ sink.addTest(hc_nodegetlastchildnull.class);
+ sink.addTest(hc_nodegetnextsibling.class);
+ sink.addTest(hc_nodegetnextsiblingnull.class);
+ sink.addTest(hc_nodegetownerdocument.class);
+ sink.addTest(hc_nodegetownerdocumentnull.class);
+ sink.addTest(hc_nodegetprevioussibling.class);
+ sink.addTest(hc_nodegetprevioussiblingnull.class);
+ sink.addTest(hc_nodehaschildnodes.class);
+ sink.addTest(hc_nodehaschildnodesfalse.class);
+// sink.addTest(hc_nodeinsertbefore.class);
+// sink.addTest(hc_nodeinsertbeforedocfragment.class);
+// sink.addTest(hc_nodeinsertbeforeinvalidnodetype.class);
+ sink.addTest(hc_nodeinsertbeforenewchilddiffdocument.class);
+// sink.addTest(hc_nodeinsertbeforenewchildexists.class);
+ sink.addTest(hc_nodeinsertbeforenodeancestor.class);
+ sink.addTest(hc_nodeinsertbeforenodename.class);
+// sink.addTest(hc_nodeinsertbeforerefchildnonexistent.class);
+// sink.addTest(hc_nodeinsertbeforerefchildnull.class);
+ sink.addTest(hc_nodelistindexequalzero.class);
+ sink.addTest(hc_nodelistindexgetlength.class);
+ sink.addTest(hc_nodelistindexgetlengthofemptylist.class);
+ sink.addTest(hc_nodelistindexnotzero.class);
+ sink.addTest(hc_nodelistreturnfirstitem.class);
+ sink.addTest(hc_nodelistreturnlastitem.class);
+ sink.addTest(hc_nodelisttraverselist.class);
+ sink.addTest(hc_nodeparentnode.class);
+ sink.addTest(hc_nodeparentnodenull.class);
+ sink.addTest(hc_noderemovechild.class);
+ sink.addTest(hc_noderemovechildgetnodename.class);
+// sink.addTest(hc_noderemovechildnode.class);
+// sink.addTest(hc_noderemovechildoldchildnonexistent.class);
+// sink.addTest(hc_nodereplacechild.class);
+// sink.addTest(hc_nodereplacechildinvalidnodetype.class);
+ sink.addTest(hc_nodereplacechildnewchilddiffdocument.class);
+// sink.addTest(hc_nodereplacechildnewchildexists.class);
+ sink.addTest(hc_nodereplacechildnodeancestor.class);
+ sink.addTest(hc_nodereplacechildnodename.class);
+// sink.addTest(hc_nodereplacechildoldchildnonexistent.class);
+ sink.addTest(hc_nodetextnodeattribute.class);
+ sink.addTest(hc_nodetextnodename.class);
+ sink.addTest(hc_nodetextnodetype.class);
+ sink.addTest(hc_nodetextnodevalue.class);
+ sink.addTest(hc_nodevalue01.class);
+// sink.addTest(hc_nodevalue02.class);
+ sink.addTest(hc_nodevalue03.class);
+ sink.addTest(hc_nodevalue04.class);
+ sink.addTest(hc_nodevalue05.class);
+ sink.addTest(hc_nodevalue06.class);
+// sink.addTest(hc_nodevalue07.class);
+// sink.addTest(hc_nodevalue08.class);
+// sink.addTest(hc_notationsremovenameditem1.class);
+// sink.addTest(hc_notationssetnameditem1.class);
+// sink.addTest(hc_textindexsizeerrnegativeoffset.class);
+// sink.addTest(hc_textindexsizeerroffsetoutofbounds.class);
+// sink.addTest(hc_textparseintolistofelements.class);
+ sink.addTest(hc_textsplittextfour.class);
+ sink.addTest(hc_textsplittextone.class);
+ sink.addTest(hc_textsplittextthree.class);
+// sink.addTest(hc_textsplittexttwo.class);
+ sink.addTest(hc_textwithnomarkup.class);
+// sink.addTest(hc_attrappendchild1.class);
+ sink.addTest(hc_attrappendchild2.class);
+// sink.addTest(hc_attrappendchild3.class);
+ sink.addTest(hc_attrappendchild4.class);
+// sink.addTest(hc_attrappendchild5.class);
+// sink.addTest(hc_attrappendchild6.class);
+// sink.addTest(hc_attrchildnodes1.class);
+// sink.addTest(hc_attrchildnodes2.class);
+// sink.addTest(hc_attrclonenode1.class);
+// sink.addTest(hc_attrfirstchild.class);
+// sink.addTest(hc_attrgetvalue1.class);
+// sink.addTest(hc_attrgetvalue2.class);
+// sink.addTest(hc_attrhaschildnodes.class);
+// sink.addTest(hc_attrinsertbefore1.class);
+// sink.addTest(hc_attrinsertbefore2.class);
+// sink.addTest(hc_attrinsertbefore3.class);
+// sink.addTest(hc_attrinsertbefore4.class);
+ sink.addTest(hc_attrinsertbefore5.class);
+// sink.addTest(hc_attrinsertbefore6.class);
+ sink.addTest(hc_attrinsertbefore7.class);
+// sink.addTest(hc_attrlastchild.class);
+// sink.addTest(hc_attrnormalize.class);
+// sink.addTest(hc_attrremovechild1.class);
+// sink.addTest(hc_attrremovechild2.class);
+// sink.addTest(hc_attrreplacechild1.class);
+// sink.addTest(hc_attrreplacechild2.class);
+// sink.addTest(hc_attrsetvalue1.class);
+// sink.addTest(hc_attrsetvalue2.class);
+// sink.addTest(attrremovechild1.class);
+// sink.addTest(attrreplacechild1.class);
+
+ }
+ /**
+ * Gets URI that identifies the test suite
+ * @return uri identifier of test suite
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/alltests";
+ }
+
+ /**
+ * Runs individual test
+ * @param args command line arguments
+ */
+ public static void main(String[] args) {
+ DOMTestCase.doMain(alltests.class, args);
+ }
+
+}
diff --git a/dom/src/test/java/org/w3c/domts/level1/core/attrcreatedocumentfragment.java b/dom/src/test/java/org/w3c/domts/level1/core/attrcreatedocumentfragment.java
new file mode 100644
index 0000000..e1c6b1e
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level1/core/attrcreatedocumentfragment.java
@@ -0,0 +1,97 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+Copyright (c) 2001 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+*/
+
+package org.w3c.domts.level1.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * Attr nodes may be associated with Element nodes contained within a DocumentFragment.
+ * Create a new DocumentFragment and add a newly created Element node(with one attribute).
+ * Once the element is added, its attribute should be available as an attribute associated
+ * with an Element within a DocumentFragment.
+* @author NIST
+* @author Mary Brady
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-35CB04B5">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-35CB04B5</a>
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-F68F082">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-F68F082</a>
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-B63ED1A3">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-B63ED1A3</a>
+*/
+public final class attrcreatedocumentfragment extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public attrcreatedocumentfragment(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "staff", true);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ DocumentFragment docFragment;
+ Element newOne;
+ Node domesticNode;
+ NamedNodeMap domesticAttr;
+ Attr attrs;
+ String attrName;
+ Node appendedChild;
+ doc = (Document) load("staff", true);
+ docFragment = doc.createDocumentFragment();
+ newOne = doc.createElement("newElement");
+ newOne.setAttribute("newdomestic", "Yes");
+ appendedChild = docFragment.appendChild(newOne);
+ domesticNode = docFragment.getFirstChild();
+ domesticAttr = domesticNode.getAttributes();
+ attrs = (Attr) domesticAttr.item(0);
+ attrName = attrs.getName();
+ assertEquals("attrCreateDocumentFragmentAssert", "newdomestic", attrName);
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/attrcreatedocumentfragment";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(attrcreatedocumentfragment.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level1/core/attrcreatetextnode.java b/dom/src/test/java/org/w3c/domts/level1/core/attrcreatetextnode.java
new file mode 100644
index 0000000..1ff80ff
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level1/core/attrcreatetextnode.java
@@ -0,0 +1,98 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+Copyright (c) 2001 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+*/
+
+package org.w3c.domts.level1.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The "setValue()" method for an attribute creates a
+ * Text node with the unparsed content of the string.
+ * Retrieve the attribute named "street" from the last
+ * child of of the fourth employee and assign the "Y&ent1;"
+ * string to its value attribute. This value is not yet
+ * parsed and therefore should still be the same upon
+ * retrieval. This test uses the "getNamedItem(name)" method
+ * from the NamedNodeMap interface.
+* @author NIST
+* @author Mary Brady
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-221662474">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-221662474</a>
+* @see <a href="http://lists.w3.org/Archives/Public/www-dom-ts/2002Apr/0057.html">http://lists.w3.org/Archives/Public/www-dom-ts/2002Apr/0057.html</a>
+*/
+public final class attrcreatetextnode extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public attrcreatetextnode(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "staff", true);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ NodeList addressList;
+ Node testNode;
+ NamedNodeMap attributes;
+ Attr streetAttr;
+ String value;
+ doc = (Document) load("staff", true);
+ addressList = doc.getElementsByTagName("address");
+ testNode = addressList.item(3);
+ attributes = testNode.getAttributes();
+ streetAttr = (Attr) attributes.getNamedItem("street");
+ streetAttr.setValue("Y&ent1;");
+ value = streetAttr.getValue();
+ assertEquals("value", "Y&ent1;", value);
+ value = streetAttr.getNodeValue();
+ assertEquals("nodeValue", "Y&ent1;", value);
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/attrcreatetextnode";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(attrcreatetextnode.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level1/core/attrcreatetextnode2.java b/dom/src/test/java/org/w3c/domts/level1/core/attrcreatetextnode2.java
new file mode 100644
index 0000000..2733c43
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level1/core/attrcreatetextnode2.java
@@ -0,0 +1,97 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+Copyright (c) 2001 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+*/
+
+package org.w3c.domts.level1.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The "setNodeValue()" method for an attribute creates a
+ * Text node with the unparsed content of the string.
+ * Retrieve the attribute named "street" from the last
+ * child of of the fourth employee and assign the "Y&ent1;"
+ * string to its value attribute. This value is not yet
+ * parsed and therefore should still be the same upon
+ * retrieval. This test uses the "getNamedItem(name)" method
+ * from the NamedNodeMap interface.
+* @author Curt Arnold
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-F68D080">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-F68D080</a>
+* @see <a href="http://lists.w3.org/Archives/Public/www-dom-ts/2002Apr/0057.html">http://lists.w3.org/Archives/Public/www-dom-ts/2002Apr/0057.html</a>
+*/
+public final class attrcreatetextnode2 extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public attrcreatetextnode2(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "staff", true);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ NodeList addressList;
+ Node testNode;
+ NamedNodeMap attributes;
+ Attr streetAttr;
+ String value;
+ doc = (Document) load("staff", true);
+ addressList = doc.getElementsByTagName("address");
+ testNode = addressList.item(3);
+ attributes = testNode.getAttributes();
+ streetAttr = (Attr) attributes.getNamedItem("street");
+ streetAttr.setNodeValue("Y&ent1;");
+ value = streetAttr.getValue();
+ assertEquals("value", "Y&ent1;", value);
+ value = streetAttr.getNodeValue();
+ assertEquals("nodeValue", "Y&ent1;", value);
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/attrcreatetextnode2";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(attrcreatetextnode2.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level1/core/attrdefaultvalue.java b/dom/src/test/java/org/w3c/domts/level1/core/attrdefaultvalue.java
new file mode 100644
index 0000000..151c584
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level1/core/attrdefaultvalue.java
@@ -0,0 +1,104 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+Copyright (c) 2001 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+*/
+
+package org.w3c.domts.level1.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * If there is not an explicit value assigned to an attribute
+ * and there is a declaration for this attribute and that
+ * declaration includes a default value, then that default
+ * value is the attributes default value.
+ * Retrieve the attribute named "street" from the last
+ * child of of the first employee and examine its
+ * value. That value should be the value given the
+ * attribute in the DTD file. The test uses the
+ * "getNamedItem(name)" method from the NamedNodeMap
+ * interface.
+* @author NIST
+* @author Mary Brady
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-84CF096">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-84CF096</a>
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-1074577549">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-1074577549</a>
+* @see <a href="http://lists.w3.org/Archives/Public/www-dom-ts/2002Mar/0002.html">http://lists.w3.org/Archives/Public/www-dom-ts/2002Mar/0002.html</a>
+*/
+public final class attrdefaultvalue extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public attrdefaultvalue(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+
+ org.w3c.domts.DocumentBuilderSetting[] settings =
+ new org.w3c.domts.DocumentBuilderSetting[] {
+org.w3c.domts.DocumentBuilderSetting.validating
+ };
+ DOMTestDocumentBuilderFactory testFactory = factory.newInstance(settings);
+ setFactory(testFactory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "staff", false);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ NodeList addressList;
+ Node testNode;
+ NamedNodeMap attributes;
+ Attr streetAttr;
+ String value;
+ doc = (Document) load("staff", false);
+ addressList = doc.getElementsByTagName("address");
+ testNode = addressList.item(0);
+ attributes = testNode.getAttributes();
+ streetAttr = (Attr) attributes.getNamedItem("street");
+ value = streetAttr.getNodeValue();
+ assertEquals("attrDefaultValueAssert", "Yes", value);
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/attrdefaultvalue";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(attrdefaultvalue.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level1/core/attreffectivevalue.java b/dom/src/test/java/org/w3c/domts/level1/core/attreffectivevalue.java
new file mode 100644
index 0000000..0efe4f0
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level1/core/attreffectivevalue.java
@@ -0,0 +1,91 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+Copyright (c) 2001 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+*/
+
+package org.w3c.domts.level1.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * If an Attr is explicitly assigned any value, then that value is the attributes effective value.
+ * Retrieve the attribute named "domestic" from the last child of of the first employee
+ * and examine its nodeValue attribute. This test uses the "getNamedItem(name)" method
+ * from the NamedNodeMap interface.
+* @author NIST
+* @author Mary Brady
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-84CF096">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-84CF096</a>
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-1074577549">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-1074577549</a>
+*/
+public final class attreffectivevalue extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public attreffectivevalue(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "staff", false);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ NodeList addressList;
+ Node testNode;
+ NamedNodeMap attributes;
+ Attr domesticAttr;
+ String value;
+ doc = (Document) load("staff", false);
+ addressList = doc.getElementsByTagName("address");
+ testNode = addressList.item(0);
+ attributes = testNode.getAttributes();
+ domesticAttr = (Attr) attributes.getNamedItem("domestic");
+ value = domesticAttr.getNodeValue();
+ assertEquals("attrEffectiveValueAssert", "Yes", value);
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/attreffectivevalue";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(attreffectivevalue.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level1/core/attrentityreplacement.java b/dom/src/test/java/org/w3c/domts/level1/core/attrentityreplacement.java
new file mode 100644
index 0000000..b258811
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level1/core/attrentityreplacement.java
@@ -0,0 +1,96 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+Copyright (c) 2001-2004 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+*/
+
+package org.w3c.domts.level1.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The "getValue()" method will return the value of the
+ * attribute as a string. The general entity references
+ * are replaced with their values.
+ * Retrieve the attribute named "street" from the last
+ * child of of the fourth employee and examine the string
+ * returned by the "getValue()" method. The value should
+ * be set to "Yes" after the EntityReference is
+ * replaced with its value. This test uses the
+ * "getNamedItem(name)" method from the NamedNodeMap
+ * interface.
+* @author NIST
+* @author Mary Brady
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-221662474">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-221662474</a>
+*/
+public final class attrentityreplacement extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public attrentityreplacement(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "staff", true);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ NodeList addressList;
+ Node testNode;
+ NamedNodeMap attributes;
+ Attr streetAttr;
+ String value;
+ doc = (Document) load("staff", true);
+ addressList = doc.getElementsByTagName("address");
+ testNode = addressList.item(3);
+ attributes = testNode.getAttributes();
+ streetAttr = (Attr) attributes.getNamedItem("street");
+ value = streetAttr.getValue();
+ assertEquals("streetYes", "Yes", value);
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/attrentityreplacement";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(attrentityreplacement.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level1/core/attrname.java b/dom/src/test/java/org/w3c/domts/level1/core/attrname.java
new file mode 100644
index 0000000..06a78cc
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level1/core/attrname.java
@@ -0,0 +1,94 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+Copyright (c) 2001 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+*/
+
+package org.w3c.domts.level1.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The getNodeName() method of an Attribute node.
+ * Retrieve the attribute named street from the last
+ * child of of the second employee and examine its
+ * NodeName. This test uses the getNamedItem(name) method from the NamedNodeMap
+ * interface.
+* @author NIST
+* @author Mary Brady
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-F68D095">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-F68D095</a>
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-1112119403">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-1112119403</a>
+*/
+public final class attrname extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public attrname(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "staff", false);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ NodeList addressList;
+ Node testNode;
+ NamedNodeMap attributes;
+ Attr streetAttr;
+ String name;
+ doc = (Document) load("staff", false);
+ addressList = doc.getElementsByTagName("address");
+ testNode = addressList.item(1);
+ attributes = testNode.getAttributes();
+ streetAttr = (Attr) attributes.getNamedItem("street");
+ name = streetAttr.getNodeName();
+ assertEquals("nodeName", "street", name);
+ name = streetAttr.getName();
+ assertEquals("name", "street", name);
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/attrname";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(attrname.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level1/core/attrnextsiblingnull.java b/dom/src/test/java/org/w3c/domts/level1/core/attrnextsiblingnull.java
new file mode 100644
index 0000000..853a912
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level1/core/attrnextsiblingnull.java
@@ -0,0 +1,91 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+Copyright (c) 2001 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+*/
+
+package org.w3c.domts.level1.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The "getNextSibling()" method for an Attr node should return null.
+ * Retrieve the attribute named "domestic" from the last child of of the
+ * first employee and examine its NextSibling node. This test uses the
+ * "getNamedItem(name)" method from the NamedNodeMap interface.
+* @author NIST
+* @author Mary Brady
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-6AC54C2F">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-6AC54C2F</a>
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-637646024">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-637646024</a>
+*/
+public final class attrnextsiblingnull extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public attrnextsiblingnull(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "staff", false);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ NodeList addressList;
+ Node testNode;
+ NamedNodeMap attributes;
+ Attr domesticAttr;
+ Node s;
+ doc = (Document) load("staff", false);
+ addressList = doc.getElementsByTagName("address");
+ testNode = addressList.item(0);
+ attributes = testNode.getAttributes();
+ domesticAttr = (Attr) attributes.getNamedItem("domestic");
+ s = domesticAttr.getNextSibling();
+ assertNull("attrNextSiblingNullAssert", s);
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/attrnextsiblingnull";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(attrnextsiblingnull.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level1/core/attrnotspecifiedvalue.java b/dom/src/test/java/org/w3c/domts/level1/core/attrnotspecifiedvalue.java
new file mode 100644
index 0000000..5adff50
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level1/core/attrnotspecifiedvalue.java
@@ -0,0 +1,101 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+Copyright (c) 2001-2004 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+*/
+
+package org.w3c.domts.level1.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The "getSpecified()" method for an Attr node should
+ * be set to false if the attribute was not explicitly given
+ * a value.
+ * Retrieve the attribute named "street" from the last
+ * child of of the first employee and examine the value
+ * returned by the "getSpecified()" method. This test uses
+ * the "getNamedItem(name)" method from the NamedNodeMap
+ * interface.
+* @author NIST
+* @author Mary Brady
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-862529273">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-862529273</a>
+* @see <a href="http://lists.w3.org/Archives/Public/www-dom-ts/2002Mar/0002.html">http://lists.w3.org/Archives/Public/www-dom-ts/2002Mar/0002.html</a>
+*/
+public final class attrnotspecifiedvalue extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public attrnotspecifiedvalue(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+
+ org.w3c.domts.DocumentBuilderSetting[] settings =
+ new org.w3c.domts.DocumentBuilderSetting[] {
+org.w3c.domts.DocumentBuilderSetting.validating
+ };
+ DOMTestDocumentBuilderFactory testFactory = factory.newInstance(settings);
+ setFactory(testFactory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "staff", false);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ NodeList addressList;
+ Node testNode;
+ NamedNodeMap attributes;
+ Attr streetAttr;
+ boolean state;
+ doc = (Document) load("staff", false);
+ addressList = doc.getElementsByTagName("address");
+ testNode = addressList.item(0);
+ attributes = testNode.getAttributes();
+ streetAttr = (Attr) attributes.getNamedItem("street");
+ state = streetAttr.getSpecified();
+ assertFalse("streetNotSpecified", state);
+}
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/attrnotspecifiedvalue";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(attrnotspecifiedvalue.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level1/core/attrparentnodenull.java b/dom/src/test/java/org/w3c/domts/level1/core/attrparentnodenull.java
new file mode 100644
index 0000000..8757a72
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level1/core/attrparentnodenull.java
@@ -0,0 +1,91 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+Copyright (c) 2001 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+*/
+
+package org.w3c.domts.level1.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The "getParentNode()" method for an Attr node should return null. Retrieve
+ * the attribute named "domestic" from the last child of the first employee
+ * and examine its parentNode attribute. This test also uses the "getNamedItem(name)"
+ * method from the NamedNodeMap interface.
+* @author NIST
+* @author Mary Brady
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-1060184317">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-1060184317</a>
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-637646024">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-637646024</a>
+*/
+public final class attrparentnodenull extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public attrparentnodenull(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "staff", false);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ NodeList addressList;
+ Node testNode;
+ NamedNodeMap attributes;
+ Attr domesticAttr;
+ Node s;
+ doc = (Document) load("staff", false);
+ addressList = doc.getElementsByTagName("address");
+ testNode = addressList.item(0);
+ attributes = testNode.getAttributes();
+ domesticAttr = (Attr) attributes.getNamedItem("domestic");
+ s = domesticAttr.getParentNode();
+ assertNull("attrParentNodeNullAssert", s);
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/attrparentnodenull";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(attrparentnodenull.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level1/core/attrprevioussiblingnull.java b/dom/src/test/java/org/w3c/domts/level1/core/attrprevioussiblingnull.java
new file mode 100644
index 0000000..bdce569
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level1/core/attrprevioussiblingnull.java
@@ -0,0 +1,91 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+Copyright (c) 2001 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+*/
+
+package org.w3c.domts.level1.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The "getPreviousSibling()" method for an Attr node should return null.
+ * Retrieve the attribute named "domestic" from the last child of of the
+ * first employee and examine its PreviousSibling node. This test uses the
+ * "getNamedItem(name)" method from the NamedNodeMap interface.
+* @author NIST
+* @author Mary Brady
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-640FB3C8">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-640FB3C8</a>
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-637646024">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-637646024</a>
+*/
+public final class attrprevioussiblingnull extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public attrprevioussiblingnull(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "staff", false);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ NodeList addressList;
+ Node testNode;
+ NamedNodeMap attributes;
+ Attr domesticAttr;
+ Node s;
+ doc = (Document) load("staff", false);
+ addressList = doc.getElementsByTagName("address");
+ testNode = addressList.item(0);
+ attributes = testNode.getAttributes();
+ domesticAttr = (Attr) attributes.getNamedItem("domestic");
+ s = domesticAttr.getPreviousSibling();
+ assertNull("attrPreviousSiblingNullAssert", s);
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/attrprevioussiblingnull";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(attrprevioussiblingnull.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level1/core/attrremovechild1.java b/dom/src/test/java/org/w3c/domts/level1/core/attrremovechild1.java
new file mode 100644
index 0000000..8de15cb
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level1/core/attrremovechild1.java
@@ -0,0 +1,99 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+Copyright (c) 2001-2004 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+*/
+
+package org.w3c.domts.level1.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * Removing a child node from an attribute in an entity reference
+ * should result in an NO_MODIFICATION_ALLOWED_ERR DOMException.
+* @author Curt Arnold
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-1734834066">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-1734834066</a>
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-1734834066')/raises/exception[@name='DOMException']/descr/p[substring-before(.,':')='NO_MODIFICATION_ALLOWED_ERR'])">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-1734834066')/raises/exception[@name='DOMException']/descr/p[substring-before(.,':')='NO_MODIFICATION_ALLOWED_ERR'])</a>
+*/
+public final class attrremovechild1 extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public attrremovechild1(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "staff", true);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ EntityReference entRef;
+ Element entElement;
+ Node attrNode;
+ Text textNode;
+ Node removedNode;
+ doc = (Document) load("staff", true);
+ entRef = doc.createEntityReference("ent4");
+ assertNotNull("createdEntRefNotNull", entRef);
+ entElement = (Element) entRef.getFirstChild();
+ assertNotNull("entElementNotNull", entElement);
+ attrNode = entElement.getAttributeNode("domestic");
+ textNode = (Text) attrNode.getFirstChild();
+ assertNotNull("attrChildNotNull", textNode);
+
+ {
+ boolean success = false;
+ try {
+ removedNode = attrNode.removeChild(textNode);
+ } catch (DOMException ex) {
+ success = (ex.code == DOMException.NO_MODIFICATION_ALLOWED_ERR);
+ }
+ assertTrue("setValue_throws_NO_MODIFICATION_ERR", success);
+ }
+}
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/attrremovechild1";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(attrremovechild1.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level1/core/attrreplacechild1.java b/dom/src/test/java/org/w3c/domts/level1/core/attrreplacechild1.java
new file mode 100644
index 0000000..c84586c
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level1/core/attrreplacechild1.java
@@ -0,0 +1,101 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+Copyright (c) 2001-2004 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+*/
+
+package org.w3c.domts.level1.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * Replacing a child node from an attribute in an entity reference
+ * should result in an NO_MODIFICATION_ALLOWED_ERR DOMException.
+* @author Curt Arnold
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-785887307">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-785887307</a>
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-785887307')/raises/exception[@name='DOMException']/descr/p[substring-before(.,':')='NO_MODIFICATION_ALLOWED_ERR'])">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-785887307')/raises/exception[@name='DOMException']/descr/p[substring-before(.,':')='NO_MODIFICATION_ALLOWED_ERR'])</a>
+*/
+public final class attrreplacechild1 extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public attrreplacechild1(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "staff", true);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ EntityReference entRef;
+ Element entElement;
+ Node attrNode;
+ Text textNode;
+ Node removedNode;
+ Node newChild;
+ doc = (Document) load("staff", true);
+ entRef = doc.createEntityReference("ent4");
+ assertNotNull("createdEntRefNotNull", entRef);
+ entElement = (Element) entRef.getFirstChild();
+ assertNotNull("entElementNotNull", entElement);
+ attrNode = entElement.getAttributeNode("domestic");
+ textNode = (Text) attrNode.getFirstChild();
+ assertNotNull("attrChildNotNull", textNode);
+ newChild = doc.createTextNode("Yesterday");
+
+ {
+ boolean success = false;
+ try {
+ removedNode = attrNode.replaceChild(newChild, textNode);
+ } catch (DOMException ex) {
+ success = (ex.code == DOMException.NO_MODIFICATION_ALLOWED_ERR);
+ }
+ assertTrue("setValue_throws_NO_MODIFICATION_ERR", success);
+ }
+}
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/attrreplacechild1";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(attrreplacechild1.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level1/core/attrsetvaluenomodificationallowederr.java b/dom/src/test/java/org/w3c/domts/level1/core/attrsetvaluenomodificationallowederr.java
new file mode 100644
index 0000000..98c5e28
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level1/core/attrsetvaluenomodificationallowederr.java
@@ -0,0 +1,133 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+Copyright (c) 2001-2004 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+*/
+
+package org.w3c.domts.level1.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The "setValue()" method for an attribute causes the
+ * DOMException NO_MODIFICATION_ALLOWED_ERR to be raised
+ * if the node is readonly.
+ * Obtain the children of the THIRD "gender" element. The elements
+ * content is an entity reference. Get the "domestic" attribute
+ * from the entity reference and execute the "setValue()" method.
+ * This causes a NO_MODIFICATION_ALLOWED_ERR DOMException to be thrown.
+* @author NIST
+* @author Mary Brady
+* @see <a href="http://www.w3.org/TR/2000/WD-DOM-Level-1-20000929/level-one-core#xpointer(id('ID-258A00AF')/constant[@name='NO_MODIFICATION_ALLOWED_ERR'])">http://www.w3.org/TR/2000/WD-DOM-Level-1-20000929/level-one-core#xpointer(id('ID-258A00AF')/constant[@name='NO_MODIFICATION_ALLOWED_ERR'])</a>
+* @see <a href="http://www.w3.org/TR/2000/WD-DOM-Level-1-20000929/level-one-core#ID-221662474">http://www.w3.org/TR/2000/WD-DOM-Level-1-20000929/level-one-core#ID-221662474</a>
+* @see <a href="http://www.w3.org/TR/2000/WD-DOM-Level-1-20000929/level-one-core#xpointer(id('ID-221662474')/setraises/exception[@name='DOMException']/descr/p[substring-before(.,':')='NO_MODIFICATION_ALLOWED_ERR'])">http://www.w3.org/TR/2000/WD-DOM-Level-1-20000929/level-one-core#xpointer(id('ID-221662474')/setraises/exception[@name='DOMException']/descr/p[substring-before(.,':')='NO_MODIFICATION_ALLOWED_ERR'])</a>
+* @see <a href="http://www.w3.org/DOM/updates/REC-DOM-Level-1-19981001-errata.html">http://www.w3.org/DOM/updates/REC-DOM-Level-1-19981001-errata.html</a>
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-221662474">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-221662474</a>
+*/
+public final class attrsetvaluenomodificationallowederr extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public attrsetvaluenomodificationallowederr(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+
+ org.w3c.domts.DocumentBuilderSetting[] settings =
+ new org.w3c.domts.DocumentBuilderSetting[] {
+org.w3c.domts.DocumentBuilderSetting.notExpandEntityReferences
+ };
+ DOMTestDocumentBuilderFactory testFactory = factory.newInstance(settings);
+ setFactory(testFactory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "staff", true);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ NodeList genderList;
+ Node gender;
+ NodeList genList;
+ Node gen;
+ NodeList gList;
+ Node g;
+ NamedNodeMap attrList;
+ Attr attrNode;
+ doc = (Document) load("staff", true);
+ genderList = doc.getElementsByTagName("gender");
+ gender = genderList.item(2);
+ assertNotNull("genderNotNull", gender);
+ genList = gender.getChildNodes();
+ gen = genList.item(0);
+ assertNotNull("genderFirstChildNotNull", gen);
+ gList = gen.getChildNodes();
+ g = gList.item(0);
+ assertNotNull("genderFirstGrandchildNotNull", g);
+ attrList = g.getAttributes();
+ assertNotNull("attributesNotNull", attrList);
+ attrNode = (Attr) attrList.getNamedItem("domestic");
+ assertNotNull("attrNotNull", attrNode);
+
+ {
+ boolean success = false;
+ try {
+ attrNode.setValue("newvalue");
+ } catch (DOMException ex) {
+ success = (ex.code == DOMException.NO_MODIFICATION_ALLOWED_ERR);
+ }
+ assertTrue("setValue_throws_NO_MODIFICATION", success);
+ }
+
+ {
+ boolean success = false;
+ try {
+ attrNode.setNodeValue("newvalue2");
+ } catch (DOMException ex) {
+ success = (ex.code == DOMException.NO_MODIFICATION_ALLOWED_ERR);
+ }
+ assertTrue("setNodeValue_throws_NO_MODIFICATION", success);
+ }
+}
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/attrsetvaluenomodificationallowederr";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(attrsetvaluenomodificationallowederr.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level1/core/attrsetvaluenomodificationallowederrEE.java b/dom/src/test/java/org/w3c/domts/level1/core/attrsetvaluenomodificationallowederrEE.java
new file mode 100644
index 0000000..5455fee
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level1/core/attrsetvaluenomodificationallowederrEE.java
@@ -0,0 +1,123 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+Copyright (c) 2001 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+*/
+
+package org.w3c.domts.level1.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The "setValue()" method for an attribute causes the
+ * DOMException NO_MODIFICATION_ALLOWED_ERR to be raised
+ * if the node is readonly.
+ * Create an entity reference using document.createEntityReference()
+ * Get the "domestic" attribute from the entity
+ * reference and execute the "setValue()" method.
+ * This causes a NO_MODIFICATION_ALLOWED_ERR DOMException to be thrown.
+* @author Curt Arnold
+* @see <a href="http://www.w3.org/TR/2000/WD-DOM-Level-1-20000929/level-one-core#xpointer(id('ID-258A00AF')/constant[@name='NO_MODIFICATION_ALLOWED_ERR'])">http://www.w3.org/TR/2000/WD-DOM-Level-1-20000929/level-one-core#xpointer(id('ID-258A00AF')/constant[@name='NO_MODIFICATION_ALLOWED_ERR'])</a>
+* @see <a href="http://www.w3.org/TR/2000/WD-DOM-Level-1-20000929/level-one-core#ID-221662474">http://www.w3.org/TR/2000/WD-DOM-Level-1-20000929/level-one-core#ID-221662474</a>
+* @see <a href="http://www.w3.org/TR/2000/WD-DOM-Level-1-20000929/level-one-core#xpointer(id('ID-221662474')/setraises/exception[@name='DOMException']/descr/p[substring-before(.,':')='NO_MODIFICATION_ALLOWED_ERR'])">http://www.w3.org/TR/2000/WD-DOM-Level-1-20000929/level-one-core#xpointer(id('ID-221662474')/setraises/exception[@name='DOMException']/descr/p[substring-before(.,':')='NO_MODIFICATION_ALLOWED_ERR'])</a>
+* @see <a href="http://www.w3.org/DOM/updates/REC-DOM-Level-1-19981001-errata.html">http://www.w3.org/DOM/updates/REC-DOM-Level-1-19981001-errata.html</a>
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-221662474">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-221662474</a>
+* @see <a href="http://www.w3.org/2001/DOM-Test-Suite/level1/core/attrsetvaluenomodificationallowederr.xml">http://www.w3.org/2001/DOM-Test-Suite/level1/core/attrsetvaluenomodificationallowederr.xml</a>
+*/
+public final class attrsetvaluenomodificationallowederrEE extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public attrsetvaluenomodificationallowederrEE(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "staff", true);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ EntityReference entRef;
+ Element entElement;
+ NamedNodeMap attrList;
+ Node attrNode;
+ Node gender;
+ NodeList genderList;
+ Node appendedChild;
+ doc = (Document) load("staff", true);
+ genderList = doc.getElementsByTagName("gender");
+ gender = genderList.item(2);
+ assertNotNull("genderNotNull", gender);
+ entRef = doc.createEntityReference("ent4");
+ assertNotNull("entRefNotNull", entRef);
+ appendedChild = gender.appendChild(entRef);
+ entElement = (Element) entRef.getFirstChild();
+ assertNotNull("entElementNotNull", entElement);
+ attrList = entElement.getAttributes();
+ attrNode = attrList.getNamedItem("domestic");
+
+ {
+ boolean success = false;
+ try {
+ ((Attr) /*Node */attrNode).setValue("newvalue");
+ } catch (DOMException ex) {
+ success = (ex.code == DOMException.NO_MODIFICATION_ALLOWED_ERR);
+ }
+ assertTrue("setValue_throws_NO_MODIFICATION", success);
+ }
+
+ {
+ boolean success = false;
+ try {
+ attrNode.setNodeValue("newvalue2");
+ } catch (DOMException ex) {
+ success = (ex.code == DOMException.NO_MODIFICATION_ALLOWED_ERR);
+ }
+ assertTrue("setNodeValue_throws_NO_MODIFICATION", success);
+ }
+}
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/attrsetvaluenomodificationallowederrEE";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(attrsetvaluenomodificationallowederrEE.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level1/core/attrspecifiedvalue.java b/dom/src/test/java/org/w3c/domts/level1/core/attrspecifiedvalue.java
new file mode 100644
index 0000000..10087ff
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level1/core/attrspecifiedvalue.java
@@ -0,0 +1,94 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+Copyright (c) 2001-2004 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+*/
+
+package org.w3c.domts.level1.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The "getSpecified()" method for an Attr node should
+ * be set to true if the attribute was explicitly given
+ * a value.
+ * Retrieve the attribute named "domestic" from the last
+ * child of of the first employee and examine the value
+ * returned by the "getSpecified()" method. This test uses
+ * the "getNamedItem(name)" method from the NamedNodeMap
+ * interface.
+* @author NIST
+* @author Mary Brady
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-862529273">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-862529273</a>
+*/
+public final class attrspecifiedvalue extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public attrspecifiedvalue(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "staff", false);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ NodeList addressList;
+ Node testNode;
+ NamedNodeMap attributes;
+ Attr domesticAttr;
+ boolean state;
+ doc = (Document) load("staff", false);
+ addressList = doc.getElementsByTagName("address");
+ testNode = addressList.item(0);
+ attributes = testNode.getAttributes();
+ domesticAttr = (Attr) attributes.getNamedItem("domestic");
+ state = domesticAttr.getSpecified();
+ assertTrue("domesticSpecified", state);
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/attrspecifiedvalue";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(attrspecifiedvalue.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level1/core/attrspecifiedvaluechanged.java b/dom/src/test/java/org/w3c/domts/level1/core/attrspecifiedvaluechanged.java
new file mode 100644
index 0000000..dacc8ae
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level1/core/attrspecifiedvaluechanged.java
@@ -0,0 +1,96 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+Copyright (c) 2001-2004 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+*/
+
+package org.w3c.domts.level1.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The "getSpecified()" method for an Attr node should return true if the
+ * value of the attribute is changed.
+ * Retrieve the attribute named "street" from the last
+ * child of of the THIRD employee and change its
+ * value to "Yes"(which is the default DTD value). This
+ * should cause the "getSpecified()" method to be true.
+ * This test uses the "setAttribute(name,value)" method
+ * from the Element interface and the "getNamedItem(name)"
+ * method from the NamedNodeMap interface.
+* @author NIST
+* @author Mary Brady
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-862529273">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-862529273</a>
+*/
+public final class attrspecifiedvaluechanged extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public attrspecifiedvaluechanged(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "staff", true);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ NodeList addressList;
+ Node testNode;
+ NamedNodeMap attributes;
+ Attr streetAttr;
+ boolean state;
+ doc = (Document) load("staff", true);
+ addressList = doc.getElementsByTagName("address");
+ testNode = addressList.item(2);
+ ((Element) /*Node */testNode).setAttribute("street", "Yes");
+ attributes = testNode.getAttributes();
+ streetAttr = (Attr) attributes.getNamedItem("street");
+ state = streetAttr.getSpecified();
+ assertTrue("streetSpecified", state);
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/attrspecifiedvaluechanged";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(attrspecifiedvaluechanged.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level1/core/attrspecifiedvalueremove.java b/dom/src/test/java/org/w3c/domts/level1/core/attrspecifiedvalueremove.java
new file mode 100644
index 0000000..bd72827
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level1/core/attrspecifiedvalueremove.java
@@ -0,0 +1,107 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+Copyright (c) 2001-2004 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+*/
+
+package org.w3c.domts.level1.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * To respecify the attribute to its default value from
+ * the DTD, the attribute must be deleted. This will then
+ * make a new attribute available with the "getSpecified()"
+ * method value set to false.
+ * Retrieve the attribute named "street" from the last
+ * child of of the THIRD employee and delete it. This
+ * should then create a new attribute with its default
+ * value and also cause the "getSpecified()" method to
+ * return false.
+ * This test uses the "removeAttribute(name)" method
+ * from the Element interface and the "getNamedItem(name)"
+ * method from the NamedNodeMap interface.
+* @author NIST
+* @author Mary Brady
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-6D6AC0F9">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-6D6AC0F9</a>
+* @see <a href="http://lists.w3.org/Archives/Public/www-dom-ts/2002Mar/0002.html">http://lists.w3.org/Archives/Public/www-dom-ts/2002Mar/0002.html</a>
+*/
+public final class attrspecifiedvalueremove extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public attrspecifiedvalueremove(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+
+ org.w3c.domts.DocumentBuilderSetting[] settings =
+ new org.w3c.domts.DocumentBuilderSetting[] {
+org.w3c.domts.DocumentBuilderSetting.validating
+ };
+ DOMTestDocumentBuilderFactory testFactory = factory.newInstance(settings);
+ setFactory(testFactory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "staff", true);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ NodeList addressList;
+ Node testNode;
+ NamedNodeMap attributes;
+ Attr streetAttr;
+ boolean state;
+ doc = (Document) load("staff", true);
+ addressList = doc.getElementsByTagName("address");
+ testNode = addressList.item(2);
+ ((Element) /*Node */testNode).removeAttribute("street");
+ attributes = testNode.getAttributes();
+ streetAttr = (Attr) attributes.getNamedItem("street");
+ assertNotNull("streetAttrNotNull", streetAttr);
+ state = streetAttr.getSpecified();
+ assertFalse("attrSpecifiedValueRemoveAssert", state);
+}
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/attrspecifiedvalueremove";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(attrspecifiedvalueremove.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level1/core/cdatasectiongetdata.java b/dom/src/test/java/org/w3c/domts/level1/core/cdatasectiongetdata.java
new file mode 100644
index 0000000..f3ef7a8
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level1/core/cdatasectiongetdata.java
@@ -0,0 +1,99 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+Copyright (c) 2001-2004 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+*/
+
+package org.w3c.domts.level1.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * Retrieve the last CDATASection node located inside the
+ * second child of the second employee and examine its
+ * content. Since the CDATASection interface inherits
+ * from the CharacterData interface(via the Text node),
+ * the "getData()" method can be used to access the
+ * CDATA content.
+* @author NIST
+* @author Mary Brady
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-72AB8359">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-72AB8359</a>
+*/
+public final class cdatasectiongetdata extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public cdatasectiongetdata(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+
+ org.w3c.domts.DocumentBuilderSetting[] settings =
+ new org.w3c.domts.DocumentBuilderSetting[] {
+org.w3c.domts.DocumentBuilderSetting.notCoalescing
+ };
+ DOMTestDocumentBuilderFactory testFactory = factory.newInstance(settings);
+ setFactory(testFactory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "staff", false);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ NodeList nameList;
+ Node child;
+ Node lastChild;
+ String data;
+ int nodeType;
+ doc = (Document) load("staff", false);
+ nameList = doc.getElementsByTagName("name");
+ child = nameList.item(1);
+ lastChild = child.getLastChild();
+ nodeType = (int) lastChild.getNodeType();
+ assertEquals("isCDATA", 4, nodeType);
+ data = ((CharacterData) /*Node */lastChild).getData();
+ assertEquals("data", "This is an adjacent CDATASection with a reference to a tab &tab;", data);
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/cdatasectiongetdata";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(cdatasectiongetdata.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level1/core/cdatasectionnormalize.java b/dom/src/test/java/org/w3c/domts/level1/core/cdatasectionnormalize.java
new file mode 100644
index 0000000..7235b31
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level1/core/cdatasectionnormalize.java
@@ -0,0 +1,98 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+Copyright (c) 2001 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+*/
+
+package org.w3c.domts.level1.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * Adjacent CDATASection nodes cannot be merged together by
+ * use of the "normalize()" method from the Element interface.
+ * Retrieve second child of the second employee and invoke
+ * the "normalize()" method. The Element under contains
+ * two CDATASection nodes that should not be merged together
+ * by the "normalize()" method.
+* @author NIST
+* @author Mary Brady
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-162CF083">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-162CF083</a>
+*/
+public final class cdatasectionnormalize extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public cdatasectionnormalize(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "staff", true);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ NodeList nameList;
+ Element lChild;
+ NodeList childNodes;
+ CDATASection cdataN;
+ String data;
+ doc = (Document) load("staff", true);
+ nameList = doc.getElementsByTagName("name");
+ lChild = (Element) nameList.item(1);
+ lChild.normalize();
+ childNodes = lChild.getChildNodes();
+ cdataN = (CDATASection) childNodes.item(1);
+ assertNotNull("firstCDATASection", cdataN);
+ data = cdataN.getData();
+ assertEquals("data1", "This is a CDATASection with EntityReference number 2 &ent2;", data);
+ cdataN = (CDATASection) childNodes.item(3);
+ assertNotNull("secondCDATASection", cdataN);
+ data = cdataN.getData();
+ assertEquals("data3", "This is an adjacent CDATASection with a reference to a tab &tab;", data);
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/cdatasectionnormalize";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(cdatasectionnormalize.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level1/core/characterdataappenddata.java b/dom/src/test/java/org/w3c/domts/level1/core/characterdataappenddata.java
new file mode 100644
index 0000000..0ca7b0c
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level1/core/characterdataappenddata.java
@@ -0,0 +1,97 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+Copyright (c) 2001 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+*/
+
+package org.w3c.domts.level1.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The "appendData(arg)" method appends a string to the end
+ * of the character data of the node.
+ *
+ * Retrieve the character data from the second child
+ * of the first employee. The appendData(arg) method is
+ * called with arg=", Esquire". The method should append
+ * the specified data to the already existing character
+ * data. The new value return by the "getLength()" method
+ * should be 24.
+* @author NIST
+* @author Mary Brady
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-72AB8359">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-72AB8359</a>
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-32791A2F">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-32791A2F</a>
+*/
+public final class characterdataappenddata extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public characterdataappenddata(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "staff", true);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ NodeList elementList;
+ Node nameNode;
+ CharacterData child;
+ String childValue;
+ int childLength;
+ doc = (Document) load("staff", true);
+ elementList = doc.getElementsByTagName("name");
+ nameNode = elementList.item(0);
+ child = (CharacterData) nameNode.getFirstChild();
+ child.appendData(", Esquire");
+ childValue = child.getData();
+ childLength = childValue.length();
+ assertEquals("characterdataAppendDataAssert", 24, childLength);
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/characterdataappenddata";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(characterdataappenddata.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level1/core/characterdataappenddatagetdata.java b/dom/src/test/java/org/w3c/domts/level1/core/characterdataappenddatagetdata.java
new file mode 100644
index 0000000..e3c352e
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level1/core/characterdataappenddatagetdata.java
@@ -0,0 +1,96 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+Copyright (c) 2001 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+*/
+
+package org.w3c.domts.level1.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * On successful invocation of the "appendData(arg)"
+ * method the "getData()" method provides access to the
+ * concatentation of data and the specified string.
+ *
+ * Retrieve the character data from the second child
+ * of the first employee. The appendData(arg) method is
+ * called with arg=", Esquire". The method should append
+ * the specified data to the already existing character
+ * data. The new value return by the "getData()" method
+ * should be "Margaret Martin, Esquire".
+* @author NIST
+* @author Mary Brady
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-72AB8359">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-72AB8359</a>
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-32791A2F">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-32791A2F</a>
+*/
+public final class characterdataappenddatagetdata extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public characterdataappenddatagetdata(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "staff", true);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ NodeList elementList;
+ Node nameNode;
+ CharacterData child;
+ String childData;
+ doc = (Document) load("staff", true);
+ elementList = doc.getElementsByTagName("name");
+ nameNode = elementList.item(0);
+ child = (CharacterData) nameNode.getFirstChild();
+ child.appendData(", Esquire");
+ childData = child.getData();
+ assertEquals("characterdataAppendDataGetDataAssert", "Margaret Martin, Esquire", childData);
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/characterdataappenddatagetdata";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(characterdataappenddatagetdata.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level1/core/characterdataappenddatanomodificationallowederr.java b/dom/src/test/java/org/w3c/domts/level1/core/characterdataappenddatanomodificationallowederr.java
new file mode 100644
index 0000000..5c1fd9a
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level1/core/characterdataappenddatanomodificationallowederr.java
@@ -0,0 +1,114 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+Copyright (c) 2001-2004 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+*/
+
+package org.w3c.domts.level1.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The "appendData(arg)" method raises a NO_MODIFICATION_ALLOWED_ERR
+ * DOMException if the node is readonly.
+ * Obtain the children of the THIRD "gender" element. The elements
+ * content is an entity reference. Get the FIRST item
+ * from the entity reference and execute the "appendData(arg)" method.
+ * This causes a NO_MODIFICATION_ALLOWED_ERR DOMException to be thrown.
+* @author NIST
+* @author Mary Brady
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-258A00AF')/constant[@name='NO_MODIFICATION_ALLOWED_ERR'])">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-258A00AF')/constant[@name='NO_MODIFICATION_ALLOWED_ERR'])</a>
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-32791A2F">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-32791A2F</a>
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-32791A2F')/raises/exception[@name='DOMException']/descr/p[substring-before(.,':')='NO_MODIFICATION_ALLOWED_ERR'])">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-32791A2F')/raises/exception[@name='DOMException']/descr/p[substring-before(.,':')='NO_MODIFICATION_ALLOWED_ERR'])</a>
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-32791A2F">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-32791A2F</a>
+*/
+public final class characterdataappenddatanomodificationallowederr extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public characterdataappenddatanomodificationallowederr(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "staff", true);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ NodeList genderList;
+ Node genderNode;
+ Node entElement;
+ Node entElementContent;
+ Node entReference;
+ int nodeType;
+ doc = (Document) load("staff", true);
+ genderList = doc.getElementsByTagName("gender");
+ genderNode = genderList.item(2);
+ entReference = genderNode.getFirstChild();
+ assertNotNull("entReferenceNotNull", entReference);
+ nodeType = (int) entReference.getNodeType();
+
+ if (equals(1, nodeType)) {
+ entReference = doc.createEntityReference("ent4");
+ assertNotNull("createdEntRefNotNull", entReference);
+ }
+ entElement = entReference.getFirstChild();
+ assertNotNull("entElementNotNull", entElement);
+ entElementContent = entElement.getFirstChild();
+ assertNotNull("entElementContentNotNull", entElementContent);
+
+ {
+ boolean success = false;
+ try {
+ ((CharacterData) /*Node */entElementContent).appendData("newString");
+ } catch (DOMException ex) {
+ success = (ex.code == DOMException.NO_MODIFICATION_ALLOWED_ERR);
+ }
+ assertTrue("throw_NO_MODIFICATION_ALLOWED_ERR", success);
+ }
+}
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/characterdataappenddatanomodificationallowederr";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(characterdataappenddatanomodificationallowederr.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level1/core/characterdataappenddatanomodificationallowederrEE.java b/dom/src/test/java/org/w3c/domts/level1/core/characterdataappenddatanomodificationallowederrEE.java
new file mode 100644
index 0000000..725a35f
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level1/core/characterdataappenddatanomodificationallowederrEE.java
@@ -0,0 +1,101 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+Copyright (c) 2001-2004 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+*/
+
+package org.w3c.domts.level1.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * Create an ent3 entity reference and call appendData on a text child, should thrown a NO_MODIFICATION_ALLOWED_ERR.
+* @author Curt Arnold
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-258A00AF')/constant[@name='NO_MODIFICATION_ALLOWED_ERR'])">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-258A00AF')/constant[@name='NO_MODIFICATION_ALLOWED_ERR'])</a>
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-32791A2F">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-32791A2F</a>
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-32791A2F')/raises/exception[@name='DOMException']/descr/p[substring-before(.,':')='NO_MODIFICATION_ALLOWED_ERR'])">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-32791A2F')/raises/exception[@name='DOMException']/descr/p[substring-before(.,':')='NO_MODIFICATION_ALLOWED_ERR'])</a>
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-32791A2F">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-32791A2F</a>
+* @see <a href="http://www.w3.org/2001/DOM-Test-Suite/level1/core/characterdataappenddatanomodificationallowederr.xml">http://www.w3.org/2001/DOM-Test-Suite/level1/core/characterdataappenddatanomodificationallowederr.xml</a>
+*/
+public final class characterdataappenddatanomodificationallowederrEE extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public characterdataappenddatanomodificationallowederrEE(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "staff", true);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ NodeList genderList;
+ Node genderNode;
+ Node entText;
+ EntityReference entReference;
+ Node appendedChild;
+ doc = (Document) load("staff", true);
+ genderList = doc.getElementsByTagName("gender");
+ genderNode = genderList.item(2);
+ entReference = doc.createEntityReference("ent3");
+ assertNotNull("createdEntRefNotNull", entReference);
+ appendedChild = genderNode.appendChild(entReference);
+ entText = entReference.getFirstChild();
+ assertNotNull("entTextNotNull", entText);
+
+ {
+ boolean success = false;
+ try {
+ ((CharacterData) /*Node */entText).appendData("newString");
+ } catch (DOMException ex) {
+ success = (ex.code == DOMException.NO_MODIFICATION_ALLOWED_ERR);
+ }
+ assertTrue("throw_NO_MODIFICATION_ALLOWED_ERR", success);
+ }
+}
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/characterdataappenddatanomodificationallowederrEE";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(characterdataappenddatanomodificationallowederrEE.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level1/core/characterdatadeletedatabegining.java b/dom/src/test/java/org/w3c/domts/level1/core/characterdatadeletedatabegining.java
new file mode 100644
index 0000000..2a0a4bc
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level1/core/characterdatadeletedatabegining.java
@@ -0,0 +1,94 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+Copyright (c) 2001 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+*/
+
+package org.w3c.domts.level1.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The "deleteData(offset,count)" method removes a range of
+ * characters from the node. Delete data at the beginning
+ * of the character data.
+ * Retrieve the character data from the last child of the
+ * first employee. The "deleteData(offset,count)"
+ * method is then called with offset=0 and count=16.
+ * The method should delete the characters from position
+ * 0 thru position 16. The new value of the character data
+ * should be "Dallas, Texas 98551".
+* @author NIST
+* @author Mary Brady
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-7C603781">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-7C603781</a>
+*/
+public final class characterdatadeletedatabegining extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public characterdatadeletedatabegining(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "staff", true);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ NodeList elementList;
+ Node nameNode;
+ CharacterData child;
+ String childData;
+ doc = (Document) load("staff", true);
+ elementList = doc.getElementsByTagName("address");
+ nameNode = elementList.item(0);
+ child = (CharacterData) nameNode.getFirstChild();
+ child.deleteData(0, 16);
+ childData = child.getData();
+ assertEquals("characterdataDeleteDataBeginingAssert", "Dallas, Texas 98551", childData);
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/characterdatadeletedatabegining";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(characterdatadeletedatabegining.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level1/core/characterdatadeletedataend.java b/dom/src/test/java/org/w3c/domts/level1/core/characterdatadeletedataend.java
new file mode 100644
index 0000000..fbe195a
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level1/core/characterdatadeletedataend.java
@@ -0,0 +1,96 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+Copyright (c) 2001 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+*/
+
+package org.w3c.domts.level1.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The "deleteData(offset,count)" method removes a range of
+ * characters from the node. Delete data at the end
+ * of the character data.
+ *
+ * Retrieve the character data from the last child of the
+ * first employee. The "deleteData(offset,count)"
+ * method is then called with offset=30 and count=5.
+ * The method should delete the characters from position
+ * 30 thru position 35. The new value of the character data
+ * should be "1230 North Ave. Dallas, Texas".
+* @author NIST
+* @author Mary Brady
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-72AB8359">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-72AB8359</a>
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-7C603781">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-7C603781</a>
+*/
+public final class characterdatadeletedataend extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public characterdatadeletedataend(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "staff", true);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ NodeList elementList;
+ Node nameNode;
+ CharacterData child;
+ String childData;
+ doc = (Document) load("staff", true);
+ elementList = doc.getElementsByTagName("address");
+ nameNode = elementList.item(0);
+ child = (CharacterData) nameNode.getFirstChild();
+ child.deleteData(30, 5);
+ childData = child.getData();
+ assertEquals("characterdataDeleteDataEndAssert", "1230 North Ave. Dallas, Texas ", childData);
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/characterdatadeletedataend";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(characterdatadeletedataend.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level1/core/characterdatadeletedataexceedslength.java b/dom/src/test/java/org/w3c/domts/level1/core/characterdatadeletedataexceedslength.java
new file mode 100644
index 0000000..b1e254e
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level1/core/characterdatadeletedataexceedslength.java
@@ -0,0 +1,98 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+Copyright (c) 2001 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+*/
+
+package org.w3c.domts.level1.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * If the sum of the offset and count used in the
+ * "deleteData(offset,count) method is greater than the
+ * length of the character data then all the characters
+ * from the offset to the end of the data are deleted.
+ *
+ * Retrieve the character data from the last child of the
+ * first employee. The "deleteData(offset,count)"
+ * method is then called with offset=4 and count=50.
+ * The method should delete the characters from position 4
+ * to the end of the data since the offset+count(50+4)
+ * is greater than the length of the character data(35).
+ * The new value of the character data should be "1230".
+* @author NIST
+* @author Mary Brady
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-72AB8359">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-72AB8359</a>
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-7C603781">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-7C603781</a>
+*/
+public final class characterdatadeletedataexceedslength extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public characterdatadeletedataexceedslength(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "staff", true);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ NodeList elementList;
+ Node nameNode;
+ CharacterData child;
+ String childData;
+ doc = (Document) load("staff", true);
+ elementList = doc.getElementsByTagName("address");
+ nameNode = elementList.item(0);
+ child = (CharacterData) nameNode.getFirstChild();
+ child.deleteData(4, 50);
+ childData = child.getData();
+ assertEquals("characterdataDeleteDataExceedsLengthAssert", "1230", childData);
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/characterdatadeletedataexceedslength";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(characterdatadeletedataexceedslength.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level1/core/characterdatadeletedatagetlengthanddata.java b/dom/src/test/java/org/w3c/domts/level1/core/characterdatadeletedatagetlengthanddata.java
new file mode 100644
index 0000000..7e3cf13
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level1/core/characterdatadeletedatagetlengthanddata.java
@@ -0,0 +1,104 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+Copyright (c) 2001 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+*/
+
+package org.w3c.domts.level1.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * On successful invocation of the "deleteData(offset,count)"
+ * method, the "getData()" and "getLength()" methods reflect
+ * the changes.
+ *
+ * Retrieve the character data from the last child of the
+ * first employee. The "deleteData(offset,count)"
+ * method is then called with offset=30 and count=5.
+ * The method should delete the characters from position
+ * 30 thru position 35. The new value of the character data
+ * should be "1230 North Ave. Dallas, Texas" which is
+ * returned by the "getData()" method and "getLength()"
+ * method should return 30".
+* @author NIST
+* @author Mary Brady
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-72AB8359">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-72AB8359</a>
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-7D61178C">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-7D61178C</a>
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-7C603781">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-7C603781</a>
+*/
+public final class characterdatadeletedatagetlengthanddata extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public characterdatadeletedatagetlengthanddata(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "staff", true);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ NodeList elementList;
+ Node nameNode;
+ CharacterData child;
+ String childData;
+ int childLength;
+ java.util.List result = new java.util.ArrayList();
+
+ doc = (Document) load("staff", true);
+ elementList = doc.getElementsByTagName("address");
+ nameNode = elementList.item(0);
+ child = (CharacterData) nameNode.getFirstChild();
+ child.deleteData(30, 5);
+ childData = child.getData();
+ assertEquals("data", "1230 North Ave. Dallas, Texas ", childData);
+ childLength = (int) child.getLength();
+ assertEquals("length", 30, childLength);
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/characterdatadeletedatagetlengthanddata";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(characterdatadeletedatagetlengthanddata.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level1/core/characterdatadeletedatamiddle.java b/dom/src/test/java/org/w3c/domts/level1/core/characterdatadeletedatamiddle.java
new file mode 100644
index 0000000..35f2ff3
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level1/core/characterdatadeletedatamiddle.java
@@ -0,0 +1,96 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+Copyright (c) 2001 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+*/
+
+package org.w3c.domts.level1.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The "deleteData(offset,count)" method removes a range of
+ * characters from the node. Delete data in the middle
+ * of the character data.
+ *
+ * Retrieve the character data from the last child of the
+ * first employee. The "deleteData(offset,count)"
+ * method is then called with offset=16 and count=8.
+ * The method should delete the characters from position
+ * 16 thru position 24. The new value of the character data
+ * should be "1230 North Ave. Texas 98551".
+* @author NIST
+* @author Mary Brady
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-72AB8359">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-72AB8359</a>
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-7C603781">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-7C603781</a>
+*/
+public final class characterdatadeletedatamiddle extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public characterdatadeletedatamiddle(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "staff", true);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ NodeList elementList;
+ Node nameNode;
+ CharacterData child;
+ String childData;
+ doc = (Document) load("staff", true);
+ elementList = doc.getElementsByTagName("address");
+ nameNode = elementList.item(0);
+ child = (CharacterData) nameNode.getFirstChild();
+ child.deleteData(16, 8);
+ childData = child.getData();
+ assertEquals("characterdataDeleteDataMiddleAssert", "1230 North Ave. Texas 98551", childData);
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/characterdatadeletedatamiddle";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(characterdatadeletedatamiddle.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level1/core/characterdatadeletedatanomodificationallowederr.java b/dom/src/test/java/org/w3c/domts/level1/core/characterdatadeletedatanomodificationallowederr.java
new file mode 100644
index 0000000..d902b77
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level1/core/characterdatadeletedatanomodificationallowederr.java
@@ -0,0 +1,114 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+Copyright (c) 2001-2004 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+*/
+
+package org.w3c.domts.level1.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The "deleteData(offset,count)" method raises a NO_MODIFICATION_ALLOWED_ERR
+ * DOMException if the node is readonly.
+ * Obtain the children of the THIRD "gender" element. The elements
+ * content is an entity reference. Get the FIRST item
+ * from the entity reference and execute the "deleteData(offset,count)" method.
+ * This causes a NO_MODIFICATION_ALLOWED_ERR DOMException to be thrown.
+* @author NIST
+* @author Mary Brady
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-258A00AF')/constant[@name='NO_MODIFICATION_ALLOWED_ERR'])">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-258A00AF')/constant[@name='NO_MODIFICATION_ALLOWED_ERR'])</a>
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-7C603781">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-7C603781</a>
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-7C603781')/raises/exception[@name='DOMException']/descr/p[substring-before(.,':')='NO_MODIFICATION_ALLOWED_ERR'])">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-7C603781')/raises/exception[@name='DOMException']/descr/p[substring-before(.,':')='NO_MODIFICATION_ALLOWED_ERR'])</a>
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-7C603781">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-7C603781</a>
+*/
+public final class characterdatadeletedatanomodificationallowederr extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public characterdatadeletedatanomodificationallowederr(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "staff", true);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ NodeList genderList;
+ Node genderNode;
+ Node entElement;
+ Node entElementContent;
+ int nodeType;
+ Node entReference;
+ doc = (Document) load("staff", true);
+ genderList = doc.getElementsByTagName("gender");
+ genderNode = genderList.item(2);
+ entReference = genderNode.getFirstChild();
+ assertNotNull("entReferenceNotNull", entReference);
+ nodeType = (int) entReference.getNodeType();
+
+ if (equals(3, nodeType)) {
+ entReference = doc.createEntityReference("ent4");
+ assertNotNull("createdEntRefNotNull", entReference);
+ }
+ entElement = entReference.getFirstChild();
+ assertNotNull("entElementNotNull", entElement);
+ entElementContent = entElement.getFirstChild();
+ assertNotNull("entElementContentNotNull", entElementContent);
+
+ {
+ boolean success = false;
+ try {
+ ((CharacterData) /*Node */entElementContent).deleteData(1, 3);
+ } catch (DOMException ex) {
+ success = (ex.code == DOMException.NO_MODIFICATION_ALLOWED_ERR);
+ }
+ assertTrue("throw_NO_MODIFICATION_ALLOWED_ERR", success);
+ }
+}
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/characterdatadeletedatanomodificationallowederr";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(characterdatadeletedatanomodificationallowederr.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level1/core/characterdatadeletedatanomodificationallowederrEE.java b/dom/src/test/java/org/w3c/domts/level1/core/characterdatadeletedatanomodificationallowederrEE.java
new file mode 100644
index 0000000..2122c3d
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level1/core/characterdatadeletedatanomodificationallowederrEE.java
@@ -0,0 +1,101 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+Copyright (c) 2001-2004 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+*/
+
+package org.w3c.domts.level1.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * Create an ent3 entity reference and call deleteData on a text child, should thrown a NO_MODIFICATION_ALLOWED_ERR.
+* @author Curt Arnold
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-258A00AF')/constant[@name='NO_MODIFICATION_ALLOWED_ERR'])">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-258A00AF')/constant[@name='NO_MODIFICATION_ALLOWED_ERR'])</a>
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-7C603781">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-7C603781</a>
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-7C603781')/raises/exception[@name='DOMException']/descr/p[substring-before(.,':')='NO_MODIFICATION_ALLOWED_ERR'])">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-7C603781')/raises/exception[@name='DOMException']/descr/p[substring-before(.,':')='NO_MODIFICATION_ALLOWED_ERR'])</a>
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-7C603781">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-7C603781</a>
+* @see <a href="http://www.w3.org/2001/DOM-Test-Suite/level1/core/characterdatadeletedatanomodificationallowederr.xml">http://www.w3.org/2001/DOM-Test-Suite/level1/core/characterdatadeletedatanomodificationallowederr.xml</a>
+*/
+public final class characterdatadeletedatanomodificationallowederrEE extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public characterdatadeletedatanomodificationallowederrEE(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "staff", true);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ NodeList genderList;
+ Node genderNode;
+ Node entText;
+ EntityReference entReference;
+ Node appendedChild;
+ doc = (Document) load("staff", true);
+ genderList = doc.getElementsByTagName("gender");
+ genderNode = genderList.item(2);
+ entReference = doc.createEntityReference("ent3");
+ assertNotNull("createdEntRefNotNull", entReference);
+ appendedChild = genderNode.appendChild(entReference);
+ entText = entReference.getFirstChild();
+ assertNotNull("entTextNotNull", entText);
+
+ {
+ boolean success = false;
+ try {
+ ((CharacterData) /*Node */entText).deleteData(1, 3);
+ } catch (DOMException ex) {
+ success = (ex.code == DOMException.NO_MODIFICATION_ALLOWED_ERR);
+ }
+ assertTrue("throw_NO_MODIFICATION_ALLOWED_ERR", success);
+ }
+}
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/characterdatadeletedatanomodificationallowederrEE";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(characterdatadeletedatanomodificationallowederrEE.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level1/core/characterdatagetdata.java b/dom/src/test/java/org/w3c/domts/level1/core/characterdatagetdata.java
new file mode 100644
index 0000000..895f9d5
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level1/core/characterdatagetdata.java
@@ -0,0 +1,90 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+Copyright (c) 2001 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+*/
+
+package org.w3c.domts.level1.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The "getData()" method retrieves the character data
+ * currently stored in the node.
+ * Retrieve the character data from the second child
+ * of the first employee and invoke the "getData()"
+ * method. The method returns the character data
+ * string.
+* @author NIST
+* @author Mary Brady
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-72AB8359">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-72AB8359</a>
+*/
+public final class characterdatagetdata extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public characterdatagetdata(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "staff", false);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ NodeList elementList;
+ Node nameNode;
+ CharacterData child;
+ String childData;
+ doc = (Document) load("staff", false);
+ elementList = doc.getElementsByTagName("name");
+ nameNode = elementList.item(0);
+ child = (CharacterData) nameNode.getFirstChild();
+ childData = child.getData();
+ assertEquals("characterdataGetDataAssert", "Margaret Martin", childData);
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/characterdatagetdata";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(characterdatagetdata.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level1/core/characterdatagetlength.java b/dom/src/test/java/org/w3c/domts/level1/core/characterdatagetlength.java
new file mode 100644
index 0000000..7458d7a
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level1/core/characterdatagetlength.java
@@ -0,0 +1,92 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+Copyright (c) 2001 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+*/
+
+package org.w3c.domts.level1.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The "getLength()" method returns the number of characters
+ * stored in this nodes data.
+ * Retrieve the character data from the second
+ * child of the first employee and examine the
+ * value returned by the getLength() method.
+* @author NIST
+* @author Mary Brady
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-72AB8359">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-72AB8359</a>
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-7D61178C">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-7D61178C</a>
+*/
+public final class characterdatagetlength extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public characterdatagetlength(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "staff", false);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ NodeList elementList;
+ Node nameNode;
+ CharacterData child;
+ String childValue;
+ int childLength;
+ doc = (Document) load("staff", false);
+ elementList = doc.getElementsByTagName("name");
+ nameNode = elementList.item(0);
+ child = (CharacterData) nameNode.getFirstChild();
+ childValue = child.getData();
+ childLength = childValue.length();
+ assertEquals("characterdataGetLengthAssert", 15, childLength);
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/characterdatagetlength";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(characterdatagetlength.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level1/core/characterdataindexsizeerrdeletedatacountnegative.java b/dom/src/test/java/org/w3c/domts/level1/core/characterdataindexsizeerrdeletedatacountnegative.java
new file mode 100644
index 0000000..d902d73
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level1/core/characterdataindexsizeerrdeletedatacountnegative.java
@@ -0,0 +1,107 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+Copyright (c) 2001 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+*/
+
+package org.w3c.domts.level1.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The "deleteData(offset,count)" method raises an
+ * INDEX_SIZE_ERR DOMException if the specified count
+ * is negative.
+ *
+ * Retrieve the character data of the last child of the
+ * first employee and invoke its "deleteData(offset,count)"
+ * method with offset=10 and count=-3. It should raise the
+ * desired exception since the count is negative.
+* @author NIST
+* @author Mary Brady
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-258A00AF')/constant[@name='INDEX_SIZE_ERR'])">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-258A00AF')/constant[@name='INDEX_SIZE_ERR'])</a>
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-6531BCCF">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-6531BCCF</a>
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-6531BCCF')/raises/exception[@name='DOMException']/descr/p[substring-before(.,':')='INDEX_SIZE_ERR'])">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-6531BCCF')/raises/exception[@name='DOMException']/descr/p[substring-before(.,':')='INDEX_SIZE_ERR'])</a>
+*/
+public final class characterdataindexsizeerrdeletedatacountnegative extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public characterdataindexsizeerrdeletedatacountnegative(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+
+ org.w3c.domts.DocumentBuilderSetting[] settings =
+ new org.w3c.domts.DocumentBuilderSetting[] {
+org.w3c.domts.DocumentBuilderSetting.signed
+ };
+ DOMTestDocumentBuilderFactory testFactory = factory.newInstance(settings);
+ setFactory(testFactory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "staff", true);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ NodeList elementList;
+ Node nameNode;
+ CharacterData child;
+ doc = (Document) load("staff", true);
+ elementList = doc.getElementsByTagName("address");
+ nameNode = elementList.item(0);
+ child = (CharacterData) nameNode.getFirstChild();
+
+ {
+ boolean success = false;
+ try {
+ child.deleteData(10, -3);
+ } catch (DOMException ex) {
+ success = (ex.code == DOMException.INDEX_SIZE_ERR);
+ }
+ assertTrue("throws_INDEX_SIZE_ERR", success);
+ }
+}
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/characterdataindexsizeerrdeletedatacountnegative";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(characterdataindexsizeerrdeletedatacountnegative.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level1/core/characterdataindexsizeerrdeletedataoffsetgreater.java b/dom/src/test/java/org/w3c/domts/level1/core/characterdataindexsizeerrdeletedataoffsetgreater.java
new file mode 100644
index 0000000..dd8c7e8
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level1/core/characterdataindexsizeerrdeletedataoffsetgreater.java
@@ -0,0 +1,104 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+Copyright (c) 2001-2003 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+*/
+
+package org.w3c.domts.level1.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The "deleteData(offset,count)" method raises an
+ * INDEX_SIZE_ERR DOMException if the specified offset
+ * is greater that the number of characters in the string.
+ *
+ * Retrieve the character data of the last child of the
+ * first employee and invoke its "deleteData(offset,count)"
+ * method with offset=40 and count=3. It should raise the
+ * desired exception since the offset is greater than the
+ * number of characters in the string.
+* @author NIST
+* @author Mary Brady
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-258A00AF')/constant[@name='INDEX_SIZE_ERR'])">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-258A00AF')/constant[@name='INDEX_SIZE_ERR'])</a>
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-7C603781">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-7C603781</a>
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-7C603781')/raises/exception[@name='DOMException']/descr/p[substring-before(.,':')='INDEX_SIZE_ERR'])">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-7C603781')/raises/exception[@name='DOMException']/descr/p[substring-before(.,':')='INDEX_SIZE_ERR'])</a>
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-7C603781">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-7C603781</a>
+* @see <a href="http://www.w3.org/Bugs/Public/show_bug.cgi?id=249">http://www.w3.org/Bugs/Public/show_bug.cgi?id=249</a>
+*/
+public final class characterdataindexsizeerrdeletedataoffsetgreater extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public characterdataindexsizeerrdeletedataoffsetgreater(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "staff", true);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ NodeList elementList;
+ Node nameNode;
+ CharacterData child;
+ doc = (Document) load("staff", true);
+ elementList = doc.getElementsByTagName("address");
+ nameNode = elementList.item(0);
+ child = (CharacterData) nameNode.getFirstChild();
+
+ {
+ boolean success = false;
+ try {
+ child.deleteData(40, 3);
+ } catch (DOMException ex) {
+ success = (ex.code == DOMException.INDEX_SIZE_ERR);
+ }
+ assertTrue("throw_INDEX_SIZE_ERR", success);
+ }
+}
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/characterdataindexsizeerrdeletedataoffsetgreater";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(characterdataindexsizeerrdeletedataoffsetgreater.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level1/core/characterdataindexsizeerrdeletedataoffsetnegative.java b/dom/src/test/java/org/w3c/domts/level1/core/characterdataindexsizeerrdeletedataoffsetnegative.java
new file mode 100644
index 0000000..96dd368
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level1/core/characterdataindexsizeerrdeletedataoffsetnegative.java
@@ -0,0 +1,108 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+Copyright (c) 2001 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+*/
+
+package org.w3c.domts.level1.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The "deleteData(offset,count)" method raises an
+ * INDEX_SIZE_ERR DOMException if the specified offset
+ * is negative.
+ *
+ * Retrieve the character data of the last child of the
+ * first employee and invoke its "deleteData(offset,count)"
+ * method with offset=-5 and count=3. It should raise the
+ * desired exception since the offset is negative.
+* @author NIST
+* @author Mary Brady
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-258A00AF')/constant[@name='INDEX_SIZE_ERR'])">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-258A00AF')/constant[@name='INDEX_SIZE_ERR'])</a>
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-7C603781">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-7C603781</a>
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-7C603781')/raises/exception[@name='DOMException']/descr/p[substring-before(.,':')='INDEX_SIZE_ERR'])">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-7C603781')/raises/exception[@name='DOMException']/descr/p[substring-before(.,':')='INDEX_SIZE_ERR'])</a>
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-7C603781">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-7C603781</a>
+*/
+public final class characterdataindexsizeerrdeletedataoffsetnegative extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public characterdataindexsizeerrdeletedataoffsetnegative(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+
+ org.w3c.domts.DocumentBuilderSetting[] settings =
+ new org.w3c.domts.DocumentBuilderSetting[] {
+org.w3c.domts.DocumentBuilderSetting.signed
+ };
+ DOMTestDocumentBuilderFactory testFactory = factory.newInstance(settings);
+ setFactory(testFactory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "staff", true);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ NodeList elementList;
+ Node nameNode;
+ CharacterData child;
+ doc = (Document) load("staff", true);
+ elementList = doc.getElementsByTagName("address");
+ nameNode = elementList.item(0);
+ child = (CharacterData) nameNode.getFirstChild();
+
+ {
+ boolean success = false;
+ try {
+ child.deleteData(-5, 3);
+ } catch (DOMException ex) {
+ success = (ex.code == DOMException.INDEX_SIZE_ERR);
+ }
+ assertTrue("throws_INDEX_SIZE_ERR", success);
+ }
+}
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/characterdataindexsizeerrdeletedataoffsetnegative";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(characterdataindexsizeerrdeletedataoffsetnegative.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level1/core/characterdataindexsizeerrinsertdataoffsetgreater.java b/dom/src/test/java/org/w3c/domts/level1/core/characterdataindexsizeerrinsertdataoffsetgreater.java
new file mode 100644
index 0000000..3163162
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level1/core/characterdataindexsizeerrinsertdataoffsetgreater.java
@@ -0,0 +1,103 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+Copyright (c) 2001-2003 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+*/
+
+package org.w3c.domts.level1.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The "insertData(offset,arg)" method raises an
+ * INDEX_SIZE_ERR DOMException if the specified offset
+ * is greater than the number of characters in the string.
+ *
+ * Retrieve the character data of the last child of the
+ * first employee and invoke its insertData"(offset,arg)"
+ * method with offset=40 and arg="ABC". It should raise
+ * the desired exception since the offset is greater than
+ * the number of characters in the string.
+* @author NIST
+* @author Mary Brady
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-258A00AF')/constant[@name='INDEX_SIZE_ERR'])">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-258A00AF')/constant[@name='INDEX_SIZE_ERR'])</a>
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-7C603781">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-7C603781</a>
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-7C603781')/raises/exception[@name='DOMException']/descr/p[substring-before(.,':')='INDEX_SIZE_ERR'])">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-7C603781')/raises/exception[@name='DOMException']/descr/p[substring-before(.,':')='INDEX_SIZE_ERR'])</a>
+* @see <a href="http://www.w3.org/Bugs/Public/show_bug.cgi?id=249">http://www.w3.org/Bugs/Public/show_bug.cgi?id=249</a>
+*/
+public final class characterdataindexsizeerrinsertdataoffsetgreater extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public characterdataindexsizeerrinsertdataoffsetgreater(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "staff", true);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ NodeList elementList;
+ Node nameNode;
+ CharacterData child;
+ doc = (Document) load("staff", true);
+ elementList = doc.getElementsByTagName("address");
+ nameNode = elementList.item(0);
+ child = (CharacterData) nameNode.getFirstChild();
+
+ {
+ boolean success = false;
+ try {
+ child.insertData(40, "ABC");
+ } catch (DOMException ex) {
+ success = (ex.code == DOMException.INDEX_SIZE_ERR);
+ }
+ assertTrue("throw_INDEX_SIZE_ERR", success);
+ }
+}
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/characterdataindexsizeerrinsertdataoffsetgreater";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(characterdataindexsizeerrinsertdataoffsetgreater.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level1/core/characterdataindexsizeerrinsertdataoffsetnegative.java b/dom/src/test/java/org/w3c/domts/level1/core/characterdataindexsizeerrinsertdataoffsetnegative.java
new file mode 100644
index 0000000..e578d9c
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level1/core/characterdataindexsizeerrinsertdataoffsetnegative.java
@@ -0,0 +1,107 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+Copyright (c) 2001 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+*/
+
+package org.w3c.domts.level1.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The "insertData(offset,arg)" method raises an
+ * INDEX_SIZE_ERR DOMException if the specified offset
+ * is negative.
+ *
+ * Retrieve the character data of the last child of the
+ * first employee and invoke its insertData"(offset,arg)"
+ * method with offset=-5 and arg="ABC". It should raise
+ * the desired exception since the offset is negative.
+* @author NIST
+* @author Mary Brady
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-258A00AF')/constant[@name='INDEX_SIZE_ERR'])">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-258A00AF')/constant[@name='INDEX_SIZE_ERR'])</a>
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-E5CBA7FB">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-E5CBA7FB</a>
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-E5CBA7FB')/raises/exception[@name='DOMException']/descr/p[substring-before(.,':')='INDEX_SIZE_ERR'])">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-E5CBA7FB')/raises/exception[@name='DOMException']/descr/p[substring-before(.,':')='INDEX_SIZE_ERR'])</a>
+*/
+public final class characterdataindexsizeerrinsertdataoffsetnegative extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public characterdataindexsizeerrinsertdataoffsetnegative(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+
+ org.w3c.domts.DocumentBuilderSetting[] settings =
+ new org.w3c.domts.DocumentBuilderSetting[] {
+org.w3c.domts.DocumentBuilderSetting.signed
+ };
+ DOMTestDocumentBuilderFactory testFactory = factory.newInstance(settings);
+ setFactory(testFactory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "staff", true);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ NodeList elementList;
+ Node nameNode;
+ CharacterData child;
+ doc = (Document) load("staff", true);
+ elementList = doc.getElementsByTagName("address");
+ nameNode = elementList.item(0);
+ child = (CharacterData) nameNode.getFirstChild();
+
+ {
+ boolean success = false;
+ try {
+ child.insertData(-5, "ABC");
+ } catch (DOMException ex) {
+ success = (ex.code == DOMException.INDEX_SIZE_ERR);
+ }
+ assertTrue("throws_INDEX_SIZE_ERR", success);
+ }
+}
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/characterdataindexsizeerrinsertdataoffsetnegative";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(characterdataindexsizeerrinsertdataoffsetnegative.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level1/core/characterdataindexsizeerrreplacedatacountnegative.java b/dom/src/test/java/org/w3c/domts/level1/core/characterdataindexsizeerrreplacedatacountnegative.java
new file mode 100644
index 0000000..01b5bcc
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level1/core/characterdataindexsizeerrreplacedatacountnegative.java
@@ -0,0 +1,108 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+Copyright (c) 2001 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+*/
+
+package org.w3c.domts.level1.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The "replaceData(offset,count,arg)" method raises an
+ * INDEX_SIZE_ERR DOMException if the specified count
+ * is negative.
+ *
+ * Retrieve the character data of the last child of the
+ * first employee and invoke its
+ * "replaceData(offset,count,arg) method with offset=10
+ * and count=-3 and arg="ABC". It should raise the
+ * desired exception since the count is negative.
+* @author NIST
+* @author Mary Brady
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-258A00AF')/constant[@name='INDEX_SIZE_ERR'])">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-258A00AF')/constant[@name='INDEX_SIZE_ERR'])</a>
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-6531BCCF">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-6531BCCF</a>
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-6531BCCF')/raises/exception[@name='DOMException']/descr/p[substring-before(.,':')='INDEX_SIZE_ERR'])">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-6531BCCF')/raises/exception[@name='DOMException']/descr/p[substring-before(.,':')='INDEX_SIZE_ERR'])</a>
+*/
+public final class characterdataindexsizeerrreplacedatacountnegative extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public characterdataindexsizeerrreplacedatacountnegative(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+
+ org.w3c.domts.DocumentBuilderSetting[] settings =
+ new org.w3c.domts.DocumentBuilderSetting[] {
+org.w3c.domts.DocumentBuilderSetting.signed
+ };
+ DOMTestDocumentBuilderFactory testFactory = factory.newInstance(settings);
+ setFactory(testFactory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "staff", true);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ NodeList elementList;
+ Node nameNode;
+ CharacterData child;
+ doc = (Document) load("staff", true);
+ elementList = doc.getElementsByTagName("address");
+ nameNode = elementList.item(0);
+ child = (CharacterData) nameNode.getFirstChild();
+
+ {
+ boolean success = false;
+ try {
+ child.replaceData(10, -3, "ABC");
+ } catch (DOMException ex) {
+ success = (ex.code == DOMException.INDEX_SIZE_ERR);
+ }
+ assertTrue("throws_INDEX_SIZE_ERR", success);
+ }
+}
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/characterdataindexsizeerrreplacedatacountnegative";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(characterdataindexsizeerrreplacedatacountnegative.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level1/core/characterdataindexsizeerrreplacedataoffsetgreater.java b/dom/src/test/java/org/w3c/domts/level1/core/characterdataindexsizeerrreplacedataoffsetgreater.java
new file mode 100644
index 0000000..feda16f
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level1/core/characterdataindexsizeerrreplacedataoffsetgreater.java
@@ -0,0 +1,104 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+Copyright (c) 2001-2003 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+*/
+
+package org.w3c.domts.level1.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The "replaceData(offset,count,arg)" method raises an
+ * INDEX_SIZE_ERR DOMException if the specified offset
+ * is greater than the length of the string.
+ *
+ * Retrieve the character data of the last child of the
+ * first employee and invoke its
+ * "replaceData(offset,count,arg) method with offset=40
+ * and count=3 and arg="ABC". It should raise the
+ * desired exception since the offset is greater than the
+ * length of the string.
+* @author NIST
+* @author Mary Brady
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-258A00AF')/constant[@name='INDEX_SIZE_ERR'])">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-258A00AF')/constant[@name='INDEX_SIZE_ERR'])</a>
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-7C603781">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-7C603781</a>
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-7C603781')/raises/exception[@name='DOMException']/descr/p[substring-before(.,':')='INDEX_SIZE_ERR'])">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-7C603781')/raises/exception[@name='DOMException']/descr/p[substring-before(.,':')='INDEX_SIZE_ERR'])</a>
+* @see <a href="http://www.w3.org/Bugs/Public/show_bug.cgi?id=249">http://www.w3.org/Bugs/Public/show_bug.cgi?id=249</a>
+*/
+public final class characterdataindexsizeerrreplacedataoffsetgreater extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public characterdataindexsizeerrreplacedataoffsetgreater(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "staff", true);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ NodeList elementList;
+ Node nameNode;
+ CharacterData child;
+ doc = (Document) load("staff", true);
+ elementList = doc.getElementsByTagName("address");
+ nameNode = elementList.item(0);
+ child = (CharacterData) nameNode.getFirstChild();
+
+ {
+ boolean success = false;
+ try {
+ child.replaceData(40, 3, "ABC");
+ } catch (DOMException ex) {
+ success = (ex.code == DOMException.INDEX_SIZE_ERR);
+ }
+ assertTrue("throw_INDEX_SIZE_ERR", success);
+ }
+}
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/characterdataindexsizeerrreplacedataoffsetgreater";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(characterdataindexsizeerrreplacedataoffsetgreater.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level1/core/characterdataindexsizeerrreplacedataoffsetnegative.java b/dom/src/test/java/org/w3c/domts/level1/core/characterdataindexsizeerrreplacedataoffsetnegative.java
new file mode 100644
index 0000000..f8aae5c
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level1/core/characterdataindexsizeerrreplacedataoffsetnegative.java
@@ -0,0 +1,109 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+Copyright (c) 2001 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+*/
+
+package org.w3c.domts.level1.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The "replaceData(offset,count,arg)" method raises an
+ * INDEX_SIZE_ERR DOMException if the specified offset
+ * is negative.
+ *
+ * Retrieve the character data of the last child of the
+ * first employee and invoke its
+ * "replaceData(offset,count,arg) method with offset=-5
+ * and count=3 and arg="ABC". It should raise the
+ * desired exception since the offset is negative.
+* @author NIST
+* @author Mary Brady
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-258A00AF')/constant[@name='INDEX_SIZE_ERR'])">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-258A00AF')/constant[@name='INDEX_SIZE_ERR'])</a>
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-E5CBA7FB">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-E5CBA7FB</a>
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-E5CBA7FB')/raises/exception[@name='DOMException']/descr/p[substring-before(.,':')='INDEX_SIZE_ERR'])">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-E5CBA7FB')/raises/exception[@name='DOMException']/descr/p[substring-before(.,':')='INDEX_SIZE_ERR'])</a>
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-E5CBA7FB">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-E5CBA7FB</a>
+*/
+public final class characterdataindexsizeerrreplacedataoffsetnegative extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public characterdataindexsizeerrreplacedataoffsetnegative(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+
+ org.w3c.domts.DocumentBuilderSetting[] settings =
+ new org.w3c.domts.DocumentBuilderSetting[] {
+org.w3c.domts.DocumentBuilderSetting.signed
+ };
+ DOMTestDocumentBuilderFactory testFactory = factory.newInstance(settings);
+ setFactory(testFactory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "staff", true);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ NodeList elementList;
+ Node nameNode;
+ CharacterData child;
+ doc = (Document) load("staff", true);
+ elementList = doc.getElementsByTagName("address");
+ nameNode = elementList.item(0);
+ child = (CharacterData) nameNode.getFirstChild();
+
+ {
+ boolean success = false;
+ try {
+ child.replaceData(-5, 3, "ABC");
+ } catch (DOMException ex) {
+ success = (ex.code == DOMException.INDEX_SIZE_ERR);
+ }
+ assertTrue("throws_INDEX_SIZE_ERR", success);
+ }
+}
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/characterdataindexsizeerrreplacedataoffsetnegative";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(characterdataindexsizeerrreplacedataoffsetnegative.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level1/core/characterdataindexsizeerrsubstringcountnegative.java b/dom/src/test/java/org/w3c/domts/level1/core/characterdataindexsizeerrsubstringcountnegative.java
new file mode 100644
index 0000000..c14d44a
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level1/core/characterdataindexsizeerrsubstringcountnegative.java
@@ -0,0 +1,108 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+Copyright (c) 2001 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+*/
+
+package org.w3c.domts.level1.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The "substringData(offset,count)" method raises an
+ * INDEX_SIZE_ERR DOMException if the specified count
+ * is negative.
+ *
+ * Retrieve the character data of the last child of the
+ * first employee and invoke its "substringData(offset,count)
+ * method with offset=10 and count=-3. It should raise the
+ * desired exception since the count is negative.
+* @author NIST
+* @author Mary Brady
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-258A00AF')/constant[@name='INDEX_SIZE_ERR'])">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-258A00AF')/constant[@name='INDEX_SIZE_ERR'])</a>
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-6531BCCF">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-6531BCCF</a>
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-6531BCCF')/raises/exception[@name='DOMException']/descr/p[substring-before(.,':')='INDEX_SIZE_ERR'])">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-6531BCCF')/raises/exception[@name='DOMException']/descr/p[substring-before(.,':')='INDEX_SIZE_ERR'])</a>
+*/
+public final class characterdataindexsizeerrsubstringcountnegative extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public characterdataindexsizeerrsubstringcountnegative(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+
+ org.w3c.domts.DocumentBuilderSetting[] settings =
+ new org.w3c.domts.DocumentBuilderSetting[] {
+org.w3c.domts.DocumentBuilderSetting.signed
+ };
+ DOMTestDocumentBuilderFactory testFactory = factory.newInstance(settings);
+ setFactory(testFactory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "staff", false);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ NodeList elementList;
+ Node nameNode;
+ CharacterData child;
+ String badSubstring;
+ doc = (Document) load("staff", false);
+ elementList = doc.getElementsByTagName("address");
+ nameNode = elementList.item(0);
+ child = (CharacterData) nameNode.getFirstChild();
+
+ {
+ boolean success = false;
+ try {
+ badSubstring = child.substringData(10, -3);
+ } catch (DOMException ex) {
+ success = (ex.code == DOMException.INDEX_SIZE_ERR);
+ }
+ assertTrue("throws_INDEX_SIZE_ERR", success);
+ }
+}
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/characterdataindexsizeerrsubstringcountnegative";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(characterdataindexsizeerrsubstringcountnegative.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level1/core/characterdataindexsizeerrsubstringnegativeoffset.java b/dom/src/test/java/org/w3c/domts/level1/core/characterdataindexsizeerrsubstringnegativeoffset.java
new file mode 100644
index 0000000..37fcea4
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level1/core/characterdataindexsizeerrsubstringnegativeoffset.java
@@ -0,0 +1,108 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+Copyright (c) 2001 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+*/
+
+package org.w3c.domts.level1.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The "substringData(offset,count)" method raises an
+ * INDEX_SIZE_ERR DOMException if the specified offset
+ * is negative.
+ *
+ * Retrieve the character data of the last child of the
+ * first employee and invoke its "substringData(offset,count)
+ * method with offset=-5 and count=3. It should raise the
+ * desired exception since the offset is negative.
+* @author NIST
+* @author Mary Brady
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-258A00AF')/constant[@name='INDEX_SIZE_ERR'])">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-258A00AF')/constant[@name='INDEX_SIZE_ERR'])</a>
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-6531BCCF">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-6531BCCF</a>
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-6531BCCF')/raises/exception[@name='DOMException']/descr/p[substring-before(.,':')='INDEX_SIZE_ERR'])">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-6531BCCF')/raises/exception[@name='DOMException']/descr/p[substring-before(.,':')='INDEX_SIZE_ERR'])</a>
+*/
+public final class characterdataindexsizeerrsubstringnegativeoffset extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public characterdataindexsizeerrsubstringnegativeoffset(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+
+ org.w3c.domts.DocumentBuilderSetting[] settings =
+ new org.w3c.domts.DocumentBuilderSetting[] {
+org.w3c.domts.DocumentBuilderSetting.signed
+ };
+ DOMTestDocumentBuilderFactory testFactory = factory.newInstance(settings);
+ setFactory(testFactory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "staff", false);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ NodeList elementList;
+ Node nameNode;
+ CharacterData child;
+ String badString;
+ doc = (Document) load("staff", false);
+ elementList = doc.getElementsByTagName("address");
+ nameNode = elementList.item(0);
+ child = (CharacterData) nameNode.getFirstChild();
+
+ {
+ boolean success = false;
+ try {
+ badString = child.substringData(-5, 3);
+ } catch (DOMException ex) {
+ success = (ex.code == DOMException.INDEX_SIZE_ERR);
+ }
+ assertTrue("throws_INDEX_SIZE_ERR", success);
+ }
+}
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/characterdataindexsizeerrsubstringnegativeoffset";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(characterdataindexsizeerrsubstringnegativeoffset.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level1/core/characterdataindexsizeerrsubstringoffsetgreater.java b/dom/src/test/java/org/w3c/domts/level1/core/characterdataindexsizeerrsubstringoffsetgreater.java
new file mode 100644
index 0000000..500c5eb
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level1/core/characterdataindexsizeerrsubstringoffsetgreater.java
@@ -0,0 +1,104 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+Copyright (c) 2001-2003 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+*/
+
+package org.w3c.domts.level1.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The "substringData(offset,count)" method raises an
+ * INDEX_SIZE_ERR DOMException if the specified offset
+ * is greater than the number of characters in the string.
+ *
+ * Retrieve the character data of the last child of the
+ * first employee and invoke its "substringData(offset,count)
+ * method with offset=40 and count=3. It should raise the
+ * desired exception since the offsets value is greater
+ * than the length.
+* @author NIST
+* @author Mary Brady
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-258A00AF')/constant[@name='INDEX_SIZE_ERR'])">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-258A00AF')/constant[@name='INDEX_SIZE_ERR'])</a>
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-6531BCCF">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-6531BCCF</a>
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-6531BCCF')/raises/exception[@name='DOMException']/descr/p[substring-before(.,':')='INDEX_SIZE_ERR'])">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-6531BCCF')/raises/exception[@name='DOMException']/descr/p[substring-before(.,':')='INDEX_SIZE_ERR'])</a>
+* @see <a href="http://www.w3.org/Bugs/Public/show_bug.cgi?id=249">http://www.w3.org/Bugs/Public/show_bug.cgi?id=249</a>
+*/
+public final class characterdataindexsizeerrsubstringoffsetgreater extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public characterdataindexsizeerrsubstringoffsetgreater(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "staff", false);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ NodeList elementList;
+ Node nameNode;
+ CharacterData child;
+ String badString;
+ doc = (Document) load("staff", false);
+ elementList = doc.getElementsByTagName("address");
+ nameNode = elementList.item(0);
+ child = (CharacterData) nameNode.getFirstChild();
+
+ {
+ boolean success = false;
+ try {
+ badString = child.substringData(40, 3);
+ } catch (DOMException ex) {
+ success = (ex.code == DOMException.INDEX_SIZE_ERR);
+ }
+ assertTrue("throw_INDEX_SIZE_ERR", success);
+ }
+}
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/characterdataindexsizeerrsubstringoffsetgreater";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(characterdataindexsizeerrsubstringoffsetgreater.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level1/core/characterdatainsertdatabeginning.java b/dom/src/test/java/org/w3c/domts/level1/core/characterdatainsertdatabeginning.java
new file mode 100644
index 0000000..9adb722
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level1/core/characterdatainsertdatabeginning.java
@@ -0,0 +1,94 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+Copyright (c) 2001 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+*/
+
+package org.w3c.domts.level1.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The "insertData(offset,arg)" method will insert a string
+ * at the specified character offset. Insert the data at
+ * the beginning of the character data.
+ * Retrieve the character data from the second child of
+ * the first employee. The "insertData(offset,arg)"
+ * method is then called with offset=0 and arg="Mss.".
+ * The method should insert the string "Mss." at position 0.
+ * The new value of the character data should be
+ * "Mss. Margaret Martin".
+* @author NIST
+* @author Mary Brady
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-3EDB695F">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-3EDB695F</a>
+*/
+public final class characterdatainsertdatabeginning extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public characterdatainsertdatabeginning(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "staff", true);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ NodeList elementList;
+ Node nameNode;
+ CharacterData child;
+ String childData;
+ doc = (Document) load("staff", true);
+ elementList = doc.getElementsByTagName("name");
+ nameNode = elementList.item(0);
+ child = (CharacterData) nameNode.getFirstChild();
+ child.insertData(0, "Mss. ");
+ childData = child.getData();
+ assertEquals("characterdataInsertDataBeginningAssert", "Mss. Margaret Martin", childData);
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/characterdatainsertdatabeginning";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(characterdatainsertdatabeginning.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level1/core/characterdatainsertdataend.java b/dom/src/test/java/org/w3c/domts/level1/core/characterdatainsertdataend.java
new file mode 100644
index 0000000..b3052c6
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level1/core/characterdatainsertdataend.java
@@ -0,0 +1,96 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+Copyright (c) 2001 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+*/
+
+package org.w3c.domts.level1.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The "insertData(offset,arg)" method will insert a string
+ * at the specified character offset. Insert the data at
+ * the end of the character data.
+ *
+ * Retrieve the character data from the second child of
+ * the first employee. The "insertData(offset,arg)"
+ * method is then called with offset=15 and arg=", Esquire".
+ * The method should insert the string ", Esquire" at
+ * position 15. The new value of the character data should
+ * be "Margaret Martin, Esquire".
+* @author NIST
+* @author Mary Brady
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-72AB8359">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-72AB8359</a>
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-3EDB695F">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-3EDB695F</a>
+*/
+public final class characterdatainsertdataend extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public characterdatainsertdataend(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "staff", true);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ NodeList elementList;
+ Node nameNode;
+ CharacterData child;
+ String childData;
+ doc = (Document) load("staff", true);
+ elementList = doc.getElementsByTagName("name");
+ nameNode = elementList.item(0);
+ child = (CharacterData) nameNode.getFirstChild();
+ child.insertData(15, ", Esquire");
+ childData = child.getData();
+ assertEquals("characterdataInsertDataEndAssert", "Margaret Martin, Esquire", childData);
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/characterdatainsertdataend";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(characterdatainsertdataend.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level1/core/characterdatainsertdatamiddle.java b/dom/src/test/java/org/w3c/domts/level1/core/characterdatainsertdatamiddle.java
new file mode 100644
index 0000000..9f65168
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level1/core/characterdatainsertdatamiddle.java
@@ -0,0 +1,96 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+Copyright (c) 2001 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+*/
+
+package org.w3c.domts.level1.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The "insertData(offset,arg)" method will insert a string
+ * at the specified character offset. Insert the data in
+ * the middle of the character data.
+ *
+ * Retrieve the character data from the second child of
+ * the first employee. The "insertData(offset,arg)"
+ * method is then called with offset=9 and arg="Ann".
+ * The method should insert the string "Ann" at position 9.
+ * The new value of the character data should be
+ * "Margaret Ann Martin".
+* @author NIST
+* @author Mary Brady
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-72AB8359">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-72AB8359</a>
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-3EDB695F">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-3EDB695F</a>
+*/
+public final class characterdatainsertdatamiddle extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public characterdatainsertdatamiddle(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "staff", true);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ NodeList elementList;
+ Node nameNode;
+ CharacterData child;
+ String childData;
+ doc = (Document) load("staff", true);
+ elementList = doc.getElementsByTagName("name");
+ nameNode = elementList.item(0);
+ child = (CharacterData) nameNode.getFirstChild();
+ child.insertData(9, "Ann ");
+ childData = child.getData();
+ assertEquals("characterdataInsertDataMiddleAssert", "Margaret Ann Martin", childData);
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/characterdatainsertdatamiddle";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(characterdatainsertdatamiddle.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level1/core/characterdatainsertdatanomodificationallowederr.java b/dom/src/test/java/org/w3c/domts/level1/core/characterdatainsertdatanomodificationallowederr.java
new file mode 100644
index 0000000..f2f23a6
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level1/core/characterdatainsertdatanomodificationallowederr.java
@@ -0,0 +1,114 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+Copyright (c) 2001-2004 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+*/
+
+package org.w3c.domts.level1.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The "insertData(offset,arg)" method raises a NO_MODIFICATION_ALLOWED_ERR
+ * DOMException if the node is readonly.
+ * Obtain the children of the THIRD "gender" element. The elements
+ * content is an entity reference. Get the FIRST item
+ * from the entity reference and execute the "insertData(offset,arg)" method.
+ * This causes a NO_MODIFICATION_ALLOWED_ERR DOMException to be thrown.
+* @author NIST
+* @author Mary Brady
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-258A00AF')/constant[@name='NO_MODIFICATION_ALLOWED_ERR'])">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-258A00AF')/constant[@name='NO_MODIFICATION_ALLOWED_ERR'])</a>
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-3EDB695F">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-3EDB695F</a>
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-3EDB695F')/raises/exception[@name='DOMException']/descr/p[substring-before(.,':')='NO_MODIFICATION_ALLOWED_ERR'])">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-3EDB695F')/raises/exception[@name='DOMException']/descr/p[substring-before(.,':')='NO_MODIFICATION_ALLOWED_ERR'])</a>
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-3EDB695F">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-3EDB695F</a>
+*/
+public final class characterdatainsertdatanomodificationallowederr extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public characterdatainsertdatanomodificationallowederr(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "staff", true);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ NodeList genderList;
+ Node genderNode;
+ Node entElement;
+ int nodeType;
+ Node entElementContent;
+ Node entReference;
+ doc = (Document) load("staff", true);
+ genderList = doc.getElementsByTagName("gender");
+ genderNode = genderList.item(2);
+ entReference = genderNode.getFirstChild();
+ assertNotNull("entReferenceNotNull", entReference);
+ nodeType = (int) entReference.getNodeType();
+
+ if (equals(1, nodeType)) {
+ entReference = doc.createEntityReference("ent4");
+ assertNotNull("createdEntRefNotNull", entReference);
+ }
+ entElement = entReference.getFirstChild();
+ assertNotNull("entElementNotNull", entElement);
+ entElementContent = entElement.getFirstChild();
+ assertNotNull("entElementContentNotNull", entElementContent);
+
+ {
+ boolean success = false;
+ try {
+ ((CharacterData) /*Node */entElementContent).insertData(1, "newArg");
+ } catch (DOMException ex) {
+ success = (ex.code == DOMException.NO_MODIFICATION_ALLOWED_ERR);
+ }
+ assertTrue("throw_NO_MODIFICATION_ALLOWED_ERR", success);
+ }
+}
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/characterdatainsertdatanomodificationallowederr";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(characterdatainsertdatanomodificationallowederr.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level1/core/characterdatainsertdatanomodificationallowederrEE.java b/dom/src/test/java/org/w3c/domts/level1/core/characterdatainsertdatanomodificationallowederrEE.java
new file mode 100644
index 0000000..82ca7ee
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level1/core/characterdatainsertdatanomodificationallowederrEE.java
@@ -0,0 +1,99 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+Copyright (c) 2001-2004 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+*/
+
+package org.w3c.domts.level1.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * Create an ent3 entity reference and call insertData on a text child, should thrown a NO_MODIFICATION_ALLOWED_ERR.
+* @author Curt Arnold
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-258A00AF')/constant[@name='NO_MODIFICATION_ALLOWED_ERR'])">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-258A00AF')/constant[@name='NO_MODIFICATION_ALLOWED_ERR'])</a>
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-3EDB695F">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-3EDB695F</a>
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-3EDB695F')/raises/exception[@name='DOMException']/descr/p[substring-before(.,':')='NO_MODIFICATION_ALLOWED_ERR'])">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-3EDB695F')/raises/exception[@name='DOMException']/descr/p[substring-before(.,':')='NO_MODIFICATION_ALLOWED_ERR'])</a>
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-3EDB695F">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-3EDB695F</a>
+* @see <a href="http://www.w3.org/2001/DOM-Test-Suite/level1/core/characterdatainsertdatanomodificationallowederr.xml">http://www.w3.org/2001/DOM-Test-Suite/level1/core/characterdatainsertdatanomodificationallowederr.xml</a>
+*/
+public final class characterdatainsertdatanomodificationallowederrEE extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public characterdatainsertdatanomodificationallowederrEE(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "staff", true);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ NodeList genderList;
+ Node genderNode;
+ CharacterData entText;
+ EntityReference entReference;
+ doc = (Document) load("staff", true);
+ genderList = doc.getElementsByTagName("gender");
+ genderNode = genderList.item(2);
+ entReference = doc.createEntityReference("ent3");
+ assertNotNull("createdEntRefNotNull", entReference);
+ entText = (CharacterData) entReference.getFirstChild();
+ assertNotNull("entTextNotNull", entText);
+
+ {
+ boolean success = false;
+ try {
+ entText.insertData(1, "newArg");
+ } catch (DOMException ex) {
+ success = (ex.code == DOMException.NO_MODIFICATION_ALLOWED_ERR);
+ }
+ assertTrue("throw_NO_MODIFICATION_ALLOWED_ERR", success);
+ }
+}
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/characterdatainsertdatanomodificationallowederrEE";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(characterdatainsertdatanomodificationallowederrEE.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level1/core/characterdatareplacedatabegining.java b/dom/src/test/java/org/w3c/domts/level1/core/characterdatareplacedatabegining.java
new file mode 100644
index 0000000..33fa988
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level1/core/characterdatareplacedatabegining.java
@@ -0,0 +1,94 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+Copyright (c) 2001 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+*/
+
+package org.w3c.domts.level1.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The "replaceData(offset,count,arg)" method replaces the
+ * characters starting at the specified offset with the
+ * specified string. Test for replacement in the
+ * middle of the data.
+ * Retrieve the character data from the last child of the
+ * first employee. The "replaceData(offset,count,arg)"
+ * method is then called with offset=5 and count=5 and
+ * arg="South". The method should replace characters five
+ * thru 9 of the character data with "South".
+* @author NIST
+* @author Mary Brady
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-E5CBA7FB">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-E5CBA7FB</a>
+*/
+public final class characterdatareplacedatabegining extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public characterdatareplacedatabegining(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "staff", true);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ NodeList elementList;
+ Node nameNode;
+ CharacterData child;
+ String childData;
+ doc = (Document) load("staff", true);
+ elementList = doc.getElementsByTagName("address");
+ nameNode = elementList.item(0);
+ child = (CharacterData) nameNode.getFirstChild();
+ child.replaceData(0, 4, "2500");
+ childData = child.getData();
+ assertEquals("characterdataReplaceDataBeginingAssert", "2500 North Ave. Dallas, Texas 98551", childData);
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/characterdatareplacedatabegining";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(characterdatareplacedatabegining.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level1/core/characterdatareplacedataend.java b/dom/src/test/java/org/w3c/domts/level1/core/characterdatareplacedataend.java
new file mode 100644
index 0000000..59e2f87
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level1/core/characterdatareplacedataend.java
@@ -0,0 +1,96 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+Copyright (c) 2001 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+*/
+
+package org.w3c.domts.level1.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The "replaceData(offset,count,arg)" method replaces the
+ * characters starting at the specified offset with the
+ * specified string. Test for replacement at the
+ * end of the data.
+ *
+ * Retrieve the character data from the last child of the
+ * first employee. The "replaceData(offset,count,arg)"
+ * method is then called with offset=30 and count=5 and
+ * arg="98665". The method should replace characters 30
+ * thru 34 of the character data with "98665".
+* @author NIST
+* @author Mary Brady
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-72AB8359">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-72AB8359</a>
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-E5CBA7FB">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-E5CBA7FB</a>
+*/
+public final class characterdatareplacedataend extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public characterdatareplacedataend(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "staff", true);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ NodeList elementList;
+ Node nameNode;
+ CharacterData child;
+ String childData;
+ doc = (Document) load("staff", true);
+ elementList = doc.getElementsByTagName("address");
+ nameNode = elementList.item(0);
+ child = (CharacterData) nameNode.getFirstChild();
+ child.replaceData(30, 5, "98665");
+ childData = child.getData();
+ assertEquals("characterdataReplaceDataEndAssert", "1230 North Ave. Dallas, Texas 98665", childData);
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/characterdatareplacedataend";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(characterdatareplacedataend.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level1/core/characterdatareplacedataexceedslengthofarg.java b/dom/src/test/java/org/w3c/domts/level1/core/characterdatareplacedataexceedslengthofarg.java
new file mode 100644
index 0000000..2025be4
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level1/core/characterdatareplacedataexceedslengthofarg.java
@@ -0,0 +1,97 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+Copyright (c) 2001 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+*/
+
+package org.w3c.domts.level1.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The "replaceData(offset,count,arg)" method replaces the
+ * characters starting at the specified offset with the
+ * specified string. Test the situation where the length
+ * of the arg string is greater than the specified offset.
+ *
+ * Retrieve the character data from the last child of the
+ * first employee. The "replaceData(offset,count,arg)"
+ * method is then called with offset=0 and count=4 and
+ * arg="260030". The method should replace characters one
+ * thru four with "260030". Note that the length of the
+ * specified string is greater that the specified offset.
+* @author NIST
+* @author Mary Brady
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-72AB8359">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-72AB8359</a>
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-E5CBA7FB">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-E5CBA7FB</a>
+*/
+public final class characterdatareplacedataexceedslengthofarg extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public characterdatareplacedataexceedslengthofarg(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "staff", true);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ NodeList elementList;
+ Node nameNode;
+ CharacterData child;
+ String childData;
+ doc = (Document) load("staff", true);
+ elementList = doc.getElementsByTagName("address");
+ nameNode = elementList.item(0);
+ child = (CharacterData) nameNode.getFirstChild();
+ child.replaceData(0, 4, "260030");
+ childData = child.getData();
+ assertEquals("characterdataReplaceDataExceedsLengthOfArgAssert", "260030 North Ave. Dallas, Texas 98551", childData);
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/characterdatareplacedataexceedslengthofarg";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(characterdatareplacedataexceedslengthofarg.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level1/core/characterdatareplacedataexceedslengthofdata.java b/dom/src/test/java/org/w3c/domts/level1/core/characterdatareplacedataexceedslengthofdata.java
new file mode 100644
index 0000000..5794f11
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level1/core/characterdatareplacedataexceedslengthofdata.java
@@ -0,0 +1,95 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+Copyright (c) 2001 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+*/
+
+package org.w3c.domts.level1.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * If the sum of the offset and count exceeds the length then
+ * all the characters to the end of the data are replaced.
+ *
+ * Retrieve the character data from the last child of the
+ * first employee. The "replaceData(offset,count,arg)"
+ * method is then called with offset=0 and count=50 and
+ * arg="2600". The method should replace all the characters
+ * with "2600". This is because the sum of the offset and
+ * count exceeds the length of the character data.
+* @author NIST
+* @author Mary Brady
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-72AB8359">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-72AB8359</a>
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-E5CBA7FB">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-E5CBA7FB</a>
+*/
+public final class characterdatareplacedataexceedslengthofdata extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public characterdatareplacedataexceedslengthofdata(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "staff", true);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ NodeList elementList;
+ Node nameNode;
+ CharacterData child;
+ String childData;
+ doc = (Document) load("staff", true);
+ elementList = doc.getElementsByTagName("address");
+ nameNode = elementList.item(0);
+ child = (CharacterData) nameNode.getFirstChild();
+ child.replaceData(0, 50, "2600");
+ childData = child.getData();
+ assertEquals("characterdataReplaceDataExceedsLengthOfDataAssert", "2600", childData);
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/characterdatareplacedataexceedslengthofdata";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(characterdatareplacedataexceedslengthofdata.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level1/core/characterdatareplacedatamiddle.java b/dom/src/test/java/org/w3c/domts/level1/core/characterdatareplacedatamiddle.java
new file mode 100644
index 0000000..0a168e6
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level1/core/characterdatareplacedatamiddle.java
@@ -0,0 +1,96 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+Copyright (c) 2001 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+*/
+
+package org.w3c.domts.level1.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The "replaceData(offset,count,arg)" method replaces the
+ * characters starting at the specified offset with the
+ * specified string. Test for replacement in the
+ * middle of the data.
+ *
+ * Retrieve the character data from the last child of the
+ * first employee. The "replaceData(offset,count,arg)"
+ * method is then called with offset=5 and count=5 and
+ * arg="South". The method should replace characters five
+ * thru 9 of the character data with "South".
+* @author NIST
+* @author Mary Brady
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-72AB8359">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-72AB8359</a>
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-E5CBA7FB">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-E5CBA7FB</a>
+*/
+public final class characterdatareplacedatamiddle extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public characterdatareplacedatamiddle(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "staff", true);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ NodeList elementList;
+ Node nameNode;
+ CharacterData child;
+ String childData;
+ doc = (Document) load("staff", true);
+ elementList = doc.getElementsByTagName("address");
+ nameNode = elementList.item(0);
+ child = (CharacterData) nameNode.getFirstChild();
+ child.replaceData(5, 5, "South");
+ childData = child.getData();
+ assertEquals("characterdataReplaceDataMiddleAssert", "1230 South Ave. Dallas, Texas 98551", childData);
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/characterdatareplacedatamiddle";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(characterdatareplacedatamiddle.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level1/core/characterdatareplacedatanomodificationallowederr.java b/dom/src/test/java/org/w3c/domts/level1/core/characterdatareplacedatanomodificationallowederr.java
new file mode 100644
index 0000000..6176d3b
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level1/core/characterdatareplacedatanomodificationallowederr.java
@@ -0,0 +1,115 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+Copyright (c) 2001-2004 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+*/
+
+package org.w3c.domts.level1.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The "replaceData(offset,count,arg)" method raises a NO_MODIFICATION_ALLOWED_ERR
+ * DOMException if the node is readonly.
+ *
+ * Obtain the children of the THIRD "gender" element. The elements
+ * content is an entity reference. Get the FIRST item
+ * from the entity reference and execute the "replaceData(offset,count,arg)" method.
+ * This causes a NO_MODIFICATION_ALLOWED_ERR DOMException to be thrown.
+* @author NIST
+* @author Mary Brady
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-258A00AF')/constant[@name='NO_MODIFICATION_ALLOWED_ERR'])">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-258A00AF')/constant[@name='NO_MODIFICATION_ALLOWED_ERR'])</a>
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-E5CBA7FB">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-E5CBA7FB</a>
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-E5CBA7FB')/raises/exception[@name='DOMException']/descr/p[substring-before(.,':')='NO_MODIFICATION_ALLOWED_ERR'])">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-E5CBA7FB')/raises/exception[@name='DOMException']/descr/p[substring-before(.,':')='NO_MODIFICATION_ALLOWED_ERR'])</a>
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-E5CBA7FB">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-E5CBA7FB</a>
+*/
+public final class characterdatareplacedatanomodificationallowederr extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public characterdatareplacedatanomodificationallowederr(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "staff", true);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ NodeList genderList;
+ Node genderNode;
+ Node entElement;
+ Node entElementContent;
+ Node entReference;
+ int nodeType;
+ doc = (Document) load("staff", true);
+ genderList = doc.getElementsByTagName("gender");
+ genderNode = genderList.item(2);
+ entReference = genderNode.getFirstChild();
+ assertNotNull("entReferenceNotNull", entReference);
+ nodeType = (int) entReference.getNodeType();
+
+ if (equals(1, nodeType)) {
+ entReference = doc.createEntityReference("ent4");
+ assertNotNull("createdEntRefNotNull", entReference);
+ }
+ entElement = entReference.getFirstChild();
+ assertNotNull("entElementNotNull", entElement);
+ entElementContent = entElement.getFirstChild();
+ assertNotNull("entElementContentNotNull", entElementContent);
+
+ {
+ boolean success = false;
+ try {
+ ((CharacterData) /*Node */entElementContent).replaceData(1, 3, "newArg");
+ } catch (DOMException ex) {
+ success = (ex.code == DOMException.NO_MODIFICATION_ALLOWED_ERR);
+ }
+ assertTrue("throw_NO_MODIFICATION_ALLOWED_ERR", success);
+ }
+}
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/characterdatareplacedatanomodificationallowederr";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(characterdatareplacedatanomodificationallowederr.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level1/core/characterdatareplacedatanomodificationallowederrEE.java b/dom/src/test/java/org/w3c/domts/level1/core/characterdatareplacedatanomodificationallowederrEE.java
new file mode 100644
index 0000000..30d7efd
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level1/core/characterdatareplacedatanomodificationallowederrEE.java
@@ -0,0 +1,101 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+Copyright (c) 2001-2004 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+*/
+
+package org.w3c.domts.level1.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * Create an ent3 entity reference and call replaceData on a text child, should thrown a NO_MODIFICATION_ALLOWED_ERR.
+* @author Curt Arnold
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-258A00AF')/constant[@name='NO_MODIFICATION_ALLOWED_ERR'])">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-258A00AF')/constant[@name='NO_MODIFICATION_ALLOWED_ERR'])</a>
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-E5CBA7FB">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-E5CBA7FB</a>
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-E5CBA7FB')/raises/exception[@name='DOMException']/descr/p[substring-before(.,':')='NO_MODIFICATION_ALLOWED_ERR'])">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-E5CBA7FB')/raises/exception[@name='DOMException']/descr/p[substring-before(.,':')='NO_MODIFICATION_ALLOWED_ERR'])</a>
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-E5CBA7FB">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-E5CBA7FB</a>
+* @see <a href="http://www.w3.org/2001/DOM-Test-Suite/level1/core/characterdatareplacedatanomodificationallowederr.xml">http://www.w3.org/2001/DOM-Test-Suite/level1/core/characterdatareplacedatanomodificationallowederr.xml</a>
+*/
+public final class characterdatareplacedatanomodificationallowederrEE extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public characterdatareplacedatanomodificationallowederrEE(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "staff", true);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ NodeList genderList;
+ Node genderNode;
+ CharacterData entText;
+ EntityReference entReference;
+ Node appendedNode;
+ doc = (Document) load("staff", true);
+ genderList = doc.getElementsByTagName("gender");
+ genderNode = genderList.item(2);
+ entReference = doc.createEntityReference("ent3");
+ assertNotNull("createdEntRefNotNull", entReference);
+ appendedNode = genderNode.appendChild(entReference);
+ entText = (CharacterData) entReference.getFirstChild();
+ assertNotNull("entTextNotNull", entText);
+
+ {
+ boolean success = false;
+ try {
+ entText.replaceData(1, 3, "newArg");
+ } catch (DOMException ex) {
+ success = (ex.code == DOMException.NO_MODIFICATION_ALLOWED_ERR);
+ }
+ assertTrue("throw_NO_MODIFICATION_ALLOWED_ERR", success);
+ }
+}
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/characterdatareplacedatanomodificationallowederrEE";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(characterdatareplacedatanomodificationallowederrEE.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level1/core/characterdatasetdatanomodificationallowederr.java b/dom/src/test/java/org/w3c/domts/level1/core/characterdatasetdatanomodificationallowederr.java
new file mode 100644
index 0000000..ce7898c
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level1/core/characterdatasetdatanomodificationallowederr.java
@@ -0,0 +1,114 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+Copyright (c) 2001-2004 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+*/
+
+package org.w3c.domts.level1.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The "setData(data)" method raises a NO_MODIFICATION_ALLOWED_ERR
+ * DOMException if the node is readonly.
+ * Obtain the children of the THIRD "gender" element. The elements
+ * content is an entity reference. Get the FIRST item
+ * from the entity reference and execute the "setData(data)" method.
+ * This causes a NO_MODIFICATION_ALLOWED_ERR DOMException to be thrown.
+* @author NIST
+* @author Mary Brady
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-258A00AF')/constant[@name='NO_MODIFICATION_ALLOWED_ERR'])">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-258A00AF')/constant[@name='NO_MODIFICATION_ALLOWED_ERR'])</a>
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-72AB8359">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-72AB8359</a>
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-72AB8359')/setraises/exception[@name='DOMException']/descr/p[substring-before(.,':')='NO_MODIFICATION_ALLOWED_ERR'])">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-72AB8359')/setraises/exception[@name='DOMException']/descr/p[substring-before(.,':')='NO_MODIFICATION_ALLOWED_ERR'])</a>
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-72AB8359">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-72AB8359</a>
+*/
+public final class characterdatasetdatanomodificationallowederr extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public characterdatasetdatanomodificationallowederr(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "staff", true);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ NodeList genderList;
+ Node genderNode;
+ Node entElement;
+ Node entElementContent;
+ Node entReference;
+ int nodeType;
+ doc = (Document) load("staff", true);
+ genderList = doc.getElementsByTagName("gender");
+ genderNode = genderList.item(2);
+ entReference = genderNode.getFirstChild();
+ assertNotNull("entReferenceNotNull", entReference);
+ nodeType = (int) entReference.getNodeType();
+
+ if (equals(1, nodeType)) {
+ entReference = doc.createEntityReference("ent4");
+ assertNotNull("createdEntRefNotNull", entReference);
+ }
+ entElement = entReference.getFirstChild();
+ assertNotNull("entElementNotNull", entElement);
+ entElementContent = entElement.getFirstChild();
+ assertNotNull("entElementContentNotNull", entElementContent);
+
+ {
+ boolean success = false;
+ try {
+ ((CharacterData) /*Node */entElementContent).setData("newData");
+ } catch (DOMException ex) {
+ success = (ex.code == DOMException.NO_MODIFICATION_ALLOWED_ERR);
+ }
+ assertTrue("throw_NO_MODIFICATION_ALLOWED_ERR", success);
+ }
+}
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/characterdatasetdatanomodificationallowederr";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(characterdatasetdatanomodificationallowederr.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level1/core/characterdatasetdatanomodificationallowederrEE.java b/dom/src/test/java/org/w3c/domts/level1/core/characterdatasetdatanomodificationallowederrEE.java
new file mode 100644
index 0000000..2db63a9
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level1/core/characterdatasetdatanomodificationallowederrEE.java
@@ -0,0 +1,99 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+Copyright (c) 2001-2004 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+*/
+
+package org.w3c.domts.level1.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * Create an ent3 entity reference and call setData on a text child, should thrown a NO_MODIFICATION_ALLOWED_ERR.
+* @author Curt Arnold
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-258A00AF')/constant[@name='NO_MODIFICATION_ALLOWED_ERR'])">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-258A00AF')/constant[@name='NO_MODIFICATION_ALLOWED_ERR'])</a>
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-72AB8359">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-72AB8359</a>
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-72AB8359')/setraises/exception[@name='DOMException']/descr/p[substring-before(.,':')='NO_MODIFICATION_ALLOWED_ERR'])">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-72AB8359')/setraises/exception[@name='DOMException']/descr/p[substring-before(.,':')='NO_MODIFICATION_ALLOWED_ERR'])</a>
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-72AB8359">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-72AB8359</a>
+* @see <a href="http://www.w3.org/2001/DOM-Test-Suite/level1/core/characterdatasetdatanomodificationallowederr.xml">http://www.w3.org/2001/DOM-Test-Suite/level1/core/characterdatasetdatanomodificationallowederr.xml</a>
+*/
+public final class characterdatasetdatanomodificationallowederrEE extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public characterdatasetdatanomodificationallowederrEE(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "staff", true);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ NodeList genderList;
+ Node genderNode;
+ Node entText;
+ EntityReference entReference;
+ doc = (Document) load("staff", true);
+ genderList = doc.getElementsByTagName("gender");
+ genderNode = genderList.item(4);
+ entReference = doc.createEntityReference("ent3");
+ assertNotNull("createdEntRefNotNull", entReference);
+ entText = entReference.getFirstChild();
+ assertNotNull("entTextNotNull", entText);
+
+ {
+ boolean success = false;
+ try {
+ ((CharacterData) /*Node */entText).setData("newData");
+ } catch (DOMException ex) {
+ success = (ex.code == DOMException.NO_MODIFICATION_ALLOWED_ERR);
+ }
+ assertTrue("throw_NO_MODIFICATION_ALLOWED_ERR", success);
+ }
+}
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/characterdatasetdatanomodificationallowederrEE";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(characterdatasetdatanomodificationallowederrEE.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level1/core/characterdatasetnodevalue.java b/dom/src/test/java/org/w3c/domts/level1/core/characterdatasetnodevalue.java
new file mode 100644
index 0000000..bb5dfeb
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level1/core/characterdatasetnodevalue.java
@@ -0,0 +1,92 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+Copyright (c) 2001 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+*/
+
+package org.w3c.domts.level1.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The "setNodeValue()" method changes the character data
+ * currently stored in the node.
+ * Retrieve the character data from the second child
+ * of the first employee and invoke the "setNodeValue()"
+ * method, call "getData()" and compare.
+* @author Curt Arnold
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-72AB8359">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-72AB8359</a>
+*/
+public final class characterdatasetnodevalue extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public characterdatasetnodevalue(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "staff", true);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ NodeList elementList;
+ Node nameNode;
+ CharacterData child;
+ String childData;
+ String childValue;
+ doc = (Document) load("staff", true);
+ elementList = doc.getElementsByTagName("name");
+ nameNode = elementList.item(0);
+ child = (CharacterData) nameNode.getFirstChild();
+ child.setNodeValue("Marilyn Martin");
+ childData = child.getData();
+ assertEquals("data", "Marilyn Martin", childData);
+ childValue = child.getNodeValue();
+ assertEquals("value", "Marilyn Martin", childValue);
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/characterdatasetnodevalue";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(characterdatasetnodevalue.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level1/core/characterdatasubstringexceedsvalue.java b/dom/src/test/java/org/w3c/domts/level1/core/characterdatasubstringexceedsvalue.java
new file mode 100644
index 0000000..7ee0b8f
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level1/core/characterdatasubstringexceedsvalue.java
@@ -0,0 +1,94 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+Copyright (c) 2001 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+*/
+
+package org.w3c.domts.level1.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * If the sum of the "offset" and "count" exceeds the
+ * "length" then the "substringData(offset,count)" method
+ * returns all the characters to the end of the data.
+ *
+ * Retrieve the character data from the second child
+ * of the first employee and access part of the data
+ * by using the substringData(offset,count) method
+ * with offset=9 and count=10. The method should return
+ * the substring "Martin" since offset+count > length
+ * (19 > 15).
+* @author NIST
+* @author Mary Brady
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-6531BCCF">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-6531BCCF</a>
+*/
+public final class characterdatasubstringexceedsvalue extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public characterdatasubstringexceedsvalue(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "staff", false);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ NodeList elementList;
+ Node nameNode;
+ CharacterData child;
+ String substring;
+ doc = (Document) load("staff", false);
+ elementList = doc.getElementsByTagName("name");
+ nameNode = elementList.item(0);
+ child = (CharacterData) nameNode.getFirstChild();
+ substring = child.substringData(9, 10);
+ assertEquals("characterdataSubStringExceedsValueAssert", "Martin", substring);
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/characterdatasubstringexceedsvalue";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(characterdatasubstringexceedsvalue.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level1/core/characterdatasubstringvalue.java b/dom/src/test/java/org/w3c/domts/level1/core/characterdatasubstringvalue.java
new file mode 100644
index 0000000..46e712c
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level1/core/characterdatasubstringvalue.java
@@ -0,0 +1,93 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+Copyright (c) 2001 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+*/
+
+package org.w3c.domts.level1.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The "substringData(offset,count)" method returns the
+ * specified string.
+ *
+ * Retrieve the character data from the second child
+ * of the first employee and access part of the data
+ * by using the substringData(offset,count) method. The
+ * method should return the specified substring starting
+ * at position "offset" and extract "count" characters.
+ * The method should return the string "Margaret".
+* @author NIST
+* @author Mary Brady
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-6531BCCF">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-6531BCCF</a>
+*/
+public final class characterdatasubstringvalue extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public characterdatasubstringvalue(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "staff", false);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ NodeList elementList;
+ Node nameNode;
+ CharacterData child;
+ String substring;
+ doc = (Document) load("staff", false);
+ elementList = doc.getElementsByTagName("name");
+ nameNode = elementList.item(0);
+ child = (CharacterData) nameNode.getFirstChild();
+ substring = child.substringData(0, 8);
+ assertEquals("characterdataSubStringValueAssert", "Margaret", substring);
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/characterdatasubstringvalue";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(characterdatasubstringvalue.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level1/core/commentgetcomment.java b/dom/src/test/java/org/w3c/domts/level1/core/commentgetcomment.java
new file mode 100644
index 0000000..66eb212
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level1/core/commentgetcomment.java
@@ -0,0 +1,102 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+Copyright (c) 2001 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+*/
+
+package org.w3c.domts.level1.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * A comment is all the characters between the starting
+ * '<!--' and ending '-->'
+ * Retrieve the nodes of the DOM document. Search for a
+ * comment node and the content is its value.
+* @author NIST
+* @author Mary Brady
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-1334481328">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-1334481328</a>
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-F68D095">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-F68D095</a>
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-F68D080">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-F68D080</a>
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-111237558">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-111237558</a>
+*/
+public final class commentgetcomment extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public commentgetcomment(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "staff", false);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ NodeList elementList;
+ Node child;
+ String childName;
+ String childValue;
+ int commentCount = 0;
+ int childType;
+ doc = (Document) load("staff", false);
+ elementList = doc.getChildNodes();
+ for (int indexN10057 = 0; indexN10057 < elementList.getLength(); indexN10057++) {
+ child = (Node) elementList.item(indexN10057);
+ childType = (int) child.getNodeType();
+
+ if (equals(8, childType)) {
+ childName = child.getNodeName();
+ assertEquals("nodeName", "#comment", childName);
+ childValue = child.getNodeValue();
+ assertEquals("nodeValue", " This is comment number 1.", childValue);
+ commentCount = commentCount + 1;
+ }
+ }
+ assertEquals("commentCount", 1, commentCount);
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/commentgetcomment";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(commentgetcomment.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level1/core/documentcreateattribute.java b/dom/src/test/java/org/w3c/domts/level1/core/documentcreateattribute.java
new file mode 100644
index 0000000..5b7f528
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level1/core/documentcreateattribute.java
@@ -0,0 +1,94 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+Copyright (c) 2001 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+*/
+
+package org.w3c.domts.level1.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The "createAttribute(name)" method creates an Attribute
+ * node of the given name.
+ *
+ * Retrieve the entire DOM document and invoke its
+ * "createAttribute(name)" method. It should create a
+ * new Attribute node with the given name. The name, value
+ * and type of the newly created object are retrieved and
+ * output.
+* @author NIST
+* @author Mary Brady
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-1084891198">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-1084891198</a>
+*/
+public final class documentcreateattribute extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public documentcreateattribute(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "staff", true);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ Attr newAttrNode;
+ String attrValue;
+ String attrName;
+ int attrType;
+ doc = (Document) load("staff", true);
+ newAttrNode = doc.createAttribute("district");
+ attrValue = newAttrNode.getNodeValue();
+ assertEquals("value", "", attrValue);
+ attrName = newAttrNode.getNodeName();
+ assertEquals("name", "district", attrName);
+ attrType = (int) newAttrNode.getNodeType();
+ assertEquals("type", 2, attrType);
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/documentcreateattribute";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(documentcreateattribute.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level1/core/documentcreatecdatasection.java b/dom/src/test/java/org/w3c/domts/level1/core/documentcreatecdatasection.java
new file mode 100644
index 0000000..412341e
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level1/core/documentcreatecdatasection.java
@@ -0,0 +1,93 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+Copyright (c) 2001-2004 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+*/
+
+package org.w3c.domts.level1.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The "createCDATASection(data)" method creates a new
+ * CDATASection node whose value is the specified string.
+ * Retrieve the entire DOM document and invoke its
+ * "createCDATASection(data)" method. It should create a
+ * new CDATASection node whose "data" is the specified
+ * string. The content, name and type are retrieved and
+ * output.
+* @author NIST
+* @author Mary Brady
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-D26C0AF8">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-D26C0AF8</a>
+*/
+public final class documentcreatecdatasection extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public documentcreatecdatasection(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "staff", true);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ CDATASection newCDATASectionNode;
+ String newCDATASectionValue;
+ String newCDATASectionName;
+ int newCDATASectionType;
+ doc = (Document) load("staff", true);
+ newCDATASectionNode = doc.createCDATASection("This is a new CDATASection node");
+ newCDATASectionValue = newCDATASectionNode.getNodeValue();
+ assertEquals("nodeValue", "This is a new CDATASection node", newCDATASectionValue);
+ newCDATASectionName = newCDATASectionNode.getNodeName();
+ assertEquals("nodeName", "#cdata-section", newCDATASectionName);
+ newCDATASectionType = (int) newCDATASectionNode.getNodeType();
+ assertEquals("nodeType", 4, newCDATASectionType);
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/documentcreatecdatasection";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(documentcreatecdatasection.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level1/core/documentcreatecomment.java b/dom/src/test/java/org/w3c/domts/level1/core/documentcreatecomment.java
new file mode 100644
index 0000000..9158390
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level1/core/documentcreatecomment.java
@@ -0,0 +1,92 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+Copyright (c) 2001 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+*/
+
+package org.w3c.domts.level1.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The "createComment(data)" method creates a new Comment
+ * node given the specified string.
+ * Retrieve the entire DOM document and invoke its
+ * "createComment(data)" method. It should create a new
+ * Comment node whose "data" is the specified string.
+ * The content, name and type are retrieved and output.
+* @author NIST
+* @author Mary Brady
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-1334481328">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-1334481328</a>
+*/
+public final class documentcreatecomment extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public documentcreatecomment(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "staff", true);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ Comment newCommentNode;
+ String newCommentValue;
+ String newCommentName;
+ int newCommentType;
+ doc = (Document) load("staff", true);
+ newCommentNode = doc.createComment("This is a new Comment node");
+ newCommentValue = newCommentNode.getNodeValue();
+ assertEquals("value", "This is a new Comment node", newCommentValue);
+ newCommentName = newCommentNode.getNodeName();
+ assertEquals("name", "#comment", newCommentName);
+ newCommentType = (int) newCommentNode.getNodeType();
+ assertEquals("type", 8, newCommentType);
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/documentcreatecomment";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(documentcreatecomment.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level1/core/documentcreatedocumentfragment.java b/dom/src/test/java/org/w3c/domts/level1/core/documentcreatedocumentfragment.java
new file mode 100644
index 0000000..2942abb
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level1/core/documentcreatedocumentfragment.java
@@ -0,0 +1,96 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+Copyright (c) 2001 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+*/
+
+package org.w3c.domts.level1.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The "createDocumentFragment()" method creates an empty
+ * DocumentFragment object.
+ * Retrieve the entire DOM document and invoke its
+ * "createDocumentFragment()" method. The content, name,
+ * type and value of the newly created object are output.
+* @author NIST
+* @author Mary Brady
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-35CB04B5">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-35CB04B5</a>
+*/
+public final class documentcreatedocumentfragment extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public documentcreatedocumentfragment(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "staff", true);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ DocumentFragment newDocFragment;
+ NodeList children;
+ int length;
+ String newDocFragmentName;
+ int newDocFragmentType;
+ String newDocFragmentValue;
+ doc = (Document) load("staff", true);
+ newDocFragment = doc.createDocumentFragment();
+ children = newDocFragment.getChildNodes();
+ length = (int) children.getLength();
+ assertEquals("length", 0, length);
+ newDocFragmentName = newDocFragment.getNodeName();
+ assertEquals("name", "#document-fragment", newDocFragmentName);
+ newDocFragmentType = (int) newDocFragment.getNodeType();
+ assertEquals("type", 11, newDocFragmentType);
+ newDocFragmentValue = newDocFragment.getNodeValue();
+ assertNull("value", newDocFragmentValue);
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/documentcreatedocumentfragment";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(documentcreatedocumentfragment.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level1/core/documentcreateelement.java b/dom/src/test/java/org/w3c/domts/level1/core/documentcreateelement.java
new file mode 100644
index 0000000..69a339b
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level1/core/documentcreateelement.java
@@ -0,0 +1,93 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+Copyright (c) 2001 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+*/
+
+package org.w3c.domts.level1.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The "createElement(tagName)" method creates an Element
+ * of the type specified.
+ * Retrieve the entire DOM document and invoke its
+ * "createElement(tagName)" method with tagName="address".
+ * The method should create an instance of an Element node
+ * whose tagName is "address". The NodeName, NodeType
+ * and NodeValue are returned.
+* @author NIST
+* @author Mary Brady
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-2141741547">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-2141741547</a>
+*/
+public final class documentcreateelement extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public documentcreateelement(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "staff", true);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ Element newElement;
+ String newElementName;
+ int newElementType;
+ String newElementValue;
+ doc = (Document) load("staff", true);
+ newElement = doc.createElement("address");
+ newElementName = newElement.getNodeName();
+ assertEquals("name", "address", newElementName);
+ newElementType = (int) newElement.getNodeType();
+ assertEquals("type", 1, newElementType);
+ newElementValue = newElement.getNodeValue();
+ assertNull("valueInitiallyNull", newElementValue);
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/documentcreateelement";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(documentcreateelement.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level1/core/documentcreateelementcasesensitive.java b/dom/src/test/java/org/w3c/domts/level1/core/documentcreateelementcasesensitive.java
new file mode 100644
index 0000000..908e458
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level1/core/documentcreateelementcasesensitive.java
@@ -0,0 +1,95 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+Copyright (c) 2001 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+*/
+
+package org.w3c.domts.level1.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The tagName parameter in the "createElement(tagName)"
+ * method is case-sensitive for XML documents.
+ * Retrieve the entire DOM document and invoke its
+ * "createElement(tagName)" method twice. Once for tagName
+ * equal to "address" and once for tagName equal to "ADDRESS"
+ * Each call should create a distinct Element node. The
+ * newly created Elements are then assigned attributes
+ * that are retrieved.
+* @author NIST
+* @author Mary Brady
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-2141741547">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-2141741547</a>
+*/
+public final class documentcreateelementcasesensitive extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public documentcreateelementcasesensitive(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "staff", true);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ Element newElement1;
+ Element newElement2;
+ String attribute1;
+ String attribute2;
+ doc = (Document) load("staff", true);
+ newElement1 = doc.createElement("ADDRESS");
+ newElement2 = doc.createElement("address");
+ newElement1.setAttribute("district", "Fort Worth");
+ newElement2.setAttribute("county", "Dallas");
+ attribute1 = newElement1.getAttribute("district");
+ attribute2 = newElement2.getAttribute("county");
+ assertEquals("attrib1", "Fort Worth", attribute1);
+ assertEquals("attrib2", "Dallas", attribute2);
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/documentcreateelementcasesensitive";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(documentcreateelementcasesensitive.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level1/core/documentcreateelementdefaultattr.java b/dom/src/test/java/org/w3c/domts/level1/core/documentcreateelementdefaultattr.java
new file mode 100644
index 0000000..7d7a97a
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level1/core/documentcreateelementdefaultattr.java
@@ -0,0 +1,106 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+Copyright (c) 2001-2004 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+*/
+
+package org.w3c.domts.level1.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The "createElement(tagName)" method creates an Element
+ * of the type specified. In addition, if there are known attributes
+ * with default values, Attr nodes representing them are automatically
+ * created and attached to the element.
+ * Retrieve the entire DOM document and invoke its
+ * "createElement(tagName)" method with tagName="address".
+ * The method should create an instance of an Element node
+ * whose tagName is "address". The tagName "address" has an
+ * attribute with default values, therefore the newly created element
+ * will have them.
+* @author NIST
+* @author Mary Brady
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-2141741547">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-2141741547</a>
+* @see <a href="http://lists.w3.org/Archives/Public/www-dom-ts/2002Mar/0002.html">http://lists.w3.org/Archives/Public/www-dom-ts/2002Mar/0002.html</a>
+*/
+public final class documentcreateelementdefaultattr extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public documentcreateelementdefaultattr(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+
+ org.w3c.domts.DocumentBuilderSetting[] settings =
+ new org.w3c.domts.DocumentBuilderSetting[] {
+org.w3c.domts.DocumentBuilderSetting.validating
+ };
+ DOMTestDocumentBuilderFactory testFactory = factory.newInstance(settings);
+ setFactory(testFactory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "staff", true);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ Element newElement;
+ NamedNodeMap defaultAttr;
+ Node child;
+ String name;
+ String value;
+ doc = (Document) load("staff", true);
+ newElement = doc.createElement("address");
+ defaultAttr = newElement.getAttributes();
+ child = defaultAttr.item(0);
+ assertNotNull("defaultAttrNotNull", child);
+ name = child.getNodeName();
+ assertEquals("attrName", "street", name);
+ value = child.getNodeValue();
+ assertEquals("attrValue", "Yes", value);
+ assertSize("attrCount", 1, defaultAttr);
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/documentcreateelementdefaultattr";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(documentcreateelementdefaultattr.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level1/core/documentcreateentityreference.java b/dom/src/test/java/org/w3c/domts/level1/core/documentcreateentityreference.java
new file mode 100644
index 0000000..e6726af
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level1/core/documentcreateentityreference.java
@@ -0,0 +1,97 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+Copyright (c) 2001-2004 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+*/
+
+package org.w3c.domts.level1.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The "createEntityReference(name)" method creates an
+ * EntityReferrence node.
+ *
+ * Retrieve the entire DOM document and invoke its
+ * "createEntityReference(name)" method. It should create
+ * a new EntityReference node for the Entity with the
+ * given name. The name, value and type are retrieved and
+ * output.
+* @author NIST
+* @author Mary Brady
+* @author Curt Arnold
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-392B75AE">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-392B75AE</a>
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-F68D080">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-F68D080</a>
+*/
+public final class documentcreateentityreference extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public documentcreateentityreference(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "staff", true);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ EntityReference newEntRefNode;
+ String entRefValue;
+ String entRefName;
+ int entRefType;
+ doc = (Document) load("staff", true);
+ newEntRefNode = doc.createEntityReference("ent1");
+ assertNotNull("createdEntRefNotNull", newEntRefNode);
+ entRefValue = newEntRefNode.getNodeValue();
+ assertNull("value", entRefValue);
+ entRefName = newEntRefNode.getNodeName();
+ assertEquals("name", "ent1", entRefName);
+ entRefType = (int) newEntRefNode.getNodeType();
+ assertEquals("type", 5, entRefType);
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/documentcreateentityreference";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(documentcreateentityreference.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level1/core/documentcreateentityreferenceknown.java b/dom/src/test/java/org/w3c/domts/level1/core/documentcreateentityreferenceknown.java
new file mode 100644
index 0000000..02f167e
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level1/core/documentcreateentityreferenceknown.java
@@ -0,0 +1,100 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+Copyright (c) 2001-2004 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+*/
+
+package org.w3c.domts.level1.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The "createEntityReference(name)" method creates an
+ * EntityReference node. In addition, if the referenced entity
+ * is known, the child list of the "EntityReference" node
+ * is the same as the corresponding "Entity" node.
+ *
+ * Retrieve the entire DOM document and invoke its
+ * "createEntityReference(name)" method. It should create
+ * a new EntityReference node for the Entity with the
+ * given name. The referenced entity is known, therefore the child
+ * list of the "EntityReference" node is the same as the corresponding
+ * "Entity" node.
+* @author NIST
+* @author Mary Brady
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-392B75AE">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-392B75AE</a>
+*/
+public final class documentcreateentityreferenceknown extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public documentcreateentityreferenceknown(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "staff", true);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ EntityReference newEntRefNode;
+ NodeList newEntRefList;
+ Node child;
+ String name;
+ String value;
+ doc = (Document) load("staff", true);
+ newEntRefNode = doc.createEntityReference("ent3");
+ assertNotNull("createdEntRefNotNull", newEntRefNode);
+ newEntRefList = newEntRefNode.getChildNodes();
+ assertSize("size", 1, newEntRefList);
+ child = newEntRefNode.getFirstChild();
+ name = child.getNodeName();
+ assertEquals("name", "#text", name);
+ value = child.getNodeValue();
+ assertEquals("value", "Texas", value);
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/documentcreateentityreferenceknown";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(documentcreateentityreferenceknown.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level1/core/documentcreateprocessinginstruction.java b/dom/src/test/java/org/w3c/domts/level1/core/documentcreateprocessinginstruction.java
new file mode 100644
index 0000000..ad1d7b9
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level1/core/documentcreateprocessinginstruction.java
@@ -0,0 +1,100 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+Copyright (c) 2001-2004 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+*/
+
+package org.w3c.domts.level1.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The "createProcessingInstruction(target,data)" method
+ * creates a new ProcessingInstruction node with the
+ * specified name and data string.
+ *
+ * Retrieve the entire DOM document and invoke its
+ * "createProcessingInstruction(target,data)" method.
+ * It should create a new PI node with the specified target
+ * and data. The target, data and type are retrieved and
+ * output.
+* @author NIST
+* @author Mary Brady
+* @author Curt Arnold
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#</a>
+* @see <a href="http://lists.w3.org/Archives/Public/www-dom-ts/2001Apr/0020.html">http://lists.w3.org/Archives/Public/www-dom-ts/2001Apr/0020.html</a>
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-135944439">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-135944439</a>
+* @see <a href="http://www.w3.org/Bugs/Public/show_bug.cgi?id=249">http://www.w3.org/Bugs/Public/show_bug.cgi?id=249</a>
+*/
+public final class documentcreateprocessinginstruction extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public documentcreateprocessinginstruction(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "staff", true);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ ProcessingInstruction newPINode;
+ String piValue;
+ String piName;
+ int piType;
+ doc = (Document) load("staff", true);
+ newPINode = doc.createProcessingInstruction("TESTPI", "This is a new PI node");
+ assertNotNull("createdPINotNull", newPINode);
+ piName = newPINode.getNodeName();
+ assertEquals("name", "TESTPI", piName);
+ piValue = newPINode.getNodeValue();
+ assertEquals("value", "This is a new PI node", piValue);
+ piType = (int) newPINode.getNodeType();
+ assertEquals("type", 7, piType);
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/documentcreateprocessinginstruction";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(documentcreateprocessinginstruction.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level1/core/documentcreatetextnode.java b/dom/src/test/java/org/w3c/domts/level1/core/documentcreatetextnode.java
new file mode 100644
index 0000000..c5d9a6b
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level1/core/documentcreatetextnode.java
@@ -0,0 +1,92 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+Copyright (c) 2001 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+*/
+
+package org.w3c.domts.level1.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The "createTextNode(data)" method creates a Text node
+ * given the specfied string.
+ * Retrieve the entire DOM document and invoke its
+ * "createTextNode(data)" method. It should create a
+ * new Text node whose "data" is the specified string.
+ * The NodeName and NodeType are also checked.
+* @author NIST
+* @author Mary Brady
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-1975348127">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-1975348127</a>
+*/
+public final class documentcreatetextnode extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public documentcreatetextnode(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "staff", true);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ Text newTextNode;
+ String newTextName;
+ String newTextValue;
+ int newTextType;
+ doc = (Document) load("staff", true);
+ newTextNode = doc.createTextNode("This is a new Text node");
+ newTextValue = newTextNode.getNodeValue();
+ assertEquals("value", "This is a new Text node", newTextValue);
+ newTextName = newTextNode.getNodeName();
+ assertEquals("name", "#text", newTextName);
+ newTextType = (int) newTextNode.getNodeType();
+ assertEquals("type", 3, newTextType);
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/documentcreatetextnode";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(documentcreatetextnode.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level1/core/documentgetdoctype.java b/dom/src/test/java/org/w3c/domts/level1/core/documentgetdoctype.java
new file mode 100644
index 0000000..40e2376
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level1/core/documentgetdoctype.java
@@ -0,0 +1,98 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+Copyright (c) 2001-2004 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+*/
+
+package org.w3c.domts.level1.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The "getDoctype()" method returns the Document
+ * Type Declaration associated with this document.
+ * Retrieve the entire DOM document and invoke its
+ * "getDoctype()" method. The name of the document
+ * type should be returned. The "getName()" method
+ * should be equal to "staff" or "svg".
+* @author NIST
+* @author Mary Brady
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-B63ED1A31">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-B63ED1A31</a>
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-F68D080">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-F68D080</a>
+* @see <a href="http://www.w3.org/Bugs/Public/show_bug.cgi?id=249">http://www.w3.org/Bugs/Public/show_bug.cgi?id=249</a>
+*/
+public final class documentgetdoctype extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public documentgetdoctype(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "staff", false);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ DocumentType docType;
+ String docTypeName;
+ String nodeValue;
+ doc = (Document) load("staff", false);
+ docType = doc.getDoctype();
+ assertNotNull("docTypeNotNull", docType);
+ docTypeName = docType.getName();
+
+ if (("image/svg+xml".equals(getContentType()))) {
+ assertEquals("doctypeNameSVG", "svg", docTypeName);
+ } else {
+ assertEquals("doctypeName", "staff", docTypeName);
+ }
+
+ nodeValue = docType.getNodeValue();
+ assertNull("initiallyNull", nodeValue);
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/documentgetdoctype";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(documentgetdoctype.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level1/core/documentgetdoctypenodtd.java b/dom/src/test/java/org/w3c/domts/level1/core/documentgetdoctypenodtd.java
new file mode 100644
index 0000000..554a78e
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level1/core/documentgetdoctypenodtd.java
@@ -0,0 +1,88 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+Copyright (c) 2001 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+*/
+
+package org.w3c.domts.level1.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The "getDoctype()" method returns null for XML documents
+ * without a document type declaration.
+ * Retrieve the XML document without a DTD and invoke the
+ * "getDoctype()" method. It should return null.
+* @author NIST
+* @author Mary Brady
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-B63ED1A31">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-B63ED1A31</a>
+*/
+public final class documentgetdoctypenodtd extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public documentgetdoctypenodtd(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+
+ org.w3c.domts.DocumentBuilderSetting[] settings =
+ new org.w3c.domts.DocumentBuilderSetting[] {
+org.w3c.domts.DocumentBuilderSetting.notValidating
+ };
+ DOMTestDocumentBuilderFactory testFactory = factory.newInstance(settings);
+ setFactory(testFactory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "hc_nodtdstaff", false);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ DocumentType docType;
+ doc = (Document) load("hc_nodtdstaff", false);
+ docType = doc.getDoctype();
+ assertNull("documentGetDocTypeNoDTDAssert", docType);
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/documentgetdoctypenodtd";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(documentgetdoctypenodtd.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level1/core/documentgetelementsbytagnamelength.java b/dom/src/test/java/org/w3c/domts/level1/core/documentgetelementsbytagnamelength.java
new file mode 100644
index 0000000..e06a2ff
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level1/core/documentgetelementsbytagnamelength.java
@@ -0,0 +1,85 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+Copyright (c) 2001 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+*/
+
+package org.w3c.domts.level1.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The "getElementsByTagName(tagName)" method returns a
+ * NodeList of all the Elements with a given tagName.
+ *
+ * Retrieve the entire DOM document and invoke its
+ * "getElementsByTagName(tagName)" method with tagName
+ * equal to "name". The method should return a NodeList
+ * that contains 5 elements.
+* @author NIST
+* @author Mary Brady
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-A6C9094">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-A6C9094</a>
+*/
+public final class documentgetelementsbytagnamelength extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public documentgetelementsbytagnamelength(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "staff", false);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ NodeList nameList;
+ doc = (Document) load("staff", false);
+ nameList = doc.getElementsByTagName("name");
+ assertSize("documentGetElementsByTagNameLengthAssert", 5, nameList);
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/documentgetelementsbytagnamelength";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(documentgetelementsbytagnamelength.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level1/core/documentgetelementsbytagnametotallength.java b/dom/src/test/java/org/w3c/domts/level1/core/documentgetelementsbytagnametotallength.java
new file mode 100644
index 0000000..ecb029d
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level1/core/documentgetelementsbytagnametotallength.java
@@ -0,0 +1,86 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+Copyright (c) 2001-2004 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+*/
+
+package org.w3c.domts.level1.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * Retrieve the entire DOM document, invoke
+ * getElementsByTagName("*") and check the length of the NodeList.
+* @author NIST
+* @author Mary Brady
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-A6C9094">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-A6C9094</a>
+*/
+public final class documentgetelementsbytagnametotallength extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public documentgetelementsbytagnametotallength(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "staff", false);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ NodeList nameList;
+ doc = (Document) load("staff", false);
+ nameList = doc.getElementsByTagName("*");
+
+ if (("image/svg+xml".equals(getContentType()))) {
+ assertSize("elementCountSVG", 39, nameList);
+ } else {
+ assertSize("documentGetElementsByTagNameTotalLengthAssert", 37, nameList);
+ }
+
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/documentgetelementsbytagnametotallength";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(documentgetelementsbytagnametotallength.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level1/core/documentgetelementsbytagnamevalue.java b/dom/src/test/java/org/w3c/domts/level1/core/documentgetelementsbytagnamevalue.java
new file mode 100644
index 0000000..05d154f
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level1/core/documentgetelementsbytagnamevalue.java
@@ -0,0 +1,93 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+Copyright (c) 2001 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+*/
+
+package org.w3c.domts.level1.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The "getElementsByTagName(tagName)" method returns a
+ * NodeList of all the Elements with a given tagName
+ * in a pre-order traversal of the tree.
+ *
+ * Retrieve the entire DOM document and invoke its
+ * "getElementsByTagName(tagName)" method with tagName
+ * equal to "name". The method should return a NodeList
+ * that contains 5 elements. The FOURTH item in the
+ * list is retrieved and output.
+* @author NIST
+* @author Mary Brady
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-A6C9094">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-A6C9094</a>
+*/
+public final class documentgetelementsbytagnamevalue extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public documentgetelementsbytagnamevalue(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "staff", false);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ NodeList nameList;
+ Node nameNode;
+ Node firstChild;
+ String childValue;
+ doc = (Document) load("staff", false);
+ nameList = doc.getElementsByTagName("name");
+ nameNode = nameList.item(3);
+ firstChild = nameNode.getFirstChild();
+ childValue = firstChild.getNodeValue();
+ assertEquals("documentGetElementsByTagNameValueAssert", "Jeny Oconnor", childValue);
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/documentgetelementsbytagnamevalue";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(documentgetelementsbytagnamevalue.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level1/core/documentgetimplementation.java b/dom/src/test/java/org/w3c/domts/level1/core/documentgetimplementation.java
new file mode 100644
index 0000000..ada7c30
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level1/core/documentgetimplementation.java
@@ -0,0 +1,86 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+Copyright (c) 2001 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+*/
+
+package org.w3c.domts.level1.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The "getImplementation()" method returns the
+ * DOMImplementation object that handles this document.
+ * Retrieve the entire DOM document and invoke its
+ * "getImplementation()" method. It should return a
+ * DOMImplementation whose "hasFeature("XML","1.0")
+ * method returns the boolean value "true".
+* @author NIST
+* @author Mary Brady
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-1B793EBA">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-1B793EBA</a>
+*/
+public final class documentgetimplementation extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public documentgetimplementation(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "staff", false);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ DOMImplementation docImpl;
+ boolean state;
+ doc = (Document) load("staff", false);
+ docImpl = doc.getImplementation();
+ state = docImpl.hasFeature("XML", "1.0");
+assertTrue("documentGetImplementationAssert", state);
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/documentgetimplementation";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(documentgetimplementation.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level1/core/documentgetrootnode.java b/dom/src/test/java/org/w3c/domts/level1/core/documentgetrootnode.java
new file mode 100644
index 0000000..e0711ed
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level1/core/documentgetrootnode.java
@@ -0,0 +1,92 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+Copyright (c) 2001 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+*/
+
+package org.w3c.domts.level1.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The "getDocumentElement()" method provides direct access
+ * to the child node that is the root element of the document.
+ * Retrieve the entire DOM document and invoke its
+ * "getDocumentElement()" method. It should return an
+ * Element node whose NodeName is "staff" (or "svg").
+* @author NIST
+* @author Mary Brady
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-87CD092">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-87CD092</a>
+* @see <a href="http://www.w3.org/Bugs/Public/show_bug.cgi?id=251">http://www.w3.org/Bugs/Public/show_bug.cgi?id=251</a>
+*/
+public final class documentgetrootnode extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public documentgetrootnode(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "staff", false);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ Element root;
+ String rootName;
+ doc = (Document) load("staff", false);
+ root = doc.getDocumentElement();
+ rootName = root.getNodeName();
+
+ if (("image/svg+xml".equals(getContentType()))) {
+ assertEquals("svgRootNode", "svg", rootName);
+ } else {
+ assertEquals("documentGetRootNodeAssert", "staff", rootName);
+ }
+
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/documentgetrootnode";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(documentgetrootnode.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level1/core/documentinvalidcharacterexceptioncreateattribute.java b/dom/src/test/java/org/w3c/domts/level1/core/documentinvalidcharacterexceptioncreateattribute.java
new file mode 100644
index 0000000..c8d9f0a
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level1/core/documentinvalidcharacterexceptioncreateattribute.java
@@ -0,0 +1,98 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+Copyright (c) 2001-2003 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+*/
+
+package org.w3c.domts.level1.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The "createAttribute(tagName)" method raises an
+ * INVALID_CHARACTER_ERR DOMException if the specified
+ * tagName contains an invalid character.
+ *
+ * Retrieve the entire DOM document and invoke its
+ * "createAttribute(tagName)" method with the tagName equal
+ * to the string "invalid^Name". Due to the invalid
+ * character the desired EXCEPTION should be raised.
+* @author NIST
+* @author Mary Brady
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-258A00AF')/constant[@name='INVALID_CHARACTER_ERR'])">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-258A00AF')/constant[@name='INVALID_CHARACTER_ERR'])</a>
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-1084891198">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-1084891198</a>
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-1084891198')/raises/exception[@name='DOMException']/descr/p[substring-before(.,':')='INVALID_CHARACTER_ERR'])">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-1084891198')/raises/exception[@name='DOMException']/descr/p[substring-before(.,':')='INVALID_CHARACTER_ERR'])</a>
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-1084891198">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-1084891198</a>
+* @see <a href="http://www.w3.org/Bugs/Public/show_bug.cgi?id=249">http://www.w3.org/Bugs/Public/show_bug.cgi?id=249</a>
+*/
+public final class documentinvalidcharacterexceptioncreateattribute extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public documentinvalidcharacterexceptioncreateattribute(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "staff", true);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ Attr createdAttr;
+ doc = (Document) load("staff", true);
+
+ {
+ boolean success = false;
+ try {
+ createdAttr = doc.createAttribute("invalid^Name");
+ } catch (DOMException ex) {
+ success = (ex.code == DOMException.INVALID_CHARACTER_ERR);
+ }
+ assertTrue("throw_INVALID_CHARACTER_ERR", success);
+ }
+}
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/documentinvalidcharacterexceptioncreateattribute";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(documentinvalidcharacterexceptioncreateattribute.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level1/core/documentinvalidcharacterexceptioncreateelement.java b/dom/src/test/java/org/w3c/domts/level1/core/documentinvalidcharacterexceptioncreateelement.java
new file mode 100644
index 0000000..46459ea
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level1/core/documentinvalidcharacterexceptioncreateelement.java
@@ -0,0 +1,98 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+Copyright (c) 2001-2003 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+*/
+
+package org.w3c.domts.level1.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The "createElement(tagName)" method raises an
+ * INVALID_CHARACTER_ERR DOMException if the specified
+ * tagName contains an invalid character.
+ *
+ * Retrieve the entire DOM document and invoke its
+ * "createElement(tagName)" method with the tagName equal
+ * to the string "invalid^Name". Due to the invalid
+ * character the desired EXCEPTION should be raised.
+* @author NIST
+* @author Mary Brady
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-258A00AF')/constant[@name='INVALID_CHARACTER_ERR'])">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-258A00AF')/constant[@name='INVALID_CHARACTER_ERR'])</a>
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-2141741547">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-2141741547</a>
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-2141741547')/raises/exception[@name='DOMException']/descr/p[substring-before(.,':')='INVALID_CHARACTER_ERR'])">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-2141741547')/raises/exception[@name='DOMException']/descr/p[substring-before(.,':')='INVALID_CHARACTER_ERR'])</a>
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-2141741547">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-2141741547</a>
+* @see <a href="http://www.w3.org/Bugs/Public/show_bug.cgi?id=249">http://www.w3.org/Bugs/Public/show_bug.cgi?id=249</a>
+*/
+public final class documentinvalidcharacterexceptioncreateelement extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public documentinvalidcharacterexceptioncreateelement(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "staff", true);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ Element badElement;
+ doc = (Document) load("staff", true);
+
+ {
+ boolean success = false;
+ try {
+ badElement = doc.createElement("invalid^Name");
+ } catch (DOMException ex) {
+ success = (ex.code == DOMException.INVALID_CHARACTER_ERR);
+ }
+ assertTrue("throw_INVALID_CHARACTER_ERR", success);
+ }
+}
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/documentinvalidcharacterexceptioncreateelement";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(documentinvalidcharacterexceptioncreateelement.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level1/core/documentinvalidcharacterexceptioncreateentref.java b/dom/src/test/java/org/w3c/domts/level1/core/documentinvalidcharacterexceptioncreateentref.java
new file mode 100644
index 0000000..1ebfb35
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level1/core/documentinvalidcharacterexceptioncreateentref.java
@@ -0,0 +1,110 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+Copyright (c) 2001-2004 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+*/
+
+package org.w3c.domts.level1.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The "createEntityReference(tagName)" method raises an
+ * INVALID_CHARACTER_ERR DOMException if the specified
+ * tagName contains an invalid character.
+* @author NIST
+* @author Mary Brady
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-258A00AF')/constant[@name='INVALID_CHARACTER_ERR'])">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-258A00AF')/constant[@name='INVALID_CHARACTER_ERR'])</a>
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-392B75AE">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-392B75AE</a>
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-392B75AE')/raises/exception[@name='DOMException']/descr/p[substring-before(.,':')='INVALID_CHARACTER_ERR'])">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-392B75AE')/raises/exception[@name='DOMException']/descr/p[substring-before(.,':')='INVALID_CHARACTER_ERR'])</a>
+* @see <a href="http://www.w3.org/Bugs/Public/show_bug.cgi?id=249">http://www.w3.org/Bugs/Public/show_bug.cgi?id=249</a>
+*/
+public final class documentinvalidcharacterexceptioncreateentref extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public documentinvalidcharacterexceptioncreateentref(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+ if (factory.hasFeature("XML", null) != true) {
+ throw org.w3c.domts.DOMTestIncompatibleException.incompatibleFeature("XML", null);
+ }
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "hc_staff", true);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ EntityReference badEntityRef;
+ doc = (Document) load("hc_staff", true);
+
+ if (("text/html".equals(getContentType()))) {
+
+ {
+ boolean success = false;
+ try {
+ badEntityRef = doc.createEntityReference("foo");
+ } catch (DOMException ex) {
+ success = (ex.code == DOMException.NOT_SUPPORTED_ERR);
+ }
+ assertTrue("throw_NOT_SUPPORTED_ERR", success);
+ }
+} else {
+
+ {
+ boolean success = false;
+ try {
+ badEntityRef = doc.createEntityReference("invalid^Name");
+ } catch (DOMException ex) {
+ success = (ex.code == DOMException.INVALID_CHARACTER_ERR);
+ }
+ assertTrue("throw_INVALID_CHARACTER_ERR", success);
+ }
+}
+
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/documentinvalidcharacterexceptioncreateentref";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(documentinvalidcharacterexceptioncreateentref.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level1/core/documentinvalidcharacterexceptioncreateentref1.java b/dom/src/test/java/org/w3c/domts/level1/core/documentinvalidcharacterexceptioncreateentref1.java
new file mode 100644
index 0000000..7185680
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level1/core/documentinvalidcharacterexceptioncreateentref1.java
@@ -0,0 +1,107 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+Copyright (c) 2004 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+*/
+
+package org.w3c.domts.level1.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * Creating an entity reference with an empty name should cause an INVALID_CHARACTER_ERR.
+* @author Curt Arnold
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-258A00AF')/constant[@name='INVALID_CHARACTER_ERR'])">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-258A00AF')/constant[@name='INVALID_CHARACTER_ERR'])</a>
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-392B75AE">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-392B75AE</a>
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-392B75AE')/raises/exception[@name='DOMException']/descr/p[substring-before(.,':')='INVALID_CHARACTER_ERR'])">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-392B75AE')/raises/exception[@name='DOMException']/descr/p[substring-before(.,':')='INVALID_CHARACTER_ERR'])</a>
+* @see <a href="http://www.w3.org/Bugs/Public/show_bug.cgi?id=525">http://www.w3.org/Bugs/Public/show_bug.cgi?id=525</a>
+*/
+public final class documentinvalidcharacterexceptioncreateentref1 extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public documentinvalidcharacterexceptioncreateentref1(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+ if (factory.hasFeature("XML", null) != true) {
+ throw org.w3c.domts.DOMTestIncompatibleException.incompatibleFeature("XML", null);
+ }
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "hc_staff", true);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ EntityReference badEntityRef;
+ doc = (Document) load("hc_staff", true);
+
+ if (("text/html".equals(getContentType()))) {
+
+ {
+ boolean success = false;
+ try {
+ badEntityRef = doc.createEntityReference("foo");
+ } catch (DOMException ex) {
+ success = (ex.code == DOMException.NOT_SUPPORTED_ERR);
+ }
+ assertTrue("throw_NOT_SUPPORTED_ERR", success);
+ }
+} else {
+
+ {
+ boolean success = false;
+ try {
+ badEntityRef = doc.createEntityReference("");
+ } catch (DOMException ex) {
+ success = (ex.code == DOMException.INVALID_CHARACTER_ERR);
+ }
+ assertTrue("throw_INVALID_CHARACTER_ERR", success);
+ }
+}
+
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/documentinvalidcharacterexceptioncreateentref1";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(documentinvalidcharacterexceptioncreateentref1.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level1/core/documentinvalidcharacterexceptioncreatepi.java b/dom/src/test/java/org/w3c/domts/level1/core/documentinvalidcharacterexceptioncreatepi.java
new file mode 100644
index 0000000..ca48996
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level1/core/documentinvalidcharacterexceptioncreatepi.java
@@ -0,0 +1,110 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+Copyright (c) 2001-2004 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+*/
+
+package org.w3c.domts.level1.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The "createProcessingInstruction(target,data) method
+ * raises an INVALID_CHARACTER_ERR DOMException if the
+ * specified tagName contains an invalid character.
+* @author NIST
+* @author Mary Brady
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-258A00AF')/constant[@name='INVALID_CHARACTER_ERR'])">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-258A00AF')/constant[@name='INVALID_CHARACTER_ERR'])</a>
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-135944439">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-135944439</a>
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-135944439')/raises/exception[@name='DOMException']/descr/p[substring-before(.,':')='INVALID_CHARACTER_ERR'])">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-135944439')/raises/exception[@name='DOMException']/descr/p[substring-before(.,':')='INVALID_CHARACTER_ERR'])</a>
+* @see <a href="http://www.w3.org/Bugs/Public/show_bug.cgi?id=249">http://www.w3.org/Bugs/Public/show_bug.cgi?id=249</a>
+*/
+public final class documentinvalidcharacterexceptioncreatepi extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public documentinvalidcharacterexceptioncreatepi(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+ if (factory.hasFeature("XML", null) != true) {
+ throw org.w3c.domts.DOMTestIncompatibleException.incompatibleFeature("XML", null);
+ }
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "hc_staff", true);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ ProcessingInstruction badPI;
+ doc = (Document) load("hc_staff", true);
+
+ if (("text/html".equals(getContentType()))) {
+
+ {
+ boolean success = false;
+ try {
+ badPI = doc.createProcessingInstruction("foo", "data");
+ } catch (DOMException ex) {
+ success = (ex.code == DOMException.NOT_SUPPORTED_ERR);
+ }
+ assertTrue("throw_NOT_SUPPORTED_ERR", success);
+ }
+} else {
+
+ {
+ boolean success = false;
+ try {
+ badPI = doc.createProcessingInstruction("invalid^Name", "data");
+ } catch (DOMException ex) {
+ success = (ex.code == DOMException.INVALID_CHARACTER_ERR);
+ }
+ assertTrue("throw_INVALID_CHARACTER_ERR", success);
+ }
+}
+
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/documentinvalidcharacterexceptioncreatepi";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(documentinvalidcharacterexceptioncreatepi.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level1/core/documentinvalidcharacterexceptioncreatepi1.java b/dom/src/test/java/org/w3c/domts/level1/core/documentinvalidcharacterexceptioncreatepi1.java
new file mode 100644
index 0000000..7b97807
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level1/core/documentinvalidcharacterexceptioncreatepi1.java
@@ -0,0 +1,107 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+Copyright (c) 2004 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+*/
+
+package org.w3c.domts.level1.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * Creating a processing instruction with an empty target should cause an INVALID_CHARACTER_ERR.
+* @author Curt Arnold
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-258A00AF')/constant[@name='INVALID_CHARACTER_ERR'])">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-258A00AF')/constant[@name='INVALID_CHARACTER_ERR'])</a>
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-135944439">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-135944439</a>
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-135944439')/raises/exception[@name='DOMException']/descr/p[substring-before(.,':')='INVALID_CHARACTER_ERR'])">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-135944439')/raises/exception[@name='DOMException']/descr/p[substring-before(.,':')='INVALID_CHARACTER_ERR'])</a>
+* @see <a href="http://www.w3.org/Bugs/Public/show_bug.cgi?id=525">http://www.w3.org/Bugs/Public/show_bug.cgi?id=525</a>
+*/
+public final class documentinvalidcharacterexceptioncreatepi1 extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public documentinvalidcharacterexceptioncreatepi1(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+ if (factory.hasFeature("XML", null) != true) {
+ throw org.w3c.domts.DOMTestIncompatibleException.incompatibleFeature("XML", null);
+ }
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "hc_staff", true);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ ProcessingInstruction badPI;
+ doc = (Document) load("hc_staff", true);
+
+ if (("text/html".equals(getContentType()))) {
+
+ {
+ boolean success = false;
+ try {
+ badPI = doc.createProcessingInstruction("foo", "data");
+ } catch (DOMException ex) {
+ success = (ex.code == DOMException.NOT_SUPPORTED_ERR);
+ }
+ assertTrue("throw_NOT_SUPPORTED_ERR", success);
+ }
+} else {
+
+ {
+ boolean success = false;
+ try {
+ badPI = doc.createProcessingInstruction("", "data");
+ } catch (DOMException ex) {
+ success = (ex.code == DOMException.INVALID_CHARACTER_ERR);
+ }
+ assertTrue("throw_INVALID_CHARACTER_ERR", success);
+ }
+}
+
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/documentinvalidcharacterexceptioncreatepi1";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(documentinvalidcharacterexceptioncreatepi1.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level1/core/documenttypegetdoctype.java b/dom/src/test/java/org/w3c/domts/level1/core/documenttypegetdoctype.java
new file mode 100644
index 0000000..881d27b
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level1/core/documenttypegetdoctype.java
@@ -0,0 +1,93 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+Copyright (c) 2001-2004 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+*/
+
+package org.w3c.domts.level1.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The "getName()" method contains the name of the DTD.
+ *
+ * Retrieve the Document Type for this document and examine
+ * the string returned by the "getName()" method.
+ * It should be set to "staff".
+* @author NIST
+* @author Mary Brady
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-B63ED1A31">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-B63ED1A31</a>
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-1844763134">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-1844763134</a>
+*/
+public final class documenttypegetdoctype extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public documenttypegetdoctype(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "staff", false);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ DocumentType docType;
+ String name;
+ doc = (Document) load("staff", false);
+ docType = doc.getDoctype();
+ assertNotNull("docTypeNotNull", docType);
+ name = docType.getName();
+
+ if (("image/svg+xml".equals(getContentType()))) {
+ assertEquals("doctypeName", "svg", name);
+ } else {
+ assertEquals("documenttypeGetDocTypeAssert", "staff", name);
+ }
+
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/documenttypegetdoctype";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(documenttypegetdoctype.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level1/core/documenttypegetentities.java b/dom/src/test/java/org/w3c/domts/level1/core/documenttypegetentities.java
new file mode 100644
index 0000000..c34c66e
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level1/core/documenttypegetentities.java
@@ -0,0 +1,120 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+Copyright (c) 2001-2004 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+*/
+
+package org.w3c.domts.level1.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The "getEntities()" method is a NamedNodeMap that contains
+ * the general entities for this document.
+ *
+ * Retrieve the Document Type for this document and create
+ * a NamedNodeMap of all its entities. The entire map is
+ * traversed and the names of the entities are retrieved.
+ * There should be 5 entities. Duplicates should be ignored.
+* @author NIST
+* @author Mary Brady
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-1788794630">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-1788794630</a>
+*/
+public final class documenttypegetentities extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public documenttypegetentities(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "staff", false);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ DocumentType docType;
+ NamedNodeMap entityList;
+ String name;
+ java.util.Collection expectedResult = new java.util.ArrayList();
+ expectedResult.add("ent1");
+ expectedResult.add("ent2");
+ expectedResult.add("ent3");
+ expectedResult.add("ent4");
+ expectedResult.add("ent5");
+
+ java.util.Collection expectedResultSVG = new java.util.ArrayList();
+ expectedResultSVG.add("ent1");
+ expectedResultSVG.add("ent2");
+ expectedResultSVG.add("ent3");
+ expectedResultSVG.add("ent4");
+ expectedResultSVG.add("ent5");
+ expectedResultSVG.add("svgunit");
+ expectedResultSVG.add("svgtest");
+
+ java.util.Collection nameList = new java.util.ArrayList();
+
+ Node entity;
+ doc = (Document) load("staff", false);
+ docType = doc.getDoctype();
+ assertNotNull("docTypeNotNull", docType);
+ entityList = docType.getEntities();
+ assertNotNull("entitiesNotNull", entityList);
+ for (int indexN1007B = 0; indexN1007B < entityList.getLength(); indexN1007B++) {
+ entity = (Node) entityList.item(indexN1007B);
+ name = entity.getNodeName();
+ nameList.add(name);
+ }
+
+ if (("image/svg+xml".equals(getContentType()))) {
+ assertEquals("entityNamesSVG", expectedResultSVG, nameList);
+ } else {
+ assertEquals("entityNames", expectedResult, nameList);
+ }
+
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/documenttypegetentities";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(documenttypegetentities.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level1/core/documenttypegetentitieslength.java b/dom/src/test/java/org/w3c/domts/level1/core/documenttypegetentitieslength.java
new file mode 100644
index 0000000..3a46534
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level1/core/documenttypegetentitieslength.java
@@ -0,0 +1,93 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+Copyright (c) 2001-2004 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+*/
+
+package org.w3c.domts.level1.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * Duplicate entities are to be discarded.
+ * Retrieve the Document Type for this document and create
+ * a NamedNodeMap of all its entities. The entity named
+ * "ent1" is defined twice and therefore that last
+ * occurrance should be discarded.
+* @author NIST
+* @author Mary Brady
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-1788794630">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-1788794630</a>
+*/
+public final class documenttypegetentitieslength extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public documenttypegetentitieslength(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "staff", false);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ DocumentType docType;
+ NamedNodeMap entityList;
+ doc = (Document) load("staff", false);
+ docType = doc.getDoctype();
+ assertNotNull("docTypeNotNull", docType);
+ entityList = docType.getEntities();
+ assertNotNull("entitiesNotNull", entityList);
+
+ if (("image/svg+xml".equals(getContentType()))) {
+ assertSize("entitySizeSVG", 7, entityList);
+ } else {
+ assertSize("entitySize", 5, entityList);
+ }
+
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/documenttypegetentitieslength";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(documenttypegetentitieslength.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level1/core/documenttypegetentitiestype.java b/dom/src/test/java/org/w3c/domts/level1/core/documenttypegetentitiestype.java
new file mode 100644
index 0000000..347c994
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level1/core/documenttypegetentitiestype.java
@@ -0,0 +1,95 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+Copyright (c) 2001-2004 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+*/
+
+package org.w3c.domts.level1.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * Every node in the map returned by the "getEntities()"
+ * method implements the Entity interface.
+ *
+ * Retrieve the Document Type for this document and create
+ * a NamedNodeMap of all its entities. Traverse the
+ * entire list and examine the NodeType of each node
+ * in the list.
+* @author NIST
+* @author Mary Brady
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-1788794630">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-1788794630</a>
+*/
+public final class documenttypegetentitiestype extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public documenttypegetentitiestype(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "staff", false);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ DocumentType docType;
+ NamedNodeMap entityList;
+ Node entity;
+ int entityType;
+ doc = (Document) load("staff", false);
+ docType = doc.getDoctype();
+ assertNotNull("docTypeNotNull", docType);
+ entityList = docType.getEntities();
+ assertNotNull("entitiesNotNull", entityList);
+ for (int indexN10049 = 0; indexN10049 < entityList.getLength(); indexN10049++) {
+ entity = (Node) entityList.item(indexN10049);
+ entityType = (int) entity.getNodeType();
+ assertEquals("documenttypeGetEntitiesTypeAssert", 6, entityType);
+ }
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/documenttypegetentitiestype";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(documenttypegetentitiestype.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level1/core/documenttypegetnotations.java b/dom/src/test/java/org/w3c/domts/level1/core/documenttypegetnotations.java
new file mode 100644
index 0000000..579d656
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level1/core/documenttypegetnotations.java
@@ -0,0 +1,102 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+Copyright (c) 2001-2004 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+*/
+
+package org.w3c.domts.level1.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The "getNotations()" method creates a NamedNodeMap that
+ * contains all the notations declared in the DTD.
+ *
+ * Retrieve the Document Type for this document and create
+ * a NamedNodeMap object of all the notations. There
+ * should be two items in the list (notation1 and notation2).
+* @author NIST
+* @author Mary Brady
+* @author Curt Arnold
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-D46829EF">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-D46829EF</a>
+*/
+public final class documenttypegetnotations extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public documenttypegetnotations(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "staff", false);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ DocumentType docType;
+ NamedNodeMap notationList;
+ Node notation;
+ String notationName;
+ java.util.Collection actual = new java.util.ArrayList();
+
+ java.util.Collection expected = new java.util.ArrayList();
+ expected.add("notation1");
+ expected.add("notation2");
+
+ doc = (Document) load("staff", false);
+ docType = doc.getDoctype();
+ assertNotNull("docTypeNotNull", docType);
+ notationList = docType.getNotations();
+ assertNotNull("notationsNotNull", notationList);
+ for (int indexN1005B = 0; indexN1005B < notationList.getLength(); indexN1005B++) {
+ notation = (Node) notationList.item(indexN1005B);
+ notationName = notation.getNodeName();
+ actual.add(notationName);
+ }
+ assertEquals("names", expected, actual);
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/documenttypegetnotations";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(documenttypegetnotations.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level1/core/documenttypegetnotationstype.java b/dom/src/test/java/org/w3c/domts/level1/core/documenttypegetnotationstype.java
new file mode 100644
index 0000000..251c84f
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level1/core/documenttypegetnotationstype.java
@@ -0,0 +1,94 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+Copyright (c) 2001-2004 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+*/
+
+package org.w3c.domts.level1.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * Every node in the map returned by the "getNotations()"
+ * method implements the Notation interface.
+ *
+ * Retrieve the Document Type for this document and create
+ * a NamedNodeMap object of all the notations. Traverse
+ * the entire list and examine the NodeType of each node.
+* @author NIST
+* @author Mary Brady
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-D46829EF">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-D46829EF</a>
+*/
+public final class documenttypegetnotationstype extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public documenttypegetnotationstype(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "staff", false);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ DocumentType docType;
+ NamedNodeMap notationList;
+ Node notation;
+ int notationType;
+ doc = (Document) load("staff", false);
+ docType = doc.getDoctype();
+ assertNotNull("docTypeNotNull", docType);
+ notationList = docType.getNotations();
+ assertNotNull("notationsNotNull", notationList);
+ for (int indexN10049 = 0; indexN10049 < notationList.getLength(); indexN10049++) {
+ notation = (Node) notationList.item(indexN10049);
+ notationType = (int) notation.getNodeType();
+ assertEquals("documenttypeGetNotationsTypeAssert", 12, notationType);
+ }
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/documenttypegetnotationstype";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(documenttypegetnotationstype.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level1/core/domimplementationfeaturenoversion.java b/dom/src/test/java/org/w3c/domts/level1/core/domimplementationfeaturenoversion.java
new file mode 100644
index 0000000..232b894
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level1/core/domimplementationfeaturenoversion.java
@@ -0,0 +1,82 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+Copyright (c) 2001-2004 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+*/
+
+package org.w3c.domts.level1.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * hasFeature("XML", "") should return true for implementations that can read staff files.
+* @author NIST
+* @author Mary Brady
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-5CED94D7">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-5CED94D7</a>
+* @see <a href="http://www.w3.org/2000/11/DOM-Level-2-errata#core-14">http://www.w3.org/2000/11/DOM-Level-2-errata#core-14</a>
+*/
+public final class domimplementationfeaturenoversion extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public domimplementationfeaturenoversion(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "staff", false);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ DOMImplementation domImpl;
+ boolean state;
+ doc = (Document) load("staff", false);
+ domImpl = doc.getImplementation();
+ state = domImpl.hasFeature("XML", "");
+assertTrue("hasXMLEmpty", state);
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/domimplementationfeaturenoversion";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(domimplementationfeaturenoversion.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level1/core/domimplementationfeaturenull.java b/dom/src/test/java/org/w3c/domts/level1/core/domimplementationfeaturenull.java
new file mode 100644
index 0000000..88ed136
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level1/core/domimplementationfeaturenull.java
@@ -0,0 +1,90 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+Copyright (c) 2001-2004 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+*/
+
+package org.w3c.domts.level1.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * hasFeature("XML", null) should return true for implementations that can read staff documents.
+* @author NIST
+* @author Curt Arnold
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-5CED94D7">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-5CED94D7</a>
+* @see <a href="http://www.w3.org/2000/11/DOM-Level-2-errata#core-14">http://www.w3.org/2000/11/DOM-Level-2-errata#core-14</a>
+*/
+public final class domimplementationfeaturenull extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public domimplementationfeaturenull(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+
+ org.w3c.domts.DocumentBuilderSetting[] settings =
+ new org.w3c.domts.DocumentBuilderSetting[] {
+org.w3c.domts.DocumentBuilderSetting.hasNullString
+ };
+ DOMTestDocumentBuilderFactory testFactory = factory.newInstance(settings);
+ setFactory(testFactory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "staff", false);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ DOMImplementation domImpl;
+ boolean state;
+ String nullVersion = null;
+
+ doc = (Document) load("staff", false);
+ domImpl = doc.getImplementation();
+ state = domImpl.hasFeature("XML", nullVersion);
+assertTrue("hasXMLnull", state);
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/domimplementationfeaturenull";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(domimplementationfeaturenull.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level1/core/domimplementationfeaturexml.java b/dom/src/test/java/org/w3c/domts/level1/core/domimplementationfeaturexml.java
new file mode 100644
index 0000000..c1cf633
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level1/core/domimplementationfeaturexml.java
@@ -0,0 +1,81 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+Copyright (c) 2001-2004 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+*/
+
+package org.w3c.domts.level1.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * hasFeature("xml", "1.0") should return true for implementations that can read staff documents.
+* @author NIST
+* @author Mary Brady
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-5CED94D7">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-5CED94D7</a>
+*/
+public final class domimplementationfeaturexml extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public domimplementationfeaturexml(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "staff", false);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ DOMImplementation domImpl;
+ boolean state;
+ doc = (Document) load("staff", false);
+ domImpl = doc.getImplementation();
+ state = domImpl.hasFeature("xml", "1.0");
+assertTrue("hasXML1", state);
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/domimplementationfeaturexml";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(domimplementationfeaturexml.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level1/core/elementaddnewattribute.java b/dom/src/test/java/org/w3c/domts/level1/core/elementaddnewattribute.java
new file mode 100644
index 0000000..7be482b
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level1/core/elementaddnewattribute.java
@@ -0,0 +1,91 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+Copyright (c) 2001 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+*/
+
+package org.w3c.domts.level1.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The "setAttribute(name,value)" method adds a new attribute
+ * to the Element
+ *
+ * Retrieve the last child of the last employee, then
+ * add an attribute to it by invoking the
+ * "setAttribute(name,value)" method. It should create
+ * a "name" attribute with an assigned value equal to
+ * "value".
+* @author NIST
+* @author Mary Brady
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-F68F082">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-F68F082</a>
+*/
+public final class elementaddnewattribute extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public elementaddnewattribute(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "staff", true);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ NodeList elementList;
+ Element testEmployee;
+ String attrValue;
+ doc = (Document) load("staff", true);
+ elementList = doc.getElementsByTagName("address");
+ testEmployee = (Element) elementList.item(4);
+ testEmployee.setAttribute("district", "dallas");
+ attrValue = testEmployee.getAttribute("district");
+ assertEquals("elementAddNewAttributeAssert", "dallas", attrValue);
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/elementaddnewattribute";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(elementaddnewattribute.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level1/core/elementassociatedattribute.java b/dom/src/test/java/org/w3c/domts/level1/core/elementassociatedattribute.java
new file mode 100644
index 0000000..b717e2a
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level1/core/elementassociatedattribute.java
@@ -0,0 +1,94 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+Copyright (c) 2001-2004 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+*/
+
+package org.w3c.domts.level1.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * Elements may have attributes associated with them.
+ *
+ * Retrieve the first attribute from the last child of
+ * the first employee and invoke the "getSpecified()"
+ * method. This test is only intended to show that
+ * Elements can actually have attributes. This test uses
+ * the "getNamedItem(name)" method from the NamedNodeMap
+ * interface.
+* @author NIST
+* @author Mary Brady
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-84CF096">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-84CF096</a>
+*/
+public final class elementassociatedattribute extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public elementassociatedattribute(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "staff", false);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ NodeList elementList;
+ Node testEmployee;
+ NamedNodeMap attributes;
+ Attr domesticAttr;
+ boolean specified;
+ doc = (Document) load("staff", false);
+ elementList = doc.getElementsByTagName("address");
+ testEmployee = elementList.item(0);
+ attributes = testEmployee.getAttributes();
+ domesticAttr = (Attr) attributes.getNamedItem("domestic");
+ specified = domesticAttr.getSpecified();
+ assertTrue("domesticSpecified", specified);
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/elementassociatedattribute";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(elementassociatedattribute.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level1/core/elementchangeattributevalue.java b/dom/src/test/java/org/w3c/domts/level1/core/elementchangeattributevalue.java
new file mode 100644
index 0000000..ed48770
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level1/core/elementchangeattributevalue.java
@@ -0,0 +1,94 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+Copyright (c) 2001 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+*/
+
+package org.w3c.domts.level1.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The "setAttribute(name,value)" method adds a new attribute
+ * to the Element. If the "name" is already present, then
+ * its value should be changed to the new one that is in
+ * the "value" parameter.
+ *
+ * Retrieve the last child of the fourth employee, then add
+ * an attribute to it by invoking the
+ * "setAttribute(name,value)" method. Since the name of the
+ * used attribute("street") is already present in this
+ * element, then its value should be changed to the new one
+ * of the "value" parameter.
+* @author NIST
+* @author Mary Brady
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-F68F082">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-F68F082</a>
+*/
+public final class elementchangeattributevalue extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public elementchangeattributevalue(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "staff", true);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ NodeList elementList;
+ Element testEmployee;
+ String attrValue;
+ doc = (Document) load("staff", true);
+ elementList = doc.getElementsByTagName("address");
+ testEmployee = (Element) elementList.item(3);
+ testEmployee.setAttribute("street", "Neither");
+ attrValue = testEmployee.getAttribute("street");
+ assertEquals("elementChangeAttributeValueAssert", "Neither", attrValue);
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/elementchangeattributevalue";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(elementchangeattributevalue.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level1/core/elementcreatenewattribute.java b/dom/src/test/java/org/w3c/domts/level1/core/elementcreatenewattribute.java
new file mode 100644
index 0000000..2cb8364
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level1/core/elementcreatenewattribute.java
@@ -0,0 +1,98 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+Copyright (c) 2001 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+*/
+
+package org.w3c.domts.level1.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The "setAttributeNode(newAttr)" method adds a new
+ * attribute to the Element.
+ *
+ * Retrieve first address element and add
+ * a new attribute node to it by invoking its
+ * "setAttributeNode(newAttr)" method. This test makes use
+ * of the "createAttribute(name)" method from the Document
+ * interface.
+* @author NIST
+* @author Mary Brady
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-887236154">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-887236154</a>
+*/
+public final class elementcreatenewattribute extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public elementcreatenewattribute(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "staff", true);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ NodeList elementList;
+ Element testAddress;
+ Attr newAttribute;
+ Attr oldAttr;
+ Attr districtAttr;
+ String attrVal;
+ doc = (Document) load("staff", true);
+ elementList = doc.getElementsByTagName("address");
+ testAddress = (Element) elementList.item(0);
+ newAttribute = doc.createAttribute("district");
+ oldAttr = testAddress.setAttributeNode(newAttribute);
+ assertNull("old_attr_doesnt_exist", oldAttr);
+ districtAttr = testAddress.getAttributeNode("district");
+ assertNotNull("new_district_accessible", districtAttr);
+ attrVal = testAddress.getAttribute("district");
+ assertEquals("attr_value", "", attrVal);
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/elementcreatenewattribute";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(elementcreatenewattribute.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level1/core/elementgetattributenode.java b/dom/src/test/java/org/w3c/domts/level1/core/elementgetattributenode.java
new file mode 100644
index 0000000..28c9f30
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level1/core/elementgetattributenode.java
@@ -0,0 +1,91 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+Copyright (c) 2001 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+*/
+
+package org.w3c.domts.level1.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The "getAttributeNode(name)" method retrieves an
+ * attribute node by name.
+ *
+ * Retrieve the attribute "domestic" from the last child
+ * of the first employee. Since the method returns an
+ * Attr object, the "name" can be examined to ensure the
+ * proper attribute was retrieved.
+* @author NIST
+* @author Mary Brady
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-217A91B8">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-217A91B8</a>
+*/
+public final class elementgetattributenode extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public elementgetattributenode(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "staff", true);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ NodeList elementList;
+ Element testEmployee;
+ Attr domesticAttr;
+ String name;
+ doc = (Document) load("staff", true);
+ elementList = doc.getElementsByTagName("address");
+ testEmployee = (Element) elementList.item(0);
+ domesticAttr = testEmployee.getAttributeNode("domestic");
+ name = domesticAttr.getNodeName();
+ assertEquals("elementGetAttributeNodeAssert", "domestic", name);
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/elementgetattributenode";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(elementgetattributenode.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level1/core/elementgetattributenodenull.java b/dom/src/test/java/org/w3c/domts/level1/core/elementgetattributenodenull.java
new file mode 100644
index 0000000..e5449f6
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level1/core/elementgetattributenodenull.java
@@ -0,0 +1,90 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+Copyright (c) 2001 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+*/
+
+package org.w3c.domts.level1.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The "getAttributeNode(name)" method retrieves an
+ * attribute node by name. It should return null if the
+ * "name" attribute does not exist.
+ *
+ * Retrieve the last child of the first employee and attempt
+ * to retrieve a non-existing attribute. The method should
+ * return "null". The non-existing attribute to be used
+ * is "invalidAttribute".
+* @author NIST
+* @author Mary Brady
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-217A91B8">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-217A91B8</a>
+*/
+public final class elementgetattributenodenull extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public elementgetattributenodenull(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "staff", true);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ NodeList elementList;
+ Element testEmployee;
+ Attr domesticAttr;
+ doc = (Document) load("staff", true);
+ elementList = doc.getElementsByTagName("address");
+ testEmployee = (Element) elementList.item(0);
+ domesticAttr = testEmployee.getAttributeNode("invalidAttribute");
+ assertNull("elementGetAttributeNodeNullAssert", domesticAttr);
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/elementgetattributenodenull";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(elementgetattributenodenull.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level1/core/elementgetelementempty.java b/dom/src/test/java/org/w3c/domts/level1/core/elementgetelementempty.java
new file mode 100644
index 0000000..79bb924
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level1/core/elementgetelementempty.java
@@ -0,0 +1,97 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+Copyright (c) 2001 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+*/
+
+package org.w3c.domts.level1.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The "getAttribute(name)" method returns an empty
+ * string if no value was assigned to an attribute and
+ * no default value was given in the DTD file.
+ *
+ * Retrieve the last child of the last employee, then
+ * invoke "getAttribute(name)" method, where "name" is an
+ * attribute without a specified or DTD default value.
+ * The "getAttribute(name)" method should return the empty
+ * string. This method makes use of the
+ * "createAttribute(newAttr)" method from the Document
+ * interface.
+* @author NIST
+* @author Mary Brady
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-666EE0F9">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-666EE0F9</a>
+*/
+public final class elementgetelementempty extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public elementgetelementempty(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "staff", true);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ Attr newAttribute;
+ NodeList elementList;
+ Element testEmployee;
+ Attr domesticAttr;
+ String attrValue;
+ doc = (Document) load("staff", true);
+ newAttribute = doc.createAttribute("district");
+ elementList = doc.getElementsByTagName("address");
+ testEmployee = (Element) elementList.item(3);
+ domesticAttr = testEmployee.setAttributeNode(newAttribute);
+ attrValue = testEmployee.getAttribute("district");
+ assertEquals("elementGetElementEmptyAssert", "", attrValue);
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/elementgetelementempty";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(elementgetelementempty.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level1/core/elementgetelementsbytagname.java b/dom/src/test/java/org/w3c/domts/level1/core/elementgetelementsbytagname.java
new file mode 100644
index 0000000..af8bada
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level1/core/elementgetelementsbytagname.java
@@ -0,0 +1,86 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+Copyright (c) 2001 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+*/
+
+package org.w3c.domts.level1.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The "getElementsByTagName(name)" method returns a list
+ * of all descendant Elements with the given tag name.
+ * Test for an empty list.
+ * Create a NodeList of all the descendant elements
+ * using the string "noMatch" as the tagName.
+ * The method should return a NodeList whose length is
+ * "0" since there are not any descendant elements
+ * that match the given tag name.
+* @author NIST
+* @author Mary Brady
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-1938918D">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-1938918D</a>
+*/
+public final class elementgetelementsbytagname extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public elementgetelementsbytagname(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "staff", false);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ NodeList elementList;
+ doc = (Document) load("staff", false);
+ elementList = doc.getElementsByTagName("employee");
+ assertSize("elementGetElementsByTagNameAssert", 5, elementList);
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/elementgetelementsbytagname";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(elementgetelementsbytagname.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level1/core/elementgetelementsbytagnameaccessnodelist.java b/dom/src/test/java/org/w3c/domts/level1/core/elementgetelementsbytagnameaccessnodelist.java
new file mode 100644
index 0000000..76721b0
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level1/core/elementgetelementsbytagnameaccessnodelist.java
@@ -0,0 +1,96 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+Copyright (c) 2001-2004 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+*/
+
+package org.w3c.domts.level1.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * Element.getElementsByTagName("employee") should return a NodeList whose length is
+ * "5" in the order the children were encountered.
+* @author NIST
+* @author Mary Brady
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-1938918D">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-1938918D</a>
+*/
+public final class elementgetelementsbytagnameaccessnodelist extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public elementgetelementsbytagnameaccessnodelist(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "staff", false);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ NodeList elementList;
+ Element testEmployee;
+ Node child;
+ String childName;
+ String childValue;
+ int childType;
+ doc = (Document) load("staff", false);
+ elementList = doc.getElementsByTagName("employee");
+ testEmployee = (Element) elementList.item(3);
+ child = testEmployee.getFirstChild();
+ childType = (int) child.getNodeType();
+
+ if (equals(3, childType)) {
+ child = child.getNextSibling();
+ }
+ childName = child.getNodeName();
+ assertEquals("nodename", "employeeId", childName);
+ child = child.getFirstChild();
+ childValue = child.getNodeValue();
+ assertEquals("emp0004", "EMP0004", childValue);
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/elementgetelementsbytagnameaccessnodelist";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(elementgetelementsbytagnameaccessnodelist.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level1/core/elementgetelementsbytagnamenomatch.java b/dom/src/test/java/org/w3c/domts/level1/core/elementgetelementsbytagnamenomatch.java
new file mode 100644
index 0000000..a89d4dc
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level1/core/elementgetelementsbytagnamenomatch.java
@@ -0,0 +1,84 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+Copyright (c) 2001 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+*/
+
+package org.w3c.domts.level1.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The "getElementsByTagName(name)" method returns a list
+ * of all descendant Elements with the given tag name.
+ * Create a NodeList of all the descendant elements
+ * using the string "employee" as the tagName.
+ * The method should return a NodeList whose length is
+ * "5".
+* @author NIST
+* @author Mary Brady
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-1938918D">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-1938918D</a>
+*/
+public final class elementgetelementsbytagnamenomatch extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public elementgetelementsbytagnamenomatch(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "staff", false);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ NodeList elementList;
+ doc = (Document) load("staff", false);
+ elementList = doc.getElementsByTagName("noMatch");
+ assertSize("elementGetElementsByTagNameNoMatchNoMatchAssert", 0, elementList);
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/elementgetelementsbytagnamenomatch";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(elementgetelementsbytagnamenomatch.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level1/core/elementgetelementsbytagnamespecialvalue.java b/dom/src/test/java/org/w3c/domts/level1/core/elementgetelementsbytagnamespecialvalue.java
new file mode 100644
index 0000000..2a1b927
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level1/core/elementgetelementsbytagnamespecialvalue.java
@@ -0,0 +1,106 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+Copyright (c) 2001-2004 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+*/
+
+package org.w3c.domts.level1.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The "getElementsByTagName(name)" method may use the
+ * special value "*" to match all tags in the element
+ * tree.
+ * Create a NodeList of all the descendant elements
+ * of the last employee by using the special value "*".
+ * The method should return all the descendant children(6)
+ * in the order the children were encountered.
+* @author NIST
+* @author Mary Brady
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-1938918D">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-1938918D</a>
+*/
+public final class elementgetelementsbytagnamespecialvalue extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public elementgetelementsbytagnamespecialvalue(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "staff", false);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ NodeList elementList;
+ Element lastEmployee;
+ NodeList lastempList;
+ Node child;
+ String childName;
+ java.util.List result = new java.util.ArrayList();
+
+ java.util.List expectedResult = new java.util.ArrayList();
+ expectedResult.add("employeeId");
+ expectedResult.add("name");
+ expectedResult.add("position");
+ expectedResult.add("salary");
+ expectedResult.add("gender");
+ expectedResult.add("address");
+
+ doc = (Document) load("staff", false);
+ elementList = doc.getElementsByTagName("employee");
+ lastEmployee = (Element) elementList.item(4);
+ lastempList = lastEmployee.getElementsByTagName("*");
+ for (int indexN1006A = 0; indexN1006A < lastempList.getLength(); indexN1006A++) {
+ child = (Node) lastempList.item(indexN1006A);
+ childName = child.getNodeName();
+ result.add(childName);
+ }
+ assertEquals("tagNames", expectedResult, result);
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/elementgetelementsbytagnamespecialvalue";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(elementgetelementsbytagnamespecialvalue.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level1/core/elementgettagname.java b/dom/src/test/java/org/w3c/domts/level1/core/elementgettagname.java
new file mode 100644
index 0000000..8fef87f
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level1/core/elementgettagname.java
@@ -0,0 +1,92 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+Copyright (c) 2001 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+*/
+
+package org.w3c.domts.level1.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The "getTagName()" method returns the
+ * tagName of an element.
+ *
+ * Invoke the "getTagName()" method one the
+ * root node. The value returned should be "staff".
+* @author NIST
+* @author Mary Brady
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-104682815">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-104682815</a>
+* @see <a href="http://www.w3.org/Bugs/Public/show_bug.cgi?id=251">http://www.w3.org/Bugs/Public/show_bug.cgi?id=251</a>
+*/
+public final class elementgettagname extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public elementgettagname(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "staff", false);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ Element root;
+ String tagname;
+ doc = (Document) load("staff", false);
+ root = doc.getDocumentElement();
+ tagname = root.getTagName();
+
+ if (("image/svg+xml".equals(getContentType()))) {
+ assertEquals("svgTagName", "svg", tagname);
+ } else {
+ assertEquals("elementGetTagNameAssert", "staff", tagname);
+ }
+
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/elementgettagname";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(elementgettagname.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level1/core/elementinuseattributeerr.java b/dom/src/test/java/org/w3c/domts/level1/core/elementinuseattributeerr.java
new file mode 100644
index 0000000..da60c70
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level1/core/elementinuseattributeerr.java
@@ -0,0 +1,112 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+Copyright (c) 2001 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+*/
+
+package org.w3c.domts.level1.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The "setAttributeNode(newAttr)" method raises an
+ * "INUSE_ATTRIBUTE_ERR DOMException if the "newAttr"
+ * is already an attribute of another element.
+ *
+ * Retrieve the last child of the second employee and append
+ * a newly created element. The "createAttribute(name)"
+ * and "setAttributeNode(newAttr)" methods are invoked
+ * to create and add a new attribute to the newly created
+ * Element. The "setAttributeNode(newAttr)" method is
+ * once again called to add the new attribute causing an
+ * exception to be raised since the attribute is already
+ * an attribute of another element.
+* @author NIST
+* @author Mary Brady
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-258A00AF')/constant[@name='INUSE_ATTRIBUTE_ERR'])">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-258A00AF')/constant[@name='INUSE_ATTRIBUTE_ERR'])</a>
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-887236154">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-887236154</a>
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-887236154')/raises/exception[@name='DOMException']/descr/p[substring-before(.,':')='INUSE_ATTRIBUTE_ERR'])">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-887236154')/raises/exception[@name='DOMException']/descr/p[substring-before(.,':')='INUSE_ATTRIBUTE_ERR'])</a>
+*/
+public final class elementinuseattributeerr extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public elementinuseattributeerr(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "staff", true);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ Attr newAttribute;
+ NodeList addressElementList;
+ Element testAddress;
+ Element newElement;
+ Node appendedChild;
+ Attr setAttr1;
+ Attr setAttr2;
+ doc = (Document) load("staff", true);
+ addressElementList = doc.getElementsByTagName("address");
+ testAddress = (Element) addressElementList.item(1);
+ newElement = doc.createElement("newElement");
+ appendedChild = testAddress.appendChild(newElement);
+ newAttribute = doc.createAttribute("newAttribute");
+ setAttr1 = newElement.setAttributeNode(newAttribute);
+
+ {
+ boolean success = false;
+ try {
+ setAttr2 = testAddress.setAttributeNode(newAttribute);
+ } catch (DOMException ex) {
+ success = (ex.code == DOMException.INUSE_ATTRIBUTE_ERR);
+ }
+ assertTrue("throw_INUSE_ATTRIBUTE_ERR", success);
+ }
+}
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/elementinuseattributeerr";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(elementinuseattributeerr.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level1/core/elementinvalidcharacterexception.java b/dom/src/test/java/org/w3c/domts/level1/core/elementinvalidcharacterexception.java
new file mode 100644
index 0000000..651b484
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level1/core/elementinvalidcharacterexception.java
@@ -0,0 +1,99 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+Copyright (c) 2001-2003 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+*/
+
+package org.w3c.domts.level1.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The "setAttribute(name,value)" method raises an
+ * "INVALID_CHARACTER_ERR DOMException if the specified
+ * name contains an invalid character.
+ *
+ * Retrieve the last child of the first employee and
+ * call its "setAttribute(name,value)" method with
+ * "name" containing an invalid character.
+* @author NIST
+* @author Mary Brady
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-258A00AF')/constant[@name='INVALID_CHARACTER_ERR'])">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-258A00AF')/constant[@name='INVALID_CHARACTER_ERR'])</a>
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-F68F082">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-F68F082</a>
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-F68F082')/raises/exception[@name='DOMException']/descr/p[substring-before(.,':')='INVALID_CHARACTER_ERR'])">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-F68F082')/raises/exception[@name='DOMException']/descr/p[substring-before(.,':')='INVALID_CHARACTER_ERR'])</a>
+* @see <a href="http://www.w3.org/Bugs/Public/show_bug.cgi?id=249">http://www.w3.org/Bugs/Public/show_bug.cgi?id=249</a>
+*/
+public final class elementinvalidcharacterexception extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public elementinvalidcharacterexception(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "staff", true);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ NodeList elementList;
+ Element testAddress;
+ doc = (Document) load("staff", true);
+ elementList = doc.getElementsByTagName("address");
+ testAddress = (Element) elementList.item(0);
+
+ {
+ boolean success = false;
+ try {
+ testAddress.setAttribute("invalid^Name", "value");
+ } catch (DOMException ex) {
+ success = (ex.code == DOMException.INVALID_CHARACTER_ERR);
+ }
+ assertTrue("throw_INVALID_CHARACTER_ERR", success);
+ }
+}
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/elementinvalidcharacterexception";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(elementinvalidcharacterexception.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level1/core/elementnormalize.java b/dom/src/test/java/org/w3c/domts/level1/core/elementnormalize.java
new file mode 100644
index 0000000..c73e7cd
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level1/core/elementnormalize.java
@@ -0,0 +1,95 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+Copyright (c) 2001 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+*/
+
+package org.w3c.domts.level1.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The "normalize()" method puts all the nodes in the full
+ * depth of the sub-tree underneath this element into a
+ * "normal" form.
+ *
+ * Retrieve the third employee and access its second child.
+ * This child contains a block of text that is spread
+ * across multiple lines. The content of the "name" child
+ * should be parsed and treated as a single Text node.
+* @author NIST
+* @author Mary Brady
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-162CF083">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-162CF083</a>
+*/
+public final class elementnormalize extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public elementnormalize(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "staff", true);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ Element root;
+ NodeList elementList;
+ Element testName;
+ Node firstChild;
+ String childValue;
+ doc = (Document) load("staff", true);
+ root = doc.getDocumentElement();
+ root.normalize();
+ elementList = root.getElementsByTagName("name");
+ testName = (Element) elementList.item(2);
+ firstChild = testName.getFirstChild();
+ childValue = firstChild.getNodeValue();
+ assertEquals("elementNormalizeAssert", "Roger\n Jones", childValue);
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/elementnormalize";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(elementnormalize.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level1/core/elementnotfounderr.java b/dom/src/test/java/org/w3c/domts/level1/core/elementnotfounderr.java
new file mode 100644
index 0000000..8413f6b
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level1/core/elementnotfounderr.java
@@ -0,0 +1,104 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+Copyright (c) 2001 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+*/
+
+package org.w3c.domts.level1.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The "removeAttributeNode(oldAttr)" method raises a
+ * NOT_FOUND_ERR DOMException if the "oldAttr" attribute
+ * is not an attribute of the element.
+ *
+ * Retrieve the last employee and attempt to remove
+ * a non existing attribute node. This should cause the
+ * intended exception to be raised. This test makes use
+ * of the "createAttribute(name)" method from the Document
+ * interface.
+* @author NIST
+* @author Mary Brady
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-258A00AF')/constant[@name='INUSE_ATTRIBUTE_ERR'])">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-258A00AF')/constant[@name='INUSE_ATTRIBUTE_ERR'])</a>
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-D589198">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-D589198</a>
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-D589198')/raises/exception[@name='DOMException']/descr/p[substring-before(.,':')='INUSE_ATTRIBUTE_ERR'])">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-D589198')/raises/exception[@name='DOMException']/descr/p[substring-before(.,':')='INUSE_ATTRIBUTE_ERR'])</a>
+* @see <a href="http://www.w3.org/Bugs/Public/show_bug.cgi?id=249">http://www.w3.org/Bugs/Public/show_bug.cgi?id=249</a>
+*/
+public final class elementnotfounderr extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public elementnotfounderr(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "staff", true);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ Attr oldAttribute;
+ NodeList addressElementList;
+ Element testAddress;
+ Attr attrAddress;
+ doc = (Document) load("staff", true);
+ addressElementList = doc.getElementsByTagName("address");
+ testAddress = (Element) addressElementList.item(4);
+ oldAttribute = doc.createAttribute("oldAttribute");
+
+ {
+ boolean success = false;
+ try {
+ attrAddress = testAddress.removeAttributeNode(oldAttribute);
+ } catch (DOMException ex) {
+ success = (ex.code == DOMException.NOT_FOUND_ERR);
+ }
+ assertTrue("throw_NOT_FOUND_ERR", success);
+ }
+}
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/elementnotfounderr";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(elementnotfounderr.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level1/core/elementremoveattribute.java b/dom/src/test/java/org/w3c/domts/level1/core/elementremoveattribute.java
new file mode 100644
index 0000000..da5411b
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level1/core/elementremoveattribute.java
@@ -0,0 +1,100 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+Copyright (c) 2001-2004 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+*/
+
+package org.w3c.domts.level1.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The "removeAttribute(name)" removes an attribute by name.
+ * If the attribute has a default value, it is immediately
+ * replaced.
+ *
+ * Retrieve the attribute named "street" from the last child
+ * of the fourth employee, then remove the "street"
+ * attribute by invoking the "removeAttribute(name)" method.
+ * The "street" attribute has a default value defined in the
+ * DTD file, that value should immediately replace the old
+ * value.
+* @author NIST
+* @author Mary Brady
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-6D6AC0F9">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-6D6AC0F9</a>
+* @see <a href="http://lists.w3.org/Archives/Public/www-dom-ts/2002Mar/0002.html">http://lists.w3.org/Archives/Public/www-dom-ts/2002Mar/0002.html</a>
+*/
+public final class elementremoveattribute extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public elementremoveattribute(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+
+ org.w3c.domts.DocumentBuilderSetting[] settings =
+ new org.w3c.domts.DocumentBuilderSetting[] {
+org.w3c.domts.DocumentBuilderSetting.validating
+ };
+ DOMTestDocumentBuilderFactory testFactory = factory.newInstance(settings);
+ setFactory(testFactory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "staff", true);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ NodeList elementList;
+ Element testEmployee;
+ String attrValue;
+ doc = (Document) load("staff", true);
+ elementList = doc.getElementsByTagName("address");
+ testEmployee = (Element) elementList.item(3);
+ testEmployee.removeAttribute("street");
+ attrValue = testEmployee.getAttribute("street");
+ assertEquals("streetYes", "Yes", attrValue);
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/elementremoveattribute";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(elementremoveattribute.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level1/core/elementremoveattributeaftercreate.java b/dom/src/test/java/org/w3c/domts/level1/core/elementremoveattributeaftercreate.java
new file mode 100644
index 0000000..e153f15
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level1/core/elementremoveattributeaftercreate.java
@@ -0,0 +1,97 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+Copyright (c) 2001 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+*/
+
+package org.w3c.domts.level1.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The "removeAttributeNode(oldAttr)" method removes the
+ * specified attribute.
+ *
+ * Retrieve the last child of the third employee, add a
+ * new "district" node to it and then try to remove it.
+ * To verify that the node was removed use the
+ * "getNamedItem(name)" method from the NamedNodeMap
+ * interface. It also uses the "getAttributes()" method
+ * from the Node interface.
+* @author NIST
+* @author Mary Brady
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-D589198">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-D589198</a>
+*/
+public final class elementremoveattributeaftercreate extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public elementremoveattributeaftercreate(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "staff", true);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ NodeList elementList;
+ Element testEmployee;
+ Attr newAttribute;
+ NamedNodeMap attributes;
+ Attr districtAttr;
+ doc = (Document) load("staff", true);
+ elementList = doc.getElementsByTagName("address");
+ testEmployee = (Element) elementList.item(2);
+ newAttribute = doc.createAttribute("district");
+ districtAttr = testEmployee.setAttributeNode(newAttribute);
+ districtAttr = testEmployee.removeAttributeNode(newAttribute);
+ attributes = testEmployee.getAttributes();
+ districtAttr = (Attr) attributes.getNamedItem("district");
+ assertNull("elementRemoveAttributeAfterCreateAssert", districtAttr);
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/elementremoveattributeaftercreate";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(elementremoveattributeaftercreate.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level1/core/elementremoveattributenode.java b/dom/src/test/java/org/w3c/domts/level1/core/elementremoveattributenode.java
new file mode 100644
index 0000000..5b378bf
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level1/core/elementremoveattributenode.java
@@ -0,0 +1,92 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+Copyright (c) 2001 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+*/
+
+package org.w3c.domts.level1.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The "removeAttributeNode(oldAttr)" method returns the
+ * node that was removed.
+ *
+ * Retrieve the last child of the third employee and
+ * remove its "street" Attr node. The method should
+ * return the old attribute node.
+* @author NIST
+* @author Mary Brady
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-D589198">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-D589198</a>
+*/
+public final class elementremoveattributenode extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public elementremoveattributenode(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "staff", true);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ NodeList elementList;
+ Element testEmployee;
+ Attr streetAttr;
+ Attr removedAttr;
+ String removedValue;
+ doc = (Document) load("staff", true);
+ elementList = doc.getElementsByTagName("address");
+ testEmployee = (Element) elementList.item(2);
+ streetAttr = testEmployee.getAttributeNode("street");
+ removedAttr = testEmployee.removeAttributeNode(streetAttr);
+ removedValue = removedAttr.getValue();
+ assertEquals("elementRemoveAttributeNodeAssert", "No", removedValue);
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/elementremoveattributenode";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(elementremoveattributenode.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level1/core/elementremoveattributenodenomodificationallowederr.java b/dom/src/test/java/org/w3c/domts/level1/core/elementremoveattributenodenomodificationallowederr.java
new file mode 100644
index 0000000..2d5b755
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level1/core/elementremoveattributenodenomodificationallowederr.java
@@ -0,0 +1,122 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+Copyright (c) 2001-2004 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+*/
+
+package org.w3c.domts.level1.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The "removeAttributeNode(oldAttr)" method for an attribute causes the
+ * DOMException NO_MODIFICATION_ALLOWED_ERR to be raised
+ * if the node is readonly.
+ *
+ * Obtain the children of the THIRD "gender" element. The elements
+ * content is an entity reference. Try to remove the "domestic" attribute
+ * from the entity reference by executing the "removeAttributeNode(oldAttr)" method.
+ * This causes a NO_MODIFICATION_ALLOWED_ERR DOMException to be thrown.
+* @author NIST
+* @author Mary Brady
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-258A00AF')/constant[@name='NO_MODIFICATION_ALLOWED_ERR'])">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-258A00AF')/constant[@name='NO_MODIFICATION_ALLOWED_ERR'])</a>
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-D589198">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-D589198</a>
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-D589198')/raises/exception[@name='DOMException']/descr/p[substring-before(.,':')='NO_MODIFICATION_ALLOWED_ERR'])">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-D589198')/raises/exception[@name='DOMException']/descr/p[substring-before(.,':')='NO_MODIFICATION_ALLOWED_ERR'])</a>
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-D589198">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-D589198</a>
+*/
+public final class elementremoveattributenodenomodificationallowederr extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public elementremoveattributenodenomodificationallowederr(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "staff", true);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ NodeList genderList;
+ Node gender;
+ NodeList genList;
+ Node gen;
+ int nodeType;
+ NodeList gList;
+ Element genElement;
+ NamedNodeMap attrList;
+ Attr attrNode;
+ Attr removedAttr;
+ doc = (Document) load("staff", true);
+ genderList = doc.getElementsByTagName("gender");
+ gender = genderList.item(2);
+ genList = gender.getChildNodes();
+ gen = genList.item(0);
+ assertNotNull("genNotNull", gen);
+ nodeType = (int) gen.getNodeType();
+
+ if (equals(1, nodeType)) {
+ gen = doc.createEntityReference("ent4");
+ assertNotNull("createdEntRefNotNull", gen);
+ }
+ gList = gen.getChildNodes();
+ genElement = (Element) gList.item(0);
+ assertNotNull("genElementNotNull", genElement);
+ attrList = genElement.getAttributes();
+ attrNode = (Attr) attrList.getNamedItem("domestic");
+
+ {
+ boolean success = false;
+ try {
+ removedAttr = genElement.removeAttributeNode(attrNode);
+ } catch (DOMException ex) {
+ success = (ex.code == DOMException.NO_MODIFICATION_ALLOWED_ERR);
+ }
+ assertTrue("throw_NO_MODIFICATION_ALLOWED_ERR", success);
+ }
+}
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/elementremoveattributenodenomodificationallowederr";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(elementremoveattributenodenomodificationallowederr.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level1/core/elementremoveattributenodenomodificationallowederrEE.java b/dom/src/test/java/org/w3c/domts/level1/core/elementremoveattributenodenomodificationallowederrEE.java
new file mode 100644
index 0000000..dc7d563
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level1/core/elementremoveattributenodenomodificationallowederrEE.java
@@ -0,0 +1,115 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+Copyright (c) 2001-2004 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+*/
+
+package org.w3c.domts.level1.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The "removeAttributeNode(oldAttr)" method for an attribute causes the
+ * DOMException NO_MODIFICATION_ALLOWED_ERR to be raised
+ * if the node is readonly.
+ *
+ * Create an entity reference and add it to the children of the THIRD "gender" element.
+ * Try to remove the "domestic" attribute from the entity
+ * reference by executing the "removeAttributeNode(oldAttr)" method.
+ * This causes a NO_MODIFICATION_ALLOWED_ERR DOMException to be thrown.
+* @author Curt Arnold
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-258A00AF')/constant[@name='NO_MODIFICATION_ALLOWED_ERR'])">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-258A00AF')/constant[@name='NO_MODIFICATION_ALLOWED_ERR'])</a>
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-D589198">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-D589198</a>
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-D589198')/raises/exception[@name='DOMException']/descr/p[substring-before(.,':')='NO_MODIFICATION_ALLOWED_ERR'])">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-D589198')/raises/exception[@name='DOMException']/descr/p[substring-before(.,':')='NO_MODIFICATION_ALLOWED_ERR'])</a>
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-D589198">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-D589198</a>
+* @see <a href="http://www.w3.org/2001/DOM-Test-Suite/level1/core/elementremoveattributenodenomodificationallowederr.xml">http://www.w3.org/2001/DOM-Test-Suite/level1/core/elementremoveattributenodenomodificationallowederr.xml</a>
+*/
+public final class elementremoveattributenodenomodificationallowederrEE extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public elementremoveattributenodenomodificationallowederrEE(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "staff", true);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ NodeList genderList;
+ Node gender;
+ EntityReference entRef;
+ Element entElement;
+ NamedNodeMap attrList;
+ Attr attrNode;
+ int nodeType;
+ Attr removedAttr;
+ Node appendedChild;
+ doc = (Document) load("staff", true);
+ genderList = doc.getElementsByTagName("gender");
+ gender = genderList.item(2);
+ entRef = doc.createEntityReference("ent4");
+ assertNotNull("createdEntRefNotNull", entRef);
+ appendedChild = gender.appendChild(entRef);
+ entElement = (Element) entRef.getFirstChild();
+ assertNotNull("entElementNotNull", entElement);
+ attrList = entElement.getAttributes();
+ attrNode = (Attr) attrList.getNamedItem("domestic");
+ assertNotNull("attrNodeNotNull", attrNode);
+
+ {
+ boolean success = false;
+ try {
+ removedAttr = entElement.removeAttributeNode(attrNode);
+ } catch (DOMException ex) {
+ success = (ex.code == DOMException.NO_MODIFICATION_ALLOWED_ERR);
+ }
+ assertTrue("throw_NO_MODIFICATION_ALLOWED_ERR", success);
+ }
+}
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/elementremoveattributenodenomodificationallowederrEE";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(elementremoveattributenodenomodificationallowederrEE.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level1/core/elementremoveattributenomodificationallowederr.java b/dom/src/test/java/org/w3c/domts/level1/core/elementremoveattributenomodificationallowederr.java
new file mode 100644
index 0000000..e4b93c4
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level1/core/elementremoveattributenomodificationallowederr.java
@@ -0,0 +1,117 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+Copyright (c) 2001-2004 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+*/
+
+package org.w3c.domts.level1.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The "removeAttribute(name)" method for an attribute causes the
+ * DOMException NO_MODIFICATION_ALLOWED_ERR to be raised
+ * if the node is readonly.
+ *
+ * Obtain the children of the THIRD "gender" element. The elements
+ * content is an entity reference. Try to remove the "domestic" attribute
+ * from the entity reference by executing the "removeAttribute(name)" method.
+ * This causes a NO_MODIFICATION_ALLOWED_ERR DOMException to be thrown.
+* @author NIST
+* @author Mary Brady
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-258A00AF')/constant[@name='NO_MODIFICATION_ALLOWED_ERR'])">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-258A00AF')/constant[@name='NO_MODIFICATION_ALLOWED_ERR'])</a>
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-6D6AC0F9">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-6D6AC0F9</a>
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-6D6AC0F9')/raises/exception[@name='DOMException']/descr/p[substring-before(.,':')='NO_MODIFICATION_ALLOWED_ERR'])">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-6D6AC0F9')/raises/exception[@name='DOMException']/descr/p[substring-before(.,':')='NO_MODIFICATION_ALLOWED_ERR'])</a>
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-6D6AC0F9">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-6D6AC0F9</a>
+*/
+public final class elementremoveattributenomodificationallowederr extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public elementremoveattributenomodificationallowederr(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "staff", true);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ NodeList genderList;
+ Node gender;
+ NodeList genList;
+ Node gen;
+ NodeList gList;
+ int nodeType;
+ Element genElement;
+ doc = (Document) load("staff", true);
+ genderList = doc.getElementsByTagName("gender");
+ gender = genderList.item(2);
+ genList = gender.getChildNodes();
+ gen = genList.item(0);
+ assertNotNull("genNotNull", gen);
+ nodeType = (int) gen.getNodeType();
+
+ if (equals(1, nodeType)) {
+ gen = doc.createEntityReference("ent4");
+ assertNotNull("createdEntRefNotNull", gen);
+ }
+ gList = gen.getChildNodes();
+ genElement = (Element) gList.item(0);
+ assertNotNull("genElementNotNull", genElement);
+
+ {
+ boolean success = false;
+ try {
+ genElement.removeAttribute("domestic");
+ } catch (DOMException ex) {
+ success = (ex.code == DOMException.NO_MODIFICATION_ALLOWED_ERR);
+ }
+ assertTrue("throw_NO_MODIFICATION_ALLOWED_ERR", success);
+ }
+}
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/elementremoveattributenomodificationallowederr";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(elementremoveattributenomodificationallowederr.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level1/core/elementremoveattributenomodificationallowederrEE.java b/dom/src/test/java/org/w3c/domts/level1/core/elementremoveattributenomodificationallowederrEE.java
new file mode 100644
index 0000000..4bfb1a8
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level1/core/elementremoveattributenomodificationallowederrEE.java
@@ -0,0 +1,107 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+Copyright (c) 2001-2004 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+*/
+
+package org.w3c.domts.level1.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The "removeAttribute(name)" method for an attribute causes the
+ * DOMException NO_MODIFICATION_ALLOWED_ERR to be raised
+ * if the node is readonly.
+ *
+ * Create an reference the entity ent4 and add it to the THIRD "gender" element.
+ * Try to remove the "domestic" attribute from the entity reference by executing the "removeAttribute(name)" method.
+ * This causes a NO_MODIFICATION_ALLOWED_ERR DOMException to be thrown.
+* @author Curt Arnold
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-258A00AF')/constant[@name='NO_MODIFICATION_ALLOWED_ERR'])">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-258A00AF')/constant[@name='NO_MODIFICATION_ALLOWED_ERR'])</a>
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-6D6AC0F9">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-6D6AC0F9</a>
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-6D6AC0F9')/raises/exception[@name='DOMException']/descr/p[substring-before(.,':')='NO_MODIFICATION_ALLOWED_ERR'])">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-6D6AC0F9')/raises/exception[@name='DOMException']/descr/p[substring-before(.,':')='NO_MODIFICATION_ALLOWED_ERR'])</a>
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-6D6AC0F9">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-6D6AC0F9</a>
+* @see <a href="http://www.w3.org/2001/DOM-Test-Suite/level1/core/elementremoveattributenomodificationallowederr.xml">http://www.w3.org/2001/DOM-Test-Suite/level1/core/elementremoveattributenomodificationallowederr.xml</a>
+*/
+public final class elementremoveattributenomodificationallowederrEE extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public elementremoveattributenomodificationallowederrEE(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "staff", true);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ NodeList genderList;
+ Node gender;
+ EntityReference entRef;
+ Element entElement;
+ Node appendedChild;
+ doc = (Document) load("staff", true);
+ genderList = doc.getElementsByTagName("gender");
+ gender = genderList.item(2);
+ entRef = doc.createEntityReference("ent4");
+ assertNotNull("createdEntRefNotNull", entRef);
+ appendedChild = gender.appendChild(entRef);
+ entElement = (Element) entRef.getFirstChild();
+ assertNotNull("entElementNotNull", entElement);
+
+ {
+ boolean success = false;
+ try {
+ entElement.removeAttribute("domestic");
+ } catch (DOMException ex) {
+ success = (ex.code == DOMException.NO_MODIFICATION_ALLOWED_ERR);
+ }
+ assertTrue("throw_NO_MODIFICATION_ALLOWED_ERR", success);
+ }
+}
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/elementremoveattributenomodificationallowederrEE";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(elementremoveattributenomodificationallowederrEE.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level1/core/elementremoveattributerestoredefaultvalue.java b/dom/src/test/java/org/w3c/domts/level1/core/elementremoveattributerestoredefaultvalue.java
new file mode 100644
index 0000000..bbe52be
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level1/core/elementremoveattributerestoredefaultvalue.java
@@ -0,0 +1,100 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+Copyright (c) 2001-2004 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+*/
+
+package org.w3c.domts.level1.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The "removeAttributeNode(oldAttr)" method removes the
+ * specified attribute node and restores any default values.
+ *
+ * Retrieve the last child of the third employeed and
+ * remove its "street" Attr node. Since this node has a
+ * default value defined in the DTD file, that default
+ * should immediately be the new value.
+* @author NIST
+* @author Mary Brady
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-D589198">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-D589198</a>
+* @see <a href="http://lists.w3.org/Archives/Public/www-dom-ts/2002Mar/0002.html">http://lists.w3.org/Archives/Public/www-dom-ts/2002Mar/0002.html</a>
+*/
+public final class elementremoveattributerestoredefaultvalue extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public elementremoveattributerestoredefaultvalue(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+
+ org.w3c.domts.DocumentBuilderSetting[] settings =
+ new org.w3c.domts.DocumentBuilderSetting[] {
+org.w3c.domts.DocumentBuilderSetting.validating
+ };
+ DOMTestDocumentBuilderFactory testFactory = factory.newInstance(settings);
+ setFactory(testFactory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "staff", true);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ NodeList elementList;
+ Element testEmployee;
+ Attr streetAttr;
+ String attribute;
+ Attr removedAttr;
+ doc = (Document) load("staff", true);
+ elementList = doc.getElementsByTagName("address");
+ testEmployee = (Element) elementList.item(2);
+ streetAttr = testEmployee.getAttributeNode("street");
+ removedAttr = testEmployee.removeAttributeNode(streetAttr);
+ attribute = testEmployee.getAttribute("street");
+ assertEquals("streetYes", "Yes", attribute);
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/elementremoveattributerestoredefaultvalue";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(elementremoveattributerestoredefaultvalue.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level1/core/elementreplaceattributewithself.java b/dom/src/test/java/org/w3c/domts/level1/core/elementreplaceattributewithself.java
new file mode 100644
index 0000000..0d029b5
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level1/core/elementreplaceattributewithself.java
@@ -0,0 +1,89 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+Copyright (c) 2001 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+*/
+
+package org.w3c.domts.level1.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * This test calls setAttributeNode to replace an attribute with itself.
+ * Since the node is not an attribute of another Element, it would
+ * be inappropriate to throw an INUSE_ATTRIBUTE_ERR.
+ * This test was derived from elementinuserattributeerr which
+ * inadvertanly made this test.
+* @author Curt Arnold
+* @author Curt Arnold
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-887236154">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-887236154</a>
+*/
+public final class elementreplaceattributewithself extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public elementreplaceattributewithself(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "staff", true);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ NodeList elementList;
+ Element testEmployee;
+ Attr streetAttr;
+ Attr replacedAttr;
+ doc = (Document) load("staff", true);
+ elementList = doc.getElementsByTagName("address");
+ testEmployee = (Element) elementList.item(2);
+ streetAttr = testEmployee.getAttributeNode("street");
+ replacedAttr = testEmployee.setAttributeNode(streetAttr);
+ assertSame("replacedAttr", streetAttr, replacedAttr);
+}
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/elementreplaceattributewithself";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(elementreplaceattributewithself.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level1/core/elementreplaceexistingattribute.java b/dom/src/test/java/org/w3c/domts/level1/core/elementreplaceexistingattribute.java
new file mode 100644
index 0000000..99fbcdf
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level1/core/elementreplaceexistingattribute.java
@@ -0,0 +1,97 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+Copyright (c) 2001 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+*/
+
+package org.w3c.domts.level1.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The "setAttributeNode(newAttr)" method adds a new
+ * attribute to the Element. If the "newAttr" Attr node is
+ * already present in this element, it should replace the
+ * existing one.
+ *
+ * Retrieve the last child of the third employee and add a
+ * new attribute node by invoking the "setAttributeNode(new
+ * Attr)" method. The new attribute node to be added is
+ * "street", which is already present in this element. The
+ * method should replace the existing Attr node with the
+ * new one. This test uses the "createAttribute(name)"
+ * method from the Document interface.
+* @author NIST
+* @author Mary Brady
+*/
+public final class elementreplaceexistingattribute extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public elementreplaceexistingattribute(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "staff", true);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ NodeList elementList;
+ Element testEmployee;
+ Attr newAttribute;
+ String name;
+ Attr setAttr;
+ doc = (Document) load("staff", true);
+ elementList = doc.getElementsByTagName("address");
+ testEmployee = (Element) elementList.item(2);
+ newAttribute = doc.createAttribute("street");
+ setAttr = testEmployee.setAttributeNode(newAttribute);
+ name = testEmployee.getAttribute("street");
+ assertEquals("elementReplaceExistingAttributeAssert", "", name);
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/elementreplaceexistingattribute";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(elementreplaceexistingattribute.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level1/core/elementreplaceexistingattributegevalue.java b/dom/src/test/java/org/w3c/domts/level1/core/elementreplaceexistingattributegevalue.java
new file mode 100644
index 0000000..47b4ff2
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level1/core/elementreplaceexistingattributegevalue.java
@@ -0,0 +1,95 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+Copyright (c) 2001 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+*/
+
+package org.w3c.domts.level1.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * If the "setAttributeNode(newAttr)" method replaces an
+ * existing Attr node with the same name, then it should
+ * return the previously existing Attr node.
+ * Retrieve the last child of the third employee and add a
+ * new attribute node. The new attribute node is "street",
+ * which is already present in this Element. The method
+ * should return the existing Attr node(old "street" Attr).
+ * This test uses the "createAttribute(name)" method
+ * from the Document interface.
+* @author NIST
+* @author Mary Brady
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-887236154">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-887236154</a>
+*/
+public final class elementreplaceexistingattributegevalue extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public elementreplaceexistingattributegevalue(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "staff", true);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ NodeList elementList;
+ Element testEmployee;
+ Attr newAttribute;
+ Attr streetAttr;
+ String value;
+ doc = (Document) load("staff", true);
+ elementList = doc.getElementsByTagName("address");
+ testEmployee = (Element) elementList.item(2);
+ newAttribute = doc.createAttribute("street");
+ streetAttr = testEmployee.setAttributeNode(newAttribute);
+ value = streetAttr.getValue();
+ assertEquals("streetNo", "No", value);
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/elementreplaceexistingattributegevalue";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(elementreplaceexistingattributegevalue.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level1/core/elementretrieveallattributes.java b/dom/src/test/java/org/w3c/domts/level1/core/elementretrieveallattributes.java
new file mode 100644
index 0000000..b654c01
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level1/core/elementretrieveallattributes.java
@@ -0,0 +1,98 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+Copyright (c) 2001 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+*/
+
+package org.w3c.domts.level1.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The "getAttributes()" method(Node Interface) may
+ * be used to retrieve the set of all attributes of an
+ * element.
+ *
+ * Create a list of all the attributes of the last child
+ * of the first employee by using the "getAttributes()"
+ * method. Examine the length of the attribute list.
+ * This test uses the "getLength()" method from the
+ * NameNodeMap interface.
+* @author NIST
+* @author Mary Brady
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-84CF096">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-84CF096</a>
+* @see <a href="http://lists.w3.org/Archives/Public/www-dom-ts/2002Mar/0002.html">http://lists.w3.org/Archives/Public/www-dom-ts/2002Mar/0002.html</a>
+*/
+public final class elementretrieveallattributes extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public elementretrieveallattributes(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+
+ org.w3c.domts.DocumentBuilderSetting[] settings =
+ new org.w3c.domts.DocumentBuilderSetting[] {
+org.w3c.domts.DocumentBuilderSetting.validating
+ };
+ DOMTestDocumentBuilderFactory testFactory = factory.newInstance(settings);
+ setFactory(testFactory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "staff", false);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ NodeList addressList;
+ Node testAddress;
+ NamedNodeMap attributes;
+ doc = (Document) load("staff", false);
+ addressList = doc.getElementsByTagName("address");
+ testAddress = addressList.item(0);
+ attributes = testAddress.getAttributes();
+ assertSize("elementRetrieveAllAttributesAssert", 2, attributes);
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/elementretrieveallattributes";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(elementretrieveallattributes.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level1/core/elementretrieveattrvalue.java b/dom/src/test/java/org/w3c/domts/level1/core/elementretrieveattrvalue.java
new file mode 100644
index 0000000..ca465de
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level1/core/elementretrieveattrvalue.java
@@ -0,0 +1,88 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+Copyright (c) 2001 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+*/
+
+package org.w3c.domts.level1.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The "getAttribute(name)" method returns an attribute
+ * value by name.
+ *
+ * Retrieve the second address element, then
+ * invoke the 'getAttribute("street")' method. This should
+ * return the value of the attribute("No").
+* @author NIST
+* @author Mary Brady
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-666EE0F9">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-666EE0F9</a>
+*/
+public final class elementretrieveattrvalue extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public elementretrieveattrvalue(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "staff", false);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ NodeList elementList;
+ Element testAddress;
+ String attrValue;
+ doc = (Document) load("staff", false);
+ elementList = doc.getElementsByTagName("address");
+ testAddress = (Element) elementList.item(2);
+ attrValue = testAddress.getAttribute("street");
+ assertEquals("attrValue", "No", attrValue);
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/elementretrieveattrvalue";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(elementretrieveattrvalue.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level1/core/elementretrievetagname.java b/dom/src/test/java/org/w3c/domts/level1/core/elementretrievetagname.java
new file mode 100644
index 0000000..0573919
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level1/core/elementretrievetagname.java
@@ -0,0 +1,91 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+Copyright (c) 2001 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+*/
+
+package org.w3c.domts.level1.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The "getElementsByTagName()" method returns a NodeList
+ * of all descendant elements with a given tagName.
+ *
+ * Invoke the "getElementsByTagName()" method and create
+ * a NodeList of "position" elements. Retrieve the second
+ * "position" element in the list and return the NodeName.
+* @author NIST
+* @author Mary Brady
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-F68D095">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-F68D095</a>
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-104682815">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-104682815</a>
+*/
+public final class elementretrievetagname extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public elementretrievetagname(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "staff", false);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ NodeList elementList;
+ Node testEmployee;
+ String name;
+ doc = (Document) load("staff", false);
+ elementList = doc.getElementsByTagName("position");
+ testEmployee = elementList.item(1);
+ name = testEmployee.getNodeName();
+ assertEquals("nodename", "position", name);
+ name = ((Element) /*Node */testEmployee).getTagName();
+ assertEquals("tagname", "position", name);
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/elementretrievetagname";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(elementretrievetagname.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level1/core/elementsetattributenodenomodificationallowederr.java b/dom/src/test/java/org/w3c/domts/level1/core/elementsetattributenodenomodificationallowederr.java
new file mode 100644
index 0000000..f9c9304
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level1/core/elementsetattributenodenomodificationallowederr.java
@@ -0,0 +1,116 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+Copyright (c) 2001-2004 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+*/
+
+package org.w3c.domts.level1.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The "setAttributeNode(newAttr)" method for an attribute causes the
+ * DOMException NO_MODIFICATION_ALLOWED_ERR to be raised
+ * if the node is readonly.
+ *
+ * Obtain the children of the THIRD "gender" element. The elements
+ * content is an entity reference. Try to remove the "domestic" attribute
+ * from the entity reference by executing the "setAttributeNode(newAttr)" method.
+ * This causes a NO_MODIFICATION_ALLOWED_ERR DOMException to be thrown.
+* @author NIST
+* @author Mary Brady
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-258A00AF')/constant[@name='NO_MODIFICATION_ALLOWED_ERR'])">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-258A00AF')/constant[@name='NO_MODIFICATION_ALLOWED_ERR'])</a>
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-887236154">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-887236154</a>
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-887236154')/raises/exception[@name='DOMException']/descr/p[substring-before(.,':')='NO_MODIFICATION_ALLOWED_ERR'])">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-887236154')/raises/exception[@name='DOMException']/descr/p[substring-before(.,':')='NO_MODIFICATION_ALLOWED_ERR'])</a>
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-887236154">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-887236154</a>
+*/
+public final class elementsetattributenodenomodificationallowederr extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public elementsetattributenodenomodificationallowederr(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "staff", true);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ NodeList genderList;
+ Node gender;
+ Node entRef;
+ Element entElement;
+ Attr newAttr;
+ int nodeType;
+ Attr badAttr;
+ doc = (Document) load("staff", true);
+ genderList = doc.getElementsByTagName("gender");
+ gender = genderList.item(2);
+ entRef = gender.getFirstChild();
+ assertNotNull("entRefNotNull", entRef);
+ nodeType = (int) entRef.getNodeType();
+
+ if (equals(1, nodeType)) {
+ entRef = doc.createEntityReference("ent4");
+ assertNotNull("createdEntRefNotNull", entRef);
+ }
+ entElement = (Element) entRef.getFirstChild();
+ assertNotNull("entElementNotNull", entElement);
+ newAttr = doc.createAttribute("newAttr");
+
+ {
+ boolean success = false;
+ try {
+ badAttr = entElement.setAttributeNode(newAttr);
+ } catch (DOMException ex) {
+ success = (ex.code == DOMException.NO_MODIFICATION_ALLOWED_ERR);
+ }
+ assertTrue("throw_NO_MODIFICATION_ALLOWED_ERR", success);
+ }
+}
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/elementsetattributenodenomodificationallowederr";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(elementsetattributenodenomodificationallowederr.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level1/core/elementsetattributenodenomodificationallowederrEE.java b/dom/src/test/java/org/w3c/domts/level1/core/elementsetattributenodenomodificationallowederrEE.java
new file mode 100644
index 0000000..e6970f2
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level1/core/elementsetattributenodenomodificationallowederrEE.java
@@ -0,0 +1,117 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+Copyright (c) 2001-2004 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+*/
+
+package org.w3c.domts.level1.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The "setAttributeNode(newAttr)" method for an attribute causes the
+ * DOMException NO_MODIFICATION_ALLOWED_ERR to be raised
+ * if the node is readonly.
+ *
+ * Create an entity reference and add to the THIRD "gender" element. The elements
+ * content is an entity reference. Try to remove the "domestic" attribute
+ * from the entity reference by executing the "setAttributeNode(newAttr)" method.
+ * This causes a NO_MODIFICATION_ALLOWED_ERR DOMException to be thrown.
+* @author Curt Arnold
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-258A00AF')/constant[@name='NO_MODIFICATION_ALLOWED_ERR'])">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-258A00AF')/constant[@name='NO_MODIFICATION_ALLOWED_ERR'])</a>
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-887236154">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-887236154</a>
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-887236154')/raises/exception[@name='DOMException']/descr/p[substring-before(.,':')='NO_MODIFICATION_ALLOWED_ERR'])">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-887236154')/raises/exception[@name='DOMException']/descr/p[substring-before(.,':')='NO_MODIFICATION_ALLOWED_ERR'])</a>
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-887236154">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-887236154</a>
+* @see <a href="http://www.w3.org/2001/DOM-Test-Suite/level1/core/elementsetattributenodenomodificationallowederr.xml">http://www.w3.org/2001/DOM-Test-Suite/level1/core/elementsetattributenodenomodificationallowederr.xml</a>
+*/
+public final class elementsetattributenodenomodificationallowederrEE extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public elementsetattributenodenomodificationallowederrEE(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+
+ org.w3c.domts.DocumentBuilderSetting[] settings =
+ new org.w3c.domts.DocumentBuilderSetting[] {
+org.w3c.domts.DocumentBuilderSetting.notExpandEntityReferences
+ };
+ DOMTestDocumentBuilderFactory testFactory = factory.newInstance(settings);
+ setFactory(testFactory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "staff", true);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ NodeList genderList;
+ Node gender;
+ EntityReference entRef;
+ Element entElement;
+ Attr newAttr;
+ Attr badAttr;
+ Node appendedChild;
+ doc = (Document) load("staff", true);
+ genderList = doc.getElementsByTagName("gender");
+ gender = genderList.item(2);
+ entRef = doc.createEntityReference("ent4");
+ assertNotNull("createdEntRefNotNull", entRef);
+ appendedChild = gender.appendChild(entRef);
+ entElement = (Element) entRef.getFirstChild();
+ assertNotNull("entElementNotNull", entElement);
+ newAttr = doc.createAttribute("newAttr");
+
+ {
+ boolean success = false;
+ try {
+ badAttr = entElement.setAttributeNode(newAttr);
+ } catch (DOMException ex) {
+ success = (ex.code == DOMException.NO_MODIFICATION_ALLOWED_ERR);
+ }
+ assertTrue("throw_NO_MODIFICATION_ALLOWED_ERR", success);
+ }
+}
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/elementsetattributenodenomodificationallowederrEE";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(elementsetattributenodenomodificationallowederrEE.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level1/core/elementsetattributenodenull.java b/dom/src/test/java/org/w3c/domts/level1/core/elementsetattributenodenull.java
new file mode 100644
index 0000000..55f5bcd
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level1/core/elementsetattributenodenull.java
@@ -0,0 +1,94 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+Copyright (c) 2001 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+*/
+
+package org.w3c.domts.level1.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The "setAttributeNode(newAttr)" method returns the
+ * null value if no previously existing Attr node with the
+ * same name was replaced.
+ *
+ * Retrieve the last child of the third employee and add a
+ * new attribute to it. The new attribute node added is
+ * "district", which is not part of this Element. The
+ * method should return the null value.
+ * This test uses the "createAttribute(name)"
+ * method from the Document interface.
+* @author NIST
+* @author Mary Brady
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-887236154">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-887236154</a>
+*/
+public final class elementsetattributenodenull extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public elementsetattributenodenull(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "staff", true);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ NodeList elementList;
+ Element testEmployee;
+ Attr newAttribute;
+ Attr districtAttr;
+ doc = (Document) load("staff", true);
+ elementList = doc.getElementsByTagName("address");
+ testEmployee = (Element) elementList.item(2);
+ newAttribute = doc.createAttribute("district");
+ districtAttr = testEmployee.setAttributeNode(newAttribute);
+ assertNull("elementSetAttributeNodeNullAssert", districtAttr);
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/elementsetattributenodenull";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(elementsetattributenodenull.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level1/core/elementsetattributenomodificationallowederr.java b/dom/src/test/java/org/w3c/domts/level1/core/elementsetattributenomodificationallowederr.java
new file mode 100644
index 0000000..ce01fe2
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level1/core/elementsetattributenomodificationallowederr.java
@@ -0,0 +1,112 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+Copyright (c) 2001-2004 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+*/
+
+package org.w3c.domts.level1.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The "setAttribute(name,value)" method for an attribute causes the
+ * DOMException NO_MODIFICATION_ALLOWED_ERR to be raised
+ * if the node is readonly.
+ *
+ * Obtain the children of the THIRD "gender" element. The elements
+ * content is an entity reference. Try to remove the "domestic" attribute
+ * from the entity reference by executing the "setAttribute(name,value)" method.
+ * This causes a NO_MODIFICATION_ALLOWED_ERR DOMException to be thrown.
+* @author NIST
+* @author Mary Brady
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-258A00AF')/constant[@name='NO_MODIFICATION_ALLOWED_ERR'])">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-258A00AF')/constant[@name='NO_MODIFICATION_ALLOWED_ERR'])</a>
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-F68F082">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-F68F082</a>
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-F68F082')/raises/exception[@name='DOMException']/descr/p[substring-before(.,':')='NO_MODIFICATION_ALLOWED_ERR'])">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-F68F082')/raises/exception[@name='DOMException']/descr/p[substring-before(.,':')='NO_MODIFICATION_ALLOWED_ERR'])</a>
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-F68F082">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-F68F082</a>
+*/
+public final class elementsetattributenomodificationallowederr extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public elementsetattributenomodificationallowederr(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+
+ org.w3c.domts.DocumentBuilderSetting[] settings =
+ new org.w3c.domts.DocumentBuilderSetting[] {
+org.w3c.domts.DocumentBuilderSetting.notExpandEntityReferences
+ };
+ DOMTestDocumentBuilderFactory testFactory = factory.newInstance(settings);
+ setFactory(testFactory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "staff", true);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ NodeList genderList;
+ Node gender;
+ EntityReference entRef;
+ Element entElement;
+ doc = (Document) load("staff", true);
+ genderList = doc.getElementsByTagName("gender");
+ gender = genderList.item(2);
+ entRef = (EntityReference) gender.getFirstChild();
+ assertNotNull("entRefNotNull", entRef);
+ entElement = (Element) entRef.getFirstChild();
+ assertNotNull("entElementNotNull", entElement);
+
+ {
+ boolean success = false;
+ try {
+ entElement.setAttribute("newAttr", "newValue");
+ } catch (DOMException ex) {
+ success = (ex.code == DOMException.NO_MODIFICATION_ALLOWED_ERR);
+ }
+ assertTrue("throw_NO_MODIFICATION_ALLOWED_ERR", success);
+ }
+}
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/elementsetattributenomodificationallowederr";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(elementsetattributenomodificationallowederr.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level1/core/elementsetattributenomodificationallowederrEE.java b/dom/src/test/java/org/w3c/domts/level1/core/elementsetattributenomodificationallowederrEE.java
new file mode 100644
index 0000000..e2bccb1
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level1/core/elementsetattributenomodificationallowederrEE.java
@@ -0,0 +1,107 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+Copyright (c) 2001-2004 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+*/
+
+package org.w3c.domts.level1.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The "setAttribute(name,value)" method for an attribute causes the
+ * DOMException NO_MODIFICATION_ALLOWED_ERR to be raised
+ * if the node is readonly.
+ *
+ * Add an ent4 reference to the children of the THIRD "gender" element.
+ * Try to remove the "domestic" attribute
+ * from the entity reference by executing the "setAttribute(name,value)" method.
+ * This causes a NO_MODIFICATION_ALLOWED_ERR DOMException to be thrown.
+* @author Curt Arnold
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-258A00AF')/constant[@name='NO_MODIFICATION_ALLOWED_ERR'])">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-258A00AF')/constant[@name='NO_MODIFICATION_ALLOWED_ERR'])</a>
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-F68F082">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-F68F082</a>
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-F68F082')/raises/exception[@name='DOMException']/descr/p[substring-before(.,':')='NO_MODIFICATION_ALLOWED_ERR'])">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-F68F082')/raises/exception[@name='DOMException']/descr/p[substring-before(.,':')='NO_MODIFICATION_ALLOWED_ERR'])</a>
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-F68F082">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-F68F082</a>
+* @see <a href="http://www.w3.org/2001/DOM-Test-Suite/level1/core/elementsetattributenomodificationallowederr.xml">http://www.w3.org/2001/DOM-Test-Suite/level1/core/elementsetattributenomodificationallowederr.xml</a>
+*/
+public final class elementsetattributenomodificationallowederrEE extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public elementsetattributenomodificationallowederrEE(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "staff", true);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ NodeList genderList;
+ Node gender;
+ EntityReference entRef;
+ Element entElement;
+ Node appendedChild;
+ doc = (Document) load("staff", true);
+ genderList = doc.getElementsByTagName("gender");
+ gender = genderList.item(2);
+ entRef = doc.createEntityReference("ent4");
+ appendedChild = gender.appendChild(entRef);
+ entElement = (Element) entRef.getFirstChild();
+ assertNotNull("entElementNotNull", entElement);
+
+ {
+ boolean success = false;
+ try {
+ entElement.setAttribute("newAttr", "newValue");
+ } catch (DOMException ex) {
+ success = (ex.code == DOMException.NO_MODIFICATION_ALLOWED_ERR);
+ }
+ assertTrue("throw_NO_MODIFICATION_ALLOWED_ERR", success);
+ }
+}
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/elementsetattributenomodificationallowederrEE";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(elementsetattributenomodificationallowederrEE.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level1/core/elementwrongdocumenterr.java b/dom/src/test/java/org/w3c/domts/level1/core/elementwrongdocumenterr.java
new file mode 100644
index 0000000..ec1a50b
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level1/core/elementwrongdocumenterr.java
@@ -0,0 +1,110 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+Copyright (c) 2001-2003 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+*/
+
+package org.w3c.domts.level1.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The "setAttributeNode(newAttr)" method raises an
+ * "WRONG_DOCUMENT_ERR DOMException if the "newAttr"
+ * was created from a different document than the one that
+ * created this document.
+ *
+ * Retrieve the last employee and attempt to set a new
+ * attribute node for its "employee" element. The new
+ * attribute was created from a document other than the
+ * one that created this element, therefore a
+ * WRONG_DOCUMENT_ERR DOMException should be raised.
+ * This test uses the "createAttribute(newAttr)" method
+ * from the Document interface.
+* @author NIST
+* @author Mary Brady
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-258A00AF')/constant[@name='WRONG_DOCUMENT_ERR'])">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-258A00AF')/constant[@name='WRONG_DOCUMENT_ERR'])</a>
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-887236154">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-887236154</a>
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-887236154')/raises/exception[@name='DOMException']/descr/p[substring-before(.,':')='WRONG_DOCUMENT_ERR'])">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-887236154')/raises/exception[@name='DOMException']/descr/p[substring-before(.,':')='WRONG_DOCUMENT_ERR'])</a>
+* @see <a href="http://www.w3.org/Bugs/Public/show_bug.cgi?id=249">http://www.w3.org/Bugs/Public/show_bug.cgi?id=249</a>
+*/
+public final class elementwrongdocumenterr extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public elementwrongdocumenterr(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "staff", true);
+ preload(contentType, "staff", false);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc1;
+ Document doc2;
+ Attr newAttribute;
+ NodeList addressElementList;
+ Element testAddress;
+ Attr attrAddress;
+ doc1 = (Document) load("staff", true);
+ doc2 = (Document) load("staff", false);
+ newAttribute = doc2.createAttribute("newAttribute");
+ addressElementList = doc1.getElementsByTagName("address");
+ testAddress = (Element) addressElementList.item(4);
+
+ {
+ boolean success = false;
+ try {
+ attrAddress = testAddress.setAttributeNode(newAttribute);
+ } catch (DOMException ex) {
+ success = (ex.code == DOMException.WRONG_DOCUMENT_ERR);
+ }
+ assertTrue("throw_WRONG_DOCUMENT_ERR", success);
+ }
+}
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/elementwrongdocumenterr";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(elementwrongdocumenterr.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level1/core/entitygetentityname.java b/dom/src/test/java/org/w3c/domts/level1/core/entitygetentityname.java
new file mode 100644
index 0000000..fe06dc4
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level1/core/entitygetentityname.java
@@ -0,0 +1,93 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+Copyright (c) 2001-2004 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+*/
+
+package org.w3c.domts.level1.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The nodeName attribute that is inherited from Node
+ * contains the name of the entity.
+ *
+ * Retrieve the entity named "ent1" and access its name by
+ * invoking the "getNodeName()" method inherited from
+ * the Node interface.
+* @author NIST
+* @author Mary Brady
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-527DCFF2">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-527DCFF2</a>
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-F68D095">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-F68D095</a>
+*/
+public final class entitygetentityname extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public entitygetentityname(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "staff", false);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ DocumentType docType;
+ NamedNodeMap entityList;
+ Entity entityNode;
+ String entityName;
+ doc = (Document) load("staff", false);
+ docType = doc.getDoctype();
+ assertNotNull("docTypeNotNull", docType);
+ entityList = docType.getEntities();
+ assertNotNull("entitiesNotNull", entityList);
+ entityNode = (Entity) entityList.getNamedItem("ent1");
+ entityName = entityNode.getNodeName();
+ assertEquals("entityGetEntityNameAssert", "ent1", entityName);
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/entitygetentityname";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(entitygetentityname.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level1/core/entitygetpublicid.java b/dom/src/test/java/org/w3c/domts/level1/core/entitygetpublicid.java
new file mode 100644
index 0000000..5e1e87c
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level1/core/entitygetpublicid.java
@@ -0,0 +1,101 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+Copyright (c) 2001-2004 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+*/
+
+package org.w3c.domts.level1.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The "getPublicId()" method of an Entity node contains
+ * the public identifier associated with the entity, if
+ * one was specified.
+ *
+ * Retrieve the entity named "ent5" and access its
+ * public identifier. The string "entityURI" should be
+ * returned.
+* @author NIST
+* @author Mary Brady
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-D7303025">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-D7303025</a>
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-6ABAEB38">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-6ABAEB38</a>
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-D7C29F3E">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-D7C29F3E</a>
+*/
+public final class entitygetpublicid extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public entitygetpublicid(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "staff", false);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ DocumentType docType;
+ NamedNodeMap entityList;
+ Entity entityNode;
+ String publicId;
+ String systemId;
+ String notation;
+ doc = (Document) load("staff", false);
+ docType = doc.getDoctype();
+ assertNotNull("docTypeNotNull", docType);
+ entityList = docType.getEntities();
+ assertNotNull("entitiesNotNull", entityList);
+ entityNode = (Entity) entityList.getNamedItem("ent5");
+ publicId = entityNode.getPublicId();
+ assertEquals("publicId", "entityURI", publicId);
+ systemId = entityNode.getSystemId();
+ assertURIEquals("systemId", null, null, null, "entityFile", null, null, null, null, systemId);
+notation = entityNode.getNotationName();
+ assertEquals("notation", "notation1", notation);
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/entitygetpublicid";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(entitygetpublicid.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level1/core/entitygetpublicidnull.java b/dom/src/test/java/org/w3c/domts/level1/core/entitygetpublicidnull.java
new file mode 100644
index 0000000..f50d54f
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level1/core/entitygetpublicidnull.java
@@ -0,0 +1,94 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+Copyright (c) 2001-2004 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+*/
+
+package org.w3c.domts.level1.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The "getPublicId()" method of an Entity node contains
+ * the public identifier associated with the entity, if
+ * one was not specified a null value should be returned.
+ *
+ * Retrieve the entity named "ent1" and access its
+ * public identifier. Since a public identifier was not
+ * specified for this entity, the "getPublicId()" method
+ * should return null.
+* @author NIST
+* @author Mary Brady
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-D7303025">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-D7303025</a>
+*/
+public final class entitygetpublicidnull extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public entitygetpublicidnull(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "staff", false);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ DocumentType docType;
+ NamedNodeMap entityList;
+ Entity entityNode;
+ String publicId;
+ doc = (Document) load("staff", false);
+ docType = doc.getDoctype();
+ assertNotNull("docTypeNotNull", docType);
+ entityList = docType.getEntities();
+ assertNotNull("entitiesNotNull", entityList);
+ entityNode = (Entity) entityList.getNamedItem("ent1");
+ publicId = entityNode.getPublicId();
+ assertNull("entityGetPublicIdNullAssert", publicId);
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/entitygetpublicidnull";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(entitygetpublicidnull.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level1/core/hc_attrappendchild1.java b/dom/src/test/java/org/w3c/domts/level1/core/hc_attrappendchild1.java
new file mode 100644
index 0000000..7d3e696
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level1/core/hc_attrappendchild1.java
@@ -0,0 +1,100 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+Copyright (c) 2001-2004 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+*/
+
+package org.w3c.domts.level1.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * Appends a text node to an attribute and checks if the value of
+ * the attribute is changed.
+* @author Curt Arnold
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-637646024">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-637646024</a>
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-184E7107">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-184E7107</a>
+*/
+public final class hc_attrappendchild1 extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public hc_attrappendchild1(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "hc_staff", true);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ NodeList acronymList;
+ Node testNode;
+ NamedNodeMap attributes;
+ Attr titleAttr;
+ String value;
+ Text textNode;
+ Node retval;
+ Node lastChild;
+ doc = (Document) load("hc_staff", true);
+ acronymList = doc.getElementsByTagName("acronym");
+ testNode = acronymList.item(3);
+ attributes = testNode.getAttributes();
+ titleAttr = (Attr) attributes.getNamedItem("title");
+ textNode = doc.createTextNode("terday");
+ retval = titleAttr.appendChild(textNode);
+ value = titleAttr.getValue();
+ assertEquals("attrValue", "Yesterday", value);
+ value = titleAttr.getNodeValue();
+ assertEquals("attrNodeValue", "Yesterday", value);
+ value = retval.getNodeValue();
+ assertEquals("retvalValue", "terday", value);
+ lastChild = titleAttr.getLastChild();
+ value = lastChild.getNodeValue();
+ assertEquals("lastChildValue", "terday", value);
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_attrappendchild1";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(hc_attrappendchild1.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level1/core/hc_attrappendchild2.java b/dom/src/test/java/org/w3c/domts/level1/core/hc_attrappendchild2.java
new file mode 100644
index 0000000..c619ed8
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level1/core/hc_attrappendchild2.java
@@ -0,0 +1,99 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+Copyright (c) 2001-2004 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+*/
+
+package org.w3c.domts.level1.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * Attempts to append an element to the child nodes of an attribute.
+* @author Curt Arnold
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-637646024">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-637646024</a>
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-184E7107">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-184E7107</a>
+*/
+public final class hc_attrappendchild2 extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public hc_attrappendchild2(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "hc_staff", true);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ NodeList acronymList;
+ Node testNode;
+ NamedNodeMap attributes;
+ Attr titleAttr;
+ String value;
+ Node newChild;
+ Node retval;
+ Node lastChild;
+ doc = (Document) load("hc_staff", true);
+ acronymList = doc.getElementsByTagName("acronym");
+ testNode = acronymList.item(3);
+ attributes = testNode.getAttributes();
+ titleAttr = (Attr) attributes.getNamedItem("title");
+ newChild = doc.createElement("terday");
+
+ {
+ boolean success = false;
+ try {
+ retval = titleAttr.appendChild(newChild);
+ } catch (DOMException ex) {
+ success = (ex.code == DOMException.HIERARCHY_REQUEST_ERR);
+ }
+ assertTrue("throw_HIERARCHY_REQUEST_ERR", success);
+ }
+}
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_attrappendchild2";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(hc_attrappendchild2.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level1/core/hc_attrappendchild3.java b/dom/src/test/java/org/w3c/domts/level1/core/hc_attrappendchild3.java
new file mode 100644
index 0000000..3fa01ca
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level1/core/hc_attrappendchild3.java
@@ -0,0 +1,106 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+Copyright (c) 2001-2004 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+*/
+
+package org.w3c.domts.level1.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * Appends a document fragment to an attribute and checks if the value of
+ * the attribute is changed.
+* @author Curt Arnold
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-637646024">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-637646024</a>
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-184E7107">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-184E7107</a>
+*/
+public final class hc_attrappendchild3 extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public hc_attrappendchild3(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "hc_staff", true);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ NodeList acronymList;
+ Node testNode;
+ NamedNodeMap attributes;
+ Attr titleAttr;
+ String value;
+ Text terNode;
+ Text dayNode;
+ Node retval;
+ Node lastChild;
+ DocumentFragment docFrag;
+ doc = (Document) load("hc_staff", true);
+ acronymList = doc.getElementsByTagName("acronym");
+ testNode = acronymList.item(3);
+ attributes = testNode.getAttributes();
+ titleAttr = (Attr) attributes.getNamedItem("title");
+ terNode = doc.createTextNode("ter");
+ dayNode = doc.createTextNode("day");
+ docFrag = doc.createDocumentFragment();
+ retval = docFrag.appendChild(terNode);
+ retval = docFrag.appendChild(dayNode);
+ retval = titleAttr.appendChild(docFrag);
+ value = titleAttr.getValue();
+ assertEquals("attrValue", "Yesterday", value);
+ value = titleAttr.getNodeValue();
+ assertEquals("attrNodeValue", "Yesterday", value);
+ value = retval.getNodeValue();
+ assertNull("retvalValue", value);
+ lastChild = titleAttr.getLastChild();
+ value = lastChild.getNodeValue();
+ assertEquals("lastChildValue", "day", value);
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_attrappendchild3";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(hc_attrappendchild3.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level1/core/hc_attrappendchild4.java b/dom/src/test/java/org/w3c/domts/level1/core/hc_attrappendchild4.java
new file mode 100644
index 0000000..6b74ebf
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level1/core/hc_attrappendchild4.java
@@ -0,0 +1,118 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+Copyright (c) 2001-2004 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+*/
+
+package org.w3c.domts.level1.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * Attempt to append a CDATASection to an attribute which should result
+ * in a HIERARCHY_REQUEST_ERR.
+* @author Curt Arnold
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-637646024">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-637646024</a>
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-184E7107">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-184E7107</a>
+*/
+public final class hc_attrappendchild4 extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public hc_attrappendchild4(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+ if (factory.hasFeature("XML", null) != true) {
+ throw org.w3c.domts.DOMTestIncompatibleException.incompatibleFeature("XML", null);
+ }
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "hc_staff", true);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ NodeList acronymList;
+ Node testNode;
+ NamedNodeMap attributes;
+ Attr titleAttr;
+ String value;
+ Node textNode;
+ Node retval;
+ Node lastChild;
+ doc = (Document) load("hc_staff", true);
+ acronymList = doc.getElementsByTagName("acronym");
+ testNode = acronymList.item(3);
+ attributes = testNode.getAttributes();
+ titleAttr = (Attr) attributes.getNamedItem("title");
+
+ if (("text/html".equals(getContentType()))) {
+
+ {
+ boolean success = false;
+ try {
+ textNode = doc.createCDATASection("terday");
+ } catch (DOMException ex) {
+ success = (ex.code == DOMException.NOT_SUPPORTED_ERR);
+ }
+ assertTrue("throw_NOT_SUPPORTED_ERR", success);
+ }
+} else {
+ textNode = doc.createCDATASection("terday");
+
+ {
+ boolean success = false;
+ try {
+ retval = titleAttr.appendChild(textNode);
+ } catch (DOMException ex) {
+ success = (ex.code == DOMException.HIERARCHY_REQUEST_ERR);
+ }
+ assertTrue("throw_HIERARCHY_REQUEST_ERR", success);
+ }
+}
+
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_attrappendchild4";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(hc_attrappendchild4.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level1/core/hc_attrappendchild5.java b/dom/src/test/java/org/w3c/domts/level1/core/hc_attrappendchild5.java
new file mode 100644
index 0000000..26846e1
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level1/core/hc_attrappendchild5.java
@@ -0,0 +1,103 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+Copyright (c) 2001-2004 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+*/
+
+package org.w3c.domts.level1.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * Attempt to append a node from another document to an attribute which should result
+ * in a WRONG_DOCUMENT_ERR.
+* @author Curt Arnold
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-637646024">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-637646024</a>
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-184E7107">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-184E7107</a>
+*/
+public final class hc_attrappendchild5 extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public hc_attrappendchild5(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "hc_staff", true);
+ preload(contentType, "hc_staff", true);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ NodeList acronymList;
+ Node testNode;
+ NamedNodeMap attributes;
+ Attr titleAttr;
+ String value;
+ Node textNode;
+ Node retval;
+ Node lastChild;
+ Document otherDoc;
+ doc = (Document) load("hc_staff", true);
+ otherDoc = (Document) load("hc_staff", true);
+ acronymList = doc.getElementsByTagName("acronym");
+ testNode = acronymList.item(3);
+ attributes = testNode.getAttributes();
+ titleAttr = (Attr) attributes.getNamedItem("title");
+ textNode = otherDoc.createTextNode("terday");
+
+ {
+ boolean success = false;
+ try {
+ retval = titleAttr.appendChild(textNode);
+ } catch (DOMException ex) {
+ success = (ex.code == DOMException.WRONG_DOCUMENT_ERR);
+ }
+ assertTrue("throw_WRONG_DOCUMENT_ERR", success);
+ }
+}
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_attrappendchild5";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(hc_attrappendchild5.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level1/core/hc_attrappendchild6.java b/dom/src/test/java/org/w3c/domts/level1/core/hc_attrappendchild6.java
new file mode 100644
index 0000000..754ba2b
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level1/core/hc_attrappendchild6.java
@@ -0,0 +1,96 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+Copyright (c) 2001-2004 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+*/
+
+package org.w3c.domts.level1.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * Creates an new attribute node and appends a text node.
+* @author Curt Arnold
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-637646024">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-637646024</a>
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-184E7107">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-184E7107</a>
+*/
+public final class hc_attrappendchild6 extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public hc_attrappendchild6(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "hc_staff", true);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ NodeList acronymList;
+ Node testNode;
+ NamedNodeMap attributes;
+ Attr titleAttr;
+ String value;
+ Text textNode;
+ Node retval;
+ Node lastChild;
+ doc = (Document) load("hc_staff", true);
+ titleAttr = doc.createAttribute("title");
+ textNode = doc.createTextNode("Yesterday");
+ retval = titleAttr.appendChild(textNode);
+ value = titleAttr.getValue();
+ assertEquals("attrValue", "Yesterday", value);
+ value = titleAttr.getNodeValue();
+ assertEquals("attrNodeValue", "Yesterday", value);
+ value = retval.getNodeValue();
+ assertEquals("retvalValue", "Yesterday", value);
+ lastChild = titleAttr.getLastChild();
+ value = lastChild.getNodeValue();
+ assertEquals("lastChildValue", "Yesterday", value);
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_attrappendchild6";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(hc_attrappendchild6.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level1/core/hc_attrchildnodes1.java b/dom/src/test/java/org/w3c/domts/level1/core/hc_attrchildnodes1.java
new file mode 100644
index 0000000..ab38fbb
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level1/core/hc_attrchildnodes1.java
@@ -0,0 +1,95 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+Copyright (c) 2001-2004 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+*/
+
+package org.w3c.domts.level1.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * Checks that Node.childNodes for an attribute node contains
+ * the expected text node.
+* @author Curt Arnold
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-637646024">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-637646024</a>
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-1451460987">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-1451460987</a>
+*/
+public final class hc_attrchildnodes1 extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public hc_attrchildnodes1(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "hc_staff", false);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ NodeList acronymList;
+ Node testNode;
+ NamedNodeMap attributes;
+ Attr titleAttr;
+ String value;
+ Text textNode;
+ NodeList childNodes;
+ doc = (Document) load("hc_staff", false);
+ acronymList = doc.getElementsByTagName("acronym");
+ testNode = acronymList.item(3);
+ attributes = testNode.getAttributes();
+ titleAttr = (Attr) attributes.getNamedItem("title");
+ childNodes = titleAttr.getChildNodes();
+ assertSize("childNodesSize", 1, childNodes);
+ textNode = (Text) childNodes.item(0);
+ value = textNode.getNodeValue();
+ assertEquals("child1IsYes", "Yes", value);
+ textNode = (Text) childNodes.item(1);
+ assertNull("secondItemIsNull", textNode);
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_attrchildnodes1";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(hc_attrchildnodes1.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level1/core/hc_attrchildnodes2.java b/dom/src/test/java/org/w3c/domts/level1/core/hc_attrchildnodes2.java
new file mode 100644
index 0000000..425177a
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level1/core/hc_attrchildnodes2.java
@@ -0,0 +1,100 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+Copyright (c) 2001-2004 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+*/
+
+package org.w3c.domts.level1.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * Checks Node.childNodes for an attribute with multiple child nodes.
+* @author Curt Arnold
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-637646024">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-637646024</a>
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-1451460987">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-1451460987</a>
+*/
+public final class hc_attrchildnodes2 extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public hc_attrchildnodes2(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "hc_staff", true);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ NodeList acronymList;
+ Node testNode;
+ NamedNodeMap attributes;
+ Attr titleAttr;
+ String value;
+ Text textNode;
+ NodeList childNodes;
+ Node retval;
+ doc = (Document) load("hc_staff", true);
+ acronymList = doc.getElementsByTagName("acronym");
+ testNode = acronymList.item(3);
+ attributes = testNode.getAttributes();
+ titleAttr = (Attr) attributes.getNamedItem("title");
+ childNodes = titleAttr.getChildNodes();
+ textNode = doc.createTextNode("terday");
+ retval = titleAttr.appendChild(textNode);
+ assertSize("childNodesSize", 2, childNodes);
+ textNode = (Text) childNodes.item(0);
+ value = textNode.getNodeValue();
+ assertEquals("child1IsYes", "Yes", value);
+ textNode = (Text) childNodes.item(1);
+ value = textNode.getNodeValue();
+ assertEquals("child2IsTerday", "terday", value);
+ textNode = (Text) childNodes.item(2);
+ assertNull("thirdItemIsNull", textNode);
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_attrchildnodes2";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(hc_attrchildnodes2.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level1/core/hc_attrclonenode1.java b/dom/src/test/java/org/w3c/domts/level1/core/hc_attrclonenode1.java
new file mode 100644
index 0000000..c38a673
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level1/core/hc_attrclonenode1.java
@@ -0,0 +1,100 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+Copyright (c) 2001-2004 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+*/
+
+package org.w3c.domts.level1.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * Appends a text node to an attribute and clones the node.
+* @author Curt Arnold
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-637646024">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-637646024</a>
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-3A0ED0A4">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-3A0ED0A4</a>
+*/
+public final class hc_attrclonenode1 extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public hc_attrclonenode1(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "hc_staff", true);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ NodeList acronymList;
+ Node testNode;
+ NamedNodeMap attributes;
+ Attr titleAttr;
+ String value;
+ Text textNode;
+ Node retval;
+ Node lastChild;
+ Attr clonedTitle;
+ doc = (Document) load("hc_staff", true);
+ acronymList = doc.getElementsByTagName("acronym");
+ testNode = acronymList.item(3);
+ attributes = testNode.getAttributes();
+ titleAttr = (Attr) attributes.getNamedItem("title");
+ textNode = doc.createTextNode("terday");
+ retval = titleAttr.appendChild(textNode);
+ clonedTitle = (Attr) titleAttr.cloneNode(false);
+ textNode.setNodeValue("text_node_not_cloned");
+ value = clonedTitle.getValue();
+ assertEquals("attrValue", "Yesterday", value);
+ value = clonedTitle.getNodeValue();
+ assertEquals("attrNodeValue", "Yesterday", value);
+ lastChild = clonedTitle.getLastChild();
+ value = lastChild.getNodeValue();
+ assertEquals("lastChildValue", "terday", value);
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_attrclonenode1";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(hc_attrclonenode1.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level1/core/hc_attrcreatedocumentfragment.java b/dom/src/test/java/org/w3c/domts/level1/core/hc_attrcreatedocumentfragment.java
new file mode 100644
index 0000000..be44465
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level1/core/hc_attrcreatedocumentfragment.java
@@ -0,0 +1,105 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+Copyright (c) 2001-2004 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+*/
+
+package org.w3c.domts.level1.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * Create a new DocumentFragment and add a newly created Element node(with one attribute).
+ * Once the element is added, its attribute should be available as an attribute associated
+ * with an Element within a DocumentFragment.
+* @author Curt Arnold
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-35CB04B5">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-35CB04B5</a>
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-F68F082">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-F68F082</a>
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-B63ED1A3">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-B63ED1A3</a>
+* @see <a href="http://www.w3.org/Bugs/Public/show_bug.cgi?id=236">http://www.w3.org/Bugs/Public/show_bug.cgi?id=236</a>
+* @see <a href="http://lists.w3.org/Archives/Public/www-dom-ts/2003Jun/0011.html">http://lists.w3.org/Archives/Public/www-dom-ts/2003Jun/0011.html</a>
+* @see <a href="http://www.w3.org/Bugs/Public/show_bug.cgi?id=184">http://www.w3.org/Bugs/Public/show_bug.cgi?id=184</a>
+*/
+public final class hc_attrcreatedocumentfragment extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public hc_attrcreatedocumentfragment(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "hc_staff", true);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ DocumentFragment docFragment;
+ Element newOne;
+ Node domesticNode;
+ NamedNodeMap attributes;
+ Attr attribute;
+ String attrName;
+ Node appendedChild;
+ int langAttrCount = 0;
+ doc = (Document) load("hc_staff", true);
+ docFragment = doc.createDocumentFragment();
+ newOne = doc.createElement("html");
+ newOne.setAttribute("lang", "EN");
+ appendedChild = docFragment.appendChild(newOne);
+ domesticNode = docFragment.getFirstChild();
+ attributes = domesticNode.getAttributes();
+ for (int indexN10078 = 0; indexN10078 < attributes.getLength(); indexN10078++) {
+ attribute = (Attr) attributes.item(indexN10078);
+ attrName = attribute.getNodeName();
+
+ if (equalsAutoCase("attribute", "lang", attrName)) {
+ langAttrCount += 1;
+ }
+ }
+ assertEquals("hasLangAttr", 1, langAttrCount);
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_attrcreatedocumentfragment";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(hc_attrcreatedocumentfragment.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level1/core/hc_attrcreatetextnode.java b/dom/src/test/java/org/w3c/domts/level1/core/hc_attrcreatetextnode.java
new file mode 100644
index 0000000..20eb5da
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level1/core/hc_attrcreatetextnode.java
@@ -0,0 +1,97 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+Copyright (c) 2001 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+*/
+
+package org.w3c.domts.level1.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The "setValue()" method for an attribute creates a
+ * Text node with the unparsed content of the string.
+ * Retrieve the attribute named "class" from the last
+ * child of of the fourth employee and assign the "Y&ent1;"
+ * string to its value attribute. This value is not yet
+ * parsed and therefore should still be the same upon
+ * retrieval. This test uses the "getNamedItem(name)" method
+ * from the NamedNodeMap interface.
+* @author Curt Arnold
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-221662474">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-221662474</a>
+* @see <a href="http://lists.w3.org/Archives/Public/www-dom-ts/2002Apr/0057.html">http://lists.w3.org/Archives/Public/www-dom-ts/2002Apr/0057.html</a>
+*/
+public final class hc_attrcreatetextnode extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public hc_attrcreatetextnode(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "hc_staff", true);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ NodeList addressList;
+ Node testNode;
+ NamedNodeMap attributes;
+ Attr streetAttr;
+ String value;
+ doc = (Document) load("hc_staff", true);
+ addressList = doc.getElementsByTagName("acronym");
+ testNode = addressList.item(3);
+ attributes = testNode.getAttributes();
+ streetAttr = (Attr) attributes.getNamedItem("class");
+ streetAttr.setValue("Y&ent1;");
+ value = streetAttr.getValue();
+ assertEquals("value", "Y&ent1;", value);
+ value = streetAttr.getNodeValue();
+ assertEquals("nodeValue", "Y&ent1;", value);
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_attrcreatetextnode";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(hc_attrcreatetextnode.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level1/core/hc_attrcreatetextnode2.java b/dom/src/test/java/org/w3c/domts/level1/core/hc_attrcreatetextnode2.java
new file mode 100644
index 0000000..f487d69
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level1/core/hc_attrcreatetextnode2.java
@@ -0,0 +1,97 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+Copyright (c) 2001 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+*/
+
+package org.w3c.domts.level1.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The "setNodeValue()" method for an attribute creates a
+ * Text node with the unparsed content of the string.
+ * Retrieve the attribute named "class" from the last
+ * child of of the fourth employee and assign the "Y&ent1;"
+ * string to its value attribute. This value is not yet
+ * parsed and therefore should still be the same upon
+ * retrieval. This test uses the "getNamedItem(name)" method
+ * from the NamedNodeMap interface.
+* @author Curt Arnold
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-F68D080">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-F68D080</a>
+* @see <a href="http://lists.w3.org/Archives/Public/www-dom-ts/2002Apr/0057.html">http://lists.w3.org/Archives/Public/www-dom-ts/2002Apr/0057.html</a>
+*/
+public final class hc_attrcreatetextnode2 extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public hc_attrcreatetextnode2(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "hc_staff", true);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ NodeList addressList;
+ Node testNode;
+ NamedNodeMap attributes;
+ Attr streetAttr;
+ String value;
+ doc = (Document) load("hc_staff", true);
+ addressList = doc.getElementsByTagName("acronym");
+ testNode = addressList.item(3);
+ attributes = testNode.getAttributes();
+ streetAttr = (Attr) attributes.getNamedItem("class");
+ streetAttr.setNodeValue("Y&ent1;");
+ value = streetAttr.getValue();
+ assertEquals("value", "Y&ent1;", value);
+ value = streetAttr.getNodeValue();
+ assertEquals("nodeValue", "Y&ent1;", value);
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_attrcreatetextnode2";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(hc_attrcreatetextnode2.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level1/core/hc_attreffectivevalue.java b/dom/src/test/java/org/w3c/domts/level1/core/hc_attreffectivevalue.java
new file mode 100644
index 0000000..d90944b
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level1/core/hc_attreffectivevalue.java
@@ -0,0 +1,90 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+Copyright (c) 2001 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+*/
+
+package org.w3c.domts.level1.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * If an Attr is explicitly assigned any value, then that value is the attributes effective value.
+ * Retrieve the attribute named "domestic" from the last child of of the first employee
+ * and examine its nodeValue attribute. This test uses the "getNamedItem(name)" method
+ * from the NamedNodeMap interface.
+* @author Curt Arnold
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-84CF096">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-84CF096</a>
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-1074577549">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-1074577549</a>
+*/
+public final class hc_attreffectivevalue extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public hc_attreffectivevalue(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "hc_staff", false);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ NodeList addressList;
+ Node testNode;
+ NamedNodeMap attributes;
+ Attr domesticAttr;
+ String value;
+ doc = (Document) load("hc_staff", false);
+ addressList = doc.getElementsByTagName("acronym");
+ testNode = addressList.item(0);
+ attributes = testNode.getAttributes();
+ domesticAttr = (Attr) attributes.getNamedItem("title");
+ value = domesticAttr.getNodeValue();
+ assertEquals("attrEffectiveValueAssert", "Yes", value);
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_attreffectivevalue";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(hc_attreffectivevalue.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level1/core/hc_attrfirstchild.java b/dom/src/test/java/org/w3c/domts/level1/core/hc_attrfirstchild.java
new file mode 100644
index 0000000..e7da3b8
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level1/core/hc_attrfirstchild.java
@@ -0,0 +1,96 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+Copyright (c) 2001-2004 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+*/
+
+package org.w3c.domts.level1.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * Checks that Node.firstChild for an attribute node contains
+ * the expected text node.
+* @author Curt Arnold
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-637646024">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-637646024</a>
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-169727388">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-169727388</a>
+*/
+public final class hc_attrfirstchild extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public hc_attrfirstchild(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "hc_staff", true);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ NodeList acronymList;
+ Node testNode;
+ NamedNodeMap attributes;
+ Attr titleAttr;
+ String value;
+ Text textNode;
+ Node otherChild;
+ doc = (Document) load("hc_staff", true);
+ acronymList = doc.getElementsByTagName("acronym");
+ testNode = acronymList.item(3);
+ attributes = testNode.getAttributes();
+ titleAttr = (Attr) attributes.getNamedItem("title");
+ textNode = (Text) titleAttr.getFirstChild();
+ assertNotNull("textNodeNotNull", textNode);
+ value = textNode.getNodeValue();
+ assertEquals("child1IsYes", "Yes", value);
+ otherChild = textNode.getNextSibling();
+ assertNull("nextSiblingIsNull", otherChild);
+ otherChild = textNode.getPreviousSibling();
+ assertNull("previousSiblingIsNull", otherChild);
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_attrfirstchild";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(hc_attrfirstchild.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level1/core/hc_attrgetvalue1.java b/dom/src/test/java/org/w3c/domts/level1/core/hc_attrgetvalue1.java
new file mode 100644
index 0000000..d2e38ca
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level1/core/hc_attrgetvalue1.java
@@ -0,0 +1,89 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+Copyright (c) 2001-2004 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+*/
+
+package org.w3c.domts.level1.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * Checks the value of an attribute that contains entity references.
+* @author Curt Arnold
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-221662474">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-221662474</a>
+*/
+public final class hc_attrgetvalue1 extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public hc_attrgetvalue1(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "hc_staff", true);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ NodeList acronymList;
+ Node testNode;
+ NamedNodeMap attributes;
+ Attr titleAttr;
+ String value;
+ Text textNode;
+ Node retval;
+ Node lastChild;
+ doc = (Document) load("hc_staff", true);
+ acronymList = doc.getElementsByTagName("acronym");
+ testNode = acronymList.item(3);
+ attributes = testNode.getAttributes();
+ titleAttr = (Attr) attributes.getNamedItem("class");
+ value = titleAttr.getValue();
+ assertEquals("attrValue1", "Yα", value);
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_attrgetvalue1";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(hc_attrgetvalue1.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level1/core/hc_attrgetvalue2.java b/dom/src/test/java/org/w3c/domts/level1/core/hc_attrgetvalue2.java
new file mode 100644
index 0000000..fd5b211
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level1/core/hc_attrgetvalue2.java
@@ -0,0 +1,111 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+Copyright (c) 2001-2004 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+*/
+
+package org.w3c.domts.level1.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * Checks the value of an attribute that contains entity references.
+* @author Curt Arnold
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-221662474">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-221662474</a>
+*/
+public final class hc_attrgetvalue2 extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public hc_attrgetvalue2(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+ if (factory.hasFeature("XML", null) != true) {
+ throw org.w3c.domts.DOMTestIncompatibleException.incompatibleFeature("XML", null);
+ }
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "hc_staff", true);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ NodeList acronymList;
+ Node testNode;
+ NamedNodeMap attributes;
+ Attr titleAttr;
+ String value;
+ Text textNode;
+ Node retval;
+ Node firstChild;
+ EntityReference alphaRef;
+ doc = (Document) load("hc_staff", true);
+ acronymList = doc.getElementsByTagName("acronym");
+ testNode = acronymList.item(3);
+ attributes = testNode.getAttributes();
+ titleAttr = (Attr) attributes.getNamedItem("class");
+
+ if (("text/html".equals(getContentType()))) {
+
+ {
+ boolean success = false;
+ try {
+ alphaRef = doc.createEntityReference("alpha");
+ } catch (DOMException ex) {
+ success = (ex.code == DOMException.NOT_SUPPORTED_ERR);
+ }
+ assertTrue("throw_NOT_SUPPORTED_ERR", success);
+ }
+} else {
+ alphaRef = doc.createEntityReference("alpha");
+ firstChild = titleAttr.getFirstChild();
+ retval = titleAttr.insertBefore(alphaRef, firstChild);
+ value = titleAttr.getValue();
+ assertEquals("attrValue1", "αYα", value);
+ }
+
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_attrgetvalue2";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(hc_attrgetvalue2.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level1/core/hc_attrhaschildnodes.java b/dom/src/test/java/org/w3c/domts/level1/core/hc_attrhaschildnodes.java
new file mode 100644
index 0000000..04c65f6
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level1/core/hc_attrhaschildnodes.java
@@ -0,0 +1,87 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+Copyright (c) 2001-2004 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+*/
+
+package org.w3c.domts.level1.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * Checks that Node.hasChildNodes() is true for an attribute with content.
+* @author Curt Arnold
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-637646024">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-637646024</a>
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-810594187">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-810594187</a>
+*/
+public final class hc_attrhaschildnodes extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public hc_attrhaschildnodes(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "hc_staff", true);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ NodeList acronymList;
+ Node testNode;
+ NamedNodeMap attributes;
+ Attr titleAttr;
+ boolean hasChildNodes;
+ doc = (Document) load("hc_staff", true);
+ acronymList = doc.getElementsByTagName("acronym");
+ testNode = acronymList.item(3);
+ attributes = testNode.getAttributes();
+ titleAttr = (Attr) attributes.getNamedItem("title");
+ hasChildNodes = titleAttr.hasChildNodes();
+ assertTrue("hasChildrenIsTrue", hasChildNodes);
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_attrhaschildnodes";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(hc_attrhaschildnodes.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level1/core/hc_attrinsertbefore1.java b/dom/src/test/java/org/w3c/domts/level1/core/hc_attrinsertbefore1.java
new file mode 100644
index 0000000..c671148
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level1/core/hc_attrinsertbefore1.java
@@ -0,0 +1,106 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+Copyright (c) 2001-2004 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+*/
+
+package org.w3c.domts.level1.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * Appends a text node to an attribute and checks if the value of
+ * the attribute is changed.
+* @author Curt Arnold
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-637646024">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-637646024</a>
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-952280727">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-952280727</a>
+*/
+public final class hc_attrinsertbefore1 extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public hc_attrinsertbefore1(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "hc_staff", true);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ NodeList acronymList;
+ Node testNode;
+ NamedNodeMap attributes;
+ Attr titleAttr;
+ String value;
+ Text textNode;
+ Node retval;
+ Node firstChild;
+ Node lastChild;
+ Node refChild = null;
+
+ doc = (Document) load("hc_staff", true);
+ acronymList = doc.getElementsByTagName("acronym");
+ testNode = acronymList.item(3);
+ attributes = testNode.getAttributes();
+ titleAttr = (Attr) attributes.getNamedItem("title");
+ textNode = doc.createTextNode("terday");
+ retval = titleAttr.insertBefore(textNode, refChild);
+ value = titleAttr.getValue();
+ assertEquals("attrValue", "Yesterday", value);
+ value = titleAttr.getNodeValue();
+ assertEquals("attrNodeValue", "Yesterday", value);
+ value = retval.getNodeValue();
+ assertEquals("retvalValue", "terday", value);
+ firstChild = titleAttr.getFirstChild();
+ value = firstChild.getNodeValue();
+ assertEquals("firstChildValue", "Yes", value);
+ lastChild = titleAttr.getLastChild();
+ value = lastChild.getNodeValue();
+ assertEquals("lastChildValue", "terday", value);
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_attrinsertbefore1";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(hc_attrinsertbefore1.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level1/core/hc_attrinsertbefore2.java b/dom/src/test/java/org/w3c/domts/level1/core/hc_attrinsertbefore2.java
new file mode 100644
index 0000000..9542330
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level1/core/hc_attrinsertbefore2.java
@@ -0,0 +1,106 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+Copyright (c) 2001-2004 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+*/
+
+package org.w3c.domts.level1.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * Prepends a text node to an attribute and checks if the value of
+ * the attribute is changed.
+* @author Curt Arnold
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-637646024">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-637646024</a>
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-952280727">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-952280727</a>
+*/
+public final class hc_attrinsertbefore2 extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public hc_attrinsertbefore2(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "hc_staff", true);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ NodeList acronymList;
+ Node testNode;
+ NamedNodeMap attributes;
+ Attr titleAttr;
+ String value;
+ Text textNode;
+ Node retval;
+ Node lastChild;
+ Node firstChild;
+ Node refChild;
+ doc = (Document) load("hc_staff", true);
+ acronymList = doc.getElementsByTagName("acronym");
+ testNode = acronymList.item(3);
+ attributes = testNode.getAttributes();
+ titleAttr = (Attr) attributes.getNamedItem("title");
+ textNode = doc.createTextNode("terday");
+ refChild = titleAttr.getFirstChild();
+ retval = titleAttr.insertBefore(textNode, refChild);
+ value = titleAttr.getValue();
+ assertEquals("attrValue", "terdayYes", value);
+ value = titleAttr.getNodeValue();
+ assertEquals("attrNodeValue", "terdayYes", value);
+ value = retval.getNodeValue();
+ assertEquals("retvalValue", "terday", value);
+ firstChild = titleAttr.getFirstChild();
+ value = firstChild.getNodeValue();
+ assertEquals("firstChildValue", "terday", value);
+ lastChild = titleAttr.getLastChild();
+ value = lastChild.getNodeValue();
+ assertEquals("lastChildValue", "Yes", value);
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_attrinsertbefore2";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(hc_attrinsertbefore2.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level1/core/hc_attrinsertbefore3.java b/dom/src/test/java/org/w3c/domts/level1/core/hc_attrinsertbefore3.java
new file mode 100644
index 0000000..7ac6e6b
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level1/core/hc_attrinsertbefore3.java
@@ -0,0 +1,112 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+Copyright (c) 2001-2004 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+*/
+
+package org.w3c.domts.level1.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * Appends a document fragment to an attribute and checks if the value of
+ * the attribute is changed.
+* @author Curt Arnold
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-637646024">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-637646024</a>
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-952280727">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-952280727</a>
+*/
+public final class hc_attrinsertbefore3 extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public hc_attrinsertbefore3(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "hc_staff", true);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ NodeList acronymList;
+ Node testNode;
+ NamedNodeMap attributes;
+ Attr titleAttr;
+ String value;
+ Text terNode;
+ Text dayNode;
+ DocumentFragment docFrag;
+ Node retval;
+ Node firstChild;
+ Node lastChild;
+ Node refChild = null;
+
+ doc = (Document) load("hc_staff", true);
+ acronymList = doc.getElementsByTagName("acronym");
+ testNode = acronymList.item(3);
+ attributes = testNode.getAttributes();
+ titleAttr = (Attr) attributes.getNamedItem("title");
+ terNode = doc.createTextNode("ter");
+ dayNode = doc.createTextNode("day");
+ docFrag = doc.createDocumentFragment();
+ retval = docFrag.appendChild(terNode);
+ retval = docFrag.appendChild(dayNode);
+ retval = titleAttr.insertBefore(docFrag, refChild);
+ value = titleAttr.getValue();
+ assertEquals("attrValue", "Yesterday", value);
+ value = titleAttr.getNodeValue();
+ assertEquals("attrNodeValue", "Yesterday", value);
+ value = retval.getNodeValue();
+ assertNull("retvalValue", value);
+ firstChild = titleAttr.getFirstChild();
+ value = firstChild.getNodeValue();
+ assertEquals("firstChildValue", "Yes", value);
+ lastChild = titleAttr.getLastChild();
+ value = lastChild.getNodeValue();
+ assertEquals("lastChildValue", "day", value);
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_attrinsertbefore3";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(hc_attrinsertbefore3.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level1/core/hc_attrinsertbefore4.java b/dom/src/test/java/org/w3c/domts/level1/core/hc_attrinsertbefore4.java
new file mode 100644
index 0000000..39cec5b
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level1/core/hc_attrinsertbefore4.java
@@ -0,0 +1,112 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+Copyright (c) 2001-2004 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+*/
+
+package org.w3c.domts.level1.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * Prepends a document fragment to an attribute and checks if the value of
+ * the attribute is changed.
+* @author Curt Arnold
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-637646024">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-637646024</a>
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-952280727">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-952280727</a>
+*/
+public final class hc_attrinsertbefore4 extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public hc_attrinsertbefore4(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "hc_staff", true);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ NodeList acronymList;
+ Node testNode;
+ NamedNodeMap attributes;
+ Attr titleAttr;
+ String value;
+ Text terNode;
+ Text dayNode;
+ DocumentFragment docFrag;
+ Node retval;
+ Node firstChild;
+ Node lastChild;
+ Node refChild;
+ doc = (Document) load("hc_staff", true);
+ acronymList = doc.getElementsByTagName("acronym");
+ testNode = acronymList.item(3);
+ attributes = testNode.getAttributes();
+ titleAttr = (Attr) attributes.getNamedItem("title");
+ terNode = doc.createTextNode("ter");
+ dayNode = doc.createTextNode("day");
+ docFrag = doc.createDocumentFragment();
+ retval = docFrag.appendChild(terNode);
+ retval = docFrag.appendChild(dayNode);
+ refChild = titleAttr.getFirstChild();
+ retval = titleAttr.insertBefore(docFrag, refChild);
+ value = titleAttr.getValue();
+ assertEquals("attrValue", "terdayYes", value);
+ value = titleAttr.getNodeValue();
+ assertEquals("attrNodeValue", "terdayYes", value);
+ value = retval.getNodeValue();
+ assertNull("retvalValue", value);
+ firstChild = titleAttr.getFirstChild();
+ value = firstChild.getNodeValue();
+ assertEquals("firstChildValue", "ter", value);
+ lastChild = titleAttr.getLastChild();
+ value = lastChild.getNodeValue();
+ assertEquals("lastChildValue", "Yes", value);
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_attrinsertbefore4";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(hc_attrinsertbefore4.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level1/core/hc_attrinsertbefore5.java b/dom/src/test/java/org/w3c/domts/level1/core/hc_attrinsertbefore5.java
new file mode 100644
index 0000000..3a3e47e
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level1/core/hc_attrinsertbefore5.java
@@ -0,0 +1,119 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+Copyright (c) 2001-2004 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+*/
+
+package org.w3c.domts.level1.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * Attempt to append a CDATASection to an attribute which should result
+ * in a HIERARCHY_REQUEST_ERR.
+* @author Curt Arnold
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-637646024">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-637646024</a>
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-952280727">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-952280727</a>
+*/
+public final class hc_attrinsertbefore5 extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public hc_attrinsertbefore5(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+ if (factory.hasFeature("XML", null) != true) {
+ throw org.w3c.domts.DOMTestIncompatibleException.incompatibleFeature("XML", null);
+ }
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "hc_staff", true);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ NodeList acronymList;
+ Node testNode;
+ NamedNodeMap attributes;
+ Attr titleAttr;
+ String value;
+ Node textNode;
+ Node retval;
+ Node refChild = null;
+
+ doc = (Document) load("hc_staff", true);
+ acronymList = doc.getElementsByTagName("acronym");
+ testNode = acronymList.item(3);
+ attributes = testNode.getAttributes();
+ titleAttr = (Attr) attributes.getNamedItem("title");
+
+ if (("text/html".equals(getContentType()))) {
+
+ {
+ boolean success = false;
+ try {
+ textNode = doc.createCDATASection("terday");
+ } catch (DOMException ex) {
+ success = (ex.code == DOMException.NOT_SUPPORTED_ERR);
+ }
+ assertTrue("throw_NOT_SUPPORTED_ERR", success);
+ }
+} else {
+ textNode = doc.createCDATASection("terday");
+
+ {
+ boolean success = false;
+ try {
+ retval = titleAttr.insertBefore(textNode, refChild);
+ } catch (DOMException ex) {
+ success = (ex.code == DOMException.HIERARCHY_REQUEST_ERR);
+ }
+ assertTrue("throw_HIERARCHY_REQUEST_ERR", success);
+ }
+}
+
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_attrinsertbefore5";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(hc_attrinsertbefore5.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level1/core/hc_attrinsertbefore6.java b/dom/src/test/java/org/w3c/domts/level1/core/hc_attrinsertbefore6.java
new file mode 100644
index 0000000..6cb66b5
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level1/core/hc_attrinsertbefore6.java
@@ -0,0 +1,104 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+Copyright (c) 2001-2004 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+*/
+
+package org.w3c.domts.level1.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * Attempt to append a text node from another document to an attribute which should result
+ * in a WRONG_DOCUMENT_ERR.
+* @author Curt Arnold
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-637646024">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-637646024</a>
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-952280727">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-952280727</a>
+*/
+public final class hc_attrinsertbefore6 extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public hc_attrinsertbefore6(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "hc_staff", true);
+ preload(contentType, "hc_staff", true);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ NodeList acronymList;
+ Node testNode;
+ NamedNodeMap attributes;
+ Attr titleAttr;
+ String value;
+ Node textNode;
+ Node retval;
+ Node refChild = null;
+
+ Document otherDoc;
+ doc = (Document) load("hc_staff", true);
+ otherDoc = (Document) load("hc_staff", true);
+ acronymList = doc.getElementsByTagName("acronym");
+ testNode = acronymList.item(3);
+ attributes = testNode.getAttributes();
+ titleAttr = (Attr) attributes.getNamedItem("title");
+ textNode = otherDoc.createTextNode("terday");
+
+ {
+ boolean success = false;
+ try {
+ retval = titleAttr.insertBefore(textNode, refChild);
+ } catch (DOMException ex) {
+ success = (ex.code == DOMException.WRONG_DOCUMENT_ERR);
+ }
+ assertTrue("throw_WRONG_DOCUMENT_ERR", success);
+ }
+}
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_attrinsertbefore6";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(hc_attrinsertbefore6.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level1/core/hc_attrinsertbefore7.java b/dom/src/test/java/org/w3c/domts/level1/core/hc_attrinsertbefore7.java
new file mode 100644
index 0000000..122a27f
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level1/core/hc_attrinsertbefore7.java
@@ -0,0 +1,126 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+Copyright (c) 2001-2004 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+*/
+
+package org.w3c.domts.level1.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * Appends a document fragment containing a CDATASection to an attribute.
+* @author Curt Arnold
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-637646024">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-637646024</a>
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-952280727">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-952280727</a>
+*/
+public final class hc_attrinsertbefore7 extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public hc_attrinsertbefore7(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+ if (factory.hasFeature("XML", null) != true) {
+ throw org.w3c.domts.DOMTestIncompatibleException.incompatibleFeature("XML", null);
+ }
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "hc_staff", true);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ NodeList acronymList;
+ Node testNode;
+ NamedNodeMap attributes;
+ Attr titleAttr;
+ String value;
+ Text terNode;
+ Node dayNode;
+ DocumentFragment docFrag;
+ Node retval;
+ Node firstChild;
+ Node lastChild;
+ Node refChild = null;
+
+ doc = (Document) load("hc_staff", true);
+ acronymList = doc.getElementsByTagName("acronym");
+ testNode = acronymList.item(3);
+ attributes = testNode.getAttributes();
+ titleAttr = (Attr) attributes.getNamedItem("title");
+ terNode = doc.createTextNode("ter");
+
+ if (("text/html".equals(getContentType()))) {
+
+ {
+ boolean success = false;
+ try {
+ dayNode = doc.createCDATASection("day");
+ } catch (DOMException ex) {
+ success = (ex.code == DOMException.NOT_SUPPORTED_ERR);
+ }
+ assertTrue("throw_NOT_SUPPORTED_ERR", success);
+ }
+} else {
+ dayNode = doc.createCDATASection("day");
+ docFrag = doc.createDocumentFragment();
+ retval = docFrag.appendChild(terNode);
+ retval = docFrag.appendChild(dayNode);
+
+ {
+ boolean success = false;
+ try {
+ retval = titleAttr.insertBefore(docFrag, refChild);
+ } catch (DOMException ex) {
+ success = (ex.code == DOMException.HIERARCHY_REQUEST_ERR);
+ }
+ assertTrue("throw_HIERARCHY_REQUEST_ERR", success);
+ }
+}
+
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_attrinsertbefore7";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(hc_attrinsertbefore7.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level1/core/hc_attrlastchild.java b/dom/src/test/java/org/w3c/domts/level1/core/hc_attrlastchild.java
new file mode 100644
index 0000000..0467b5b
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level1/core/hc_attrlastchild.java
@@ -0,0 +1,96 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+Copyright (c) 2001-2004 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+*/
+
+package org.w3c.domts.level1.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * Checks that Node.lastChild for an attribute node contains
+ * the expected text node.
+* @author Curt Arnold
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-637646024">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-637646024</a>
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-61AD09FB">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-61AD09FB</a>
+*/
+public final class hc_attrlastchild extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public hc_attrlastchild(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "hc_staff", true);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ NodeList acronymList;
+ Node testNode;
+ NamedNodeMap attributes;
+ Attr titleAttr;
+ String value;
+ Text textNode;
+ Node otherChild;
+ doc = (Document) load("hc_staff", true);
+ acronymList = doc.getElementsByTagName("acronym");
+ testNode = acronymList.item(3);
+ attributes = testNode.getAttributes();
+ titleAttr = (Attr) attributes.getNamedItem("title");
+ textNode = (Text) titleAttr.getFirstChild();
+ assertNotNull("textNodeNotNull", textNode);
+ value = textNode.getNodeValue();
+ assertEquals("child1IsYes", "Yes", value);
+ otherChild = textNode.getNextSibling();
+ assertNull("nextSiblingIsNull", otherChild);
+ otherChild = textNode.getPreviousSibling();
+ assertNull("previousSiblingIsNull", otherChild);
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_attrlastchild";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(hc_attrlastchild.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level1/core/hc_attrname.java b/dom/src/test/java/org/w3c/domts/level1/core/hc_attrname.java
new file mode 100644
index 0000000..3f3b276
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level1/core/hc_attrname.java
@@ -0,0 +1,94 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+Copyright (c) 2001-2004 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+*/
+
+package org.w3c.domts.level1.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * Retrieve the attribute named class from the last
+ * child of of the second "p" element and examine its
+ * NodeName.
+* @author Curt Arnold
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-F68D095">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-F68D095</a>
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-1112119403">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-1112119403</a>
+* @see <a href="http://www.w3.org/Bugs/Public/show_bug.cgi?id=236">http://www.w3.org/Bugs/Public/show_bug.cgi?id=236</a>
+* @see <a href="http://lists.w3.org/Archives/Public/www-dom-ts/2003Jun/0011.html">http://lists.w3.org/Archives/Public/www-dom-ts/2003Jun/0011.html</a>
+*/
+public final class hc_attrname extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public hc_attrname(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "hc_staff", false);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ NodeList addressList;
+ Node testNode;
+ NamedNodeMap attributes;
+ Attr streetAttr;
+ String strong1;
+ String strong2;
+ doc = (Document) load("hc_staff", false);
+ addressList = doc.getElementsByTagName("acronym");
+ testNode = addressList.item(1);
+ attributes = testNode.getAttributes();
+ streetAttr = (Attr) attributes.getNamedItem("class");
+ strong1 = streetAttr.getNodeName();
+ strong2 = streetAttr.getName();
+ assertEqualsAutoCase("attribute", "nodeName", "class", strong1);
+ assertEqualsAutoCase("attribute", "name", "class", strong2);
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_attrname";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(hc_attrname.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level1/core/hc_attrnextsiblingnull.java b/dom/src/test/java/org/w3c/domts/level1/core/hc_attrnextsiblingnull.java
new file mode 100644
index 0000000..57efb39
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level1/core/hc_attrnextsiblingnull.java
@@ -0,0 +1,90 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+Copyright (c) 2001 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+*/
+
+package org.w3c.domts.level1.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The "getNextSibling()" method for an Attr node should return null.
+ * Retrieve the attribute named "domestic" from the last child of of the
+ * first employee and examine its NextSibling node. This test uses the
+ * "getNamedItem(name)" method from the NamedNodeMap interface.
+* @author Curt Arnold
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-6AC54C2F">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-6AC54C2F</a>
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-637646024">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-637646024</a>
+*/
+public final class hc_attrnextsiblingnull extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public hc_attrnextsiblingnull(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "hc_staff", false);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ NodeList addressList;
+ Node testNode;
+ NamedNodeMap attributes;
+ Attr domesticAttr;
+ Node s;
+ doc = (Document) load("hc_staff", false);
+ addressList = doc.getElementsByTagName("acronym");
+ testNode = addressList.item(0);
+ attributes = testNode.getAttributes();
+ domesticAttr = (Attr) attributes.getNamedItem("title");
+ s = domesticAttr.getNextSibling();
+ assertNull("attrNextSiblingNullAssert", s);
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_attrnextsiblingnull";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(hc_attrnextsiblingnull.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level1/core/hc_attrnormalize.java b/dom/src/test/java/org/w3c/domts/level1/core/hc_attrnormalize.java
new file mode 100644
index 0000000..017e71a
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level1/core/hc_attrnormalize.java
@@ -0,0 +1,102 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+Copyright (c) 2001-2004 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+*/
+
+package org.w3c.domts.level1.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * Appends a text node to an attribute, normalizes the attribute
+ * and checks for a single child node.
+* @author Curt Arnold
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-637646024">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-637646024</a>
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-162CF083">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-162CF083</a>
+*/
+public final class hc_attrnormalize extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public hc_attrnormalize(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "hc_staff", true);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ NodeList acronymList;
+ Node testNode;
+ NamedNodeMap attributes;
+ Attr titleAttr;
+ String value;
+ Text textNode;
+ Node retval;
+ Node firstChild;
+ Node secondChild;
+ doc = (Document) load("hc_staff", true);
+ acronymList = doc.getElementsByTagName("acronym");
+ testNode = acronymList.item(3);
+ attributes = testNode.getAttributes();
+ titleAttr = (Attr) attributes.getNamedItem("title");
+ textNode = doc.createTextNode("terday");
+ retval = titleAttr.appendChild(textNode);
+ textNode = doc.createTextNode("");
+ retval = titleAttr.appendChild(textNode);
+ ((Element) /*Node */testNode).normalize();
+ value = titleAttr.getNodeValue();
+ assertEquals("attrNodeValue", "Yesterday", value);
+ firstChild = titleAttr.getFirstChild();
+ value = firstChild.getNodeValue();
+ assertEquals("firstChildValue", "Yesterday", value);
+ secondChild = firstChild.getNextSibling();
+ assertNull("secondChildIsNull", secondChild);
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_attrnormalize";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(hc_attrnormalize.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level1/core/hc_attrparentnodenull.java b/dom/src/test/java/org/w3c/domts/level1/core/hc_attrparentnodenull.java
new file mode 100644
index 0000000..17f4283
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level1/core/hc_attrparentnodenull.java
@@ -0,0 +1,90 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+Copyright (c) 2001 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+*/
+
+package org.w3c.domts.level1.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The "getParentNode()" method for an Attr node should return null. Retrieve
+ * the attribute named "domestic" from the last child of the first employee
+ * and examine its parentNode attribute. This test also uses the "getNamedItem(name)"
+ * method from the NamedNodeMap interface.
+* @author Curt Arnold
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-1060184317">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-1060184317</a>
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-637646024">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-637646024</a>
+*/
+public final class hc_attrparentnodenull extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public hc_attrparentnodenull(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "hc_staff", false);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ NodeList addressList;
+ Node testNode;
+ NamedNodeMap attributes;
+ Attr domesticAttr;
+ Node s;
+ doc = (Document) load("hc_staff", false);
+ addressList = doc.getElementsByTagName("acronym");
+ testNode = addressList.item(0);
+ attributes = testNode.getAttributes();
+ domesticAttr = (Attr) attributes.getNamedItem("title");
+ s = domesticAttr.getParentNode();
+ assertNull("attrParentNodeNullAssert", s);
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_attrparentnodenull";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(hc_attrparentnodenull.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level1/core/hc_attrprevioussiblingnull.java b/dom/src/test/java/org/w3c/domts/level1/core/hc_attrprevioussiblingnull.java
new file mode 100644
index 0000000..f63bf76
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level1/core/hc_attrprevioussiblingnull.java
@@ -0,0 +1,90 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+Copyright (c) 2001 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+*/
+
+package org.w3c.domts.level1.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The "getPreviousSibling()" method for an Attr node should return null.
+ * Retrieve the attribute named "domestic" from the last child of of the
+ * first employee and examine its PreviousSibling node. This test uses the
+ * "getNamedItem(name)" method from the NamedNodeMap interface.
+* @author Curt Arnold
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-640FB3C8">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-640FB3C8</a>
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-637646024">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-637646024</a>
+*/
+public final class hc_attrprevioussiblingnull extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public hc_attrprevioussiblingnull(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "hc_staff", false);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ NodeList addressList;
+ Node testNode;
+ NamedNodeMap attributes;
+ Attr domesticAttr;
+ Node s;
+ doc = (Document) load("hc_staff", false);
+ addressList = doc.getElementsByTagName("acronym");
+ testNode = addressList.item(0);
+ attributes = testNode.getAttributes();
+ domesticAttr = (Attr) attributes.getNamedItem("title");
+ s = domesticAttr.getPreviousSibling();
+ assertNull("attrPreviousSiblingNullAssert", s);
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_attrprevioussiblingnull";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(hc_attrprevioussiblingnull.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level1/core/hc_attrremovechild1.java b/dom/src/test/java/org/w3c/domts/level1/core/hc_attrremovechild1.java
new file mode 100644
index 0000000..dd88334
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level1/core/hc_attrremovechild1.java
@@ -0,0 +1,99 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+Copyright (c) 2001-2004 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+*/
+
+package org.w3c.domts.level1.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * Removes the child node of an attribute and checks that the value is empty.
+* @author Curt Arnold
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-637646024">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-637646024</a>
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-1734834066">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-1734834066</a>
+*/
+public final class hc_attrremovechild1 extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public hc_attrremovechild1(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "hc_staff", true);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ NodeList acronymList;
+ Node testNode;
+ NamedNodeMap attributes;
+ Attr titleAttr;
+ String value;
+ Text textNode;
+ Node retval;
+ Node firstChild;
+ doc = (Document) load("hc_staff", true);
+ acronymList = doc.getElementsByTagName("acronym");
+ testNode = acronymList.item(3);
+ attributes = testNode.getAttributes();
+ titleAttr = (Attr) attributes.getNamedItem("title");
+ textNode = (Text) titleAttr.getFirstChild();
+ assertNotNull("attrChildNotNull", textNode);
+ retval = titleAttr.removeChild(textNode);
+ value = titleAttr.getValue();
+ assertEquals("attrValue", "", value);
+ value = titleAttr.getNodeValue();
+ assertEquals("attrNodeValue", "", value);
+ value = retval.getNodeValue();
+ assertEquals("retvalValue", "Yes", value);
+ firstChild = titleAttr.getFirstChild();
+ assertNull("firstChildNull", firstChild);
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_attrremovechild1";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(hc_attrremovechild1.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level1/core/hc_attrremovechild2.java b/dom/src/test/java/org/w3c/domts/level1/core/hc_attrremovechild2.java
new file mode 100644
index 0000000..3ece6af
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level1/core/hc_attrremovechild2.java
@@ -0,0 +1,98 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+Copyright (c) 2001-2004 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+*/
+
+package org.w3c.domts.level1.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * Attempts to remove a freshly created text node which should result in a NOT_FOUND_ERR exception.
+* @author Curt Arnold
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-637646024">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-637646024</a>
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-1734834066">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-1734834066</a>
+*/
+public final class hc_attrremovechild2 extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public hc_attrremovechild2(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "hc_staff", true);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ NodeList acronymList;
+ Node testNode;
+ NamedNodeMap attributes;
+ Attr titleAttr;
+ String value;
+ Text textNode;
+ Node retval;
+ doc = (Document) load("hc_staff", true);
+ acronymList = doc.getElementsByTagName("acronym");
+ testNode = acronymList.item(3);
+ attributes = testNode.getAttributes();
+ titleAttr = (Attr) attributes.getNamedItem("title");
+ textNode = doc.createTextNode("Yesterday");
+
+ {
+ boolean success = false;
+ try {
+ retval = titleAttr.removeChild(textNode);
+ } catch (DOMException ex) {
+ success = (ex.code == DOMException.NOT_FOUND_ERR);
+ }
+ assertTrue("throw_NOT_FOUND_ERR", success);
+ }
+}
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_attrremovechild2";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(hc_attrremovechild2.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level1/core/hc_attrreplacechild1.java b/dom/src/test/java/org/w3c/domts/level1/core/hc_attrreplacechild1.java
new file mode 100644
index 0000000..59e80f9
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level1/core/hc_attrreplacechild1.java
@@ -0,0 +1,102 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+Copyright (c) 2001-2004 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+*/
+
+package org.w3c.domts.level1.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * Replaces a text node of an attribute and checks if the value of
+ * the attribute is changed.
+* @author Curt Arnold
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-637646024">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-637646024</a>
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-785887307">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-785887307</a>
+*/
+public final class hc_attrreplacechild1 extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public hc_attrreplacechild1(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "hc_staff", true);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ NodeList acronymList;
+ Node testNode;
+ NamedNodeMap attributes;
+ Attr titleAttr;
+ String value;
+ Text textNode;
+ Node retval;
+ Node firstChild;
+ doc = (Document) load("hc_staff", true);
+ acronymList = doc.getElementsByTagName("acronym");
+ testNode = acronymList.item(3);
+ attributes = testNode.getAttributes();
+ titleAttr = (Attr) attributes.getNamedItem("title");
+ textNode = doc.createTextNode("terday");
+ firstChild = titleAttr.getFirstChild();
+ assertNotNull("attrChildNotNull", firstChild);
+ retval = titleAttr.replaceChild(textNode, firstChild);
+ value = titleAttr.getValue();
+ assertEquals("attrValue", "terday", value);
+ value = titleAttr.getNodeValue();
+ assertEquals("attrNodeValue", "terday", value);
+ value = retval.getNodeValue();
+ assertEquals("retvalValue", "Yes", value);
+ firstChild = titleAttr.getFirstChild();
+ value = firstChild.getNodeValue();
+ assertEquals("firstChildValue", "terday", value);
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_attrreplacechild1";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(hc_attrreplacechild1.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level1/core/hc_attrreplacechild2.java b/dom/src/test/java/org/w3c/domts/level1/core/hc_attrreplacechild2.java
new file mode 100644
index 0000000..c26840d
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level1/core/hc_attrreplacechild2.java
@@ -0,0 +1,108 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+Copyright (c) 2001-2004 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+*/
+
+package org.w3c.domts.level1.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * Replaces a text node of an attribute with a document fragment and checks if the value of
+ * the attribute is changed.
+* @author Curt Arnold
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-637646024">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-637646024</a>
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-785887307">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-785887307</a>
+*/
+public final class hc_attrreplacechild2 extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public hc_attrreplacechild2(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "hc_staff", true);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ NodeList acronymList;
+ Node testNode;
+ NamedNodeMap attributes;
+ Attr titleAttr;
+ String value;
+ Text terNode;
+ Text dayNode;
+ DocumentFragment docFrag;
+ Node retval;
+ Node firstChild;
+ doc = (Document) load("hc_staff", true);
+ acronymList = doc.getElementsByTagName("acronym");
+ testNode = acronymList.item(3);
+ attributes = testNode.getAttributes();
+ titleAttr = (Attr) attributes.getNamedItem("title");
+ terNode = doc.createTextNode("ter");
+ dayNode = doc.createTextNode("day");
+ docFrag = doc.createDocumentFragment();
+ retval = docFrag.appendChild(terNode);
+ retval = docFrag.appendChild(dayNode);
+ firstChild = titleAttr.getFirstChild();
+ assertNotNull("attrChildNotNull", firstChild);
+ retval = titleAttr.replaceChild(docFrag, firstChild);
+ value = titleAttr.getValue();
+ assertEquals("attrValue", "terday", value);
+ value = titleAttr.getNodeValue();
+ assertEquals("attrNodeValue", "terday", value);
+ value = retval.getNodeValue();
+ assertEquals("retvalValue", "Yes", value);
+ firstChild = titleAttr.getFirstChild();
+ value = firstChild.getNodeValue();
+ assertEquals("firstChildValue", "ter", value);
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_attrreplacechild2";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(hc_attrreplacechild2.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level1/core/hc_attrsetvalue1.java b/dom/src/test/java/org/w3c/domts/level1/core/hc_attrsetvalue1.java
new file mode 100644
index 0000000..da4535b
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level1/core/hc_attrsetvalue1.java
@@ -0,0 +1,100 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+Copyright (c) 2001-2004 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+*/
+
+package org.w3c.domts.level1.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * Sets Attr.value on an attribute that only has a simple value.
+* @author Curt Arnold
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-221662474">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-221662474</a>
+*/
+public final class hc_attrsetvalue1 extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public hc_attrsetvalue1(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "hc_staff", true);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ NodeList acronymList;
+ Node testNode;
+ NamedNodeMap attributes;
+ Attr titleAttr;
+ String value;
+ Node retval;
+ Node firstChild;
+ Node otherChild;
+ doc = (Document) load("hc_staff", true);
+ acronymList = doc.getElementsByTagName("acronym");
+ testNode = acronymList.item(3);
+ attributes = testNode.getAttributes();
+ titleAttr = (Attr) attributes.getNamedItem("title");
+ firstChild = titleAttr.getFirstChild();
+ assertNotNull("attrChildNotNull", firstChild);
+ titleAttr.setValue("Tomorrow");
+ firstChild.setNodeValue("impl reused node");
+ value = titleAttr.getValue();
+ assertEquals("attrValue", "Tomorrow", value);
+ value = titleAttr.getNodeValue();
+ assertEquals("attrNodeValue", "Tomorrow", value);
+ firstChild = titleAttr.getLastChild();
+ value = firstChild.getNodeValue();
+ assertEquals("firstChildValue", "Tomorrow", value);
+ otherChild = firstChild.getNextSibling();
+ assertNull("nextSiblingIsNull", otherChild);
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_attrsetvalue1";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(hc_attrsetvalue1.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level1/core/hc_attrsetvalue2.java b/dom/src/test/java/org/w3c/domts/level1/core/hc_attrsetvalue2.java
new file mode 100644
index 0000000..e92eaa1
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level1/core/hc_attrsetvalue2.java
@@ -0,0 +1,103 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+Copyright (c) 2001-2004 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+*/
+
+package org.w3c.domts.level1.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * Sets Attr.value on an attribute that should contain multiple child nodes.
+* @author Curt Arnold
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-221662474">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-221662474</a>
+*/
+public final class hc_attrsetvalue2 extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public hc_attrsetvalue2(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "hc_staff", true);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ NodeList acronymList;
+ Node testNode;
+ NamedNodeMap attributes;
+ Attr titleAttr;
+ String value;
+ Text textNode;
+ Node retval;
+ Node firstChild;
+ Node otherChild;
+ doc = (Document) load("hc_staff", true);
+ acronymList = doc.getElementsByTagName("acronym");
+ testNode = acronymList.item(3);
+ attributes = testNode.getAttributes();
+ titleAttr = (Attr) attributes.getNamedItem("title");
+ textNode = doc.createTextNode("terday");
+ retval = titleAttr.appendChild(textNode);
+ firstChild = titleAttr.getFirstChild();
+ assertNotNull("attrChildNotNull", firstChild);
+ titleAttr.setValue("Tomorrow");
+ firstChild.setNodeValue("impl reused node");
+ value = titleAttr.getValue();
+ assertEquals("attrValue", "Tomorrow", value);
+ value = titleAttr.getNodeValue();
+ assertEquals("attrNodeValue", "Tomorrow", value);
+ firstChild = titleAttr.getLastChild();
+ value = firstChild.getNodeValue();
+ assertEquals("firstChildValue", "Tomorrow", value);
+ otherChild = firstChild.getNextSibling();
+ assertNull("nextSiblingIsNull", otherChild);
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_attrsetvalue2";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(hc_attrsetvalue2.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level1/core/hc_attrspecifiedvalue.java b/dom/src/test/java/org/w3c/domts/level1/core/hc_attrspecifiedvalue.java
new file mode 100644
index 0000000..9498238
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level1/core/hc_attrspecifiedvalue.java
@@ -0,0 +1,93 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+Copyright (c) 2001-2004 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+*/
+
+package org.w3c.domts.level1.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The "getSpecified()" method for an Attr node should
+ * be set to true if the attribute was explicitly given
+ * a value.
+ * Retrieve the attribute named "domestic" from the last
+ * child of of the first employee and examine the value
+ * returned by the "getSpecified()" method. This test uses
+ * the "getNamedItem(name)" method from the NamedNodeMap
+ * interface.
+* @author Curt Arnold
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-862529273">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-862529273</a>
+*/
+public final class hc_attrspecifiedvalue extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public hc_attrspecifiedvalue(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "hc_staff", false);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ NodeList addressList;
+ Node testNode;
+ NamedNodeMap attributes;
+ Attr domesticAttr;
+ boolean state;
+ doc = (Document) load("hc_staff", false);
+ addressList = doc.getElementsByTagName("acronym");
+ testNode = addressList.item(0);
+ attributes = testNode.getAttributes();
+ domesticAttr = (Attr) attributes.getNamedItem("title");
+ state = domesticAttr.getSpecified();
+ assertTrue("acronymTitleSpecified", state);
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_attrspecifiedvalue";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(hc_attrspecifiedvalue.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level1/core/hc_attrspecifiedvaluechanged.java b/dom/src/test/java/org/w3c/domts/level1/core/hc_attrspecifiedvaluechanged.java
new file mode 100644
index 0000000..c9a2e62
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level1/core/hc_attrspecifiedvaluechanged.java
@@ -0,0 +1,95 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+Copyright (c) 2001-2004 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+*/
+
+package org.w3c.domts.level1.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The "getSpecified()" method for an Attr node should return true if the
+ * value of the attribute is changed.
+ * Retrieve the attribute named "class" from the last
+ * child of of the THIRD employee and change its
+ * value to "Yes"(which is the default DTD value). This
+ * should cause the "getSpecified()" method to be true.
+ * This test uses the "setAttribute(name,value)" method
+ * from the Element interface and the "getNamedItem(name)"
+ * method from the NamedNodeMap interface.
+* @author Curt Arnold
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-862529273">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-862529273</a>
+*/
+public final class hc_attrspecifiedvaluechanged extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public hc_attrspecifiedvaluechanged(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "hc_staff", true);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ NodeList addressList;
+ Node testNode;
+ NamedNodeMap attributes;
+ Attr streetAttr;
+ boolean state;
+ doc = (Document) load("hc_staff", true);
+ addressList = doc.getElementsByTagName("acronym");
+ testNode = addressList.item(2);
+ ((Element) /*Node */testNode).setAttribute("class", "Yα");
+ attributes = testNode.getAttributes();
+ streetAttr = (Attr) attributes.getNamedItem("class");
+ state = streetAttr.getSpecified();
+ assertTrue("acronymClassSpecified", state);
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_attrspecifiedvaluechanged";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(hc_attrspecifiedvaluechanged.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level1/core/hc_characterdataappenddata.java b/dom/src/test/java/org/w3c/domts/level1/core/hc_characterdataappenddata.java
new file mode 100644
index 0000000..c07e696
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level1/core/hc_characterdataappenddata.java
@@ -0,0 +1,96 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+Copyright (c) 2001 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+*/
+
+package org.w3c.domts.level1.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The "appendData(arg)" method appends a string to the end
+ * of the character data of the node.
+ *
+ * Retrieve the character data from the second child
+ * of the first employee. The appendData(arg) method is
+ * called with arg=", Esquire". The method should append
+ * the specified data to the already existing character
+ * data. The new value return by the "getLength()" method
+ * should be 24.
+* @author Curt Arnold
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-72AB8359">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-72AB8359</a>
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-32791A2F">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-32791A2F</a>
+*/
+public final class hc_characterdataappenddata extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public hc_characterdataappenddata(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "hc_staff", true);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ NodeList elementList;
+ Node nameNode;
+ CharacterData child;
+ String childValue;
+ int childLength;
+ doc = (Document) load("hc_staff", true);
+ elementList = doc.getElementsByTagName("strong");
+ nameNode = elementList.item(0);
+ child = (CharacterData) nameNode.getFirstChild();
+ child.appendData(", Esquire");
+ childValue = child.getData();
+ childLength = childValue.length();
+ assertEquals("characterdataAppendDataAssert", 24, childLength);
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_characterdataappenddata";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(hc_characterdataappenddata.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level1/core/hc_characterdataappenddatagetdata.java b/dom/src/test/java/org/w3c/domts/level1/core/hc_characterdataappenddatagetdata.java
new file mode 100644
index 0000000..02cbf32
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level1/core/hc_characterdataappenddatagetdata.java
@@ -0,0 +1,95 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+Copyright (c) 2001 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+*/
+
+package org.w3c.domts.level1.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * On successful invocation of the "appendData(arg)"
+ * method the "getData()" method provides access to the
+ * concatentation of data and the specified string.
+ *
+ * Retrieve the character data from the second child
+ * of the first employee. The appendData(arg) method is
+ * called with arg=", Esquire". The method should append
+ * the specified data to the already existing character
+ * data. The new value return by the "getData()" method
+ * should be "Margaret Martin, Esquire".
+* @author Curt Arnold
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-72AB8359">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-72AB8359</a>
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-32791A2F">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-32791A2F</a>
+*/
+public final class hc_characterdataappenddatagetdata extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public hc_characterdataappenddatagetdata(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "hc_staff", true);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ NodeList elementList;
+ Node nameNode;
+ CharacterData child;
+ String childData;
+ doc = (Document) load("hc_staff", true);
+ elementList = doc.getElementsByTagName("strong");
+ nameNode = elementList.item(0);
+ child = (CharacterData) nameNode.getFirstChild();
+ child.appendData(", Esquire");
+ childData = child.getData();
+ assertEquals("characterdataAppendDataGetDataAssert", "Margaret Martin, Esquire", childData);
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_characterdataappenddatagetdata";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(hc_characterdataappenddatagetdata.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level1/core/hc_characterdatadeletedatabegining.java b/dom/src/test/java/org/w3c/domts/level1/core/hc_characterdatadeletedatabegining.java
new file mode 100644
index 0000000..179fe6c
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level1/core/hc_characterdatadeletedatabegining.java
@@ -0,0 +1,93 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+Copyright (c) 2001 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+*/
+
+package org.w3c.domts.level1.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The "deleteData(offset,count)" method removes a range of
+ * characters from the node. Delete data at the beginning
+ * of the character data.
+ * Retrieve the character data from the last child of the
+ * first employee. The "deleteData(offset,count)"
+ * method is then called with offset=0 and count=16.
+ * The method should delete the characters from position
+ * 0 thru position 16. The new value of the character data
+ * should be "Dallas, Texas 98551".
+* @author Curt Arnold
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-7C603781">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-7C603781</a>
+*/
+public final class hc_characterdatadeletedatabegining extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public hc_characterdatadeletedatabegining(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "hc_staff", true);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ NodeList elementList;
+ Node nameNode;
+ CharacterData child;
+ String childData;
+ doc = (Document) load("hc_staff", true);
+ elementList = doc.getElementsByTagName("acronym");
+ nameNode = elementList.item(0);
+ child = (CharacterData) nameNode.getFirstChild();
+ child.deleteData(0, 16);
+ childData = child.getData();
+ assertEquals("data", "Dallas, Texas 98551", childData);
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_characterdatadeletedatabegining";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(hc_characterdatadeletedatabegining.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level1/core/hc_characterdatadeletedataend.java b/dom/src/test/java/org/w3c/domts/level1/core/hc_characterdatadeletedataend.java
new file mode 100644
index 0000000..6401b8f
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level1/core/hc_characterdatadeletedataend.java
@@ -0,0 +1,95 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+Copyright (c) 2001 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+*/
+
+package org.w3c.domts.level1.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The "deleteData(offset,count)" method removes a range of
+ * characters from the node. Delete data at the end
+ * of the character data.
+ *
+ * Retrieve the character data from the last child of the
+ * first employee. The "deleteData(offset,count)"
+ * method is then called with offset=30 and count=5.
+ * The method should delete the characters from position
+ * 30 thru position 35. The new value of the character data
+ * should be "1230 North Ave. Dallas, Texas".
+* @author Curt Arnold
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-72AB8359">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-72AB8359</a>
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-7C603781">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-7C603781</a>
+*/
+public final class hc_characterdatadeletedataend extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public hc_characterdatadeletedataend(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "hc_staff", true);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ NodeList elementList;
+ Node nameNode;
+ CharacterData child;
+ String childData;
+ doc = (Document) load("hc_staff", true);
+ elementList = doc.getElementsByTagName("acronym");
+ nameNode = elementList.item(0);
+ child = (CharacterData) nameNode.getFirstChild();
+ child.deleteData(30, 5);
+ childData = child.getData();
+ assertEquals("characterdataDeleteDataEndAssert", "1230 North Ave. Dallas, Texas ", childData);
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_characterdatadeletedataend";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(hc_characterdatadeletedataend.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level1/core/hc_characterdatadeletedataexceedslength.java b/dom/src/test/java/org/w3c/domts/level1/core/hc_characterdatadeletedataexceedslength.java
new file mode 100644
index 0000000..ec60bfc
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level1/core/hc_characterdatadeletedataexceedslength.java
@@ -0,0 +1,97 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+Copyright (c) 2001 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+*/
+
+package org.w3c.domts.level1.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * If the sum of the offset and count used in the
+ * "deleteData(offset,count) method is greater than the
+ * length of the character data then all the characters
+ * from the offset to the end of the data are deleted.
+ *
+ * Retrieve the character data from the last child of the
+ * first employee. The "deleteData(offset,count)"
+ * method is then called with offset=4 and count=50.
+ * The method should delete the characters from position 4
+ * to the end of the data since the offset+count(50+4)
+ * is greater than the length of the character data(35).
+ * The new value of the character data should be "1230".
+* @author Curt Arnold
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-72AB8359">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-72AB8359</a>
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-7C603781">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-7C603781</a>
+*/
+public final class hc_characterdatadeletedataexceedslength extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public hc_characterdatadeletedataexceedslength(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "hc_staff", true);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ NodeList elementList;
+ Node nameNode;
+ CharacterData child;
+ String childData;
+ doc = (Document) load("hc_staff", true);
+ elementList = doc.getElementsByTagName("acronym");
+ nameNode = elementList.item(0);
+ child = (CharacterData) nameNode.getFirstChild();
+ child.deleteData(4, 50);
+ childData = child.getData();
+ assertEquals("characterdataDeleteDataExceedsLengthAssert", "1230", childData);
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_characterdatadeletedataexceedslength";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(hc_characterdatadeletedataexceedslength.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level1/core/hc_characterdatadeletedatagetlengthanddata.java b/dom/src/test/java/org/w3c/domts/level1/core/hc_characterdatadeletedatagetlengthanddata.java
new file mode 100644
index 0000000..1a7fe32
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level1/core/hc_characterdatadeletedatagetlengthanddata.java
@@ -0,0 +1,103 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+Copyright (c) 2001 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+*/
+
+package org.w3c.domts.level1.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * On successful invocation of the "deleteData(offset,count)"
+ * method, the "getData()" and "getLength()" methods reflect
+ * the changes.
+ *
+ * Retrieve the character data from the last child of the
+ * first employee. The "deleteData(offset,count)"
+ * method is then called with offset=30 and count=5.
+ * The method should delete the characters from position
+ * 30 thru position 35. The new value of the character data
+ * should be "1230 North Ave. Dallas, Texas" which is
+ * returned by the "getData()" method and "getLength()"
+ * method should return 30".
+* @author Curt Arnold
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-72AB8359">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-72AB8359</a>
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-7D61178C">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-7D61178C</a>
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-7C603781">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-7C603781</a>
+*/
+public final class hc_characterdatadeletedatagetlengthanddata extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public hc_characterdatadeletedatagetlengthanddata(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "hc_staff", true);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ NodeList elementList;
+ Node nameNode;
+ CharacterData child;
+ String childData;
+ int childLength;
+ java.util.List result = new java.util.ArrayList();
+
+ doc = (Document) load("hc_staff", true);
+ elementList = doc.getElementsByTagName("acronym");
+ nameNode = elementList.item(0);
+ child = (CharacterData) nameNode.getFirstChild();
+ child.deleteData(30, 5);
+ childData = child.getData();
+ assertEquals("data", "1230 North Ave. Dallas, Texas ", childData);
+ childLength = (int) child.getLength();
+ assertEquals("length", 30, childLength);
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_characterdatadeletedatagetlengthanddata";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(hc_characterdatadeletedatagetlengthanddata.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level1/core/hc_characterdatadeletedatamiddle.java b/dom/src/test/java/org/w3c/domts/level1/core/hc_characterdatadeletedatamiddle.java
new file mode 100644
index 0000000..672e136
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level1/core/hc_characterdatadeletedatamiddle.java
@@ -0,0 +1,95 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+Copyright (c) 2001 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+*/
+
+package org.w3c.domts.level1.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The "deleteData(offset,count)" method removes a range of
+ * characters from the node. Delete data in the middle
+ * of the character data.
+ *
+ * Retrieve the character data from the last child of the
+ * first employee. The "deleteData(offset,count)"
+ * method is then called with offset=16 and count=8.
+ * The method should delete the characters from position
+ * 16 thru position 24. The new value of the character data
+ * should be "1230 North Ave. Texas 98551".
+* @author Curt Arnold
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-72AB8359">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-72AB8359</a>
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-7C603781">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-7C603781</a>
+*/
+public final class hc_characterdatadeletedatamiddle extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public hc_characterdatadeletedatamiddle(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "hc_staff", true);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ NodeList elementList;
+ Node nameNode;
+ CharacterData child;
+ String childData;
+ doc = (Document) load("hc_staff", true);
+ elementList = doc.getElementsByTagName("acronym");
+ nameNode = elementList.item(0);
+ child = (CharacterData) nameNode.getFirstChild();
+ child.deleteData(16, 8);
+ childData = child.getData();
+ assertEquals("characterdataDeleteDataMiddleAssert", "1230 North Ave. Texas 98551", childData);
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_characterdatadeletedatamiddle";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(hc_characterdatadeletedatamiddle.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level1/core/hc_characterdatagetdata.java b/dom/src/test/java/org/w3c/domts/level1/core/hc_characterdatagetdata.java
new file mode 100644
index 0000000..63582a9
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level1/core/hc_characterdatagetdata.java
@@ -0,0 +1,89 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+Copyright (c) 2001 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+*/
+
+package org.w3c.domts.level1.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The "getData()" method retrieves the character data
+ * currently stored in the node.
+ * Retrieve the character data from the second child
+ * of the first employee and invoke the "getData()"
+ * method. The method returns the character data
+ * string.
+* @author Curt Arnold
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-72AB8359">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-72AB8359</a>
+*/
+public final class hc_characterdatagetdata extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public hc_characterdatagetdata(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "hc_staff", false);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ NodeList elementList;
+ Node nameNode;
+ CharacterData child;
+ String childData;
+ doc = (Document) load("hc_staff", false);
+ elementList = doc.getElementsByTagName("strong");
+ nameNode = elementList.item(0);
+ child = (CharacterData) nameNode.getFirstChild();
+ childData = child.getData();
+ assertEquals("characterdataGetDataAssert", "Margaret Martin", childData);
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_characterdatagetdata";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(hc_characterdatagetdata.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level1/core/hc_characterdatagetlength.java b/dom/src/test/java/org/w3c/domts/level1/core/hc_characterdatagetlength.java
new file mode 100644
index 0000000..981ca42
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level1/core/hc_characterdatagetlength.java
@@ -0,0 +1,91 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+Copyright (c) 2001 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+*/
+
+package org.w3c.domts.level1.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The "getLength()" method returns the number of characters
+ * stored in this nodes data.
+ * Retrieve the character data from the second
+ * child of the first employee and examine the
+ * value returned by the getLength() method.
+* @author Curt Arnold
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-72AB8359">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-72AB8359</a>
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-7D61178C">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-7D61178C</a>
+*/
+public final class hc_characterdatagetlength extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public hc_characterdatagetlength(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "hc_staff", false);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ NodeList elementList;
+ Node nameNode;
+ CharacterData child;
+ String childValue;
+ int childLength;
+ doc = (Document) load("hc_staff", false);
+ elementList = doc.getElementsByTagName("strong");
+ nameNode = elementList.item(0);
+ child = (CharacterData) nameNode.getFirstChild();
+ childValue = child.getData();
+ childLength = childValue.length();
+ assertEquals("characterdataGetLengthAssert", 15, childLength);
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_characterdatagetlength";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(hc_characterdatagetlength.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level1/core/hc_characterdataindexsizeerrdeletedatacountnegative.java b/dom/src/test/java/org/w3c/domts/level1/core/hc_characterdataindexsizeerrdeletedatacountnegative.java
new file mode 100644
index 0000000..f41b515
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level1/core/hc_characterdataindexsizeerrdeletedatacountnegative.java
@@ -0,0 +1,107 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+Copyright (c) 2001 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+*/
+
+package org.w3c.domts.level1.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The "deleteData(offset,count)" method raises an
+ * INDEX_SIZE_ERR DOMException if the specified count
+ * is negative.
+ *
+ * Retrieve the character data of the last child of the
+ * first employee and invoke its "deleteData(offset,count)"
+ * method with offset=10 and count=-3. It should raise the
+ * desired exception since the count is negative.
+* @author Curt Arnold
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-258A00AF')/constant[@name='INDEX_SIZE_ERR'])">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-258A00AF')/constant[@name='INDEX_SIZE_ERR'])</a>
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-6531BCCF">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-6531BCCF</a>
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-6531BCCF')/raises/exception[@name='DOMException']/descr/p[substring-before(.,':')='INDEX_SIZE_ERR'])">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-6531BCCF')/raises/exception[@name='DOMException']/descr/p[substring-before(.,':')='INDEX_SIZE_ERR'])</a>
+*/
+public final class hc_characterdataindexsizeerrdeletedatacountnegative extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public hc_characterdataindexsizeerrdeletedatacountnegative(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+
+ org.w3c.domts.DocumentBuilderSetting[] settings =
+ new org.w3c.domts.DocumentBuilderSetting[] {
+org.w3c.domts.DocumentBuilderSetting.signed
+ };
+ DOMTestDocumentBuilderFactory testFactory = factory.newInstance(settings);
+ setFactory(testFactory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "hc_staff", true);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ NodeList elementList;
+ Node nameNode;
+ CharacterData child;
+ String childSubstring;
+ doc = (Document) load("hc_staff", true);
+ elementList = doc.getElementsByTagName("acronym");
+ nameNode = elementList.item(0);
+ child = (CharacterData) nameNode.getFirstChild();
+
+ {
+ boolean success = false;
+ try {
+ childSubstring = child.substringData(10, -3);
+ } catch (DOMException ex) {
+ success = (ex.code == DOMException.INDEX_SIZE_ERR);
+ }
+ assertTrue("throws_INDEX_SIZE_ERR", success);
+ }
+}
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_characterdataindexsizeerrdeletedatacountnegative";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(hc_characterdataindexsizeerrdeletedatacountnegative.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level1/core/hc_characterdataindexsizeerrdeletedataoffsetgreater.java b/dom/src/test/java/org/w3c/domts/level1/core/hc_characterdataindexsizeerrdeletedataoffsetgreater.java
new file mode 100644
index 0000000..bf3f8cb
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level1/core/hc_characterdataindexsizeerrdeletedataoffsetgreater.java
@@ -0,0 +1,103 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+Copyright (c) 2001-2003 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+*/
+
+package org.w3c.domts.level1.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The "deleteData(offset,count)" method raises an
+ * INDEX_SIZE_ERR DOMException if the specified offset
+ * is greater that the number of characters in the string.
+ *
+ * Retrieve the character data of the last child of the
+ * first employee and invoke its "deleteData(offset,count)"
+ * method with offset=40 and count=3. It should raise the
+ * desired exception since the offset is greater than the
+ * number of characters in the string.
+* @author Curt Arnold
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-258A00AF')/constant[@name='INDEX_SIZE_ERR'])">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-258A00AF')/constant[@name='INDEX_SIZE_ERR'])</a>
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-7C603781">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-7C603781</a>
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-7C603781')/raises/exception[@name='DOMException']/descr/p[substring-before(.,':')='INDEX_SIZE_ERR'])">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-7C603781')/raises/exception[@name='DOMException']/descr/p[substring-before(.,':')='INDEX_SIZE_ERR'])</a>
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-7C603781">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-7C603781</a>
+* @see <a href="http://www.w3.org/Bugs/Public/show_bug.cgi?id=249">http://www.w3.org/Bugs/Public/show_bug.cgi?id=249</a>
+*/
+public final class hc_characterdataindexsizeerrdeletedataoffsetgreater extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public hc_characterdataindexsizeerrdeletedataoffsetgreater(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "hc_staff", true);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ NodeList elementList;
+ Node nameNode;
+ CharacterData child;
+ doc = (Document) load("hc_staff", true);
+ elementList = doc.getElementsByTagName("acronym");
+ nameNode = elementList.item(0);
+ child = (CharacterData) nameNode.getFirstChild();
+
+ {
+ boolean success = false;
+ try {
+ child.deleteData(40, 3);
+ } catch (DOMException ex) {
+ success = (ex.code == DOMException.INDEX_SIZE_ERR);
+ }
+ assertTrue("throw_INDEX_SIZE_ERR", success);
+ }
+}
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_characterdataindexsizeerrdeletedataoffsetgreater";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(hc_characterdataindexsizeerrdeletedataoffsetgreater.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level1/core/hc_characterdataindexsizeerrdeletedataoffsetnegative.java b/dom/src/test/java/org/w3c/domts/level1/core/hc_characterdataindexsizeerrdeletedataoffsetnegative.java
new file mode 100644
index 0000000..73f73a7
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level1/core/hc_characterdataindexsizeerrdeletedataoffsetnegative.java
@@ -0,0 +1,107 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+Copyright (c) 2001 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+*/
+
+package org.w3c.domts.level1.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The "deleteData(offset,count)" method raises an
+ * INDEX_SIZE_ERR DOMException if the specified offset
+ * is negative.
+ *
+ * Retrieve the character data of the last child of the
+ * first employee and invoke its "deleteData(offset,count)"
+ * method with offset=-5 and count=3. It should raise the
+ * desired exception since the offset is negative.
+* @author Curt Arnold
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-258A00AF')/constant[@name='INDEX_SIZE_ERR'])">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-258A00AF')/constant[@name='INDEX_SIZE_ERR'])</a>
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-7C603781">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-7C603781</a>
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-7C603781')/raises/exception[@name='DOMException']/descr/p[substring-before(.,':')='INDEX_SIZE_ERR'])">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-7C603781')/raises/exception[@name='DOMException']/descr/p[substring-before(.,':')='INDEX_SIZE_ERR'])</a>
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-7C603781">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-7C603781</a>
+*/
+public final class hc_characterdataindexsizeerrdeletedataoffsetnegative extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public hc_characterdataindexsizeerrdeletedataoffsetnegative(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+
+ org.w3c.domts.DocumentBuilderSetting[] settings =
+ new org.w3c.domts.DocumentBuilderSetting[] {
+org.w3c.domts.DocumentBuilderSetting.signed
+ };
+ DOMTestDocumentBuilderFactory testFactory = factory.newInstance(settings);
+ setFactory(testFactory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "hc_staff", true);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ NodeList elementList;
+ Node nameNode;
+ CharacterData child;
+ doc = (Document) load("hc_staff", true);
+ elementList = doc.getElementsByTagName("acronym");
+ nameNode = elementList.item(0);
+ child = (CharacterData) nameNode.getFirstChild();
+
+ {
+ boolean success = false;
+ try {
+ child.deleteData(-5, 3);
+ } catch (DOMException ex) {
+ success = (ex.code == DOMException.INDEX_SIZE_ERR);
+ }
+ assertTrue("throws_INDEX_SIZE_ERR", success);
+ }
+}
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_characterdataindexsizeerrdeletedataoffsetnegative";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(hc_characterdataindexsizeerrdeletedataoffsetnegative.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level1/core/hc_characterdataindexsizeerrinsertdataoffsetgreater.java b/dom/src/test/java/org/w3c/domts/level1/core/hc_characterdataindexsizeerrinsertdataoffsetgreater.java
new file mode 100644
index 0000000..4d17463
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level1/core/hc_characterdataindexsizeerrinsertdataoffsetgreater.java
@@ -0,0 +1,102 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+Copyright (c) 2001-2003 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+*/
+
+package org.w3c.domts.level1.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The "insertData(offset,arg)" method raises an
+ * INDEX_SIZE_ERR DOMException if the specified offset
+ * is greater than the number of characters in the string.
+ *
+ * Retrieve the character data of the last child of the
+ * first employee and invoke its insertData"(offset,arg)"
+ * method with offset=40 and arg="ABC". It should raise
+ * the desired exception since the offset is greater than
+ * the number of characters in the string.
+* @author Curt Arnold
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-258A00AF')/constant[@name='INDEX_SIZE_ERR'])">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-258A00AF')/constant[@name='INDEX_SIZE_ERR'])</a>
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-7C603781">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-7C603781</a>
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-7C603781')/raises/exception[@name='DOMException']/descr/p[substring-before(.,':')='INDEX_SIZE_ERR'])">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-7C603781')/raises/exception[@name='DOMException']/descr/p[substring-before(.,':')='INDEX_SIZE_ERR'])</a>
+* @see <a href="http://www.w3.org/Bugs/Public/show_bug.cgi?id=249">http://www.w3.org/Bugs/Public/show_bug.cgi?id=249</a>
+*/
+public final class hc_characterdataindexsizeerrinsertdataoffsetgreater extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public hc_characterdataindexsizeerrinsertdataoffsetgreater(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "hc_staff", true);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ NodeList elementList;
+ Node nameNode;
+ CharacterData child;
+ doc = (Document) load("hc_staff", true);
+ elementList = doc.getElementsByTagName("acronym");
+ nameNode = elementList.item(0);
+ child = (CharacterData) nameNode.getFirstChild();
+
+ {
+ boolean success = false;
+ try {
+ child.deleteData(40, 3);
+ } catch (DOMException ex) {
+ success = (ex.code == DOMException.INDEX_SIZE_ERR);
+ }
+ assertTrue("throw_INDEX_SIZE_ERR", success);
+ }
+}
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_characterdataindexsizeerrinsertdataoffsetgreater";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(hc_characterdataindexsizeerrinsertdataoffsetgreater.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level1/core/hc_characterdataindexsizeerrinsertdataoffsetnegative.java b/dom/src/test/java/org/w3c/domts/level1/core/hc_characterdataindexsizeerrinsertdataoffsetnegative.java
new file mode 100644
index 0000000..7aea106
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level1/core/hc_characterdataindexsizeerrinsertdataoffsetnegative.java
@@ -0,0 +1,106 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+Copyright (c) 2001 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+*/
+
+package org.w3c.domts.level1.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The "insertData(offset,arg)" method raises an
+ * INDEX_SIZE_ERR DOMException if the specified offset
+ * is negative.
+ *
+ * Retrieve the character data of the last child of the
+ * first employee and invoke its insertData"(offset,arg)"
+ * method with offset=-5 and arg="ABC". It should raise
+ * the desired exception since the offset is negative.
+* @author Curt Arnold
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-258A00AF')/constant[@name='INDEX_SIZE_ERR'])">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-258A00AF')/constant[@name='INDEX_SIZE_ERR'])</a>
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-E5CBA7FB">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-E5CBA7FB</a>
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-E5CBA7FB')/raises/exception[@name='DOMException']/descr/p[substring-before(.,':')='INDEX_SIZE_ERR'])">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-E5CBA7FB')/raises/exception[@name='DOMException']/descr/p[substring-before(.,':')='INDEX_SIZE_ERR'])</a>
+*/
+public final class hc_characterdataindexsizeerrinsertdataoffsetnegative extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public hc_characterdataindexsizeerrinsertdataoffsetnegative(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+
+ org.w3c.domts.DocumentBuilderSetting[] settings =
+ new org.w3c.domts.DocumentBuilderSetting[] {
+org.w3c.domts.DocumentBuilderSetting.signed
+ };
+ DOMTestDocumentBuilderFactory testFactory = factory.newInstance(settings);
+ setFactory(testFactory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "hc_staff", true);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ NodeList elementList;
+ Node nameNode;
+ CharacterData child;
+ doc = (Document) load("hc_staff", true);
+ elementList = doc.getElementsByTagName("acronym");
+ nameNode = elementList.item(0);
+ child = (CharacterData) nameNode.getFirstChild();
+
+ {
+ boolean success = false;
+ try {
+ child.replaceData(-5, 3, "ABC");
+ } catch (DOMException ex) {
+ success = (ex.code == DOMException.INDEX_SIZE_ERR);
+ }
+ assertTrue("throws_INDEX_SIZE_ERR", success);
+ }
+}
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_characterdataindexsizeerrinsertdataoffsetnegative";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(hc_characterdataindexsizeerrinsertdataoffsetnegative.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level1/core/hc_characterdataindexsizeerrreplacedatacountnegative.java b/dom/src/test/java/org/w3c/domts/level1/core/hc_characterdataindexsizeerrreplacedatacountnegative.java
new file mode 100644
index 0000000..d5eabc7
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level1/core/hc_characterdataindexsizeerrreplacedatacountnegative.java
@@ -0,0 +1,108 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+Copyright (c) 2001 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+*/
+
+package org.w3c.domts.level1.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The "replaceData(offset,count,arg)" method raises an
+ * INDEX_SIZE_ERR DOMException if the specified count
+ * is negative.
+ *
+ * Retrieve the character data of the last child of the
+ * first employee and invoke its
+ * "replaceData(offset,count,arg) method with offset=10
+ * and count=-3 and arg="ABC". It should raise the
+ * desired exception since the count is negative.
+* @author Curt Arnold
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-258A00AF')/constant[@name='INDEX_SIZE_ERR'])">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-258A00AF')/constant[@name='INDEX_SIZE_ERR'])</a>
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-6531BCCF">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-6531BCCF</a>
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-6531BCCF')/raises/exception[@name='DOMException']/descr/p[substring-before(.,':')='INDEX_SIZE_ERR'])">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-6531BCCF')/raises/exception[@name='DOMException']/descr/p[substring-before(.,':')='INDEX_SIZE_ERR'])</a>
+*/
+public final class hc_characterdataindexsizeerrreplacedatacountnegative extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public hc_characterdataindexsizeerrreplacedatacountnegative(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+
+ org.w3c.domts.DocumentBuilderSetting[] settings =
+ new org.w3c.domts.DocumentBuilderSetting[] {
+org.w3c.domts.DocumentBuilderSetting.signed
+ };
+ DOMTestDocumentBuilderFactory testFactory = factory.newInstance(settings);
+ setFactory(testFactory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "hc_staff", true);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ NodeList elementList;
+ Node nameNode;
+ CharacterData child;
+ String badString;
+ doc = (Document) load("hc_staff", true);
+ elementList = doc.getElementsByTagName("acronym");
+ nameNode = elementList.item(0);
+ child = (CharacterData) nameNode.getFirstChild();
+
+ {
+ boolean success = false;
+ try {
+ badString = child.substringData(10, -3);
+ } catch (DOMException ex) {
+ success = (ex.code == DOMException.INDEX_SIZE_ERR);
+ }
+ assertTrue("throws_INDEX_SIZE_ERR", success);
+ }
+}
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_characterdataindexsizeerrreplacedatacountnegative";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(hc_characterdataindexsizeerrreplacedatacountnegative.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level1/core/hc_characterdataindexsizeerrreplacedataoffsetgreater.java b/dom/src/test/java/org/w3c/domts/level1/core/hc_characterdataindexsizeerrreplacedataoffsetgreater.java
new file mode 100644
index 0000000..3af507e
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level1/core/hc_characterdataindexsizeerrreplacedataoffsetgreater.java
@@ -0,0 +1,103 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+Copyright (c) 2001-2003 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+*/
+
+package org.w3c.domts.level1.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The "replaceData(offset,count,arg)" method raises an
+ * INDEX_SIZE_ERR DOMException if the specified offset
+ * is greater than the length of the string.
+ *
+ * Retrieve the character data of the last child of the
+ * first employee and invoke its
+ * "replaceData(offset,count,arg) method with offset=40
+ * and count=3 and arg="ABC". It should raise the
+ * desired exception since the offset is greater than the
+ * length of the string.
+* @author Curt Arnold
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-258A00AF')/constant[@name='INDEX_SIZE_ERR'])">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-258A00AF')/constant[@name='INDEX_SIZE_ERR'])</a>
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-7C603781">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-7C603781</a>
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-7C603781')/raises/exception[@name='DOMException']/descr/p[substring-before(.,':')='INDEX_SIZE_ERR'])">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-7C603781')/raises/exception[@name='DOMException']/descr/p[substring-before(.,':')='INDEX_SIZE_ERR'])</a>
+* @see <a href="http://www.w3.org/Bugs/Public/show_bug.cgi?id=242">http://www.w3.org/Bugs/Public/show_bug.cgi?id=242</a>
+*/
+public final class hc_characterdataindexsizeerrreplacedataoffsetgreater extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public hc_characterdataindexsizeerrreplacedataoffsetgreater(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "hc_staff", true);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ NodeList elementList;
+ Node nameNode;
+ CharacterData child;
+ doc = (Document) load("hc_staff", true);
+ elementList = doc.getElementsByTagName("acronym");
+ nameNode = elementList.item(0);
+ child = (CharacterData) nameNode.getFirstChild();
+
+ {
+ boolean success = false;
+ try {
+ child.deleteData(40, 3);
+ } catch (DOMException ex) {
+ success = (ex.code == DOMException.INDEX_SIZE_ERR);
+ }
+ assertTrue("throw_INDEX_SIZE_ERR", success);
+ }
+}
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_characterdataindexsizeerrreplacedataoffsetgreater";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(hc_characterdataindexsizeerrreplacedataoffsetgreater.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level1/core/hc_characterdataindexsizeerrreplacedataoffsetnegative.java b/dom/src/test/java/org/w3c/domts/level1/core/hc_characterdataindexsizeerrreplacedataoffsetnegative.java
new file mode 100644
index 0000000..2b93ee9
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level1/core/hc_characterdataindexsizeerrreplacedataoffsetnegative.java
@@ -0,0 +1,108 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+Copyright (c) 2001 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+*/
+
+package org.w3c.domts.level1.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The "replaceData(offset,count,arg)" method raises an
+ * INDEX_SIZE_ERR DOMException if the specified offset
+ * is negative.
+ *
+ * Retrieve the character data of the last child of the
+ * first employee and invoke its
+ * "replaceData(offset,count,arg) method with offset=-5
+ * and count=3 and arg="ABC". It should raise the
+ * desired exception since the offset is negative.
+* @author Curt Arnold
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-258A00AF')/constant[@name='INDEX_SIZE_ERR'])">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-258A00AF')/constant[@name='INDEX_SIZE_ERR'])</a>
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-E5CBA7FB">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-E5CBA7FB</a>
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-E5CBA7FB')/raises/exception[@name='DOMException']/descr/p[substring-before(.,':')='INDEX_SIZE_ERR'])">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-E5CBA7FB')/raises/exception[@name='DOMException']/descr/p[substring-before(.,':')='INDEX_SIZE_ERR'])</a>
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-E5CBA7FB">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-E5CBA7FB</a>
+*/
+public final class hc_characterdataindexsizeerrreplacedataoffsetnegative extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public hc_characterdataindexsizeerrreplacedataoffsetnegative(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+
+ org.w3c.domts.DocumentBuilderSetting[] settings =
+ new org.w3c.domts.DocumentBuilderSetting[] {
+org.w3c.domts.DocumentBuilderSetting.signed
+ };
+ DOMTestDocumentBuilderFactory testFactory = factory.newInstance(settings);
+ setFactory(testFactory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "hc_staff", true);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ NodeList elementList;
+ Node nameNode;
+ CharacterData child;
+ doc = (Document) load("hc_staff", true);
+ elementList = doc.getElementsByTagName("acronym");
+ nameNode = elementList.item(0);
+ child = (CharacterData) nameNode.getFirstChild();
+
+ {
+ boolean success = false;
+ try {
+ child.replaceData(-5, 3, "ABC");
+ } catch (DOMException ex) {
+ success = (ex.code == DOMException.INDEX_SIZE_ERR);
+ }
+ assertTrue("throws_INDEX_SIZE_ERR", success);
+ }
+}
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_characterdataindexsizeerrreplacedataoffsetnegative";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(hc_characterdataindexsizeerrreplacedataoffsetnegative.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level1/core/hc_characterdataindexsizeerrsubstringcountnegative.java b/dom/src/test/java/org/w3c/domts/level1/core/hc_characterdataindexsizeerrsubstringcountnegative.java
new file mode 100644
index 0000000..1d3bc53
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level1/core/hc_characterdataindexsizeerrsubstringcountnegative.java
@@ -0,0 +1,107 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+Copyright (c) 2001 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+*/
+
+package org.w3c.domts.level1.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The "substringData(offset,count)" method raises an
+ * INDEX_SIZE_ERR DOMException if the specified count
+ * is negative.
+ *
+ * Retrieve the character data of the last child of the
+ * first employee and invoke its "substringData(offset,count)
+ * method with offset=10 and count=-3. It should raise the
+ * desired exception since the count is negative.
+* @author Curt Arnold
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-258A00AF')/constant[@name='INDEX_SIZE_ERR'])">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-258A00AF')/constant[@name='INDEX_SIZE_ERR'])</a>
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-6531BCCF">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-6531BCCF</a>
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-6531BCCF')/raises/exception[@name='DOMException']/descr/p[substring-before(.,':')='INDEX_SIZE_ERR'])">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-6531BCCF')/raises/exception[@name='DOMException']/descr/p[substring-before(.,':')='INDEX_SIZE_ERR'])</a>
+*/
+public final class hc_characterdataindexsizeerrsubstringcountnegative extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public hc_characterdataindexsizeerrsubstringcountnegative(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+
+ org.w3c.domts.DocumentBuilderSetting[] settings =
+ new org.w3c.domts.DocumentBuilderSetting[] {
+org.w3c.domts.DocumentBuilderSetting.signed
+ };
+ DOMTestDocumentBuilderFactory testFactory = factory.newInstance(settings);
+ setFactory(testFactory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "hc_staff", false);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ NodeList elementList;
+ Node nameNode;
+ CharacterData child;
+ String badSubstring;
+ doc = (Document) load("hc_staff", false);
+ elementList = doc.getElementsByTagName("acronym");
+ nameNode = elementList.item(0);
+ child = (CharacterData) nameNode.getFirstChild();
+
+ {
+ boolean success = false;
+ try {
+ badSubstring = child.substringData(10, -3);
+ } catch (DOMException ex) {
+ success = (ex.code == DOMException.INDEX_SIZE_ERR);
+ }
+ assertTrue("throws_INDEX_SIZE_ERR", success);
+ }
+}
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_characterdataindexsizeerrsubstringcountnegative";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(hc_characterdataindexsizeerrsubstringcountnegative.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level1/core/hc_characterdataindexsizeerrsubstringnegativeoffset.java b/dom/src/test/java/org/w3c/domts/level1/core/hc_characterdataindexsizeerrsubstringnegativeoffset.java
new file mode 100644
index 0000000..a7ccd2d
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level1/core/hc_characterdataindexsizeerrsubstringnegativeoffset.java
@@ -0,0 +1,107 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+Copyright (c) 2001 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+*/
+
+package org.w3c.domts.level1.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The "substringData(offset,count)" method raises an
+ * INDEX_SIZE_ERR DOMException if the specified offset
+ * is negative.
+ *
+ * Retrieve the character data of the last child of the
+ * first employee and invoke its "substringData(offset,count)
+ * method with offset=-5 and count=3. It should raise the
+ * desired exception since the offset is negative.
+* @author Curt Arnold
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-258A00AF')/constant[@name='INDEX_SIZE_ERR'])">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-258A00AF')/constant[@name='INDEX_SIZE_ERR'])</a>
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-6531BCCF">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-6531BCCF</a>
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-6531BCCF')/raises/exception[@name='DOMException']/descr/p[substring-before(.,':')='INDEX_SIZE_ERR'])">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-6531BCCF')/raises/exception[@name='DOMException']/descr/p[substring-before(.,':')='INDEX_SIZE_ERR'])</a>
+*/
+public final class hc_characterdataindexsizeerrsubstringnegativeoffset extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public hc_characterdataindexsizeerrsubstringnegativeoffset(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+
+ org.w3c.domts.DocumentBuilderSetting[] settings =
+ new org.w3c.domts.DocumentBuilderSetting[] {
+org.w3c.domts.DocumentBuilderSetting.signed
+ };
+ DOMTestDocumentBuilderFactory testFactory = factory.newInstance(settings);
+ setFactory(testFactory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "hc_staff", false);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ NodeList elementList;
+ Node nameNode;
+ CharacterData child;
+ String badString;
+ doc = (Document) load("hc_staff", false);
+ elementList = doc.getElementsByTagName("acronym");
+ nameNode = elementList.item(0);
+ child = (CharacterData) nameNode.getFirstChild();
+
+ {
+ boolean success = false;
+ try {
+ badString = child.substringData(-5, 3);
+ } catch (DOMException ex) {
+ success = (ex.code == DOMException.INDEX_SIZE_ERR);
+ }
+ assertTrue("throws_INDEX_SIZE_ERR", success);
+ }
+}
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_characterdataindexsizeerrsubstringnegativeoffset";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(hc_characterdataindexsizeerrsubstringnegativeoffset.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level1/core/hc_characterdataindexsizeerrsubstringoffsetgreater.java b/dom/src/test/java/org/w3c/domts/level1/core/hc_characterdataindexsizeerrsubstringoffsetgreater.java
new file mode 100644
index 0000000..d3d2b2f
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level1/core/hc_characterdataindexsizeerrsubstringoffsetgreater.java
@@ -0,0 +1,103 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+Copyright (c) 2001 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+*/
+
+package org.w3c.domts.level1.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The "substringData(offset,count)" method raises an
+ * INDEX_SIZE_ERR DOMException if the specified offset
+ * is greater than the number of characters in the string.
+ *
+ * Retrieve the character data of the last child of the
+ * first employee and invoke its "substringData(offset,count)
+ * method with offset=40 and count=3. It should raise the
+ * desired exception since the offsets value is greater
+ * than the length.
+* @author Curt Arnold
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-258A00AF')/constant[@name='INDEX_SIZE_ERR'])">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-258A00AF')/constant[@name='INDEX_SIZE_ERR'])</a>
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-6531BCCF">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-6531BCCF</a>
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-6531BCCF')/raises/exception[@name='DOMException']/descr/p[substring-before(.,':')='INDEX_SIZE_ERR'])">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-6531BCCF')/raises/exception[@name='DOMException']/descr/p[substring-before(.,':')='INDEX_SIZE_ERR'])</a>
+* @see <a href="http://www.w3.org/Bugs/Public/show_bug.cgi?id=249">http://www.w3.org/Bugs/Public/show_bug.cgi?id=249</a>
+*/
+public final class hc_characterdataindexsizeerrsubstringoffsetgreater extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public hc_characterdataindexsizeerrsubstringoffsetgreater(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "hc_staff", false);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ NodeList elementList;
+ Node nameNode;
+ CharacterData child;
+ String badString;
+ doc = (Document) load("hc_staff", false);
+ elementList = doc.getElementsByTagName("acronym");
+ nameNode = elementList.item(0);
+ child = (CharacterData) nameNode.getFirstChild();
+
+ {
+ boolean success = false;
+ try {
+ badString = child.substringData(40, 3);
+ } catch (DOMException ex) {
+ success = (ex.code == DOMException.INDEX_SIZE_ERR);
+ }
+ assertTrue("throw_INDEX_SIZE_ERR", success);
+ }
+}
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_characterdataindexsizeerrsubstringoffsetgreater";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(hc_characterdataindexsizeerrsubstringoffsetgreater.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level1/core/hc_characterdatainsertdatabeginning.java b/dom/src/test/java/org/w3c/domts/level1/core/hc_characterdatainsertdatabeginning.java
new file mode 100644
index 0000000..7142e9e
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level1/core/hc_characterdatainsertdatabeginning.java
@@ -0,0 +1,93 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+Copyright (c) 2001 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+*/
+
+package org.w3c.domts.level1.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The "insertData(offset,arg)" method will insert a string
+ * at the specified character offset. Insert the data at
+ * the beginning of the character data.
+ * Retrieve the character data from the second child of
+ * the first employee. The "insertData(offset,arg)"
+ * method is then called with offset=0 and arg="Mss.".
+ * The method should insert the string "Mss." at position 0.
+ * The new value of the character data should be
+ * "Mss. Margaret Martin".
+* @author Curt Arnold
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-3EDB695F">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-3EDB695F</a>
+*/
+public final class hc_characterdatainsertdatabeginning extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public hc_characterdatainsertdatabeginning(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "hc_staff", true);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ NodeList elementList;
+ Node nameNode;
+ CharacterData child;
+ String childData;
+ doc = (Document) load("hc_staff", true);
+ elementList = doc.getElementsByTagName("strong");
+ nameNode = elementList.item(0);
+ child = (CharacterData) nameNode.getFirstChild();
+ child.insertData(0, "Mss. ");
+ childData = child.getData();
+ assertEquals("characterdataInsertDataBeginningAssert", "Mss. Margaret Martin", childData);
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_characterdatainsertdatabeginning";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(hc_characterdatainsertdatabeginning.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level1/core/hc_characterdatainsertdataend.java b/dom/src/test/java/org/w3c/domts/level1/core/hc_characterdatainsertdataend.java
new file mode 100644
index 0000000..0c7218f
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level1/core/hc_characterdatainsertdataend.java
@@ -0,0 +1,95 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+Copyright (c) 2001 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+*/
+
+package org.w3c.domts.level1.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The "insertData(offset,arg)" method will insert a string
+ * at the specified character offset. Insert the data at
+ * the end of the character data.
+ *
+ * Retrieve the character data from the second child of
+ * the first employee. The "insertData(offset,arg)"
+ * method is then called with offset=15 and arg=", Esquire".
+ * The method should insert the string ", Esquire" at
+ * position 15. The new value of the character data should
+ * be "Margaret Martin, Esquire".
+* @author Curt Arnold
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-72AB8359">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-72AB8359</a>
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-3EDB695F">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-3EDB695F</a>
+*/
+public final class hc_characterdatainsertdataend extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public hc_characterdatainsertdataend(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "hc_staff", true);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ NodeList elementList;
+ Node nameNode;
+ CharacterData child;
+ String childData;
+ doc = (Document) load("hc_staff", true);
+ elementList = doc.getElementsByTagName("strong");
+ nameNode = elementList.item(0);
+ child = (CharacterData) nameNode.getFirstChild();
+ child.insertData(15, ", Esquire");
+ childData = child.getData();
+ assertEquals("characterdataInsertDataEndAssert", "Margaret Martin, Esquire", childData);
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_characterdatainsertdataend";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(hc_characterdatainsertdataend.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level1/core/hc_characterdatainsertdatamiddle.java b/dom/src/test/java/org/w3c/domts/level1/core/hc_characterdatainsertdatamiddle.java
new file mode 100644
index 0000000..160fe4d
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level1/core/hc_characterdatainsertdatamiddle.java
@@ -0,0 +1,95 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+Copyright (c) 2001 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+*/
+
+package org.w3c.domts.level1.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The "insertData(offset,arg)" method will insert a string
+ * at the specified character offset. Insert the data in
+ * the middle of the character data.
+ *
+ * Retrieve the character data from the second child of
+ * the first employee. The "insertData(offset,arg)"
+ * method is then called with offset=9 and arg="Ann".
+ * The method should insert the string "Ann" at position 9.
+ * The new value of the character data should be
+ * "Margaret Ann Martin".
+* @author Curt Arnold
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-72AB8359">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-72AB8359</a>
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-3EDB695F">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-3EDB695F</a>
+*/
+public final class hc_characterdatainsertdatamiddle extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public hc_characterdatainsertdatamiddle(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "hc_staff", true);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ NodeList elementList;
+ Node nameNode;
+ CharacterData child;
+ String childData;
+ doc = (Document) load("hc_staff", true);
+ elementList = doc.getElementsByTagName("strong");
+ nameNode = elementList.item(0);
+ child = (CharacterData) nameNode.getFirstChild();
+ child.insertData(9, "Ann ");
+ childData = child.getData();
+ assertEquals("characterdataInsertDataMiddleAssert", "Margaret Ann Martin", childData);
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_characterdatainsertdatamiddle";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(hc_characterdatainsertdatamiddle.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level1/core/hc_characterdatareplacedatabegining.java b/dom/src/test/java/org/w3c/domts/level1/core/hc_characterdatareplacedatabegining.java
new file mode 100644
index 0000000..562c1dd
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level1/core/hc_characterdatareplacedatabegining.java
@@ -0,0 +1,93 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+Copyright (c) 2001 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+*/
+
+package org.w3c.domts.level1.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The "replaceData(offset,count,arg)" method replaces the
+ * characters starting at the specified offset with the
+ * specified string. Test for replacement in the
+ * middle of the data.
+ * Retrieve the character data from the last child of the
+ * first employee. The "replaceData(offset,count,arg)"
+ * method is then called with offset=5 and count=5 and
+ * arg="South". The method should replace characters five
+ * thru 9 of the character data with "South".
+* @author Curt Arnold
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-E5CBA7FB">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-E5CBA7FB</a>
+*/
+public final class hc_characterdatareplacedatabegining extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public hc_characterdatareplacedatabegining(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "hc_staff", true);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ NodeList elementList;
+ Node nameNode;
+ CharacterData child;
+ String childData;
+ doc = (Document) load("hc_staff", true);
+ elementList = doc.getElementsByTagName("acronym");
+ nameNode = elementList.item(0);
+ child = (CharacterData) nameNode.getFirstChild();
+ child.replaceData(0, 4, "2500");
+ childData = child.getData();
+ assertEquals("characterdataReplaceDataBeginingAssert", "2500 North Ave. Dallas, Texas 98551", childData);
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_characterdatareplacedatabegining";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(hc_characterdatareplacedatabegining.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level1/core/hc_characterdatareplacedataend.java b/dom/src/test/java/org/w3c/domts/level1/core/hc_characterdatareplacedataend.java
new file mode 100644
index 0000000..3c86794
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level1/core/hc_characterdatareplacedataend.java
@@ -0,0 +1,95 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+Copyright (c) 2001 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+*/
+
+package org.w3c.domts.level1.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The "replaceData(offset,count,arg)" method replaces the
+ * characters starting at the specified offset with the
+ * specified string. Test for replacement at the
+ * end of the data.
+ *
+ * Retrieve the character data from the last child of the
+ * first employee. The "replaceData(offset,count,arg)"
+ * method is then called with offset=30 and count=5 and
+ * arg="98665". The method should replace characters 30
+ * thru 34 of the character data with "98665".
+* @author Curt Arnold
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-72AB8359">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-72AB8359</a>
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-E5CBA7FB">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-E5CBA7FB</a>
+*/
+public final class hc_characterdatareplacedataend extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public hc_characterdatareplacedataend(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "hc_staff", true);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ NodeList elementList;
+ Node nameNode;
+ CharacterData child;
+ String childData;
+ doc = (Document) load("hc_staff", true);
+ elementList = doc.getElementsByTagName("acronym");
+ nameNode = elementList.item(0);
+ child = (CharacterData) nameNode.getFirstChild();
+ child.replaceData(30, 5, "98665");
+ childData = child.getData();
+ assertEquals("characterdataReplaceDataEndAssert", "1230 North Ave. Dallas, Texas 98665", childData);
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_characterdatareplacedataend";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(hc_characterdatareplacedataend.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level1/core/hc_characterdatareplacedataexceedslengthofarg.java b/dom/src/test/java/org/w3c/domts/level1/core/hc_characterdatareplacedataexceedslengthofarg.java
new file mode 100644
index 0000000..f45c49a
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level1/core/hc_characterdatareplacedataexceedslengthofarg.java
@@ -0,0 +1,96 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+Copyright (c) 2001 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+*/
+
+package org.w3c.domts.level1.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The "replaceData(offset,count,arg)" method replaces the
+ * characters starting at the specified offset with the
+ * specified string. Test the situation where the length
+ * of the arg string is greater than the specified offset.
+ *
+ * Retrieve the character data from the last child of the
+ * first employee. The "replaceData(offset,count,arg)"
+ * method is then called with offset=0 and count=4 and
+ * arg="260030". The method should replace characters one
+ * thru four with "260030". Note that the length of the
+ * specified string is greater that the specified offset.
+* @author Curt Arnold
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-72AB8359">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-72AB8359</a>
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-E5CBA7FB">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-E5CBA7FB</a>
+*/
+public final class hc_characterdatareplacedataexceedslengthofarg extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public hc_characterdatareplacedataexceedslengthofarg(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "hc_staff", true);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ NodeList elementList;
+ Node nameNode;
+ CharacterData child;
+ String childData;
+ doc = (Document) load("hc_staff", true);
+ elementList = doc.getElementsByTagName("acronym");
+ nameNode = elementList.item(0);
+ child = (CharacterData) nameNode.getFirstChild();
+ child.replaceData(0, 4, "260030");
+ childData = child.getData();
+ assertEquals("characterdataReplaceDataExceedsLengthOfArgAssert", "260030 North Ave. Dallas, Texas 98551", childData);
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_characterdatareplacedataexceedslengthofarg";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(hc_characterdatareplacedataexceedslengthofarg.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level1/core/hc_characterdatareplacedataexceedslengthofdata.java b/dom/src/test/java/org/w3c/domts/level1/core/hc_characterdatareplacedataexceedslengthofdata.java
new file mode 100644
index 0000000..efe88cc
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level1/core/hc_characterdatareplacedataexceedslengthofdata.java
@@ -0,0 +1,94 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+Copyright (c) 2001 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+*/
+
+package org.w3c.domts.level1.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * If the sum of the offset and count exceeds the length then
+ * all the characters to the end of the data are replaced.
+ *
+ * Retrieve the character data from the last child of the
+ * first employee. The "replaceData(offset,count,arg)"
+ * method is then called with offset=0 and count=50 and
+ * arg="2600". The method should replace all the characters
+ * with "2600". This is because the sum of the offset and
+ * count exceeds the length of the character data.
+* @author Curt Arnold
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-72AB8359">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-72AB8359</a>
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-E5CBA7FB">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-E5CBA7FB</a>
+*/
+public final class hc_characterdatareplacedataexceedslengthofdata extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public hc_characterdatareplacedataexceedslengthofdata(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "hc_staff", true);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ NodeList elementList;
+ Node nameNode;
+ CharacterData child;
+ String childData;
+ doc = (Document) load("hc_staff", true);
+ elementList = doc.getElementsByTagName("acronym");
+ nameNode = elementList.item(0);
+ child = (CharacterData) nameNode.getFirstChild();
+ child.replaceData(0, 50, "2600");
+ childData = child.getData();
+ assertEquals("characterdataReplaceDataExceedsLengthOfDataAssert", "2600", childData);
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_characterdatareplacedataexceedslengthofdata";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(hc_characterdatareplacedataexceedslengthofdata.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level1/core/hc_characterdatareplacedatamiddle.java b/dom/src/test/java/org/w3c/domts/level1/core/hc_characterdatareplacedatamiddle.java
new file mode 100644
index 0000000..87b1081
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level1/core/hc_characterdatareplacedatamiddle.java
@@ -0,0 +1,95 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+Copyright (c) 2001 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+*/
+
+package org.w3c.domts.level1.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The "replaceData(offset,count,arg)" method replaces the
+ * characters starting at the specified offset with the
+ * specified string. Test for replacement in the
+ * middle of the data.
+ *
+ * Retrieve the character data from the last child of the
+ * first employee. The "replaceData(offset,count,arg)"
+ * method is then called with offset=5 and count=5 and
+ * arg="South". The method should replace characters five
+ * thru 9 of the character data with "South".
+* @author Curt Arnold
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-72AB8359">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-72AB8359</a>
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-E5CBA7FB">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-E5CBA7FB</a>
+*/
+public final class hc_characterdatareplacedatamiddle extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public hc_characterdatareplacedatamiddle(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "hc_staff", true);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ NodeList elementList;
+ Node nameNode;
+ CharacterData child;
+ String childData;
+ doc = (Document) load("hc_staff", true);
+ elementList = doc.getElementsByTagName("acronym");
+ nameNode = elementList.item(0);
+ child = (CharacterData) nameNode.getFirstChild();
+ child.replaceData(5, 5, "South");
+ childData = child.getData();
+ assertEquals("characterdataReplaceDataMiddleAssert", "1230 South Ave. Dallas, Texas 98551", childData);
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_characterdatareplacedatamiddle";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(hc_characterdatareplacedatamiddle.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level1/core/hc_characterdatasetnodevalue.java b/dom/src/test/java/org/w3c/domts/level1/core/hc_characterdatasetnodevalue.java
new file mode 100644
index 0000000..71d93fc
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level1/core/hc_characterdatasetnodevalue.java
@@ -0,0 +1,92 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+Copyright (c) 2001 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+*/
+
+package org.w3c.domts.level1.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The "setNodeValue()" method changes the character data
+ * currently stored in the node.
+ * Retrieve the character data from the second child
+ * of the first employee and invoke the "setNodeValue()"
+ * method, call "getData()" and compare.
+* @author Curt Arnold
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-72AB8359">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-72AB8359</a>
+*/
+public final class hc_characterdatasetnodevalue extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public hc_characterdatasetnodevalue(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "hc_staff", true);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ NodeList elementList;
+ Node nameNode;
+ CharacterData child;
+ String childData;
+ String childValue;
+ doc = (Document) load("hc_staff", true);
+ elementList = doc.getElementsByTagName("strong");
+ nameNode = elementList.item(0);
+ child = (CharacterData) nameNode.getFirstChild();
+ child.setNodeValue("Marilyn Martin");
+ childData = child.getData();
+ assertEquals("data", "Marilyn Martin", childData);
+ childValue = child.getNodeValue();
+ assertEquals("value", "Marilyn Martin", childValue);
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_characterdatasetnodevalue";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(hc_characterdatasetnodevalue.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level1/core/hc_characterdatasubstringexceedsvalue.java b/dom/src/test/java/org/w3c/domts/level1/core/hc_characterdatasubstringexceedsvalue.java
new file mode 100644
index 0000000..fc64688
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level1/core/hc_characterdatasubstringexceedsvalue.java
@@ -0,0 +1,93 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+Copyright (c) 2001 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+*/
+
+package org.w3c.domts.level1.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * If the sum of the "offset" and "count" exceeds the
+ * "length" then the "substringData(offset,count)" method
+ * returns all the characters to the end of the data.
+ *
+ * Retrieve the character data from the second child
+ * of the first employee and access part of the data
+ * by using the substringData(offset,count) method
+ * with offset=9 and count=10. The method should return
+ * the substring "Martin" since offset+count > length
+ * (19 > 15).
+* @author Curt Arnold
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-6531BCCF">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-6531BCCF</a>
+*/
+public final class hc_characterdatasubstringexceedsvalue extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public hc_characterdatasubstringexceedsvalue(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "hc_staff", false);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ NodeList elementList;
+ Node nameNode;
+ CharacterData child;
+ String substring;
+ doc = (Document) load("hc_staff", false);
+ elementList = doc.getElementsByTagName("strong");
+ nameNode = elementList.item(0);
+ child = (CharacterData) nameNode.getFirstChild();
+ substring = child.substringData(9, 10);
+ assertEquals("characterdataSubStringExceedsValueAssert", "Martin", substring);
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_characterdatasubstringexceedsvalue";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(hc_characterdatasubstringexceedsvalue.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level1/core/hc_characterdatasubstringvalue.java b/dom/src/test/java/org/w3c/domts/level1/core/hc_characterdatasubstringvalue.java
new file mode 100644
index 0000000..5050fba
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level1/core/hc_characterdatasubstringvalue.java
@@ -0,0 +1,92 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+Copyright (c) 2001 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+*/
+
+package org.w3c.domts.level1.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The "substringData(offset,count)" method returns the
+ * specified string.
+ *
+ * Retrieve the character data from the second child
+ * of the first employee and access part of the data
+ * by using the substringData(offset,count) method. The
+ * method should return the specified substring starting
+ * at position "offset" and extract "count" characters.
+ * The method should return the string "Margaret".
+* @author Curt Arnold
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-6531BCCF">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-6531BCCF</a>
+*/
+public final class hc_characterdatasubstringvalue extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public hc_characterdatasubstringvalue(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "hc_staff", false);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ NodeList elementList;
+ Node nameNode;
+ CharacterData child;
+ String substring;
+ doc = (Document) load("hc_staff", false);
+ elementList = doc.getElementsByTagName("strong");
+ nameNode = elementList.item(0);
+ child = (CharacterData) nameNode.getFirstChild();
+ substring = child.substringData(0, 8);
+ assertEquals("characterdataSubStringValueAssert", "Margaret", substring);
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_characterdatasubstringvalue";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(hc_characterdatasubstringvalue.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level1/core/hc_commentgetcomment.java b/dom/src/test/java/org/w3c/domts/level1/core/hc_commentgetcomment.java
new file mode 100644
index 0000000..946f975
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level1/core/hc_commentgetcomment.java
@@ -0,0 +1,106 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+Copyright (c) 2001-2004 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+*/
+
+package org.w3c.domts.level1.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * A comment is all the characters between the starting
+ * '<!--' and ending '-->'
+ * Retrieve the nodes of the DOM document. Search for a
+ * comment node and the content is its value.
+* @author Curt Arnold
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-1334481328">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-1334481328</a>
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-F68D095">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-F68D095</a>
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-F68D080">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-F68D080</a>
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-111237558">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-111237558</a>
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-111237558">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-111237558</a>
+* @see <a href="http://www.w3.org/Bugs/Public/show_bug.cgi?id=509">http://www.w3.org/Bugs/Public/show_bug.cgi?id=509</a>
+*/
+public final class hc_commentgetcomment extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public hc_commentgetcomment(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "hc_staff", false);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ NodeList elementList;
+ Node child;
+ String childName;
+ String childValue;
+ int commentCount = 0;
+ int childType;
+ NamedNodeMap attributes;
+ doc = (Document) load("hc_staff", false);
+ elementList = doc.getChildNodes();
+ for (int indexN1005E = 0; indexN1005E < elementList.getLength(); indexN1005E++) {
+ child = (Node) elementList.item(indexN1005E);
+ childType = (int) child.getNodeType();
+
+ if (equals(8, childType)) {
+ childName = child.getNodeName();
+ assertEquals("nodeName", "#comment", childName);
+ childValue = child.getNodeValue();
+ assertEquals("nodeValue", " This is comment number 1.", childValue);
+ attributes = child.getAttributes();
+ assertNull("attributes", attributes);
+ commentCount += 1;
+ }
+ }
+ assertTrue("atMostOneComment", (commentCount < 2));
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_commentgetcomment";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(hc_commentgetcomment.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level1/core/hc_documentcreateattribute.java b/dom/src/test/java/org/w3c/domts/level1/core/hc_documentcreateattribute.java
new file mode 100644
index 0000000..983dabd
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level1/core/hc_documentcreateattribute.java
@@ -0,0 +1,93 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+Copyright (c) 2001-2004 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+*/
+
+package org.w3c.domts.level1.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * Retrieve the entire DOM document and invoke its
+ * "createAttribute(name)" method. It should create a
+ * new Attribute node with the given name. The name, value
+ * and type of the newly created object are retrieved and
+ * output.
+* @author Curt Arnold
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-1084891198">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-1084891198</a>
+* @see <a href="http://www.w3.org/Bugs/Public/show_bug.cgi?id=236">http://www.w3.org/Bugs/Public/show_bug.cgi?id=236</a>
+* @see <a href="http://lists.w3.org/Archives/Public/www-dom-ts/2003Jun/0011.html">http://lists.w3.org/Archives/Public/www-dom-ts/2003Jun/0011.html</a>
+* @see <a href="http://www.w3.org/Bugs/Public/show_bug.cgi?id=243">http://www.w3.org/Bugs/Public/show_bug.cgi?id=243</a>
+*/
+public final class hc_documentcreateattribute extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public hc_documentcreateattribute(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "hc_staff", true);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ Attr newAttrNode;
+ String attrValue;
+ String attrName;
+ int attrType;
+ doc = (Document) load("hc_staff", true);
+ newAttrNode = doc.createAttribute("title");
+ attrValue = newAttrNode.getNodeValue();
+ assertEquals("value", "", attrValue);
+ attrName = newAttrNode.getNodeName();
+ assertEqualsAutoCase("attribute", "name", "title", attrName);
+ attrType = (int) newAttrNode.getNodeType();
+ assertEquals("type", 2, attrType);
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_documentcreateattribute";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(hc_documentcreateattribute.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level1/core/hc_documentcreatecomment.java b/dom/src/test/java/org/w3c/domts/level1/core/hc_documentcreatecomment.java
new file mode 100644
index 0000000..b5c0226
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level1/core/hc_documentcreatecomment.java
@@ -0,0 +1,91 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+Copyright (c) 2001 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+*/
+
+package org.w3c.domts.level1.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The "createComment(data)" method creates a new Comment
+ * node given the specified string.
+ * Retrieve the entire DOM document and invoke its
+ * "createComment(data)" method. It should create a new
+ * Comment node whose "data" is the specified string.
+ * The content, name and type are retrieved and output.
+* @author Curt Arnold
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-1334481328">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-1334481328</a>
+*/
+public final class hc_documentcreatecomment extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public hc_documentcreatecomment(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "hc_staff", true);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ Comment newCommentNode;
+ String newCommentValue;
+ String newCommentName;
+ int newCommentType;
+ doc = (Document) load("hc_staff", true);
+ newCommentNode = doc.createComment("This is a new Comment node");
+ newCommentValue = newCommentNode.getNodeValue();
+ assertEquals("value", "This is a new Comment node", newCommentValue);
+ newCommentName = newCommentNode.getNodeName();
+ assertEquals("strong", "#comment", newCommentName);
+ newCommentType = (int) newCommentNode.getNodeType();
+ assertEquals("type", 8, newCommentType);
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_documentcreatecomment";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(hc_documentcreatecomment.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level1/core/hc_documentcreatedocumentfragment.java b/dom/src/test/java/org/w3c/domts/level1/core/hc_documentcreatedocumentfragment.java
new file mode 100644
index 0000000..7c96f48
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level1/core/hc_documentcreatedocumentfragment.java
@@ -0,0 +1,95 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+Copyright (c) 2001 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+*/
+
+package org.w3c.domts.level1.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The "createDocumentFragment()" method creates an empty
+ * DocumentFragment object.
+ * Retrieve the entire DOM document and invoke its
+ * "createDocumentFragment()" method. The content, name,
+ * type and value of the newly created object are output.
+* @author Curt Arnold
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-35CB04B5">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-35CB04B5</a>
+*/
+public final class hc_documentcreatedocumentfragment extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public hc_documentcreatedocumentfragment(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "hc_staff", true);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ DocumentFragment newDocFragment;
+ NodeList children;
+ int length;
+ String newDocFragmentName;
+ int newDocFragmentType;
+ String newDocFragmentValue;
+ doc = (Document) load("hc_staff", true);
+ newDocFragment = doc.createDocumentFragment();
+ children = newDocFragment.getChildNodes();
+ length = (int) children.getLength();
+ assertEquals("length", 0, length);
+ newDocFragmentName = newDocFragment.getNodeName();
+ assertEquals("strong", "#document-fragment", newDocFragmentName);
+ newDocFragmentType = (int) newDocFragment.getNodeType();
+ assertEquals("type", 11, newDocFragmentType);
+ newDocFragmentValue = newDocFragment.getNodeValue();
+ assertNull("value", newDocFragmentValue);
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_documentcreatedocumentfragment";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(hc_documentcreatedocumentfragment.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level1/core/hc_documentcreateelement.java b/dom/src/test/java/org/w3c/domts/level1/core/hc_documentcreateelement.java
new file mode 100644
index 0000000..d266ef5
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level1/core/hc_documentcreateelement.java
@@ -0,0 +1,92 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+Copyright (c) 2001 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+*/
+
+package org.w3c.domts.level1.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The "createElement(tagName)" method creates an Element
+ * of the type specified.
+ * Retrieve the entire DOM document and invoke its
+ * "createElement(tagName)" method with tagName="acronym".
+ * The method should create an instance of an Element node
+ * whose tagName is "acronym". The NodeName, NodeType
+ * and NodeValue are returned.
+* @author Curt Arnold
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-2141741547">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-2141741547</a>
+*/
+public final class hc_documentcreateelement extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public hc_documentcreateelement(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "hc_staff", true);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ Element newElement;
+ String newElementName;
+ int newElementType;
+ String newElementValue;
+ doc = (Document) load("hc_staff", true);
+ newElement = doc.createElement("acronym");
+ newElementName = newElement.getNodeName();
+ assertEqualsAutoCase("element", "strong", "acronym", newElementName);
+ newElementType = (int) newElement.getNodeType();
+ assertEquals("type", 1, newElementType);
+ newElementValue = newElement.getNodeValue();
+ assertNull("valueInitiallyNull", newElementValue);
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_documentcreateelement";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(hc_documentcreateelement.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level1/core/hc_documentcreateelementcasesensitive.java b/dom/src/test/java/org/w3c/domts/level1/core/hc_documentcreateelementcasesensitive.java
new file mode 100644
index 0000000..224d675
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level1/core/hc_documentcreateelementcasesensitive.java
@@ -0,0 +1,103 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+Copyright (c) 2001-2003 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+*/
+
+package org.w3c.domts.level1.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The tagName parameter in the "createElement(tagName)"
+ * method is case-sensitive for XML documents.
+ * Retrieve the entire DOM document and invoke its
+ * "createElement(tagName)" method twice. Once for tagName
+ * equal to "acronym" and once for tagName equal to "ACRONYM"
+ * Each call should create a distinct Element node. The
+ * newly created Elements are then assigned attributes
+ * that are retrieved.
+ * Modified on 27 June 2003 to avoid setting an invalid style
+ * values and checked the node names to see if they matched expectations.
+* @author Curt Arnold
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-2141741547">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-2141741547</a>
+* @see <a href="http://www.w3.org/Bugs/Public/show_bug.cgi?id=243">http://www.w3.org/Bugs/Public/show_bug.cgi?id=243</a>
+*/
+public final class hc_documentcreateelementcasesensitive extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public hc_documentcreateelementcasesensitive(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "hc_staff", true);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ Element newElement1;
+ Element newElement2;
+ String attribute1;
+ String attribute2;
+ String nodeName1;
+ String nodeName2;
+ doc = (Document) load("hc_staff", true);
+ newElement1 = doc.createElement("ACRONYM");
+ newElement2 = doc.createElement("acronym");
+ newElement1.setAttribute("lang", "EN");
+ newElement2.setAttribute("title", "Dallas");
+ attribute1 = newElement1.getAttribute("lang");
+ attribute2 = newElement2.getAttribute("title");
+ assertEquals("attrib1", "EN", attribute1);
+ assertEquals("attrib2", "Dallas", attribute2);
+ nodeName1 = newElement1.getNodeName();
+ nodeName2 = newElement2.getNodeName();
+ assertEqualsAutoCase("element", "nodeName1", "ACRONYM", nodeName1);
+ assertEqualsAutoCase("element", "nodeName2", "acronym", nodeName2);
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_documentcreateelementcasesensitive";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(hc_documentcreateelementcasesensitive.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level1/core/hc_documentcreatetextnode.java b/dom/src/test/java/org/w3c/domts/level1/core/hc_documentcreatetextnode.java
new file mode 100644
index 0000000..47faab1
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level1/core/hc_documentcreatetextnode.java
@@ -0,0 +1,91 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+Copyright (c) 2001 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+*/
+
+package org.w3c.domts.level1.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The "createTextNode(data)" method creates a Text node
+ * given the specfied string.
+ * Retrieve the entire DOM document and invoke its
+ * "createTextNode(data)" method. It should create a
+ * new Text node whose "data" is the specified string.
+ * The NodeName and NodeType are also checked.
+* @author Curt Arnold
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-1975348127">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-1975348127</a>
+*/
+public final class hc_documentcreatetextnode extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public hc_documentcreatetextnode(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "hc_staff", true);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ Text newTextNode;
+ String newTextName;
+ String newTextValue;
+ int newTextType;
+ doc = (Document) load("hc_staff", true);
+ newTextNode = doc.createTextNode("This is a new Text node");
+ newTextValue = newTextNode.getNodeValue();
+ assertEquals("value", "This is a new Text node", newTextValue);
+ newTextName = newTextNode.getNodeName();
+ assertEquals("strong", "#text", newTextName);
+ newTextType = (int) newTextNode.getNodeType();
+ assertEquals("type", 3, newTextType);
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_documentcreatetextnode";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(hc_documentcreatetextnode.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level1/core/hc_documentgetdoctype.java b/dom/src/test/java/org/w3c/domts/level1/core/hc_documentgetdoctype.java
new file mode 100644
index 0000000..69acccc
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level1/core/hc_documentgetdoctype.java
@@ -0,0 +1,102 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+Copyright (c) 2001-2004 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+*/
+
+package org.w3c.domts.level1.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * Access Document.doctype for hc_staff, if not text/html should return DocumentType node.
+ * HTML implementations may return null.
+* @author Curt Arnold
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-B63ED1A31">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-B63ED1A31</a>
+*/
+public final class hc_documentgetdoctype extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public hc_documentgetdoctype(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "hc_staff", false);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ DocumentType docType;
+ String docTypeName;
+ String nodeValue;
+ NamedNodeMap attributes;
+ doc = (Document) load("hc_staff", false);
+ docType = doc.getDoctype();
+
+ if (
+ !(("text/html".equals(getContentType())))
+) {
+ assertNotNull("docTypeNotNull", docType);
+ }
+
+ if ((docType != null)) {
+ docTypeName = docType.getName();
+
+ if (("image/svg+xml".equals(getContentType()))) {
+ assertEquals("nodeNameSVG", "svg", docTypeName);
+ } else {
+ assertEquals("nodeName", "html", docTypeName);
+ }
+
+ nodeValue = docType.getNodeValue();
+ assertNull("nodeValue", nodeValue);
+ attributes = docType.getAttributes();
+ assertNull("attributes", attributes);
+ }
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_documentgetdoctype";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(hc_documentgetdoctype.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level1/core/hc_documentgetelementsbytagnamelength.java b/dom/src/test/java/org/w3c/domts/level1/core/hc_documentgetelementsbytagnamelength.java
new file mode 100644
index 0000000..c824751
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level1/core/hc_documentgetelementsbytagnamelength.java
@@ -0,0 +1,84 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+Copyright (c) 2001 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+*/
+
+package org.w3c.domts.level1.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The "getElementsByTagName(tagName)" method returns a
+ * NodeList of all the Elements with a given tagName.
+ *
+ * Retrieve the entire DOM document and invoke its
+ * "getElementsByTagName(tagName)" method with tagName
+ * equal to "strong". The method should return a NodeList
+ * that contains 5 elements.
+* @author Curt Arnold
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-A6C9094">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-A6C9094</a>
+*/
+public final class hc_documentgetelementsbytagnamelength extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public hc_documentgetelementsbytagnamelength(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "hc_staff", false);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ NodeList nameList;
+ doc = (Document) load("hc_staff", false);
+ nameList = doc.getElementsByTagName("strong");
+ assertSize("documentGetElementsByTagNameLengthAssert", 5, nameList);
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_documentgetelementsbytagnamelength";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(hc_documentgetelementsbytagnamelength.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level1/core/hc_documentgetelementsbytagnametotallength.java b/dom/src/test/java/org/w3c/domts/level1/core/hc_documentgetelementsbytagnametotallength.java
new file mode 100644
index 0000000..34660dd
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level1/core/hc_documentgetelementsbytagnametotallength.java
@@ -0,0 +1,186 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+Copyright (c) 2001-2004 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+*/
+
+package org.w3c.domts.level1.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * Retrieve the entire DOM document and invoke its
+ * "getElementsByTagName(tagName)" method with tagName
+ * equal to "*". The method should return a NodeList
+ * that contains all the elements of the document.
+* @author Curt Arnold
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-A6C9094">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-A6C9094</a>
+* @see <a href="http://www.w3.org/Bugs/Public/show_bug.cgi?id=251">http://www.w3.org/Bugs/Public/show_bug.cgi?id=251</a>
+*/
+public final class hc_documentgetelementsbytagnametotallength extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public hc_documentgetelementsbytagnametotallength(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "hc_staff", false);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ NodeList nameList;
+ java.util.List expectedNames = new java.util.ArrayList();
+ expectedNames.add("html");
+ expectedNames.add("head");
+ expectedNames.add("meta");
+ expectedNames.add("title");
+ expectedNames.add("script");
+ expectedNames.add("script");
+ expectedNames.add("script");
+ expectedNames.add("body");
+ expectedNames.add("p");
+ expectedNames.add("em");
+ expectedNames.add("strong");
+ expectedNames.add("code");
+ expectedNames.add("sup");
+ expectedNames.add("var");
+ expectedNames.add("acronym");
+ expectedNames.add("p");
+ expectedNames.add("em");
+ expectedNames.add("strong");
+ expectedNames.add("code");
+ expectedNames.add("sup");
+ expectedNames.add("var");
+ expectedNames.add("acronym");
+ expectedNames.add("p");
+ expectedNames.add("em");
+ expectedNames.add("strong");
+ expectedNames.add("code");
+ expectedNames.add("sup");
+ expectedNames.add("var");
+ expectedNames.add("acronym");
+ expectedNames.add("p");
+ expectedNames.add("em");
+ expectedNames.add("strong");
+ expectedNames.add("code");
+ expectedNames.add("sup");
+ expectedNames.add("var");
+ expectedNames.add("acronym");
+ expectedNames.add("p");
+ expectedNames.add("em");
+ expectedNames.add("strong");
+ expectedNames.add("code");
+ expectedNames.add("sup");
+ expectedNames.add("var");
+ expectedNames.add("acronym");
+
+ java.util.List svgExpectedNames = new java.util.ArrayList();
+ svgExpectedNames.add("svg");
+ svgExpectedNames.add("rect");
+ svgExpectedNames.add("script");
+ svgExpectedNames.add("head");
+ svgExpectedNames.add("meta");
+ svgExpectedNames.add("title");
+ svgExpectedNames.add("body");
+ svgExpectedNames.add("p");
+ svgExpectedNames.add("em");
+ svgExpectedNames.add("strong");
+ svgExpectedNames.add("code");
+ svgExpectedNames.add("sup");
+ svgExpectedNames.add("var");
+ svgExpectedNames.add("acronym");
+ svgExpectedNames.add("p");
+ svgExpectedNames.add("em");
+ svgExpectedNames.add("strong");
+ svgExpectedNames.add("code");
+ svgExpectedNames.add("sup");
+ svgExpectedNames.add("var");
+ svgExpectedNames.add("acronym");
+ svgExpectedNames.add("p");
+ svgExpectedNames.add("em");
+ svgExpectedNames.add("strong");
+ svgExpectedNames.add("code");
+ svgExpectedNames.add("sup");
+ svgExpectedNames.add("var");
+ svgExpectedNames.add("acronym");
+ svgExpectedNames.add("p");
+ svgExpectedNames.add("em");
+ svgExpectedNames.add("strong");
+ svgExpectedNames.add("code");
+ svgExpectedNames.add("sup");
+ svgExpectedNames.add("var");
+ svgExpectedNames.add("acronym");
+ svgExpectedNames.add("p");
+ svgExpectedNames.add("em");
+ svgExpectedNames.add("strong");
+ svgExpectedNames.add("code");
+ svgExpectedNames.add("sup");
+ svgExpectedNames.add("var");
+ svgExpectedNames.add("acronym");
+
+ java.util.List actualNames = new java.util.ArrayList();
+
+ Element thisElement;
+ String thisTag;
+ doc = (Document) load("hc_staff", false);
+ nameList = doc.getElementsByTagName("*");
+ for (int indexN10148 = 0; indexN10148 < nameList.getLength(); indexN10148++) {
+ thisElement = (Element) nameList.item(indexN10148);
+ thisTag = thisElement.getTagName();
+ actualNames.add(thisTag);
+ }
+
+ if (("image/svg+xml".equals(getContentType()))) {
+ assertEqualsAutoCase("element", "svgTagNames", svgExpectedNames, actualNames);
+ } else {
+ assertEqualsAutoCase("element", "tagNames", expectedNames, actualNames);
+ }
+
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_documentgetelementsbytagnametotallength";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(hc_documentgetelementsbytagnametotallength.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level1/core/hc_documentgetelementsbytagnamevalue.java b/dom/src/test/java/org/w3c/domts/level1/core/hc_documentgetelementsbytagnamevalue.java
new file mode 100644
index 0000000..7bf6703
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level1/core/hc_documentgetelementsbytagnamevalue.java
@@ -0,0 +1,92 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+Copyright (c) 2001 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+*/
+
+package org.w3c.domts.level1.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The "getElementsByTagName(tagName)" method returns a
+ * NodeList of all the Elements with a given tagName
+ * in a pre-order traversal of the tree.
+ *
+ * Retrieve the entire DOM document and invoke its
+ * "getElementsByTagName(tagName)" method with tagName
+ * equal to "strong". The method should return a NodeList
+ * that contains 5 elements. The FOURTH item in the
+ * list is retrieved and output.
+* @author Curt Arnold
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-A6C9094">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-A6C9094</a>
+*/
+public final class hc_documentgetelementsbytagnamevalue extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public hc_documentgetelementsbytagnamevalue(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "hc_staff", false);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ NodeList nameList;
+ Node nameNode;
+ Node firstChild;
+ String childValue;
+ doc = (Document) load("hc_staff", false);
+ nameList = doc.getElementsByTagName("strong");
+ nameNode = nameList.item(3);
+ firstChild = nameNode.getFirstChild();
+ childValue = firstChild.getNodeValue();
+ assertEquals("documentGetElementsByTagNameValueAssert", "Jeny Oconnor", childValue);
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_documentgetelementsbytagnamevalue";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(hc_documentgetelementsbytagnamevalue.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level1/core/hc_documentgetimplementation.java b/dom/src/test/java/org/w3c/domts/level1/core/hc_documentgetimplementation.java
new file mode 100644
index 0000000..d636275
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level1/core/hc_documentgetimplementation.java
@@ -0,0 +1,93 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+Copyright (c) 2001-2004 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+*/
+
+package org.w3c.domts.level1.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * Retrieve the entire DOM document and invoke its
+ * "getImplementation()" method. If contentType="text/html",
+ * DOMImplementation.hasFeature("HTML","1.0") should be true.
+ * Otherwise, DOMImplementation.hasFeature("XML", "1.0")
+ * should be true.
+* @author Curt Arnold
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-1B793EBA">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-1B793EBA</a>
+* @see <a href="http://www.w3.org/Bugs/Public/show_bug.cgi?id=245">http://www.w3.org/Bugs/Public/show_bug.cgi?id=245</a>
+*/
+public final class hc_documentgetimplementation extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public hc_documentgetimplementation(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "hc_staff", false);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ DOMImplementation docImpl;
+ boolean xmlstate;
+ boolean htmlstate;
+ doc = (Document) load("hc_staff", false);
+ docImpl = doc.getImplementation();
+ xmlstate = docImpl.hasFeature("XML", "1.0");
+htmlstate = docImpl.hasFeature("HTML", "1.0");
+
+ if (("text/html".equals(getContentType()))) {
+ assertTrue("supports_HTML_1.0", htmlstate);
+ } else {
+ assertTrue("supports_XML_1.0", xmlstate);
+ }
+
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_documentgetimplementation";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(hc_documentgetimplementation.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level1/core/hc_documentgetrootnode.java b/dom/src/test/java/org/w3c/domts/level1/core/hc_documentgetrootnode.java
new file mode 100644
index 0000000..17b54fb
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level1/core/hc_documentgetrootnode.java
@@ -0,0 +1,88 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+Copyright (c) 2001-2004 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+*/
+
+package org.w3c.domts.level1.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * Load a document and invoke its
+ * "getDocumentElement()" method.
+* @author Curt Arnold
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-87CD092">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-87CD092</a>
+* @see <a href="http://www.w3.org/Bugs/Public/show_bug.cgi?id=251">http://www.w3.org/Bugs/Public/show_bug.cgi?id=251</a>
+*/
+public final class hc_documentgetrootnode extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public hc_documentgetrootnode(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "hc_staff", false);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ Element root;
+ String rootName;
+ doc = (Document) load("hc_staff", false);
+ root = doc.getDocumentElement();
+ rootName = root.getNodeName();
+
+ if (("image/svg+xml".equals(getContentType()))) {
+ assertEquals("svgTagName", "svg", rootName);
+ } else {
+ assertEqualsAutoCase("element", "docElemName", "html", rootName);
+ }
+
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_documentgetrootnode";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(hc_documentgetrootnode.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level1/core/hc_documentinvalidcharacterexceptioncreateattribute.java b/dom/src/test/java/org/w3c/domts/level1/core/hc_documentinvalidcharacterexceptioncreateattribute.java
new file mode 100644
index 0000000..1f47469
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level1/core/hc_documentinvalidcharacterexceptioncreateattribute.java
@@ -0,0 +1,97 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+Copyright (c) 2001-2003 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+*/
+
+package org.w3c.domts.level1.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The "createAttribute(tagName)" method raises an
+ * INVALID_CHARACTER_ERR DOMException if the specified
+ * tagName contains an invalid character.
+ *
+ * Retrieve the entire DOM document and invoke its
+ * "createAttribute(tagName)" method with the tagName equal
+ * to the string "invalid^Name". Due to the invalid
+ * character the desired EXCEPTION should be raised.
+* @author Curt Arnold
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-258A00AF')/constant[@name='INVALID_CHARACTER_ERR'])">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-258A00AF')/constant[@name='INVALID_CHARACTER_ERR'])</a>
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-1084891198">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-1084891198</a>
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-1084891198')/raises/exception[@name='DOMException']/descr/p[substring-before(.,':')='INVALID_CHARACTER_ERR'])">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-1084891198')/raises/exception[@name='DOMException']/descr/p[substring-before(.,':')='INVALID_CHARACTER_ERR'])</a>
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-1084891198">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-1084891198</a>
+* @see <a href="http://www.w3.org/Bugs/Public/show_bug.cgi?id=249">http://www.w3.org/Bugs/Public/show_bug.cgi?id=249</a>
+*/
+public final class hc_documentinvalidcharacterexceptioncreateattribute extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public hc_documentinvalidcharacterexceptioncreateattribute(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "hc_staff", true);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ Attr createdAttr;
+ doc = (Document) load("hc_staff", true);
+
+ {
+ boolean success = false;
+ try {
+ createdAttr = doc.createAttribute("invalid^Name");
+ } catch (DOMException ex) {
+ success = (ex.code == DOMException.INVALID_CHARACTER_ERR);
+ }
+ assertTrue("throw_INVALID_CHARACTER_ERR", success);
+ }
+}
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_documentinvalidcharacterexceptioncreateattribute";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(hc_documentinvalidcharacterexceptioncreateattribute.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level1/core/hc_documentinvalidcharacterexceptioncreateattribute1.java b/dom/src/test/java/org/w3c/domts/level1/core/hc_documentinvalidcharacterexceptioncreateattribute1.java
new file mode 100644
index 0000000..3b29953
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level1/core/hc_documentinvalidcharacterexceptioncreateattribute1.java
@@ -0,0 +1,90 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+Copyright (c) 2004 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+*/
+
+package org.w3c.domts.level1.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * Creating an attribute with an empty name should cause an INVALID_CHARACTER_ERR.
+* @author Curt Arnold
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-258A00AF')/constant[@name='INVALID_CHARACTER_ERR'])">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-258A00AF')/constant[@name='INVALID_CHARACTER_ERR'])</a>
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-1084891198">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-1084891198</a>
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-1084891198')/raises/exception[@name='DOMException']/descr/p[substring-before(.,':')='INVALID_CHARACTER_ERR'])">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-1084891198')/raises/exception[@name='DOMException']/descr/p[substring-before(.,':')='INVALID_CHARACTER_ERR'])</a>
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-1084891198">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-1084891198</a>
+* @see <a href="http://www.w3.org/Bugs/Public/show_bug.cgi?id=525">http://www.w3.org/Bugs/Public/show_bug.cgi?id=525</a>
+*/
+public final class hc_documentinvalidcharacterexceptioncreateattribute1 extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public hc_documentinvalidcharacterexceptioncreateattribute1(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "hc_staff", true);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ Attr createdAttr;
+ doc = (Document) load("hc_staff", true);
+
+ {
+ boolean success = false;
+ try {
+ createdAttr = doc.createAttribute("");
+ } catch (DOMException ex) {
+ success = (ex.code == DOMException.INVALID_CHARACTER_ERR);
+ }
+ assertTrue("throw_INVALID_CHARACTER_ERR", success);
+ }
+}
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_documentinvalidcharacterexceptioncreateattribute1";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(hc_documentinvalidcharacterexceptioncreateattribute1.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level1/core/hc_documentinvalidcharacterexceptioncreateelement.java b/dom/src/test/java/org/w3c/domts/level1/core/hc_documentinvalidcharacterexceptioncreateelement.java
new file mode 100644
index 0000000..8e9029a
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level1/core/hc_documentinvalidcharacterexceptioncreateelement.java
@@ -0,0 +1,97 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+Copyright (c) 2001-2003 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+*/
+
+package org.w3c.domts.level1.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The "createElement(tagName)" method raises an
+ * INVALID_CHARACTER_ERR DOMException if the specified
+ * tagName contains an invalid character.
+ *
+ * Retrieve the entire DOM document and invoke its
+ * "createElement(tagName)" method with the tagName equal
+ * to the string "invalid^Name". Due to the invalid
+ * character the desired EXCEPTION should be raised.
+* @author Curt Arnold
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-258A00AF')/constant[@name='INVALID_CHARACTER_ERR'])">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-258A00AF')/constant[@name='INVALID_CHARACTER_ERR'])</a>
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-2141741547">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-2141741547</a>
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-2141741547')/raises/exception[@name='DOMException']/descr/p[substring-before(.,':')='INVALID_CHARACTER_ERR'])">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-2141741547')/raises/exception[@name='DOMException']/descr/p[substring-before(.,':')='INVALID_CHARACTER_ERR'])</a>
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-2141741547">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-2141741547</a>
+* @see <a href="http://www.w3.org/Bugs/Public/show_bug.cgi?id=249">http://www.w3.org/Bugs/Public/show_bug.cgi?id=249</a>
+*/
+public final class hc_documentinvalidcharacterexceptioncreateelement extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public hc_documentinvalidcharacterexceptioncreateelement(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "hc_staff", true);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ Element badElement;
+ doc = (Document) load("hc_staff", true);
+
+ {
+ boolean success = false;
+ try {
+ badElement = doc.createElement("invalid^Name");
+ } catch (DOMException ex) {
+ success = (ex.code == DOMException.INVALID_CHARACTER_ERR);
+ }
+ assertTrue("throw_INVALID_CHARACTER_ERR", success);
+ }
+}
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_documentinvalidcharacterexceptioncreateelement";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(hc_documentinvalidcharacterexceptioncreateelement.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level1/core/hc_documentinvalidcharacterexceptioncreateelement1.java b/dom/src/test/java/org/w3c/domts/level1/core/hc_documentinvalidcharacterexceptioncreateelement1.java
new file mode 100644
index 0000000..bf59e22
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level1/core/hc_documentinvalidcharacterexceptioncreateelement1.java
@@ -0,0 +1,90 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+Copyright (c) 2004 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+*/
+
+package org.w3c.domts.level1.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * Creating an element with an empty name should cause an INVALID_CHARACTER_ERR.
+* @author Curt Arnold
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-258A00AF')/constant[@name='INVALID_CHARACTER_ERR'])">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-258A00AF')/constant[@name='INVALID_CHARACTER_ERR'])</a>
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-2141741547">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-2141741547</a>
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-2141741547')/raises/exception[@name='DOMException']/descr/p[substring-before(.,':')='INVALID_CHARACTER_ERR'])">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-2141741547')/raises/exception[@name='DOMException']/descr/p[substring-before(.,':')='INVALID_CHARACTER_ERR'])</a>
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-2141741547">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-2141741547</a>
+* @see <a href="http://www.w3.org/Bugs/Public/show_bug.cgi?id=525">http://www.w3.org/Bugs/Public/show_bug.cgi?id=525</a>
+*/
+public final class hc_documentinvalidcharacterexceptioncreateelement1 extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public hc_documentinvalidcharacterexceptioncreateelement1(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "hc_staff", true);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ Element badElement;
+ doc = (Document) load("hc_staff", true);
+
+ {
+ boolean success = false;
+ try {
+ badElement = doc.createElement("");
+ } catch (DOMException ex) {
+ success = (ex.code == DOMException.INVALID_CHARACTER_ERR);
+ }
+ assertTrue("throw_INVALID_CHARACTER_ERR", success);
+ }
+}
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_documentinvalidcharacterexceptioncreateelement1";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(hc_documentinvalidcharacterexceptioncreateelement1.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level1/core/hc_domimplementationfeaturenoversion.java b/dom/src/test/java/org/w3c/domts/level1/core/hc_domimplementationfeaturenoversion.java
new file mode 100644
index 0000000..e4ad27c
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level1/core/hc_domimplementationfeaturenoversion.java
@@ -0,0 +1,93 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+Copyright (c) 2001-2004 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+*/
+
+package org.w3c.domts.level1.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * Load a document and invoke its
+ * "getImplementation()" method. This should create a
+ * DOMImplementation object whose "hasFeature(feature,
+ * version)" method is invoked with version equal to "".
+ * If the version is not specified, supporting any version
+ * feature will cause the method to return "true".
+* @author Curt Arnold
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-5CED94D7">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-5CED94D7</a>
+* @see <a href="http://www.w3.org/2000/11/DOM-Level-2-errata#core-14">http://www.w3.org/2000/11/DOM-Level-2-errata#core-14</a>
+* @see <a href="http://www.w3.org/Bugs/Public/show_bug.cgi?id=245">http://www.w3.org/Bugs/Public/show_bug.cgi?id=245</a>
+*/
+public final class hc_domimplementationfeaturenoversion extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public hc_domimplementationfeaturenoversion(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "hc_staff", false);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ DOMImplementation domImpl;
+ boolean state;
+ doc = (Document) load("hc_staff", false);
+ domImpl = doc.getImplementation();
+
+ if (("text/html".equals(getContentType()))) {
+ state = domImpl.hasFeature("HTML", "");
+} else {
+ state = domImpl.hasFeature("XML", "");
+}
+
+ assertTrue("hasFeatureBlank", state);
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_domimplementationfeaturenoversion";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(hc_domimplementationfeaturenoversion.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level1/core/hc_domimplementationfeaturenull.java b/dom/src/test/java/org/w3c/domts/level1/core/hc_domimplementationfeaturenull.java
new file mode 100644
index 0000000..1eb7910
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level1/core/hc_domimplementationfeaturenull.java
@@ -0,0 +1,101 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+Copyright (c) 2001-2004 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+*/
+
+package org.w3c.domts.level1.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * Load a document and invoke its
+ * "getImplementation()" method. This should create a
+ * DOMImplementation object whose "hasFeature(feature,
+ * version)" method is invoked with version equal to null.
+ * If the version is not specified, supporting any version
+ * feature will cause the method to return "true".
+* @author Curt Arnold
+* @author Curt Arnold
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-5CED94D7">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-5CED94D7</a>
+* @see <a href="http://www.w3.org/2000/11/DOM-Level-2-errata#core-14">http://www.w3.org/2000/11/DOM-Level-2-errata#core-14</a>
+* @see <a href="http://www.w3.org/Bugs/Public/show_bug.cgi?id=245">http://www.w3.org/Bugs/Public/show_bug.cgi?id=245</a>
+*/
+public final class hc_domimplementationfeaturenull extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public hc_domimplementationfeaturenull(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+
+ org.w3c.domts.DocumentBuilderSetting[] settings =
+ new org.w3c.domts.DocumentBuilderSetting[] {
+org.w3c.domts.DocumentBuilderSetting.hasNullString
+ };
+ DOMTestDocumentBuilderFactory testFactory = factory.newInstance(settings);
+ setFactory(testFactory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "hc_staff", false);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ DOMImplementation domImpl;
+ boolean state;
+ doc = (Document) load("hc_staff", false);
+ domImpl = doc.getImplementation();
+
+ if (("text/html".equals(getContentType()))) {
+ state = domImpl.hasFeature("HTML", null);
+assertTrue("supports_HTML_null", state);
+ } else {
+ state = domImpl.hasFeature("XML", null);
+assertTrue("supports_XML_null", state);
+ }
+
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_domimplementationfeaturenull";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(hc_domimplementationfeaturenull.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level1/core/hc_domimplementationfeaturexml.java b/dom/src/test/java/org/w3c/domts/level1/core/hc_domimplementationfeaturexml.java
new file mode 100644
index 0000000..f66622d
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level1/core/hc_domimplementationfeaturexml.java
@@ -0,0 +1,92 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+Copyright (c) 2001-2004 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+*/
+
+package org.w3c.domts.level1.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * Retrieve the entire DOM document and invoke its
+ * "getImplementation()" method. This should create a
+ * DOMImplementation object whose "hasFeature(feature,
+ * version)" method is invoked with "feature" equal to "html" or "xml".
+ * The method should return a boolean "true".
+* @author Curt Arnold
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-5CED94D7">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-5CED94D7</a>
+* @see <a href="http://www.w3.org/Bugs/Public/show_bug.cgi?id=245">http://www.w3.org/Bugs/Public/show_bug.cgi?id=245</a>
+*/
+public final class hc_domimplementationfeaturexml extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public hc_domimplementationfeaturexml(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "hc_staff", false);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ DOMImplementation domImpl;
+ boolean state;
+ doc = (Document) load("hc_staff", false);
+ domImpl = doc.getImplementation();
+
+ if (("text/html".equals(getContentType()))) {
+ state = domImpl.hasFeature("html", "1.0");
+assertTrue("supports_html_1.0", state);
+ } else {
+ state = domImpl.hasFeature("xml", "1.0");
+assertTrue("supports_xml_1.0", state);
+ }
+
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_domimplementationfeaturexml";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(hc_domimplementationfeaturexml.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level1/core/hc_elementaddnewattribute.java b/dom/src/test/java/org/w3c/domts/level1/core/hc_elementaddnewattribute.java
new file mode 100644
index 0000000..759b579
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level1/core/hc_elementaddnewattribute.java
@@ -0,0 +1,91 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+Copyright (c) 2001-2003 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+*/
+
+package org.w3c.domts.level1.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The "setAttribute(name,value)" method adds a new attribute
+ * to the Element
+ *
+ * Retrieve the last child of the last employee, then
+ * add an attribute to it by invoking the
+ * "setAttribute(name,value)" method. It should create
+ * a "strong" attribute with an assigned value equal to
+ * "value".
+* @author Curt Arnold
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-F68F082">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-F68F082</a>
+* @see <a href="http://www.w3.org/Bugs/Public/show_bug.cgi?id=243">http://www.w3.org/Bugs/Public/show_bug.cgi?id=243</a>
+*/
+public final class hc_elementaddnewattribute extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public hc_elementaddnewattribute(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "hc_staff", true);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ NodeList elementList;
+ Element testEmployee;
+ String attrValue;
+ doc = (Document) load("hc_staff", true);
+ elementList = doc.getElementsByTagName("acronym");
+ testEmployee = (Element) elementList.item(4);
+ testEmployee.setAttribute("lang", "EN-us");
+ attrValue = testEmployee.getAttribute("lang");
+ assertEquals("attrValue", "EN-us", attrValue);
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_elementaddnewattribute";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(hc_elementaddnewattribute.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level1/core/hc_elementassociatedattribute.java b/dom/src/test/java/org/w3c/domts/level1/core/hc_elementassociatedattribute.java
new file mode 100644
index 0000000..706bfcb
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level1/core/hc_elementassociatedattribute.java
@@ -0,0 +1,91 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+Copyright (c) 2001-2004 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+*/
+
+package org.w3c.domts.level1.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * Retrieve the first attribute from the last child of
+ * the first employee and invoke the "getSpecified()"
+ * method. This test is only intended to show that
+ * Elements can actually have attributes. This test uses
+ * the "getNamedItem(name)" method from the NamedNodeMap
+ * interface.
+* @author Curt Arnold
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-84CF096">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-84CF096</a>
+*/
+public final class hc_elementassociatedattribute extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public hc_elementassociatedattribute(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "hc_staff", false);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ NodeList elementList;
+ Node testEmployee;
+ NamedNodeMap attributes;
+ Attr domesticAttr;
+ boolean specified;
+ doc = (Document) load("hc_staff", false);
+ elementList = doc.getElementsByTagName("acronym");
+ testEmployee = elementList.item(0);
+ attributes = testEmployee.getAttributes();
+ domesticAttr = (Attr) attributes.getNamedItem("title");
+ specified = domesticAttr.getSpecified();
+ assertTrue("acronymTitleSpecified", specified);
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_elementassociatedattribute";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(hc_elementassociatedattribute.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level1/core/hc_elementchangeattributevalue.java b/dom/src/test/java/org/w3c/domts/level1/core/hc_elementchangeattributevalue.java
new file mode 100644
index 0000000..35b2e51
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level1/core/hc_elementchangeattributevalue.java
@@ -0,0 +1,93 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+Copyright (c) 2001 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+*/
+
+package org.w3c.domts.level1.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The "setAttribute(name,value)" method adds a new attribute
+ * to the Element. If the "strong" is already present, then
+ * its value should be changed to the new one that is in
+ * the "value" parameter.
+ *
+ * Retrieve the last child of the fourth employee, then add
+ * an attribute to it by invoking the
+ * "setAttribute(name,value)" method. Since the name of the
+ * used attribute("class") is already present in this
+ * element, then its value should be changed to the new one
+ * of the "value" parameter.
+* @author Curt Arnold
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-F68F082">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-F68F082</a>
+*/
+public final class hc_elementchangeattributevalue extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public hc_elementchangeattributevalue(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "hc_staff", true);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ NodeList elementList;
+ Element testEmployee;
+ String attrValue;
+ doc = (Document) load("hc_staff", true);
+ elementList = doc.getElementsByTagName("acronym");
+ testEmployee = (Element) elementList.item(3);
+ testEmployee.setAttribute("class", "Neither");
+ attrValue = testEmployee.getAttribute("class");
+ assertEquals("elementChangeAttributeValueAssert", "Neither", attrValue);
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_elementchangeattributevalue";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(hc_elementchangeattributevalue.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level1/core/hc_elementcreatenewattribute.java b/dom/src/test/java/org/w3c/domts/level1/core/hc_elementcreatenewattribute.java
new file mode 100644
index 0000000..ddd5b6a
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level1/core/hc_elementcreatenewattribute.java
@@ -0,0 +1,98 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+Copyright (c) 2001-2003 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+*/
+
+package org.w3c.domts.level1.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The "setAttributeNode(newAttr)" method adds a new
+ * attribute to the Element.
+ *
+ * Retrieve first address element and add
+ * a new attribute node to it by invoking its
+ * "setAttributeNode(newAttr)" method. This test makes use
+ * of the "createAttribute(name)" method from the Document
+ * interface.
+* @author Curt Arnold
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-887236154">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-887236154</a>
+* @see <a href="http://www.w3.org/Bugs/Public/show_bug.cgi?id=243">http://www.w3.org/Bugs/Public/show_bug.cgi?id=243</a>
+*/
+public final class hc_elementcreatenewattribute extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public hc_elementcreatenewattribute(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "hc_staff", true);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ NodeList elementList;
+ Element testAddress;
+ Attr newAttribute;
+ Attr oldAttr;
+ Attr districtAttr;
+ String attrVal;
+ doc = (Document) load("hc_staff", true);
+ elementList = doc.getElementsByTagName("acronym");
+ testAddress = (Element) elementList.item(0);
+ newAttribute = doc.createAttribute("lang");
+ oldAttr = testAddress.setAttributeNode(newAttribute);
+ assertNull("old_attr_doesnt_exist", oldAttr);
+ districtAttr = testAddress.getAttributeNode("lang");
+ assertNotNull("new_district_accessible", districtAttr);
+ attrVal = testAddress.getAttribute("lang");
+ assertEquals("attr_value", "", attrVal);
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_elementcreatenewattribute";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(hc_elementcreatenewattribute.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level1/core/hc_elementgetattributenode.java b/dom/src/test/java/org/w3c/domts/level1/core/hc_elementgetattributenode.java
new file mode 100644
index 0000000..90bc7f4
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level1/core/hc_elementgetattributenode.java
@@ -0,0 +1,87 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+Copyright (c) 2001-2004 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+*/
+
+package org.w3c.domts.level1.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * Retrieve the attribute "title" from the last child
+ * of the first "p" element and check its node name.
+* @author Curt Arnold
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-217A91B8">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-217A91B8</a>
+* @see <a href="http://www.w3.org/Bugs/Public/show_bug.cgi?id=236">http://www.w3.org/Bugs/Public/show_bug.cgi?id=236</a>
+* @see <a href="http://lists.w3.org/Archives/Public/www-dom-ts/2003Jun/0011.html">http://lists.w3.org/Archives/Public/www-dom-ts/2003Jun/0011.html</a>
+*/
+public final class hc_elementgetattributenode extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public hc_elementgetattributenode(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "hc_staff", false);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ NodeList elementList;
+ Element testEmployee;
+ Attr domesticAttr;
+ String nodeName;
+ doc = (Document) load("hc_staff", false);
+ elementList = doc.getElementsByTagName("acronym");
+ testEmployee = (Element) elementList.item(0);
+ domesticAttr = testEmployee.getAttributeNode("title");
+ nodeName = domesticAttr.getNodeName();
+ assertEqualsAutoCase("attribute", "nodeName", "title", nodeName);
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_elementgetattributenode";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(hc_elementgetattributenode.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level1/core/hc_elementgetattributenodenull.java b/dom/src/test/java/org/w3c/domts/level1/core/hc_elementgetattributenodenull.java
new file mode 100644
index 0000000..2941693
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level1/core/hc_elementgetattributenodenull.java
@@ -0,0 +1,89 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+Copyright (c) 2001 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+*/
+
+package org.w3c.domts.level1.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The "getAttributeNode(name)" method retrieves an
+ * attribute node by name. It should return null if the
+ * "strong" attribute does not exist.
+ *
+ * Retrieve the last child of the first employee and attempt
+ * to retrieve a non-existing attribute. The method should
+ * return "null". The non-existing attribute to be used
+ * is "invalidAttribute".
+* @author Curt Arnold
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-217A91B8">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-217A91B8</a>
+*/
+public final class hc_elementgetattributenodenull extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public hc_elementgetattributenodenull(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "hc_staff", true);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ NodeList elementList;
+ Element testEmployee;
+ Attr domesticAttr;
+ doc = (Document) load("hc_staff", true);
+ elementList = doc.getElementsByTagName("acronym");
+ testEmployee = (Element) elementList.item(0);
+ domesticAttr = testEmployee.getAttributeNode("invalidAttribute");
+ assertNull("elementGetAttributeNodeNullAssert", domesticAttr);
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_elementgetattributenodenull";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(hc_elementgetattributenodenull.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level1/core/hc_elementgetelementempty.java b/dom/src/test/java/org/w3c/domts/level1/core/hc_elementgetelementempty.java
new file mode 100644
index 0000000..6924187
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level1/core/hc_elementgetelementempty.java
@@ -0,0 +1,97 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+Copyright (c) 2001-2003 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+*/
+
+package org.w3c.domts.level1.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The "getAttribute(name)" method returns an empty
+ * string if no value was assigned to an attribute and
+ * no default value was given in the DTD file.
+ *
+ * Retrieve the last child of the last employee, then
+ * invoke "getAttribute(name)" method, where "strong" is an
+ * attribute without a specified or DTD default value.
+ * The "getAttribute(name)" method should return the empty
+ * string. This method makes use of the
+ * "createAttribute(newAttr)" method from the Document
+ * interface.
+* @author Curt Arnold
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-666EE0F9">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-666EE0F9</a>
+* @see <a href="http://www.w3.org/Bugs/Public/show_bug.cgi?id=243">http://www.w3.org/Bugs/Public/show_bug.cgi?id=243</a>
+*/
+public final class hc_elementgetelementempty extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public hc_elementgetelementempty(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "hc_staff", true);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ Attr newAttribute;
+ NodeList elementList;
+ Element testEmployee;
+ Attr domesticAttr;
+ String attrValue;
+ doc = (Document) load("hc_staff", true);
+ newAttribute = doc.createAttribute("lang");
+ elementList = doc.getElementsByTagName("acronym");
+ testEmployee = (Element) elementList.item(3);
+ domesticAttr = testEmployee.setAttributeNode(newAttribute);
+ attrValue = testEmployee.getAttribute("lang");
+ assertEquals("elementGetElementEmptyAssert", "", attrValue);
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_elementgetelementempty";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(hc_elementgetelementempty.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level1/core/hc_elementgetelementsbytagname.java b/dom/src/test/java/org/w3c/domts/level1/core/hc_elementgetelementsbytagname.java
new file mode 100644
index 0000000..37d1e22
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level1/core/hc_elementgetelementsbytagname.java
@@ -0,0 +1,85 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+Copyright (c) 2001 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+*/
+
+package org.w3c.domts.level1.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The "getElementsByTagName(name)" method returns a list
+ * of all descendant Elements with the given tag name.
+ * Test for an empty list.
+ * Create a NodeList of all the descendant elements
+ * using the string "noMatch" as the tagName.
+ * The method should return a NodeList whose length is
+ * "0" since there are not any descendant elements
+ * that match the given tag name.
+* @author Curt Arnold
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-1938918D">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-1938918D</a>
+*/
+public final class hc_elementgetelementsbytagname extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public hc_elementgetelementsbytagname(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "hc_staff", false);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ NodeList elementList;
+ doc = (Document) load("hc_staff", false);
+ elementList = doc.getElementsByTagName("p");
+ assertSize("elementGetElementsByTagNameAssert", 5, elementList);
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_elementgetelementsbytagname";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(hc_elementgetelementsbytagname.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level1/core/hc_elementgetelementsbytagnameaccessnodelist.java b/dom/src/test/java/org/w3c/domts/level1/core/hc_elementgetelementsbytagnameaccessnodelist.java
new file mode 100644
index 0000000..557071b
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level1/core/hc_elementgetelementsbytagnameaccessnodelist.java
@@ -0,0 +1,108 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+Copyright (c) 2001 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+*/
+
+package org.w3c.domts.level1.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The "getElementsByTagName(name)" method returns a list
+ * of all descendant Elements in the order the children
+ * were encountered in a pre order traversal of the element
+ * tree.
+ * Create a NodeList of all the descendant elements
+ * using the string "p" as the tagName.
+ * The method should return a NodeList whose length is
+ * "5" in the order the children were encountered.
+ * Access the FOURTH element in the NodeList. The FOURTH
+ * element, the first or second should be an "em" node with
+ * the content "EMP0004".
+* @author Curt Arnold
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-1938918D">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-1938918D</a>
+* @see <a href="http://www.w3.org/Bugs/Public/show_bug.cgi?id=246">http://www.w3.org/Bugs/Public/show_bug.cgi?id=246</a>
+*/
+public final class hc_elementgetelementsbytagnameaccessnodelist extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public hc_elementgetelementsbytagnameaccessnodelist(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "hc_staff", false);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ NodeList elementList;
+ Element testEmployee;
+ Node firstC;
+ String childName;
+ int nodeType;
+ CharacterData employeeIDNode;
+ String employeeID;
+ doc = (Document) load("hc_staff", false);
+ elementList = doc.getElementsByTagName("p");
+ testEmployee = (Element) elementList.item(3);
+ firstC = testEmployee.getFirstChild();
+ nodeType = (int) firstC.getNodeType();
+
+ while (equals(3, nodeType)) {
+ firstC = firstC.getNextSibling();
+ nodeType = (int) firstC.getNodeType();
+
+ }
+childName = firstC.getNodeName();
+ assertEqualsAutoCase("element", "childName", "em", childName);
+ employeeIDNode = (CharacterData) firstC.getFirstChild();
+ employeeID = employeeIDNode.getNodeValue();
+ assertEquals("employeeID", "EMP0004", employeeID);
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_elementgetelementsbytagnameaccessnodelist";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(hc_elementgetelementsbytagnameaccessnodelist.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level1/core/hc_elementgetelementsbytagnamenomatch.java b/dom/src/test/java/org/w3c/domts/level1/core/hc_elementgetelementsbytagnamenomatch.java
new file mode 100644
index 0000000..f5dc79e
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level1/core/hc_elementgetelementsbytagnamenomatch.java
@@ -0,0 +1,83 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+Copyright (c) 2001 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+*/
+
+package org.w3c.domts.level1.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The "getElementsByTagName(name)" method returns a list
+ * of all descendant Elements with the given tag name.
+ * Create a NodeList of all the descendant elements
+ * using the string "employee" as the tagName.
+ * The method should return a NodeList whose length is
+ * "5".
+* @author Curt Arnold
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-1938918D">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-1938918D</a>
+*/
+public final class hc_elementgetelementsbytagnamenomatch extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public hc_elementgetelementsbytagnamenomatch(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "hc_staff", false);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ NodeList elementList;
+ doc = (Document) load("hc_staff", false);
+ elementList = doc.getElementsByTagName("noMatch");
+ assertSize("elementGetElementsByTagNameNoMatchNoMatchAssert", 0, elementList);
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_elementgetelementsbytagnamenomatch";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(hc_elementgetelementsbytagnamenomatch.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level1/core/hc_elementgetelementsbytagnamespecialvalue.java b/dom/src/test/java/org/w3c/domts/level1/core/hc_elementgetelementsbytagnamespecialvalue.java
new file mode 100644
index 0000000..30abebb
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level1/core/hc_elementgetelementsbytagnamespecialvalue.java
@@ -0,0 +1,105 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+Copyright (c) 2001-2004 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+*/
+
+package org.w3c.domts.level1.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The "getElementsByTagName(name)" method may use the
+ * special value "*" to match all tags in the element
+ * tree.
+ * Create a NodeList of all the descendant elements
+ * of the last employee by using the special value "*".
+ * The method should return all the descendant children(6)
+ * in the order the children were encountered.
+* @author Curt Arnold
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-1938918D">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-1938918D</a>
+*/
+public final class hc_elementgetelementsbytagnamespecialvalue extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public hc_elementgetelementsbytagnamespecialvalue(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "hc_staff", false);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ NodeList elementList;
+ Element lastEmployee;
+ NodeList lastempList;
+ Node child;
+ String childName;
+ java.util.List result = new java.util.ArrayList();
+
+ java.util.List expectedResult = new java.util.ArrayList();
+ expectedResult.add("em");
+ expectedResult.add("strong");
+ expectedResult.add("code");
+ expectedResult.add("sup");
+ expectedResult.add("var");
+ expectedResult.add("acronym");
+
+ doc = (Document) load("hc_staff", false);
+ elementList = doc.getElementsByTagName("p");
+ lastEmployee = (Element) elementList.item(4);
+ lastempList = lastEmployee.getElementsByTagName("*");
+ for (int indexN10067 = 0; indexN10067 < lastempList.getLength(); indexN10067++) {
+ child = (Node) lastempList.item(indexN10067);
+ childName = child.getNodeName();
+ result.add(childName);
+ }
+ assertEqualsAutoCase("element", "tagNames", expectedResult, result);
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_elementgetelementsbytagnamespecialvalue";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(hc_elementgetelementsbytagnamespecialvalue.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level1/core/hc_elementgettagname.java b/dom/src/test/java/org/w3c/domts/level1/core/hc_elementgettagname.java
new file mode 100644
index 0000000..a382e0e
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level1/core/hc_elementgettagname.java
@@ -0,0 +1,88 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+Copyright (c) 2001-2004 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+*/
+
+package org.w3c.domts.level1.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * Invoke the "getTagName()" method one the
+ * root node. The value returned should be "html" or "svg".
+* @author Curt Arnold
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-104682815">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-104682815</a>
+* @see <a href="http://www.w3.org/Bugs/Public/show_bug.cgi?id=251">http://www.w3.org/Bugs/Public/show_bug.cgi?id=251</a>
+*/
+public final class hc_elementgettagname extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public hc_elementgettagname(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "hc_staff", false);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ Element root;
+ String tagname;
+ doc = (Document) load("hc_staff", false);
+ root = doc.getDocumentElement();
+ tagname = root.getTagName();
+
+ if (("image/svg+xml".equals(getContentType()))) {
+ assertEquals("svgTagname", "svg", tagname);
+ } else {
+ assertEqualsAutoCase("element", "tagname", "html", tagname);
+ }
+
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_elementgettagname";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(hc_elementgettagname.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level1/core/hc_elementinuseattributeerr.java b/dom/src/test/java/org/w3c/domts/level1/core/hc_elementinuseattributeerr.java
new file mode 100644
index 0000000..168a00e
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level1/core/hc_elementinuseattributeerr.java
@@ -0,0 +1,104 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+Copyright (c) 2001-2003 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+*/
+
+package org.w3c.domts.level1.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The "setAttributeNode(newAttr)" method raises an
+ * "INUSE_ATTRIBUTE_ERR DOMException if the "newAttr"
+ * is already an attribute of another element.
+* @author Curt Arnold
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-258A00AF')/constant[@name='INUSE_ATTRIBUTE_ERR'])">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-258A00AF')/constant[@name='INUSE_ATTRIBUTE_ERR'])</a>
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-887236154">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-887236154</a>
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-887236154')/raises/exception[@name='DOMException']/descr/p[substring-before(.,':')='INUSE_ATTRIBUTE_ERR'])">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-887236154')/raises/exception[@name='DOMException']/descr/p[substring-before(.,':')='INUSE_ATTRIBUTE_ERR'])</a>
+* @see <a href="http://www.w3.org/Bugs/Public/show_bug.cgi?id=244">http://www.w3.org/Bugs/Public/show_bug.cgi?id=244</a>
+*/
+public final class hc_elementinuseattributeerr extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public hc_elementinuseattributeerr(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "hc_staff", true);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ Attr newAttribute;
+ NodeList addressElementList;
+ Element testAddress;
+ Element newElement;
+ Attr attrAddress;
+ Node appendedChild;
+ Attr setAttr1;
+ Attr setAttr2;
+ doc = (Document) load("hc_staff", true);
+ addressElementList = doc.getElementsByTagName("body");
+ testAddress = (Element) addressElementList.item(0);
+ newElement = doc.createElement("p");
+ appendedChild = testAddress.appendChild(newElement);
+ newAttribute = doc.createAttribute("title");
+ setAttr1 = newElement.setAttributeNode(newAttribute);
+
+ {
+ boolean success = false;
+ try {
+ setAttr2 = testAddress.setAttributeNode(newAttribute);
+ } catch (DOMException ex) {
+ success = (ex.code == DOMException.INUSE_ATTRIBUTE_ERR);
+ }
+ assertTrue("throw_INUSE_ATTRIBUTE_ERR", success);
+ }
+}
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_elementinuseattributeerr";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(hc_elementinuseattributeerr.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level1/core/hc_elementinvalidcharacterexception.java b/dom/src/test/java/org/w3c/domts/level1/core/hc_elementinvalidcharacterexception.java
new file mode 100644
index 0000000..d7bfff5
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level1/core/hc_elementinvalidcharacterexception.java
@@ -0,0 +1,97 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+Copyright (c) 2001-2003 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+*/
+
+package org.w3c.domts.level1.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The "setAttribute(name,value)" method raises an
+ * "INVALID_CHARACTER_ERR DOMException if the specified
+ * name contains an invalid character.
+ * Retrieve the last child of the first employee and
+ * call its "setAttribute(name,value)" method with
+ * "strong" containing an invalid character.
+* @author Curt Arnold
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-258A00AF')/constant[@name='INVALID_CHARACTER_ERR'])">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-258A00AF')/constant[@name='INVALID_CHARACTER_ERR'])</a>
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-F68F082">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-F68F082</a>
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-F68F082')/raises/exception[@name='DOMException']/descr/p[substring-before(.,':')='INVALID_CHARACTER_ERR'])">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-F68F082')/raises/exception[@name='DOMException']/descr/p[substring-before(.,':')='INVALID_CHARACTER_ERR'])</a>
+* @see <a href="http://www.w3.org/Bugs/Public/show_bug.cgi?id=249">http://www.w3.org/Bugs/Public/show_bug.cgi?id=249</a>
+*/
+public final class hc_elementinvalidcharacterexception extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public hc_elementinvalidcharacterexception(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "hc_staff", true);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ NodeList elementList;
+ Element testAddress;
+ doc = (Document) load("hc_staff", true);
+ elementList = doc.getElementsByTagName("acronym");
+ testAddress = (Element) elementList.item(0);
+
+ {
+ boolean success = false;
+ try {
+ testAddress.setAttribute("invalid^Name", "value");
+ } catch (DOMException ex) {
+ success = (ex.code == DOMException.INVALID_CHARACTER_ERR);
+ }
+ assertTrue("throw_INVALID_CHARACTER_ERR", success);
+ }
+}
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_elementinvalidcharacterexception";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(hc_elementinvalidcharacterexception.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level1/core/hc_elementinvalidcharacterexception1.java b/dom/src/test/java/org/w3c/domts/level1/core/hc_elementinvalidcharacterexception1.java
new file mode 100644
index 0000000..c2886ae
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level1/core/hc_elementinvalidcharacterexception1.java
@@ -0,0 +1,92 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+Copyright (c) 2004 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+*/
+
+package org.w3c.domts.level1.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * Calling Element.setAttribute with an empty name will cause an INVALID_CHARACTER_ERR.
+* @author Curt Arnold
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-258A00AF')/constant[@name='INVALID_CHARACTER_ERR'])">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-258A00AF')/constant[@name='INVALID_CHARACTER_ERR'])</a>
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-F68F082">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-F68F082</a>
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-F68F082')/raises/exception[@name='DOMException']/descr/p[substring-before(.,':')='INVALID_CHARACTER_ERR'])">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-F68F082')/raises/exception[@name='DOMException']/descr/p[substring-before(.,':')='INVALID_CHARACTER_ERR'])</a>
+* @see <a href="http://www.w3.org/Bugs/Public/show_bug.cgi?id=525">http://www.w3.org/Bugs/Public/show_bug.cgi?id=525</a>
+*/
+public final class hc_elementinvalidcharacterexception1 extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public hc_elementinvalidcharacterexception1(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "hc_staff", true);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ NodeList elementList;
+ Element testAddress;
+ doc = (Document) load("hc_staff", true);
+ elementList = doc.getElementsByTagName("acronym");
+ testAddress = (Element) elementList.item(0);
+
+ {
+ boolean success = false;
+ try {
+ testAddress.setAttribute("", "value");
+ } catch (DOMException ex) {
+ success = (ex.code == DOMException.INVALID_CHARACTER_ERR);
+ }
+ assertTrue("throw_INVALID_CHARACTER_ERR", success);
+ }
+}
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_elementinvalidcharacterexception1";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(hc_elementinvalidcharacterexception1.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level1/core/hc_elementnormalize.java b/dom/src/test/java/org/w3c/domts/level1/core/hc_elementnormalize.java
new file mode 100644
index 0000000..fb1714d
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level1/core/hc_elementnormalize.java
@@ -0,0 +1,97 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+Copyright (c) 2001-2004 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+*/
+
+package org.w3c.domts.level1.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * Append a couple of text nodes to the first sup element, normalize the
+ * document element and check that the element has been normalized.
+* @author Curt Arnold
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-162CF083">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-162CF083</a>
+* @see <a href="http://www.w3.org/Bugs/Public/show_bug.cgi?id=546">http://www.w3.org/Bugs/Public/show_bug.cgi?id=546</a>
+*/
+public final class hc_elementnormalize extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public hc_elementnormalize(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "hc_staff", true);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ Element root;
+ NodeList elementList;
+ Element testName;
+ Node firstChild;
+ String childValue;
+ Text textNode;
+ Node retNode;
+ doc = (Document) load("hc_staff", true);
+ elementList = doc.getElementsByTagName("sup");
+ testName = (Element) elementList.item(0);
+ textNode = doc.createTextNode("");
+ retNode = testName.appendChild(textNode);
+ textNode = doc.createTextNode(",000");
+ retNode = testName.appendChild(textNode);
+ root = doc.getDocumentElement();
+ root.normalize();
+ elementList = doc.getElementsByTagName("sup");
+ testName = (Element) elementList.item(0);
+ firstChild = testName.getFirstChild();
+ childValue = firstChild.getNodeValue();
+ assertEquals("elementNormalizeAssert", "56,000,000", childValue);
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_elementnormalize";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(hc_elementnormalize.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level1/core/hc_elementnormalize2.java b/dom/src/test/java/org/w3c/domts/level1/core/hc_elementnormalize2.java
new file mode 100644
index 0000000..0f64fa5
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level1/core/hc_elementnormalize2.java
@@ -0,0 +1,99 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+Copyright (c) 2001-2004 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+*/
+
+package org.w3c.domts.level1.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * Add an empty text node to an existing attribute node, normalize the containing element
+ * and check that the attribute node has eliminated the empty text.
+* @author Curt Arnold
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-162CF083">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-162CF083</a>
+* @see <a href="http://www.w3.org/Bugs/Public/show_bug.cgi?id=482">http://www.w3.org/Bugs/Public/show_bug.cgi?id=482</a>
+*/
+public final class hc_elementnormalize2 extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public hc_elementnormalize2(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "hc_staff", true);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ Element root;
+ NodeList elementList;
+ Element element;
+ Node firstChild;
+ Node secondChild;
+ String childValue;
+ Text emptyText;
+ Attr attrNode;
+ Node retval;
+ doc = (Document) load("hc_staff", true);
+ root = doc.getDocumentElement();
+ emptyText = doc.createTextNode("");
+ elementList = root.getElementsByTagName("acronym");
+ element = (Element) elementList.item(0);
+ attrNode = element.getAttributeNode("title");
+ retval = attrNode.appendChild(emptyText);
+ element.normalize();
+ attrNode = element.getAttributeNode("title");
+ firstChild = attrNode.getFirstChild();
+ childValue = firstChild.getNodeValue();
+ assertEquals("firstChild", "Yes", childValue);
+ secondChild = firstChild.getNextSibling();
+ assertNull("secondChildNull", secondChild);
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_elementnormalize2";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(hc_elementnormalize2.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level1/core/hc_elementnotfounderr.java b/dom/src/test/java/org/w3c/domts/level1/core/hc_elementnotfounderr.java
new file mode 100644
index 0000000..e88545a
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level1/core/hc_elementnotfounderr.java
@@ -0,0 +1,103 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+Copyright (c) 2001 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+*/
+
+package org.w3c.domts.level1.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The "removeAttributeNode(oldAttr)" method raises a
+ * NOT_FOUND_ERR DOMException if the "oldAttr" attribute
+ * is not an attribute of the element.
+ *
+ * Retrieve the last employee and attempt to remove
+ * a non existing attribute node. This should cause the
+ * intended exception to be raised. This test makes use
+ * of the "createAttribute(name)" method from the Document
+ * interface.
+* @author Curt Arnold
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-258A00AF')/constant[@name='INUSE_ATTRIBUTE_ERR'])">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-258A00AF')/constant[@name='INUSE_ATTRIBUTE_ERR'])</a>
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-D589198">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-D589198</a>
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-D589198')/raises/exception[@name='DOMException']/descr/p[substring-before(.,':')='INUSE_ATTRIBUTE_ERR'])">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-D589198')/raises/exception[@name='DOMException']/descr/p[substring-before(.,':')='INUSE_ATTRIBUTE_ERR'])</a>
+* @see <a href="http://www.w3.org/Bugs/Public/show_bug.cgi?id=249">http://www.w3.org/Bugs/Public/show_bug.cgi?id=249</a>
+*/
+public final class hc_elementnotfounderr extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public hc_elementnotfounderr(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "hc_staff", true);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ Attr oldAttribute;
+ NodeList addressElementList;
+ Element testAddress;
+ Attr attrAddress;
+ doc = (Document) load("hc_staff", true);
+ addressElementList = doc.getElementsByTagName("acronym");
+ testAddress = (Element) addressElementList.item(4);
+ oldAttribute = doc.createAttribute("title");
+
+ {
+ boolean success = false;
+ try {
+ attrAddress = testAddress.removeAttributeNode(oldAttribute);
+ } catch (DOMException ex) {
+ success = (ex.code == DOMException.NOT_FOUND_ERR);
+ }
+ assertTrue("throw_NOT_FOUND_ERR", success);
+ }
+}
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_elementnotfounderr";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(hc_elementnotfounderr.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level1/core/hc_elementremoveattribute.java b/dom/src/test/java/org/w3c/domts/level1/core/hc_elementremoveattribute.java
new file mode 100644
index 0000000..acf6dc3
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level1/core/hc_elementremoveattribute.java
@@ -0,0 +1,87 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+Copyright (c) 2001 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+*/
+
+package org.w3c.domts.level1.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The "removeAttribute(name)" removes an attribute by name.
+ * If the attribute has a default value, it is immediately
+ * replaced. However, there is no default values in the HTML
+ * compatible tests, so its value is "".
+* @author Curt Arnold
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-6D6AC0F9">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-6D6AC0F9</a>
+* @see <a href="http://lists.w3.org/Archives/Public/www-dom-ts/2002Mar/0002.html">http://lists.w3.org/Archives/Public/www-dom-ts/2002Mar/0002.html</a>
+*/
+public final class hc_elementremoveattribute extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public hc_elementremoveattribute(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "hc_staff", true);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ NodeList elementList;
+ Element testEmployee;
+ String attrValue;
+ doc = (Document) load("hc_staff", true);
+ elementList = doc.getElementsByTagName("acronym");
+ testEmployee = (Element) elementList.item(3);
+ testEmployee.removeAttribute("class");
+ attrValue = testEmployee.getAttribute("class");
+ assertEquals("attrValue", "", attrValue);
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_elementremoveattribute";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(hc_elementremoveattribute.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level1/core/hc_elementremoveattributeaftercreate.java b/dom/src/test/java/org/w3c/domts/level1/core/hc_elementremoveattributeaftercreate.java
new file mode 100644
index 0000000..0ec73a9
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level1/core/hc_elementremoveattributeaftercreate.java
@@ -0,0 +1,97 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+Copyright (c) 2001-2003 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+*/
+
+package org.w3c.domts.level1.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The "removeAttributeNode(oldAttr)" method removes the
+ * specified attribute.
+ *
+ * Retrieve the last child of the third employee, add a
+ * new "lang" attribute to it and then try to remove it.
+ * To verify that the node was removed use the
+ * "getNamedItem(name)" method from the NamedNodeMap
+ * interface. It also uses the "getAttributes()" method
+ * from the Node interface.
+* @author Curt Arnold
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-D589198">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-D589198</a>
+* @see <a href="http://www.w3.org/Bugs/Public/show_bug.cgi?id=243">http://www.w3.org/Bugs/Public/show_bug.cgi?id=243</a>
+*/
+public final class hc_elementremoveattributeaftercreate extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public hc_elementremoveattributeaftercreate(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "hc_staff", true);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ NodeList elementList;
+ Element testEmployee;
+ Attr newAttribute;
+ NamedNodeMap attributes;
+ Attr districtAttr;
+ doc = (Document) load("hc_staff", true);
+ elementList = doc.getElementsByTagName("acronym");
+ testEmployee = (Element) elementList.item(2);
+ newAttribute = doc.createAttribute("lang");
+ districtAttr = testEmployee.setAttributeNode(newAttribute);
+ districtAttr = testEmployee.removeAttributeNode(newAttribute);
+ attributes = testEmployee.getAttributes();
+ districtAttr = (Attr) attributes.getNamedItem("lang");
+ assertNull("removed_item_null", districtAttr);
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_elementremoveattributeaftercreate";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(hc_elementremoveattributeaftercreate.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level1/core/hc_elementremoveattributenode.java b/dom/src/test/java/org/w3c/domts/level1/core/hc_elementremoveattributenode.java
new file mode 100644
index 0000000..5096114
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level1/core/hc_elementremoveattributenode.java
@@ -0,0 +1,92 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+Copyright (c) 2001-2004 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+*/
+
+package org.w3c.domts.level1.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The "removeAttributeNode(oldAttr)" method returns the
+ * node that was removed.
+ *
+ * Retrieve the last child of the third employee and
+ * remove its "class" Attr node. The method should
+ * return the old attribute node.
+* @author Curt Arnold
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-D589198">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-D589198</a>
+*/
+public final class hc_elementremoveattributenode extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public hc_elementremoveattributenode(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "hc_staff", true);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ NodeList elementList;
+ Element testEmployee;
+ Attr streetAttr;
+ Attr removedAttr;
+ String removedValue;
+ doc = (Document) load("hc_staff", true);
+ elementList = doc.getElementsByTagName("acronym");
+ testEmployee = (Element) elementList.item(2);
+ streetAttr = testEmployee.getAttributeNode("class");
+ removedAttr = testEmployee.removeAttributeNode(streetAttr);
+ assertNotNull("removedAttrNotNull", removedAttr);
+ removedValue = removedAttr.getValue();
+ assertEquals("elementRemoveAttributeNodeAssert", "No", removedValue);
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_elementremoveattributenode";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(hc_elementremoveattributenode.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level1/core/hc_elementreplaceattributewithself.java b/dom/src/test/java/org/w3c/domts/level1/core/hc_elementreplaceattributewithself.java
new file mode 100644
index 0000000..bb8661c
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level1/core/hc_elementreplaceattributewithself.java
@@ -0,0 +1,90 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+Copyright (c) 2001 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+*/
+
+package org.w3c.domts.level1.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * This test calls setAttributeNode to replace an attribute with itself.
+ * Since the node is not an attribute of another Element, it would
+ * be inappropriate to throw an INUSE_ATTRIBUTE_ERR.
+ * This test was derived from elementinuserattributeerr which
+ * inadvertanly made this test.
+* @author Curt Arnold
+* @author Curt Arnold
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-887236154">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-887236154</a>
+*/
+public final class hc_elementreplaceattributewithself extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public hc_elementreplaceattributewithself(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "hc_staff", true);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ NodeList elementList;
+ Element testEmployee;
+ Attr streetAttr;
+ Attr replacedAttr;
+ String value;
+ doc = (Document) load("hc_staff", true);
+ elementList = doc.getElementsByTagName("acronym");
+ testEmployee = (Element) elementList.item(2);
+ streetAttr = testEmployee.getAttributeNode("class");
+ replacedAttr = testEmployee.setAttributeNode(streetAttr);
+ assertSame("replacedAttr", streetAttr, replacedAttr);
+}
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_elementreplaceattributewithself";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(hc_elementreplaceattributewithself.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level1/core/hc_elementreplaceexistingattribute.java b/dom/src/test/java/org/w3c/domts/level1/core/hc_elementreplaceexistingattribute.java
new file mode 100644
index 0000000..b21e265
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level1/core/hc_elementreplaceexistingattribute.java
@@ -0,0 +1,96 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+Copyright (c) 2001 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+*/
+
+package org.w3c.domts.level1.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The "setAttributeNode(newAttr)" method adds a new
+ * attribute to the Element. If the "newAttr" Attr node is
+ * already present in this element, it should replace the
+ * existing one.
+ *
+ * Retrieve the last child of the third employee and add a
+ * new attribute node by invoking the "setAttributeNode(new
+ * Attr)" method. The new attribute node to be added is
+ * "class", which is already present in this element. The
+ * method should replace the existing Attr node with the
+ * new one. This test uses the "createAttribute(name)"
+ * method from the Document interface.
+* @author Curt Arnold
+*/
+public final class hc_elementreplaceexistingattribute extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public hc_elementreplaceexistingattribute(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "hc_staff", true);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ NodeList elementList;
+ Element testEmployee;
+ Attr newAttribute;
+ String strong;
+ Attr setAttr;
+ doc = (Document) load("hc_staff", true);
+ elementList = doc.getElementsByTagName("acronym");
+ testEmployee = (Element) elementList.item(2);
+ newAttribute = doc.createAttribute("class");
+ setAttr = testEmployee.setAttributeNode(newAttribute);
+ strong = testEmployee.getAttribute("class");
+ assertEquals("replacedValue", "", strong);
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_elementreplaceexistingattribute";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(hc_elementreplaceexistingattribute.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level1/core/hc_elementreplaceexistingattributegevalue.java b/dom/src/test/java/org/w3c/domts/level1/core/hc_elementreplaceexistingattributegevalue.java
new file mode 100644
index 0000000..69c37b9
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level1/core/hc_elementreplaceexistingattributegevalue.java
@@ -0,0 +1,95 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+Copyright (c) 2001-2004 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+*/
+
+package org.w3c.domts.level1.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * If the "setAttributeNode(newAttr)" method replaces an
+ * existing Attr node with the same name, then it should
+ * return the previously existing Attr node.
+ * Retrieve the last child of the third employee and add a
+ * new attribute node. The new attribute node is "class",
+ * which is already present in this Element. The method
+ * should return the existing Attr node(old "class" Attr).
+ * This test uses the "createAttribute(name)" method
+ * from the Document interface.
+* @author Curt Arnold
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-887236154">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-887236154</a>
+*/
+public final class hc_elementreplaceexistingattributegevalue extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public hc_elementreplaceexistingattributegevalue(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "hc_staff", true);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ NodeList elementList;
+ Element testEmployee;
+ Attr newAttribute;
+ Attr streetAttr;
+ String value;
+ doc = (Document) load("hc_staff", true);
+ elementList = doc.getElementsByTagName("acronym");
+ testEmployee = (Element) elementList.item(2);
+ newAttribute = doc.createAttribute("class");
+ streetAttr = testEmployee.setAttributeNode(newAttribute);
+ assertNotNull("previousAttrNotNull", streetAttr);
+ value = streetAttr.getValue();
+ assertEquals("previousAttrValue", "No", value);
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_elementreplaceexistingattributegevalue";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(hc_elementreplaceexistingattributegevalue.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level1/core/hc_elementretrieveallattributes.java b/dom/src/test/java/org/w3c/domts/level1/core/hc_elementretrieveallattributes.java
new file mode 100644
index 0000000..e12fb82
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level1/core/hc_elementretrieveallattributes.java
@@ -0,0 +1,108 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+Copyright (c) 2001-2004 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+*/
+
+package org.w3c.domts.level1.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * Create a list of all the attributes of the last child
+ * of the first "p" element by using the "getAttributes()"
+ * method.
+* @author Curt Arnold
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-84CF096">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-84CF096</a>
+* @see <a href="http://lists.w3.org/Archives/Public/www-dom-ts/2002Mar/0002.html">http://lists.w3.org/Archives/Public/www-dom-ts/2002Mar/0002.html</a>
+* @see <a href="http://www.w3.org/Bugs/Public/show_bug.cgi?id=184">http://www.w3.org/Bugs/Public/show_bug.cgi?id=184</a>
+*/
+public final class hc_elementretrieveallattributes extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public hc_elementretrieveallattributes(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "hc_staff", false);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ NodeList addressList;
+ Node testAddress;
+ NamedNodeMap attributes;
+ Attr attribute;
+ String attributeName;
+ java.util.Collection actual = new java.util.ArrayList();
+
+ java.util.Collection htmlExpected = new java.util.ArrayList();
+ htmlExpected.add("title");
+
+ java.util.Collection expected = new java.util.ArrayList();
+ expected.add("title");
+ expected.add("dir");
+
+ doc = (Document) load("hc_staff", false);
+ addressList = doc.getElementsByTagName("acronym");
+ testAddress = addressList.item(0);
+ attributes = testAddress.getAttributes();
+ for (int indexN1006B = 0; indexN1006B < attributes.getLength(); indexN1006B++) {
+ attribute = (Attr) attributes.item(indexN1006B);
+ attributeName = attribute.getNodeName();
+ actual.add(attributeName);
+ }
+
+ if (("text/html".equals(getContentType()))) {
+ assertEqualsIgnoreCase("htmlAttributeNames", htmlExpected, actual);
+} else {
+ assertEqualsIgnoreCase("attributeNames", expected, actual);
+}
+
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_elementretrieveallattributes";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(hc_elementretrieveallattributes.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level1/core/hc_elementretrieveattrvalue.java b/dom/src/test/java/org/w3c/domts/level1/core/hc_elementretrieveattrvalue.java
new file mode 100644
index 0000000..fac3d2a
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level1/core/hc_elementretrieveattrvalue.java
@@ -0,0 +1,87 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+Copyright (c) 2001 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+*/
+
+package org.w3c.domts.level1.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The "getAttribute(name)" method returns an attribute
+ * value by name.
+ *
+ * Retrieve the second address element, then
+ * invoke the 'getAttribute("class")' method. This should
+ * return the value of the attribute("No").
+* @author Curt Arnold
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-666EE0F9">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-666EE0F9</a>
+*/
+public final class hc_elementretrieveattrvalue extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public hc_elementretrieveattrvalue(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "hc_staff", false);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ NodeList elementList;
+ Element testAddress;
+ String attrValue;
+ doc = (Document) load("hc_staff", false);
+ elementList = doc.getElementsByTagName("acronym");
+ testAddress = (Element) elementList.item(2);
+ attrValue = testAddress.getAttribute("class");
+ assertEquals("attrValue", "No", attrValue);
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_elementretrieveattrvalue";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(hc_elementretrieveattrvalue.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level1/core/hc_elementretrievetagname.java b/dom/src/test/java/org/w3c/domts/level1/core/hc_elementretrievetagname.java
new file mode 100644
index 0000000..aaa4d7a
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level1/core/hc_elementretrievetagname.java
@@ -0,0 +1,90 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+Copyright (c) 2001 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+*/
+
+package org.w3c.domts.level1.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The "getElementsByTagName()" method returns a NodeList
+ * of all descendant elements with a given tagName.
+ *
+ * Invoke the "getElementsByTagName()" method and create
+ * a NodeList of "code" elements. Retrieve the second
+ * "code" element in the list and return the NodeName.
+* @author Curt Arnold
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-F68D095">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-F68D095</a>
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-104682815">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-104682815</a>
+*/
+public final class hc_elementretrievetagname extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public hc_elementretrievetagname(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "hc_staff", false);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ NodeList elementList;
+ Node testEmployee;
+ String strong;
+ doc = (Document) load("hc_staff", false);
+ elementList = doc.getElementsByTagName("code");
+ testEmployee = elementList.item(1);
+ strong = testEmployee.getNodeName();
+ assertEqualsAutoCase("element", "nodename", "code", strong);
+ strong = ((Element) /*Node */testEmployee).getTagName();
+ assertEqualsAutoCase("element", "tagname", "code", strong);
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_elementretrievetagname";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(hc_elementretrievetagname.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level1/core/hc_elementsetattributenodenull.java b/dom/src/test/java/org/w3c/domts/level1/core/hc_elementsetattributenodenull.java
new file mode 100644
index 0000000..709142f
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level1/core/hc_elementsetattributenodenull.java
@@ -0,0 +1,94 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+Copyright (c) 2001-2003 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+*/
+
+package org.w3c.domts.level1.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The "setAttributeNode(newAttr)" method returns the
+ * null value if no previously existing Attr node with the
+ * same name was replaced.
+ *
+ * Retrieve the last child of the third employee and add a
+ * new attribute to it. The new attribute node added is
+ * "lang", which is not part of this Element. The
+ * method should return the null value.
+ * This test uses the "createAttribute(name)"
+ * method from the Document interface.
+* @author Curt Arnold
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-887236154">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-887236154</a>
+* @see <a href="http://www.w3.org/Bugs/Public/show_bug.cgi?id=243">http://www.w3.org/Bugs/Public/show_bug.cgi?id=243</a>
+*/
+public final class hc_elementsetattributenodenull extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public hc_elementsetattributenodenull(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "hc_staff", true);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ NodeList elementList;
+ Element testEmployee;
+ Attr newAttribute;
+ Attr districtAttr;
+ doc = (Document) load("hc_staff", true);
+ elementList = doc.getElementsByTagName("acronym");
+ testEmployee = (Element) elementList.item(2);
+ newAttribute = doc.createAttribute("lang");
+ districtAttr = testEmployee.setAttributeNode(newAttribute);
+ assertNull("elementSetAttributeNodeNullAssert", districtAttr);
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_elementsetattributenodenull";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(hc_elementsetattributenodenull.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level1/core/hc_elementwrongdocumenterr.java b/dom/src/test/java/org/w3c/domts/level1/core/hc_elementwrongdocumenterr.java
new file mode 100644
index 0000000..e8e176a
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level1/core/hc_elementwrongdocumenterr.java
@@ -0,0 +1,108 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+Copyright (c) 2001-2003 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+*/
+
+package org.w3c.domts.level1.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The "setAttributeNode(newAttr)" method raises an
+ * "WRONG_DOCUMENT_ERR DOMException if the "newAttr"
+ * was created from a different document than the one that
+ * created this document.
+ * Retrieve the last employee and attempt to set a new
+ * attribute node for its "employee" element. The new
+ * attribute was created from a document other than the
+ * one that created this element, therefore a
+ * WRONG_DOCUMENT_ERR DOMException should be raised.
+ * This test uses the "createAttribute(newAttr)" method
+ * from the Document interface.
+* @author Curt Arnold
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-258A00AF')/constant[@name='WRONG_DOCUMENT_ERR'])">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-258A00AF')/constant[@name='WRONG_DOCUMENT_ERR'])</a>
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-887236154">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-887236154</a>
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-887236154')/raises/exception[@name='DOMException']/descr/p[substring-before(.,':')='WRONG_DOCUMENT_ERR'])">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-887236154')/raises/exception[@name='DOMException']/descr/p[substring-before(.,':')='WRONG_DOCUMENT_ERR'])</a>
+* @see <a href="http://www.w3.org/Bugs/Public/show_bug.cgi?id=249">http://www.w3.org/Bugs/Public/show_bug.cgi?id=249</a>
+*/
+public final class hc_elementwrongdocumenterr extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public hc_elementwrongdocumenterr(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "hc_staff", true);
+ preload(contentType, "hc_staff", false);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc1;
+ Document doc2;
+ Attr newAttribute;
+ NodeList addressElementList;
+ Element testAddress;
+ Attr attrAddress;
+ doc1 = (Document) load("hc_staff", true);
+ doc2 = (Document) load("hc_staff", false);
+ newAttribute = doc2.createAttribute("newAttribute");
+ addressElementList = doc1.getElementsByTagName("acronym");
+ testAddress = (Element) addressElementList.item(4);
+
+ {
+ boolean success = false;
+ try {
+ attrAddress = testAddress.setAttributeNode(newAttribute);
+ } catch (DOMException ex) {
+ success = (ex.code == DOMException.WRONG_DOCUMENT_ERR);
+ }
+ assertTrue("throw_WRONG_DOCUMENT_ERR", success);
+ }
+}
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_elementwrongdocumenterr";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(hc_elementwrongdocumenterr.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level1/core/hc_entitiesremovenameditem1.java b/dom/src/test/java/org/w3c/domts/level1/core/hc_entitiesremovenameditem1.java
new file mode 100644
index 0000000..be6b5ea
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level1/core/hc_entitiesremovenameditem1.java
@@ -0,0 +1,101 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+Copyright (c) 2004 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+*/
+
+package org.w3c.domts.level1.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * An attempt to add remove an entity should result in a NO_MODIFICATION_ERR.
+* @author Curt Arnold
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-1788794630">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-1788794630</a>
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-D58B193">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-D58B193</a>
+*/
+public final class hc_entitiesremovenameditem1 extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public hc_entitiesremovenameditem1(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+ if (factory.hasFeature("XML", null) != true) {
+ throw org.w3c.domts.DOMTestIncompatibleException.incompatibleFeature("XML", null);
+ }
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "hc_staff", true);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ NamedNodeMap entities;
+ DocumentType docType;
+ Node retval;
+ doc = (Document) load("hc_staff", true);
+ docType = doc.getDoctype();
+
+ if (
+ !(("text/html".equals(getContentType())))
+) {
+ assertNotNull("docTypeNotNull", docType);
+ entities = docType.getEntities();
+ assertNotNull("entitiesNotNull", entities);
+
+ {
+ boolean success = false;
+ try {
+ retval = entities.removeNamedItem("alpha");
+ } catch (DOMException ex) {
+ success = (ex.code == DOMException.NO_MODIFICATION_ALLOWED_ERR);
+ }
+ assertTrue("throw_NO_MODIFICATION_ALLOWED_ERR", success);
+ }
+}
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_entitiesremovenameditem1";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(hc_entitiesremovenameditem1.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level1/core/hc_entitiessetnameditem1.java b/dom/src/test/java/org/w3c/domts/level1/core/hc_entitiessetnameditem1.java
new file mode 100644
index 0000000..890f35a
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level1/core/hc_entitiessetnameditem1.java
@@ -0,0 +1,109 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+Copyright (c) 2004 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+*/
+
+package org.w3c.domts.level1.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * An attempt to add an element to the named node map returned by entities should
+ * result in a NO_MODIFICATION_ERR or HIERARCHY_REQUEST_ERR.
+* @author Curt Arnold
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-1788794630">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-1788794630</a>
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-1025163788">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-1025163788</a>
+*/
+public final class hc_entitiessetnameditem1 extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public hc_entitiessetnameditem1(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+ if (factory.hasFeature("XML", null) != true) {
+ throw org.w3c.domts.DOMTestIncompatibleException.incompatibleFeature("XML", null);
+ }
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "hc_staff", true);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ NamedNodeMap entities;
+ DocumentType docType;
+ Node retval;
+ Element elem;
+ doc = (Document) load("hc_staff", true);
+ docType = doc.getDoctype();
+
+ if (
+ !(("text/html".equals(getContentType())))
+) {
+ assertNotNull("docTypeNotNull", docType);
+ entities = docType.getEntities();
+ assertNotNull("entitiesNotNull", entities);
+ elem = doc.createElement("br");
+
+ try {
+ retval = entities.setNamedItem(elem);
+ fail("throw_HIER_OR_NO_MOD_ERR");
+
+ } catch (DOMException ex) {
+ switch (ex.code) {
+ case 3 :
+ break;
+ case 7 :
+ break;
+ default:
+ throw ex;
+ }
+ }
+}
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_entitiessetnameditem1";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(hc_entitiessetnameditem1.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level1/core/hc_namednodemapchildnoderange.java b/dom/src/test/java/org/w3c/domts/level1/core/hc_namednodemapchildnoderange.java
new file mode 100644
index 0000000..1283a61
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level1/core/hc_namednodemapchildnoderange.java
@@ -0,0 +1,106 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+Copyright (c) 2001-2004 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+*/
+
+package org.w3c.domts.level1.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * Create a NamedNodeMap object from the attributes of the
+ * last child of the third "p" element and traverse the
+ * list from index 0 thru length -1. All indices should
+ * be valid.
+* @author Curt Arnold
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-84CF096">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-84CF096</a>
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-349467F9">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-349467F9</a>
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-6D0FB19E">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-6D0FB19E</a>
+* @see <a href="http://www.w3.org/Bugs/Public/show_bug.cgi?id=250">http://www.w3.org/Bugs/Public/show_bug.cgi?id=250</a>
+*/
+public final class hc_namednodemapchildnoderange extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public hc_namednodemapchildnoderange(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "hc_staff", false);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ NodeList elementList;
+ Node testEmployee;
+ NamedNodeMap attributes;
+ Node child;
+ String strong;
+ int length;
+ doc = (Document) load("hc_staff", false);
+ elementList = doc.getElementsByTagName("acronym");
+ testEmployee = elementList.item(2);
+ attributes = testEmployee.getAttributes();
+ length = (int) attributes.getLength();
+
+ if (("text/html".equals(getContentType()))) {
+ assertEquals("htmlLength", 2, length);
+ } else {
+ assertEquals("length", 3, length);
+ child = attributes.item(2);
+ assertNotNull("attr2", child);
+ }
+
+ child = attributes.item(0);
+ assertNotNull("attr0", child);
+ child = attributes.item(1);
+ assertNotNull("attr1", child);
+ child = attributes.item(3);
+ assertNull("attr3", child);
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_namednodemapchildnoderange";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(hc_namednodemapchildnoderange.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level1/core/hc_namednodemapgetnameditem.java b/dom/src/test/java/org/w3c/domts/level1/core/hc_namednodemapgetnameditem.java
new file mode 100644
index 0000000..fe9e793
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level1/core/hc_namednodemapgetnameditem.java
@@ -0,0 +1,93 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+Copyright (c) 2001-2004 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+*/
+
+package org.w3c.domts.level1.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * Retrieve the second "p" element and create a NamedNodeMap
+ * listing of the attributes of the last child. Once the
+ * list is created an invocation of the "getNamedItem(name)"
+ * method is done with name="title". This should result
+ * in the title Attr node being returned.
+* @author Curt Arnold
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-1074577549">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-1074577549</a>
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-349467F9">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-349467F9</a>
+* @see <a href="http://www.w3.org/Bugs/Public/show_bug.cgi?id=236">http://www.w3.org/Bugs/Public/show_bug.cgi?id=236</a>
+* @see <a href="http://lists.w3.org/Archives/Public/www-dom-ts/2003Jun/0011.html">http://lists.w3.org/Archives/Public/www-dom-ts/2003Jun/0011.html</a>
+*/
+public final class hc_namednodemapgetnameditem extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public hc_namednodemapgetnameditem(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "hc_staff", false);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ NodeList elementList;
+ Node testEmployee;
+ NamedNodeMap attributes;
+ Attr domesticAttr;
+ String attrName;
+ doc = (Document) load("hc_staff", false);
+ elementList = doc.getElementsByTagName("acronym");
+ testEmployee = elementList.item(1);
+ attributes = testEmployee.getAttributes();
+ domesticAttr = (Attr) attributes.getNamedItem("title");
+ attrName = domesticAttr.getNodeName();
+ assertEqualsAutoCase("attribute", "nodeName", "title", attrName);
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_namednodemapgetnameditem";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(hc_namednodemapgetnameditem.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level1/core/hc_namednodemapinuseattributeerr.java b/dom/src/test/java/org/w3c/domts/level1/core/hc_namednodemapinuseattributeerr.java
new file mode 100644
index 0000000..e8d3268
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level1/core/hc_namednodemapinuseattributeerr.java
@@ -0,0 +1,109 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+Copyright (c) 2001-2003 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+*/
+
+package org.w3c.domts.level1.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The "setNamedItem(arg)" method raises a
+ * INUSE_ATTRIBUTE_ERR DOMException if "arg" is an
+ * Attr that is already in an attribute of another Element.
+ * Create a NamedNodeMap object from the attributes of the
+ * last child of the third employee and attempt to add
+ * an attribute that is already being used by the first
+ * employee. This should raise the desired exception.
+* @author Curt Arnold
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-258A00AF')/constant[@name='INUSE_ATTRIBUTE_ERR'])">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-258A00AF')/constant[@name='INUSE_ATTRIBUTE_ERR'])</a>
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-1025163788">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-1025163788</a>
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-1025163788')/raises/exception[@name='DOMException']/descr/p[substring-before(.,':')='INUSE_ATTRIBUTE_ERR'])">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-1025163788')/raises/exception[@name='DOMException']/descr/p[substring-before(.,':')='INUSE_ATTRIBUTE_ERR'])</a>
+* @see <a href="http://www.w3.org/Bugs/Public/show_bug.cgi?id=249">http://www.w3.org/Bugs/Public/show_bug.cgi?id=249</a>
+*/
+public final class hc_namednodemapinuseattributeerr extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public hc_namednodemapinuseattributeerr(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "hc_staff", true);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ NodeList elementList;
+ Element firstNode;
+ Node testNode;
+ NamedNodeMap attributes;
+ Attr domesticAttr;
+ Attr setAttr;
+ Node setNode;
+ doc = (Document) load("hc_staff", true);
+ elementList = doc.getElementsByTagName("acronym");
+ firstNode = (Element) elementList.item(0);
+ domesticAttr = doc.createAttribute("title");
+ domesticAttr.setValue("Yα");
+ setAttr = firstNode.setAttributeNode(domesticAttr);
+ elementList = doc.getElementsByTagName("acronym");
+ testNode = elementList.item(2);
+ attributes = testNode.getAttributes();
+
+ {
+ boolean success = false;
+ try {
+ setNode = attributes.setNamedItem(domesticAttr);
+ } catch (DOMException ex) {
+ success = (ex.code == DOMException.INUSE_ATTRIBUTE_ERR);
+ }
+ assertTrue("throw_INUSE_ATTRIBUTE_ERR", success);
+ }
+}
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_namednodemapinuseattributeerr";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(hc_namednodemapinuseattributeerr.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level1/core/hc_namednodemapnotfounderr.java b/dom/src/test/java/org/w3c/domts/level1/core/hc_namednodemapnotfounderr.java
new file mode 100644
index 0000000..ed6b86f
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level1/core/hc_namednodemapnotfounderr.java
@@ -0,0 +1,103 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+Copyright (c) 2001-2003 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+*/
+
+package org.w3c.domts.level1.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The "removeNamedItem(name)" method raises a
+ * NOT_FOUND_ERR DOMException if there is not a node
+ * named "strong" in the map.
+ *
+ * Create a NamedNodeMap object from the attributes of the
+ * last child of the third employee and attempt to remove
+ * the "lang" attribute. There is not a node named
+ * "lang" in the list and therefore the desired
+ * exception should be raised.
+* @author Curt Arnold
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-258A00AF')/constant[@name='INUSE_ATTRIBUTE_ERR'])">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-258A00AF')/constant[@name='INUSE_ATTRIBUTE_ERR'])</a>
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-D58B193">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-D58B193</a>
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-D58B193')/raises/exception[@name='DOMException']/descr/p[substring-before(.,':')='INUSE_ATTRIBUTE_ERR'])">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-D58B193')/raises/exception[@name='DOMException']/descr/p[substring-before(.,':')='INUSE_ATTRIBUTE_ERR'])</a>
+* @see <a href="http://www.w3.org/Bugs/Public/show_bug.cgi?id=243">http://www.w3.org/Bugs/Public/show_bug.cgi?id=243</a>
+*/
+public final class hc_namednodemapnotfounderr extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public hc_namednodemapnotfounderr(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "hc_staff", true);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ NodeList elementList;
+ Element testEmployee;
+ NamedNodeMap attributes;
+ Node removedNode;
+ doc = (Document) load("hc_staff", true);
+ elementList = doc.getElementsByTagName("acronym");
+ testEmployee = (Element) elementList.item(2);
+ attributes = testEmployee.getAttributes();
+
+ {
+ boolean success = false;
+ try {
+ removedNode = attributes.removeNamedItem("lang");
+ } catch (DOMException ex) {
+ success = (ex.code == DOMException.NOT_FOUND_ERR);
+ }
+ assertTrue("throw_NOT_FOUND_ERR", success);
+ }
+}
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_namednodemapnotfounderr";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(hc_namednodemapnotfounderr.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level1/core/hc_namednodemapnumberofnodes.java b/dom/src/test/java/org/w3c/domts/level1/core/hc_namednodemapnumberofnodes.java
new file mode 100644
index 0000000..e4a4965
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level1/core/hc_namednodemapnumberofnodes.java
@@ -0,0 +1,92 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+Copyright (c) 2001-2004 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+*/
+
+package org.w3c.domts.level1.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * Retrieve the second "p" element and evaluate Node.attributes.length.
+* @author Curt Arnold
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-84CF096">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-84CF096</a>
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-6D0FB19E">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-6D0FB19E</a>
+* @see <a href="http://www.w3.org/Bugs/Public/show_bug.cgi?id=250">http://www.w3.org/Bugs/Public/show_bug.cgi?id=250</a>
+*/
+public final class hc_namednodemapnumberofnodes extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public hc_namednodemapnumberofnodes(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "hc_staff", true);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ NodeList elementList;
+ Node testEmployee;
+ NamedNodeMap attributes;
+ int length;
+ doc = (Document) load("hc_staff", true);
+ elementList = doc.getElementsByTagName("acronym");
+ testEmployee = elementList.item(2);
+ attributes = testEmployee.getAttributes();
+ length = (int) attributes.getLength();
+
+ if (("text/html".equals(getContentType()))) {
+ assertEquals("htmlLength", 2, length);
+ } else {
+ assertEquals("length", 3, length);
+ }
+
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_namednodemapnumberofnodes";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(hc_namednodemapnumberofnodes.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level1/core/hc_namednodemapremovenameditem.java b/dom/src/test/java/org/w3c/domts/level1/core/hc_namednodemapremovenameditem.java
new file mode 100644
index 0000000..02b7a60
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level1/core/hc_namednodemapremovenameditem.java
@@ -0,0 +1,97 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+Copyright (c) 2001 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+*/
+
+package org.w3c.domts.level1.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The "removeNamedItem(name)" method removes a node
+ * specified by name.
+ *
+ * Retrieve the third employee and create a NamedNodeMap
+ * object of the attributes of the last child. Once the
+ * list is created invoke the "removeNamedItem(name)"
+ * method with name="class". This should result
+ * in the removal of the specified attribute.
+* @author Curt Arnold
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-D58B193">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-D58B193</a>
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-349467F9">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-349467F9</a>
+* @see <a href="http://lists.w3.org/Archives/Public/www-dom-ts/2002Mar/0002.html">http://lists.w3.org/Archives/Public/www-dom-ts/2002Mar/0002.html</a>
+*/
+public final class hc_namednodemapremovenameditem extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public hc_namednodemapremovenameditem(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "hc_staff", true);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ NodeList elementList;
+ Attr newAttribute;
+ Node testAddress;
+ NamedNodeMap attributes;
+ Attr streetAttr;
+ boolean specified;
+ Node removedNode;
+ doc = (Document) load("hc_staff", true);
+ elementList = doc.getElementsByTagName("acronym");
+ testAddress = elementList.item(2);
+ attributes = testAddress.getAttributes();
+ removedNode = attributes.removeNamedItem("class");
+ streetAttr = (Attr) attributes.getNamedItem("class");
+ assertNull("isnull", streetAttr);
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_namednodemapremovenameditem";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(hc_namednodemapremovenameditem.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level1/core/hc_namednodemapreturnattrnode.java b/dom/src/test/java/org/w3c/domts/level1/core/hc_namednodemapreturnattrnode.java
new file mode 100644
index 0000000..fd4793a
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level1/core/hc_namednodemapreturnattrnode.java
@@ -0,0 +1,97 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+Copyright (c) 2001-2004 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+*/
+
+package org.w3c.domts.level1.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * Retrieve the second p element and create a NamedNodeMap
+ * listing of the attributes of the last child. Once the
+ * list is created an invocation of the "getNamedItem(name)"
+ * method is done with name="class". This should result
+ * in the method returning an Attr node.
+* @author Curt Arnold
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-1074577549">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-1074577549</a>
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-84CF096">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-84CF096</a>
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-637646024">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-637646024</a>
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-1112119403">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-1112119403</a>
+* @see <a href="http://www.w3.org/Bugs/Public/show_bug.cgi?id=236">http://www.w3.org/Bugs/Public/show_bug.cgi?id=236</a>
+*/
+public final class hc_namednodemapreturnattrnode extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public hc_namednodemapreturnattrnode(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "hc_staff", false);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ NodeList elementList;
+ Node testEmployee;
+ NamedNodeMap attributes;
+ Node streetAttr;
+ String attrName;
+ doc = (Document) load("hc_staff", false);
+ elementList = doc.getElementsByTagName("acronym");
+ testEmployee = elementList.item(1);
+ attributes = testEmployee.getAttributes();
+ streetAttr = attributes.getNamedItem("class");
+ assertInstanceOf("typeAssert", Attr.class, streetAttr);
+attrName = streetAttr.getNodeName();
+ assertEqualsAutoCase("attribute", "nodeName", "class", attrName);
+ attrName = ((Attr) /*Node */streetAttr).getName();
+ assertEqualsAutoCase("attribute", "name", "class", attrName);
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_namednodemapreturnattrnode";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(hc_namednodemapreturnattrnode.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level1/core/hc_namednodemapreturnfirstitem.java b/dom/src/test/java/org/w3c/domts/level1/core/hc_namednodemapreturnfirstitem.java
new file mode 100644
index 0000000..20fd55d
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level1/core/hc_namednodemapreturnfirstitem.java
@@ -0,0 +1,114 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+Copyright (c) 2001-2003 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+*/
+
+package org.w3c.domts.level1.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The "item(index)" method returns the indexth item in
+ * the map(test for first item).
+ *
+ * Retrieve the second "acronym" get the NamedNodeMap of the attributes. Since the
+ * DOM does not specify an order of these nodes the contents
+ * of the FIRST node can contain either "title", "class" or "dir".
+* @author Curt Arnold
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-349467F9">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-349467F9</a>
+* @see <a href="http://www.w3.org/Bugs/Public/show_bug.cgi?id=236">http://www.w3.org/Bugs/Public/show_bug.cgi?id=236</a>
+* @see <a href="http://lists.w3.org/Archives/Public/www-dom-ts/2003Jun/0011.html">http://lists.w3.org/Archives/Public/www-dom-ts/2003Jun/0011.html</a>
+* @see <a href="http://www.w3.org/Bugs/Public/show_bug.cgi?id=184">http://www.w3.org/Bugs/Public/show_bug.cgi?id=184</a>
+*/
+public final class hc_namednodemapreturnfirstitem extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public hc_namednodemapreturnfirstitem(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "hc_staff", true);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ NodeList elementList;
+ Node testAddress;
+ NamedNodeMap attributes;
+ Node child;
+ String nodeName;
+ java.util.Collection htmlExpected = new java.util.ArrayList();
+ htmlExpected.add("title");
+ htmlExpected.add("class");
+
+ java.util.Collection expected = new java.util.ArrayList();
+ expected.add("title");
+ expected.add("class");
+ expected.add("dir");
+
+ java.util.Collection actual = new java.util.ArrayList();
+
+ doc = (Document) load("hc_staff", true);
+ elementList = doc.getElementsByTagName("acronym");
+ testAddress = elementList.item(1);
+ attributes = testAddress.getAttributes();
+ for (int indexN10070 = 0; indexN10070 < attributes.getLength(); indexN10070++) {
+ child = (Node) attributes.item(indexN10070);
+ nodeName = child.getNodeName();
+ actual.add(nodeName);
+ }
+
+ if (("text/html".equals(getContentType()))) {
+ assertEqualsIgnoreCase("attrName_html", htmlExpected, actual);
+} else {
+ assertEquals("attrName", expected, actual);
+ }
+
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_namednodemapreturnfirstitem";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(hc_namednodemapreturnfirstitem.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level1/core/hc_namednodemapreturnlastitem.java b/dom/src/test/java/org/w3c/domts/level1/core/hc_namednodemapreturnlastitem.java
new file mode 100644
index 0000000..32b783b
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level1/core/hc_namednodemapreturnlastitem.java
@@ -0,0 +1,116 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+Copyright (c) 2001-2003 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+*/
+
+package org.w3c.domts.level1.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The "item(index)" method returns the indexth item in
+ * the map(test for last item).
+ *
+ * Retrieve the second "acronym" and get the attribute name. Since the
+ * DOM does not specify an order of these nodes the contents
+ * of the LAST node can contain either "title" or "class".
+ * The test should return "true" if the LAST node is either
+ * of these values.
+* @author Curt Arnold
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-349467F9">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-349467F9</a>
+* @see <a href="http://www.w3.org/Bugs/Public/show_bug.cgi?id=236">http://www.w3.org/Bugs/Public/show_bug.cgi?id=236</a>
+* @see <a href="http://lists.w3.org/Archives/Public/www-dom-ts/2003Jun/0011.html">http://lists.w3.org/Archives/Public/www-dom-ts/2003Jun/0011.html</a>
+* @see <a href="http://www.w3.org/Bugs/Public/show_bug.cgi?id=184">http://www.w3.org/Bugs/Public/show_bug.cgi?id=184</a>
+*/
+public final class hc_namednodemapreturnlastitem extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public hc_namednodemapreturnlastitem(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "hc_staff", true);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ NodeList elementList;
+ Node testEmployee;
+ NamedNodeMap attributes;
+ Node child;
+ String nodeName;
+ java.util.Collection htmlExpected = new java.util.ArrayList();
+ htmlExpected.add("title");
+ htmlExpected.add("class");
+
+ java.util.Collection expected = new java.util.ArrayList();
+ expected.add("title");
+ expected.add("class");
+ expected.add("dir");
+
+ java.util.Collection actual = new java.util.ArrayList();
+
+ doc = (Document) load("hc_staff", true);
+ elementList = doc.getElementsByTagName("acronym");
+ testEmployee = elementList.item(1);
+ attributes = testEmployee.getAttributes();
+ for (int indexN10070 = 0; indexN10070 < attributes.getLength(); indexN10070++) {
+ child = (Node) attributes.item(indexN10070);
+ nodeName = child.getNodeName();
+ actual.add(nodeName);
+ }
+
+ if (("text/html".equals(getContentType()))) {
+ assertEqualsIgnoreCase("attrName_html", htmlExpected, actual);
+} else {
+ assertEquals("attrName", expected, actual);
+ }
+
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_namednodemapreturnlastitem";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(hc_namednodemapreturnlastitem.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level1/core/hc_namednodemapreturnnull.java b/dom/src/test/java/org/w3c/domts/level1/core/hc_namednodemapreturnnull.java
new file mode 100644
index 0000000..0d5ab3b
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level1/core/hc_namednodemapreturnnull.java
@@ -0,0 +1,94 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+Copyright (c) 2001-2003 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+*/
+
+package org.w3c.domts.level1.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The "getNamedItem(name)" method returns null of the
+ * specified name did not identify any node in the map.
+ *
+ * Retrieve the second employee and create a NamedNodeMap
+ * listing of the attributes of the last child. Once the
+ * list is created an invocation of the "getNamedItem(name)"
+ * method is done with name="lang". This name does not
+ * match any names in the list therefore the method should
+ * return null.
+* @author Curt Arnold
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-1074577549">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-1074577549</a>
+* @see <a href="http://www.w3.org/Bugs/Public/show_bug.cgi?id=243">http://www.w3.org/Bugs/Public/show_bug.cgi?id=243</a>
+* @see <a href="http://www.w3.org/Bugs/Public/show_bug.cgi?id=249">http://www.w3.org/Bugs/Public/show_bug.cgi?id=249</a>
+*/
+public final class hc_namednodemapreturnnull extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public hc_namednodemapreturnnull(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "hc_staff", false);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ NodeList elementList;
+ Node testEmployee;
+ NamedNodeMap attributes;
+ Attr districtNode;
+ doc = (Document) load("hc_staff", false);
+ elementList = doc.getElementsByTagName("acronym");
+ testEmployee = elementList.item(1);
+ attributes = testEmployee.getAttributes();
+ districtNode = (Attr) attributes.getNamedItem("lang");
+ assertNull("langAttrNull", districtNode);
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_namednodemapreturnnull";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(hc_namednodemapreturnnull.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level1/core/hc_namednodemapsetnameditem.java b/dom/src/test/java/org/w3c/domts/level1/core/hc_namednodemapsetnameditem.java
new file mode 100644
index 0000000..609009a
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level1/core/hc_namednodemapsetnameditem.java
@@ -0,0 +1,103 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+Copyright (c) 2001-2004 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+*/
+
+package org.w3c.domts.level1.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * Retrieve the second "p" element and create a NamedNodeMap
+ * object from the attributes of the last child by
+ * invoking the "getAttributes()" method. Once the
+ * list is created an invocation of the "setNamedItem(arg)"
+ * method is done with arg=newAttr, where newAttr is a
+ * new Attr Node previously created. The "setNamedItem(arg)"
+ * method should add then new node to the NamedNodeItem
+ * object by using its "nodeName" attribute("lang').
+ * This node is then retrieved using the "getNamedItem(name)"
+ * method.
+* @author Curt Arnold
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-1025163788">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-1025163788</a>
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-349467F9">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-349467F9</a>
+* @see <a href="http://www.w3.org/Bugs/Public/show_bug.cgi?id=236">http://www.w3.org/Bugs/Public/show_bug.cgi?id=236</a>
+* @see <a href="http://lists.w3.org/Archives/Public/www-dom-ts/2003Jun/0011.html">http://lists.w3.org/Archives/Public/www-dom-ts/2003Jun/0011.html</a>
+* @see <a href="http://www.w3.org/Bugs/Public/show_bug.cgi?id=243">http://www.w3.org/Bugs/Public/show_bug.cgi?id=243</a>
+*/
+public final class hc_namednodemapsetnameditem extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public hc_namednodemapsetnameditem(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "hc_staff", true);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ NodeList elementList;
+ Attr newAttribute;
+ Node testAddress;
+ NamedNodeMap attributes;
+ Attr districtNode;
+ String attrName;
+ Node setNode;
+ doc = (Document) load("hc_staff", true);
+ elementList = doc.getElementsByTagName("acronym");
+ testAddress = elementList.item(1);
+ newAttribute = doc.createAttribute("lang");
+ attributes = testAddress.getAttributes();
+ setNode = attributes.setNamedItem(newAttribute);
+ districtNode = (Attr) attributes.getNamedItem("lang");
+ attrName = districtNode.getNodeName();
+ assertEqualsAutoCase("attribute", "nodeName", "lang", attrName);
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_namednodemapsetnameditem";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(hc_namednodemapsetnameditem.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level1/core/hc_namednodemapsetnameditemreturnvalue.java b/dom/src/test/java/org/w3c/domts/level1/core/hc_namednodemapsetnameditemreturnvalue.java
new file mode 100644
index 0000000..e9d796f
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level1/core/hc_namednodemapsetnameditemreturnvalue.java
@@ -0,0 +1,104 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+Copyright (c) 2001-2004 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+*/
+
+package org.w3c.domts.level1.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * If the "setNamedItem(arg)" method replaces an already
+ * existing node with the same name then the already
+ * existing node is returned.
+ *
+ * Retrieve the third employee and create a NamedNodeMap
+ * object from the attributes of the last child by
+ * invoking the "getAttributes()" method. Once the
+ * list is created an invocation of the "setNamedItem(arg)"
+ * method is done with arg=newAttr, where newAttr is a
+ * new Attr Node previously created and whose node name
+ * already exists in the map. The "setNamedItem(arg)"
+ * method should replace the already existing node with
+ * the new one and return the existing node.
+ * This test uses the "createAttribute(name)" method from
+ * the document interface.
+* @author Curt Arnold
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-1025163788">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-1025163788</a>
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-349467F9">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-349467F9</a>
+*/
+public final class hc_namednodemapsetnameditemreturnvalue extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public hc_namednodemapsetnameditemreturnvalue(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "hc_staff", true);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ NodeList elementList;
+ Attr newAttribute;
+ Node testAddress;
+ NamedNodeMap attributes;
+ Node newNode;
+ String attrValue;
+ doc = (Document) load("hc_staff", true);
+ elementList = doc.getElementsByTagName("acronym");
+ testAddress = elementList.item(2);
+ newAttribute = doc.createAttribute("class");
+ attributes = testAddress.getAttributes();
+ newNode = attributes.setNamedItem(newAttribute);
+ assertNotNull("previousAttrNotNull", newNode);
+ attrValue = newNode.getNodeValue();
+ assertEquals("previousAttrValue", "No", attrValue);
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_namednodemapsetnameditemreturnvalue";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(hc_namednodemapsetnameditemreturnvalue.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level1/core/hc_namednodemapsetnameditemthatexists.java b/dom/src/test/java/org/w3c/domts/level1/core/hc_namednodemapsetnameditemthatexists.java
new file mode 100644
index 0000000..90f88e4
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level1/core/hc_namednodemapsetnameditemthatexists.java
@@ -0,0 +1,106 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+Copyright (c) 2001 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+*/
+
+package org.w3c.domts.level1.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * If the node to be added by the "setNamedItem(arg)" method
+ * already exists in the NamedNodeMap, it is replaced by
+ * the new one.
+ *
+ * Retrieve the second employee and create a NamedNodeMap
+ * object from the attributes of the last child by
+ * invoking the "getAttributes()" method. Once the
+ * list is created an invocation of the "setNamedItem(arg)"
+ * method is done with arg=newAttr, where newAttr is a
+ * new Attr Node previously created and whose node name
+ * already exists in the map. The "setNamedItem(arg)"
+ * method should replace the already existing node with
+ * the new one.
+ * This node is then retrieved using the "getNamedItem(name)"
+ * method. This test uses the "createAttribute(name)"
+ * method from the document interface
+* @author Curt Arnold
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-1025163788">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-1025163788</a>
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-349467F9">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-349467F9</a>
+*/
+public final class hc_namednodemapsetnameditemthatexists extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public hc_namednodemapsetnameditemthatexists(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "hc_staff", true);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ NodeList elementList;
+ Attr newAttribute;
+ Node testAddress;
+ NamedNodeMap attributes;
+ Attr districtNode;
+ String attrValue;
+ Node setNode;
+ doc = (Document) load("hc_staff", true);
+ elementList = doc.getElementsByTagName("acronym");
+ testAddress = elementList.item(1);
+ newAttribute = doc.createAttribute("class");
+ attributes = testAddress.getAttributes();
+ setNode = attributes.setNamedItem(newAttribute);
+ districtNode = (Attr) attributes.getNamedItem("class");
+ attrValue = districtNode.getNodeValue();
+ assertEquals("namednodemapSetNamedItemThatExistsAssert", "", attrValue);
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_namednodemapsetnameditemthatexists";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(hc_namednodemapsetnameditemthatexists.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level1/core/hc_namednodemapsetnameditemwithnewvalue.java b/dom/src/test/java/org/w3c/domts/level1/core/hc_namednodemapsetnameditemwithnewvalue.java
new file mode 100644
index 0000000..28f25fd
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level1/core/hc_namednodemapsetnameditemwithnewvalue.java
@@ -0,0 +1,99 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+Copyright (c) 2001-2003 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+*/
+
+package org.w3c.domts.level1.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * If the "setNamedItem(arg)" method does not replace an
+ * existing node with the same name then it returns null.
+ *
+ * Retrieve the third employee and create a NamedNodeMap
+ * object from the attributes of the last child.
+ * Once the list is created the "setNamedItem(arg)" method
+ * is invoked with arg=newAttr, where newAttr is a
+ * newly created Attr Node and whose node name
+ * already exists in the map. The "setNamedItem(arg)"
+ * method should add the new node and return null.
+ * This test uses the "createAttribute(name)" method from
+ * the document interface.
+* @author Curt Arnold
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-1025163788">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-1025163788</a>
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-349467F9">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-349467F9</a>
+* @see <a href="http://www.w3.org/Bugs/Public/show_bug.cgi?id=243">http://www.w3.org/Bugs/Public/show_bug.cgi?id=243</a>
+*/
+public final class hc_namednodemapsetnameditemwithnewvalue extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public hc_namednodemapsetnameditemwithnewvalue(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "hc_staff", true);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ NodeList elementList;
+ Attr newAttribute;
+ Node testAddress;
+ NamedNodeMap attributes;
+ Node newNode;
+ doc = (Document) load("hc_staff", true);
+ elementList = doc.getElementsByTagName("acronym");
+ testAddress = elementList.item(2);
+ newAttribute = doc.createAttribute("lang");
+ attributes = testAddress.getAttributes();
+ newNode = attributes.setNamedItem(newAttribute);
+ assertNull("prevValueNull", newNode);
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_namednodemapsetnameditemwithnewvalue";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(hc_namednodemapsetnameditemwithnewvalue.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level1/core/hc_namednodemapwrongdocumenterr.java b/dom/src/test/java/org/w3c/domts/level1/core/hc_namednodemapwrongdocumenterr.java
new file mode 100644
index 0000000..cc4649d
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level1/core/hc_namednodemapwrongdocumenterr.java
@@ -0,0 +1,111 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+Copyright (c) 2001-2003 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+*/
+
+package org.w3c.domts.level1.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The "setNamedItem(arg)" method raises a
+ * WRONG_DOCUMENT_ERR DOMException if "arg" was created
+ * from a different document than the one that created
+ * the NamedNodeMap.
+ *
+ * Create a NamedNodeMap object from the attributes of the
+ * last child of the third employee and attempt to add
+ * another Attr node to it that was created from a
+ * different DOM document. This should raise the desired
+ * exception. This method uses the "createAttribute(name)"
+ * method from the Document interface.
+* @author Curt Arnold
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-258A00AF')/constant[@name='WRONG_DOCUMENT_ERR'])">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-258A00AF')/constant[@name='WRONG_DOCUMENT_ERR'])</a>
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-1025163788">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-1025163788</a>
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-1025163788')/raises/exception[@name='DOMException']/descr/p[substring-before(.,':')='WRONG_DOCUMENT_ERR'])">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-1025163788')/raises/exception[@name='DOMException']/descr/p[substring-before(.,':')='WRONG_DOCUMENT_ERR'])</a>
+* @see <a href="http://www.w3.org/Bugs/Public/show_bug.cgi?id=249">http://www.w3.org/Bugs/Public/show_bug.cgi?id=249</a>
+*/
+public final class hc_namednodemapwrongdocumenterr extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public hc_namednodemapwrongdocumenterr(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "hc_staff", true);
+ preload(contentType, "hc_staff", true);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc1;
+ Document doc2;
+ NodeList elementList;
+ Node testAddress;
+ NamedNodeMap attributes;
+ Node newAttribute;
+ String strong;
+ Node setNode;
+ doc1 = (Document) load("hc_staff", true);
+ doc2 = (Document) load("hc_staff", true);
+ elementList = doc1.getElementsByTagName("acronym");
+ testAddress = elementList.item(2);
+ newAttribute = doc2.createAttribute("newAttribute");
+ attributes = testAddress.getAttributes();
+
+ {
+ boolean success = false;
+ try {
+ setNode = attributes.setNamedItem(newAttribute);
+ } catch (DOMException ex) {
+ success = (ex.code == DOMException.WRONG_DOCUMENT_ERR);
+ }
+ assertTrue("throw_WRONG_DOCUMENT_ERR", success);
+ }
+}
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_namednodemapwrongdocumenterr";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(hc_namednodemapwrongdocumenterr.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level1/core/hc_nodeappendchild.java b/dom/src/test/java/org/w3c/domts/level1/core/hc_nodeappendchild.java
new file mode 100644
index 0000000..621f871
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level1/core/hc_nodeappendchild.java
@@ -0,0 +1,94 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+Copyright (c) 2001-2003 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+*/
+
+package org.w3c.domts.level1.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * Retrieve the second "p" and append a "br" Element
+ * node to the list of children. The last node in the list
+ * is then retrieved and its NodeName examined. The
+ * "getNodeName()" method should return "br".
+* @author Curt Arnold
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-184E7107">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-184E7107</a>
+* @see <a href="http://www.w3.org/Bugs/Public/show_bug.cgi?id=247">http://www.w3.org/Bugs/Public/show_bug.cgi?id=247</a>
+*/
+public final class hc_nodeappendchild extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public hc_nodeappendchild(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "hc_staff", true);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ NodeList elementList;
+ Node employeeNode;
+ NodeList childList;
+ Node createdNode;
+ Node lchild;
+ String childName;
+ Node appendedChild;
+ doc = (Document) load("hc_staff", true);
+ elementList = doc.getElementsByTagName("p");
+ employeeNode = elementList.item(1);
+ childList = employeeNode.getChildNodes();
+ createdNode = doc.createElement("br");
+ appendedChild = employeeNode.appendChild(createdNode);
+ lchild = employeeNode.getLastChild();
+ childName = lchild.getNodeName();
+ assertEqualsAutoCase("element", "nodeName", "br", childName);
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_nodeappendchild";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(hc_nodeappendchild.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level1/core/hc_nodeappendchildchildexists.java b/dom/src/test/java/org/w3c/domts/level1/core/hc_nodeappendchildchildexists.java
new file mode 100644
index 0000000..f837971
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level1/core/hc_nodeappendchildchildexists.java
@@ -0,0 +1,125 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+Copyright (c) 2001-2003 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+*/
+
+package org.w3c.domts.level1.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * If the "newChild" is already in the tree, it is first
+ * removed before the new one is appended.
+ *
+ * Retrieve the "em" second employee and
+ * append the first child to the end of the list. After
+ * the "appendChild(newChild)" method is invoked the first
+ * child should be the one that was second and the last
+ * child should be the one that was first.
+* @author Curt Arnold
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-184E7107">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-184E7107</a>
+* @see <a href="http://www.w3.org/Bugs/Public/show_bug.cgi?id=246">http://www.w3.org/Bugs/Public/show_bug.cgi?id=246</a>
+*/
+public final class hc_nodeappendchildchildexists extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public hc_nodeappendchildchildexists(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "hc_staff", true);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ NodeList elementList;
+ NodeList childList;
+ Node childNode;
+ Node newChild;
+ Node memberNode;
+ String memberName;
+ java.util.List refreshedActual = new java.util.ArrayList();
+
+ java.util.List actual = new java.util.ArrayList();
+
+ int nodeType;
+ java.util.List expected = new java.util.ArrayList();
+ expected.add("strong");
+ expected.add("code");
+ expected.add("sup");
+ expected.add("var");
+ expected.add("acronym");
+ expected.add("em");
+
+ Node appendedChild;
+ doc = (Document) load("hc_staff", true);
+ elementList = doc.getElementsByTagName("p");
+ childNode = elementList.item(1);
+ childList = ((Element) /*Node */childNode).getElementsByTagName("*");
+ newChild = childList.item(0);
+ appendedChild = childNode.appendChild(newChild);
+ for (int indexN10085 = 0; indexN10085 < childList.getLength(); indexN10085++) {
+ memberNode = (Node) childList.item(indexN10085);
+ memberName = memberNode.getNodeName();
+ actual.add(memberName);
+ }
+ assertEqualsAutoCase("element", "liveByTagName", expected, actual);
+ childList = childNode.getChildNodes();
+ for (int indexN1009C = 0; indexN1009C < childList.getLength(); indexN1009C++) {
+ memberNode = (Node) childList.item(indexN1009C);
+ nodeType = (int) memberNode.getNodeType();
+
+ if (equals(1, nodeType)) {
+ memberName = memberNode.getNodeName();
+ refreshedActual.add(memberName);
+ }
+ }
+ assertEqualsAutoCase("element", "refreshedChildNodes", expected, refreshedActual);
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_nodeappendchildchildexists";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(hc_nodeappendchildchildexists.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level1/core/hc_nodeappendchilddocfragment.java b/dom/src/test/java/org/w3c/domts/level1/core/hc_nodeappendchilddocfragment.java
new file mode 100644
index 0000000..690c1f0
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level1/core/hc_nodeappendchilddocfragment.java
@@ -0,0 +1,125 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+Copyright (c) 2001 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+*/
+
+package org.w3c.domts.level1.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * If the "newChild" is a DocumentFragment object then
+ * all its content is added to the child list of this node.
+ *
+ * Create and populate a new DocumentFragment object and
+ * append it to the second employee. After the
+ * "appendChild(newChild)" method is invoked retrieve the
+ * new nodes at the end of the list, they should be the
+ * two Element nodes from the DocumentFragment.
+* @author Curt Arnold
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-184E7107">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-184E7107</a>
+* @see <a href="http://www.w3.org/Bugs/Public/show_bug.cgi?id=246">http://www.w3.org/Bugs/Public/show_bug.cgi?id=246</a>
+* @see <a href="http://www.w3.org/Bugs/Public/show_bug.cgi?id=247">http://www.w3.org/Bugs/Public/show_bug.cgi?id=247</a>
+*/
+public final class hc_nodeappendchilddocfragment extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public hc_nodeappendchilddocfragment(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "hc_staff", true);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ NodeList elementList;
+ Node employeeNode;
+ NodeList childList;
+ DocumentFragment newdocFragment;
+ Node newChild1;
+ Node newChild2;
+ Node child;
+ String childName;
+ java.util.List result = new java.util.ArrayList();
+
+ Node appendedChild;
+ int nodeType;
+ java.util.List expected = new java.util.ArrayList();
+ expected.add("em");
+ expected.add("strong");
+ expected.add("code");
+ expected.add("sup");
+ expected.add("var");
+ expected.add("acronym");
+ expected.add("br");
+ expected.add("b");
+
+ doc = (Document) load("hc_staff", true);
+ elementList = doc.getElementsByTagName("p");
+ employeeNode = elementList.item(1);
+ childList = employeeNode.getChildNodes();
+ newdocFragment = doc.createDocumentFragment();
+ newChild1 = doc.createElement("br");
+ newChild2 = doc.createElement("b");
+ appendedChild = newdocFragment.appendChild(newChild1);
+ appendedChild = newdocFragment.appendChild(newChild2);
+ appendedChild = employeeNode.appendChild(newdocFragment);
+ for (int indexN100A2 = 0; indexN100A2 < childList.getLength(); indexN100A2++) {
+ child = (Node) childList.item(indexN100A2);
+ nodeType = (int) child.getNodeType();
+
+ if (equals(1, nodeType)) {
+ childName = child.getNodeName();
+ result.add(childName);
+ }
+ }
+ assertEqualsAutoCase("element", "nodeNames", expected, result);
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_nodeappendchilddocfragment";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(hc_nodeappendchilddocfragment.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level1/core/hc_nodeappendchildgetnodename.java b/dom/src/test/java/org/w3c/domts/level1/core/hc_nodeappendchildgetnodename.java
new file mode 100644
index 0000000..86cd3a3
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level1/core/hc_nodeappendchildgetnodename.java
@@ -0,0 +1,95 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+Copyright (c) 2001-2003 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+*/
+
+package org.w3c.domts.level1.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The "appendChild(newChild)" method returns the node
+ * added.
+ *
+ * Append a newly created node to the child list of the
+ * second employee and check the NodeName returned. The
+ * "getNodeName()" method should return "br".
+* @author Curt Arnold
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-F68D095">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-F68D095</a>
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-184E7107">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-184E7107</a>
+* @see <a href="http://www.w3.org/Bugs/Public/show_bug.cgi?id=247">http://www.w3.org/Bugs/Public/show_bug.cgi?id=247</a>
+*/
+public final class hc_nodeappendchildgetnodename extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public hc_nodeappendchildgetnodename(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "hc_staff", true);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ NodeList elementList;
+ Node employeeNode;
+ NodeList childList;
+ Node newChild;
+ Node appendNode;
+ String childName;
+ doc = (Document) load("hc_staff", true);
+ elementList = doc.getElementsByTagName("p");
+ employeeNode = elementList.item(1);
+ childList = employeeNode.getChildNodes();
+ newChild = doc.createElement("br");
+ appendNode = employeeNode.appendChild(newChild);
+ childName = appendNode.getNodeName();
+ assertEqualsAutoCase("element", "nodeName", "br", childName);
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_nodeappendchildgetnodename";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(hc_nodeappendchildgetnodename.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level1/core/hc_nodeappendchildinvalidnodetype.java b/dom/src/test/java/org/w3c/domts/level1/core/hc_nodeappendchildinvalidnodetype.java
new file mode 100644
index 0000000..12c804f
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level1/core/hc_nodeappendchildinvalidnodetype.java
@@ -0,0 +1,102 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+Copyright (c) 2001 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+*/
+
+package org.w3c.domts.level1.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The "appendChild(newChild)" method raises a
+ * HIERARCHY_REQUEST_ERR DOMException if this node is of
+ * a type that does not allow children of the type "newChild"
+ * to be inserted.
+ *
+ * Retrieve the root node and attempt to append a newly
+ * created Attr node. An Element node cannot have children
+ * of the "Attr" type, therefore the desired exception
+ * should be raised.
+* @author Curt Arnold
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-258A00AF')/constant[@name='HIERARCHY_REQUEST_ERR'])">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-258A00AF')/constant[@name='HIERARCHY_REQUEST_ERR'])</a>
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-184E7107">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-184E7107</a>
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-184E7107')/raises/exception[@name='DOMException']/descr/p[substring-before(.,':')='HIERARCHY_REQUEST_ERR'])">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-184E7107')/raises/exception[@name='DOMException']/descr/p[substring-before(.,':')='HIERARCHY_REQUEST_ERR'])</a>
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-184E7107">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-184E7107</a>
+* @see <a href="http://www.w3.org/Bugs/Public/show_bug.cgi?id=249">http://www.w3.org/Bugs/Public/show_bug.cgi?id=249</a>
+*/
+public final class hc_nodeappendchildinvalidnodetype extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public hc_nodeappendchildinvalidnodetype(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "hc_staff", true);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ Element rootNode;
+ Node newChild;
+ Node appendedChild;
+ doc = (Document) load("hc_staff", true);
+ rootNode = doc.getDocumentElement();
+ newChild = doc.createAttribute("newAttribute");
+
+ {
+ boolean success = false;
+ try {
+ appendedChild = rootNode.appendChild(newChild);
+ } catch (DOMException ex) {
+ success = (ex.code == DOMException.HIERARCHY_REQUEST_ERR);
+ }
+ assertTrue("throw_HIERARCHY_REQUEST_ERR", success);
+ }
+}
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_nodeappendchildinvalidnodetype";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(hc_nodeappendchildinvalidnodetype.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level1/core/hc_nodeappendchildnewchilddiffdocument.java b/dom/src/test/java/org/w3c/domts/level1/core/hc_nodeappendchildnewchilddiffdocument.java
new file mode 100644
index 0000000..cb9c363
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level1/core/hc_nodeappendchildnewchilddiffdocument.java
@@ -0,0 +1,107 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+Copyright (c) 2001-2003 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+*/
+
+package org.w3c.domts.level1.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The "appendChild(newChild)" method raises a
+ * WRONG_DOCUMENT_ERR DOMException if the "newChild" was
+ * created from a different document than the one that
+ * created this node.
+ *
+ * Retrieve the second employee and attempt to append
+ * a node created from a different document. An attempt
+ * to make such a replacement should raise the desired
+ * exception.
+* @author Curt Arnold
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-258A00AF')/constant[@name='NOT_FOUND_ERR'])">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-258A00AF')/constant[@name='NOT_FOUND_ERR'])</a>
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-184E7107">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-184E7107</a>
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-184E7107')/raises/exception[@name='DOMException']/descr/p[substring-before(.,':')='NOT_FOUND_ERR'])">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-184E7107')/raises/exception[@name='DOMException']/descr/p[substring-before(.,':')='NOT_FOUND_ERR'])</a>
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-184E7107">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-184E7107</a>
+* @see <a href="http://www.w3.org/Bugs/Public/show_bug.cgi?id=247">http://www.w3.org/Bugs/Public/show_bug.cgi?id=247</a>
+*/
+public final class hc_nodeappendchildnewchilddiffdocument extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public hc_nodeappendchildnewchilddiffdocument(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "hc_staff", false);
+ preload(contentType, "hc_staff", true);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc1;
+ Document doc2;
+ Node newChild;
+ NodeList elementList;
+ Node elementNode;
+ Node appendedChild;
+ doc1 = (Document) load("hc_staff", false);
+ doc2 = (Document) load("hc_staff", true);
+ newChild = doc1.createElement("br");
+ elementList = doc2.getElementsByTagName("p");
+ elementNode = elementList.item(1);
+
+ {
+ boolean success = false;
+ try {
+ appendedChild = elementNode.appendChild(newChild);
+ } catch (DOMException ex) {
+ success = (ex.code == DOMException.WRONG_DOCUMENT_ERR);
+ }
+ assertTrue("throw_WRONG_DOCUMENT_ERR", success);
+ }
+}
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_nodeappendchildnewchilddiffdocument";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(hc_nodeappendchildnewchilddiffdocument.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level1/core/hc_nodeappendchildnodeancestor.java b/dom/src/test/java/org/w3c/domts/level1/core/hc_nodeappendchildnodeancestor.java
new file mode 100644
index 0000000..b884bf9
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level1/core/hc_nodeappendchildnodeancestor.java
@@ -0,0 +1,104 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+Copyright (c) 2001 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+*/
+
+package org.w3c.domts.level1.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The "appendChild(newChild)" method raises a
+ * HIERARCHY_REQUEST_ERR DOMException if the node to
+ * append is one of this node's ancestors.
+ *
+ * Retrieve the second employee and attempt to append
+ * an ancestor node(root node) to it.
+ * An attempt to make such an addition should raise the
+ * desired exception.
+* @author Curt Arnold
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-258A00AF')/constant[@name='HIERARCHY_REQUEST_ERR'])">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-258A00AF')/constant[@name='HIERARCHY_REQUEST_ERR'])</a>
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-184E7107">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-184E7107</a>
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-184E7107')/raises/exception[@name='DOMException']/descr/p[substring-before(.,':')='HIERARCHY_REQUEST_ERR'])">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-184E7107')/raises/exception[@name='DOMException']/descr/p[substring-before(.,':')='HIERARCHY_REQUEST_ERR'])</a>
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-184E7107">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-184E7107</a>
+*/
+public final class hc_nodeappendchildnodeancestor extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public hc_nodeappendchildnodeancestor(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "hc_staff", true);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ Node newChild;
+ NodeList elementList;
+ Node employeeNode;
+ NodeList childList;
+ Node oldChild;
+ Node appendedChild;
+ doc = (Document) load("hc_staff", true);
+ newChild = doc.getDocumentElement();
+ elementList = doc.getElementsByTagName("p");
+ employeeNode = elementList.item(1);
+
+ {
+ boolean success = false;
+ try {
+ appendedChild = employeeNode.appendChild(newChild);
+ } catch (DOMException ex) {
+ success = (ex.code == DOMException.HIERARCHY_REQUEST_ERR);
+ }
+ assertTrue("throw_HIERARCHY_REQUEST_ERR", success);
+ }
+}
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_nodeappendchildnodeancestor";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(hc_nodeappendchildnodeancestor.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level1/core/hc_nodeattributenodeattribute.java b/dom/src/test/java/org/w3c/domts/level1/core/hc_nodeattributenodeattribute.java
new file mode 100644
index 0000000..12430b7
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level1/core/hc_nodeattributenodeattribute.java
@@ -0,0 +1,91 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+Copyright (c) 2001 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+*/
+
+package org.w3c.domts.level1.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The "getAttributes()" method invoked on an Attribute
+ * Node returns null.
+ * Retrieve the first attribute from the last child of the
+ * first employee and invoke the "getAttributes()" method
+ * on the Attribute Node. It should return null.
+* @author Curt Arnold
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-84CF096">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-84CF096</a>
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-637646024">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-637646024</a>
+*/
+public final class hc_nodeattributenodeattribute extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public hc_nodeattributenodeattribute(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "hc_staff", false);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ NodeList elementList;
+ Element testAddr;
+ NamedNodeMap addrAttr;
+ Node attrNode;
+ NamedNodeMap attrList;
+ doc = (Document) load("hc_staff", false);
+ elementList = doc.getElementsByTagName("acronym");
+ testAddr = (Element) elementList.item(0);
+ addrAttr = testAddr.getAttributes();
+ attrNode = addrAttr.item(0);
+ attrList = attrNode.getAttributes();
+ assertNull("nodeAttributeNodeAttributeAssert1", attrList);
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_nodeattributenodeattribute";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(hc_nodeattributenodeattribute.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level1/core/hc_nodeattributenodename.java b/dom/src/test/java/org/w3c/domts/level1/core/hc_nodeattributenodename.java
new file mode 100644
index 0000000..23ea3fd
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level1/core/hc_nodeattributenodename.java
@@ -0,0 +1,88 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+Copyright (c) 2001-2004 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+*/
+
+package org.w3c.domts.level1.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * Retrieve the Attribute named "title" from the last
+ * child of the first p element and check the string returned
+ * by the "getNodeName()" method. It should be equal to
+ * "title".
+* @author Curt Arnold
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-F68D095">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-F68D095</a>
+* @see <a href="http://www.w3.org/Bugs/Public/show_bug.cgi?id=236">http://www.w3.org/Bugs/Public/show_bug.cgi?id=236</a>
+*/
+public final class hc_nodeattributenodename extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public hc_nodeattributenodename(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "hc_staff", false);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ NodeList elementList;
+ Element testAddr;
+ Attr addrAttr;
+ String attrName;
+ doc = (Document) load("hc_staff", false);
+ elementList = doc.getElementsByTagName("acronym");
+ testAddr = (Element) elementList.item(0);
+ addrAttr = testAddr.getAttributeNode("title");
+ attrName = addrAttr.getNodeName();
+ assertEqualsAutoCase("attribute", "nodeName", "title", attrName);
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_nodeattributenodename";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(hc_nodeattributenodename.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level1/core/hc_nodeattributenodetype.java b/dom/src/test/java/org/w3c/domts/level1/core/hc_nodeattributenodetype.java
new file mode 100644
index 0000000..c3e53a7
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level1/core/hc_nodeattributenodetype.java
@@ -0,0 +1,89 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+Copyright (c) 2001 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+*/
+
+package org.w3c.domts.level1.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The "getNodeType()" method for an Attribute Node
+ * returns the constant value 2.
+ *
+ * Retrieve the first attribute from the last child of
+ * the first employee and invoke the "getNodeType()"
+ * method. The method should return 2.
+* @author Curt Arnold
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-111237558">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-111237558</a>
+*/
+public final class hc_nodeattributenodetype extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public hc_nodeattributenodetype(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "hc_staff", false);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ NodeList elementList;
+ Element testAddr;
+ Attr addrAttr;
+ int nodeType;
+ doc = (Document) load("hc_staff", false);
+ elementList = doc.getElementsByTagName("acronym");
+ testAddr = (Element) elementList.item(0);
+ addrAttr = testAddr.getAttributeNode("title");
+ nodeType = (int) addrAttr.getNodeType();
+ assertEquals("nodeAttrNodeTypeAssert1", 2, nodeType);
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_nodeattributenodetype";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(hc_nodeattributenodetype.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level1/core/hc_nodeattributenodevalue.java b/dom/src/test/java/org/w3c/domts/level1/core/hc_nodeattributenodevalue.java
new file mode 100644
index 0000000..8f78762
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level1/core/hc_nodeattributenodevalue.java
@@ -0,0 +1,90 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+Copyright (c) 2001 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+*/
+
+package org.w3c.domts.level1.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The string returned by the "getNodeValue()" method for an
+ * Attribute Node is the value of the Attribute.
+ *
+ * Retrieve the Attribute named "title" from the last
+ * child of the first "p" and check the string returned
+ * by the "getNodeValue()" method. It should be equal to
+ * "Yes".
+* @author Curt Arnold
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-F68D080">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-F68D080</a>
+*/
+public final class hc_nodeattributenodevalue extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public hc_nodeattributenodevalue(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "hc_staff", false);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ NodeList elementList;
+ Element testAddr;
+ Attr addrAttr;
+ String attrValue;
+ doc = (Document) load("hc_staff", false);
+ elementList = doc.getElementsByTagName("acronym");
+ testAddr = (Element) elementList.item(0);
+ addrAttr = testAddr.getAttributeNode("title");
+ attrValue = addrAttr.getNodeValue();
+ assertEquals("nodeValue", "Yes", attrValue);
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_nodeattributenodevalue";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(hc_nodeattributenodevalue.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level1/core/hc_nodechildnodes.java b/dom/src/test/java/org/w3c/domts/level1/core/hc_nodechildnodes.java
new file mode 100644
index 0000000..9b35bc9
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level1/core/hc_nodechildnodes.java
@@ -0,0 +1,114 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+Copyright (c) 2001-2003 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+*/
+
+package org.w3c.domts.level1.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ *
+ * The "getChildNodes()" method returns a NodeList
+ * that contains all children of this node.
+ *
+ * Retrieve the second employee and check the NodeList
+ * returned by the "getChildNodes()" method. The
+ * length of the list should be 13.
+* @author Curt Arnold
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-1451460987">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-1451460987</a>
+* @see <a href="http://www.w3.org/Bugs/Public/show_bug.cgi?id=246">http://www.w3.org/Bugs/Public/show_bug.cgi?id=246</a>
+*/
+public final class hc_nodechildnodes extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public hc_nodechildnodes(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "hc_staff", false);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ NodeList elementList;
+ Node employeeNode;
+ Node childNode;
+ NodeList childNodes;
+ int nodeType;
+ String childName;
+ java.util.List actual = new java.util.ArrayList();
+
+ java.util.List expected = new java.util.ArrayList();
+ expected.add("em");
+ expected.add("strong");
+ expected.add("code");
+ expected.add("sup");
+ expected.add("var");
+ expected.add("acronym");
+
+ doc = (Document) load("hc_staff", false);
+ elementList = doc.getElementsByTagName("p");
+ employeeNode = elementList.item(1);
+ childNodes = employeeNode.getChildNodes();
+ for (int indexN1006C = 0; indexN1006C < childNodes.getLength(); indexN1006C++) {
+ childNode = (Node) childNodes.item(indexN1006C);
+ nodeType = (int) childNode.getNodeType();
+ childName = childNode.getNodeName();
+
+ if (equals(1, nodeType)) {
+ actual.add(childName);
+ } else {
+ assertEquals("textNodeType", 3, nodeType);
+ }
+
+ }
+ assertEqualsAutoCase("element", "elementNames", expected, actual);
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_nodechildnodes";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(hc_nodechildnodes.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level1/core/hc_nodechildnodesappendchild.java b/dom/src/test/java/org/w3c/domts/level1/core/hc_nodechildnodesappendchild.java
new file mode 100644
index 0000000..40f1139
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level1/core/hc_nodechildnodesappendchild.java
@@ -0,0 +1,124 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+Copyright (c) 2001 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+*/
+
+package org.w3c.domts.level1.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The NodeList returned by the "getChildNodes()" method
+ * is live. Changes on the node's children are immediately
+ * reflected on the nodes returned in the NodeList.
+ *
+ * Create a NodeList of the children of the second employee
+ * and then add a newly created element that was created
+ * by the "createElement()" method(Document Interface) to
+ * the second employee by using the "appendChild()" method.
+ * The length of the NodeList should reflect this new
+ * addition to the child list. It should return the value 14.
+* @author Curt Arnold
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-1451460987">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-1451460987</a>
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-184E7107">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-184E7107</a>
+* @see <a href="http://www.w3.org/Bugs/Public/show_bug.cgi?id=246">http://www.w3.org/Bugs/Public/show_bug.cgi?id=246</a>
+* @see <a href="http://www.w3.org/Bugs/Public/show_bug.cgi?id=247">http://www.w3.org/Bugs/Public/show_bug.cgi?id=247</a>
+*/
+public final class hc_nodechildnodesappendchild extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public hc_nodechildnodesappendchild(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "hc_staff", true);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ NodeList elementList;
+ Node employeeNode;
+ NodeList childList;
+ Node createdNode;
+ Node childNode;
+ String childName;
+ int childType;
+ Node textNode;
+ java.util.List actual = new java.util.ArrayList();
+
+ java.util.List expected = new java.util.ArrayList();
+ expected.add("em");
+ expected.add("strong");
+ expected.add("code");
+ expected.add("sup");
+ expected.add("var");
+ expected.add("acronym");
+ expected.add("br");
+
+ doc = (Document) load("hc_staff", true);
+ elementList = doc.getElementsByTagName("p");
+ employeeNode = elementList.item(1);
+ childList = employeeNode.getChildNodes();
+ createdNode = doc.createElement("br");
+ employeeNode = employeeNode.appendChild(createdNode);
+ for (int indexN10087 = 0; indexN10087 < childList.getLength(); indexN10087++) {
+ childNode = (Node) childList.item(indexN10087);
+ childName = childNode.getNodeName();
+ childType = (int) childNode.getNodeType();
+
+ if (equals(1, childType)) {
+ actual.add(childName);
+ } else {
+ assertEquals("textNodeType", 3, childType);
+ }
+
+ }
+ assertEqualsAutoCase("element", "childElements", expected, actual);
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_nodechildnodesappendchild";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(hc_nodechildnodesappendchild.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level1/core/hc_nodechildnodesempty.java b/dom/src/test/java/org/w3c/domts/level1/core/hc_nodechildnodesempty.java
new file mode 100644
index 0000000..2533e25
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level1/core/hc_nodechildnodesempty.java
@@ -0,0 +1,93 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+Copyright (c) 2001-2003 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+*/
+
+package org.w3c.domts.level1.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The "getChildNodes()" method returns a NodeList
+ * that contains all children of this node. If there
+ * are not any children, this is a NodeList that does not
+ * contain any nodes.
+ * Retrieve the character data of the second "em" node and
+ * invoke the "getChildNodes()" method. The
+ * NodeList returned should not have any nodes.
+* @author Curt Arnold
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-1451460987">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-1451460987</a>
+* @see <a href="http://www.w3.org/Bugs/Public/show_bug.cgi?id=246">http://www.w3.org/Bugs/Public/show_bug.cgi?id=246</a>
+*/
+public final class hc_nodechildnodesempty extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public hc_nodechildnodesempty(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "hc_staff", false);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ NodeList elementList;
+ NodeList childList;
+ Node employeeNode;
+ Node textNode;
+ int length;
+ doc = (Document) load("hc_staff", false);
+ elementList = doc.getElementsByTagName("em");
+ employeeNode = elementList.item(1);
+ textNode = employeeNode.getFirstChild();
+ childList = textNode.getChildNodes();
+ length = (int) childList.getLength();
+ assertEquals("length_zero", 0, length);
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_nodechildnodesempty";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(hc_nodechildnodesempty.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level1/core/hc_nodecloneattributescopied.java b/dom/src/test/java/org/w3c/domts/level1/core/hc_nodecloneattributescopied.java
new file mode 100644
index 0000000..a101d2d
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level1/core/hc_nodecloneattributescopied.java
@@ -0,0 +1,113 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+Copyright (c) 2001-2004 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+*/
+
+package org.w3c.domts.level1.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * Retrieve the second acronym element and invoke
+ * the cloneNode method. The
+ * duplicate node returned by the method should copy the
+ * attributes associated with this node.
+* @author Curt Arnold
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-84CF096">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-84CF096</a>
+* @see <a href="http://www.w3.org/Bugs/Public/show_bug.cgi?id=236">http://www.w3.org/Bugs/Public/show_bug.cgi?id=236</a>
+* @see <a href="http://www.w3.org/Bugs/Public/show_bug.cgi?id=184">http://www.w3.org/Bugs/Public/show_bug.cgi?id=184</a>
+*/
+public final class hc_nodecloneattributescopied extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public hc_nodecloneattributescopied(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "hc_staff", true);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ NodeList elementList;
+ Node addressNode;
+ Node clonedNode;
+ NamedNodeMap attributes;
+ Node attributeNode;
+ String attributeName;
+ java.util.Collection result = new java.util.ArrayList();
+
+ java.util.Collection htmlExpected = new java.util.ArrayList();
+ htmlExpected.add("class");
+ htmlExpected.add("title");
+
+ java.util.Collection expected = new java.util.ArrayList();
+ expected.add("class");
+ expected.add("title");
+ expected.add("dir");
+
+ doc = (Document) load("hc_staff", true);
+ elementList = doc.getElementsByTagName("acronym");
+ addressNode = elementList.item(1);
+ clonedNode = addressNode.cloneNode(false);
+ attributes = clonedNode.getAttributes();
+ for (int indexN10076 = 0; indexN10076 < attributes.getLength(); indexN10076++) {
+ attributeNode = (Node) attributes.item(indexN10076);
+ attributeName = attributeNode.getNodeName();
+ result.add(attributeName);
+ }
+
+ if (("text/html".equals(getContentType()))) {
+ assertEqualsIgnoreCase("nodeNames_html", htmlExpected, result);
+} else {
+ assertEquals("nodeNames", expected, result);
+ }
+
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_nodecloneattributescopied";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(hc_nodecloneattributescopied.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level1/core/hc_nodeclonefalsenocopytext.java b/dom/src/test/java/org/w3c/domts/level1/core/hc_nodeclonefalsenocopytext.java
new file mode 100644
index 0000000..25da6aa
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level1/core/hc_nodeclonefalsenocopytext.java
@@ -0,0 +1,94 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+Copyright (c) 2001 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+*/
+
+package org.w3c.domts.level1.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The "cloneNode(deep)" method does not copy text unless it
+ * is deep cloned.(Test for deep=false)
+ *
+ * Retrieve the fourth child of the second employee and
+ * the "cloneNode(deep)" method with deep=false. The
+ * duplicate node returned by the method should not copy
+ * any text data contained in this node.
+* @author Curt Arnold
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-3A0ED0A4">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-3A0ED0A4</a>
+*/
+public final class hc_nodeclonefalsenocopytext extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public hc_nodeclonefalsenocopytext(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "hc_staff", true);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ NodeList elementList;
+ Node employeeNode;
+ NodeList childList;
+ Node childNode;
+ Node clonedNode;
+ Node lastChildNode;
+ doc = (Document) load("hc_staff", true);
+ elementList = doc.getElementsByTagName("p");
+ employeeNode = elementList.item(1);
+ childList = employeeNode.getChildNodes();
+ childNode = childList.item(3);
+ clonedNode = childNode.cloneNode(false);
+ lastChildNode = clonedNode.getLastChild();
+ assertNull("nodeCloneFalseNoCopyTextAssert1", lastChildNode);
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_nodeclonefalsenocopytext";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(hc_nodeclonefalsenocopytext.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level1/core/hc_nodeclonegetparentnull.java b/dom/src/test/java/org/w3c/domts/level1/core/hc_nodeclonegetparentnull.java
new file mode 100644
index 0000000..ee1b298
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level1/core/hc_nodeclonegetparentnull.java
@@ -0,0 +1,90 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+Copyright (c) 2001 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+*/
+
+package org.w3c.domts.level1.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The duplicate node returned by the "cloneNode(deep)"
+ * method does not have a ParentNode.
+ *
+ * Retrieve the second employee and invoke the
+ * "cloneNode(deep)" method with deep=false. The
+ * duplicate node returned should return null when the
+ * "getParentNode()" is invoked.
+* @author Curt Arnold
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-3A0ED0A4">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-3A0ED0A4</a>
+*/
+public final class hc_nodeclonegetparentnull extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public hc_nodeclonegetparentnull(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "hc_staff", true);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ NodeList elementList;
+ Node employeeNode;
+ Node clonedNode;
+ Node parentNode;
+ doc = (Document) load("hc_staff", true);
+ elementList = doc.getElementsByTagName("p");
+ employeeNode = elementList.item(1);
+ clonedNode = employeeNode.cloneNode(false);
+ parentNode = clonedNode.getParentNode();
+ assertNull("nodeCloneGetParentNullAssert1", parentNode);
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_nodeclonegetparentnull";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(hc_nodeclonegetparentnull.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level1/core/hc_nodeclonenodefalse.java b/dom/src/test/java/org/w3c/domts/level1/core/hc_nodeclonenodefalse.java
new file mode 100644
index 0000000..51e20b2
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level1/core/hc_nodeclonenodefalse.java
@@ -0,0 +1,97 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+Copyright (c) 2001 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+*/
+
+package org.w3c.domts.level1.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The "cloneNode(deep)" method returns a copy of the node
+ * only if deep=false.
+ *
+ * Retrieve the second employee and invoke the
+ * "cloneNode(deep)" method with deep=false. The
+ * method should only clone this node. The NodeName and
+ * length of the NodeList are checked. The "getNodeName()"
+ * method should return "employee" and the "getLength()"
+ * method should return 0.
+* @author Curt Arnold
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-3A0ED0A4">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-3A0ED0A4</a>
+*/
+public final class hc_nodeclonenodefalse extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public hc_nodeclonenodefalse(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "hc_staff", true);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ NodeList elementList;
+ Node employeeNode;
+ Node clonedNode;
+ String cloneName;
+ NodeList cloneChildren;
+ int length;
+ doc = (Document) load("hc_staff", true);
+ elementList = doc.getElementsByTagName("p");
+ employeeNode = elementList.item(1);
+ clonedNode = employeeNode.cloneNode(false);
+ cloneName = clonedNode.getNodeName();
+ assertEqualsAutoCase("element", "strong", "p", cloneName);
+ cloneChildren = clonedNode.getChildNodes();
+ length = (int) cloneChildren.getLength();
+ assertEquals("length", 0, length);
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_nodeclonenodefalse";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(hc_nodeclonenodefalse.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level1/core/hc_nodeclonenodetrue.java b/dom/src/test/java/org/w3c/domts/level1/core/hc_nodeclonenodetrue.java
new file mode 100644
index 0000000..69c0455
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level1/core/hc_nodeclonenodetrue.java
@@ -0,0 +1,113 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+Copyright (c) 2001-2003 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+*/
+
+package org.w3c.domts.level1.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The "cloneNode(deep)" method returns a copy of the node
+ * and the subtree under it if deep=true.
+ *
+ * Retrieve the second employee and invoke the
+ * "cloneNode(deep)" method with deep=true. The
+ * method should clone this node and the subtree under it.
+ * The NodeName of each child in the returned node is
+ * checked to insure the entire subtree under the second
+ * employee was cloned.
+* @author Curt Arnold
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-3A0ED0A4">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-3A0ED0A4</a>
+* @see <a href="http://www.w3.org/Bugs/Public/show_bug.cgi?id=246">http://www.w3.org/Bugs/Public/show_bug.cgi?id=246</a>
+*/
+public final class hc_nodeclonenodetrue extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public hc_nodeclonenodetrue(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "hc_staff", true);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ NodeList elementList;
+ Node employeeNode;
+ Node clonedNode;
+ NodeList clonedList;
+ Node clonedChild;
+ String clonedChildName;
+ NodeList origList;
+ Node origChild;
+ String origChildName;
+ java.util.List result = new java.util.ArrayList();
+
+ java.util.List expected = new java.util.ArrayList();
+
+ doc = (Document) load("hc_staff", true);
+ elementList = doc.getElementsByTagName("p");
+ employeeNode = elementList.item(1);
+ origList = employeeNode.getChildNodes();
+ for (int indexN10065 = 0; indexN10065 < origList.getLength(); indexN10065++) {
+ origChild = (Node) origList.item(indexN10065);
+ origChildName = origChild.getNodeName();
+ expected.add(origChildName);
+ }
+ clonedNode = employeeNode.cloneNode(true);
+ clonedList = clonedNode.getChildNodes();
+ for (int indexN1007B = 0; indexN1007B < clonedList.getLength(); indexN1007B++) {
+ clonedChild = (Node) clonedList.item(indexN1007B);
+ clonedChildName = clonedChild.getNodeName();
+ result.add(clonedChildName);
+ }
+ assertEquals("clone", expected, result);
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_nodeclonenodetrue";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(hc_nodeclonenodetrue.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level1/core/hc_nodeclonetruecopytext.java b/dom/src/test/java/org/w3c/domts/level1/core/hc_nodeclonetruecopytext.java
new file mode 100644
index 0000000..a79f82c
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level1/core/hc_nodeclonetruecopytext.java
@@ -0,0 +1,93 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+Copyright (c) 2001-2003 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+*/
+
+package org.w3c.domts.level1.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The "cloneNode(deep)" method does not copy text unless it
+ * is deep cloned.(Test for deep=true)
+ *
+ * Retrieve the eighth child of the second employee and
+ * the "cloneNode(deep)" method with deep=true. The
+ * duplicate node returned by the method should copy
+ * any text data contained in this node.
+* @author Curt Arnold
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-3A0ED0A4">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-3A0ED0A4</a>
+* @see <a href="http://www.w3.org/Bugs/Public/show_bug.cgi?id=246">http://www.w3.org/Bugs/Public/show_bug.cgi?id=246</a>
+*/
+public final class hc_nodeclonetruecopytext extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public hc_nodeclonetruecopytext(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "hc_staff", true);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ NodeList elementList;
+ Node childNode;
+ Node clonedNode;
+ Node lastChildNode;
+ String childValue;
+ doc = (Document) load("hc_staff", true);
+ elementList = doc.getElementsByTagName("sup");
+ childNode = elementList.item(1);
+ clonedNode = childNode.cloneNode(true);
+ lastChildNode = clonedNode.getLastChild();
+ childValue = lastChildNode.getNodeValue();
+ assertEquals("cloneContainsText", "35,000", childValue);
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_nodeclonetruecopytext";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(hc_nodeclonetruecopytext.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level1/core/hc_nodecommentnodeattributes.java b/dom/src/test/java/org/w3c/domts/level1/core/hc_nodecommentnodeattributes.java
new file mode 100644
index 0000000..0db3b83
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level1/core/hc_nodecommentnodeattributes.java
@@ -0,0 +1,100 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+Copyright (c) 2001-2003 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+*/
+
+package org.w3c.domts.level1.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The "getAttributes()" method invoked on a Comment
+ * Node returns null.
+ * Find any comment that is an immediate child of the root
+ * and assert that Node.attributes is null. Then create
+ * a new comment node (in case they had been omitted) and
+ * make the assertion.
+* @author Curt Arnold
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-84CF096">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-84CF096</a>
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-1728279322">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-1728279322</a>
+* @see <a href="http://www.w3.org/Bugs/Public/show_bug.cgi?id=248">http://www.w3.org/Bugs/Public/show_bug.cgi?id=248</a>
+* @see <a href="http://www.w3.org/Bugs/Public/show_bug.cgi?id=263">http://www.w3.org/Bugs/Public/show_bug.cgi?id=263</a>
+*/
+public final class hc_nodecommentnodeattributes extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public hc_nodecommentnodeattributes(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "hc_staff", false);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ Node commentNode;
+ NodeList nodeList;
+ NamedNodeMap attrList;
+ int nodeType;
+ doc = (Document) load("hc_staff", false);
+ nodeList = doc.getChildNodes();
+ for (int indexN10043 = 0; indexN10043 < nodeList.getLength(); indexN10043++) {
+ commentNode = (Node) nodeList.item(indexN10043);
+ nodeType = (int) commentNode.getNodeType();
+
+ if (equals(8, nodeType)) {
+ attrList = commentNode.getAttributes();
+ assertNull("existingCommentAttributesNull", attrList);
+ }
+ }
+ commentNode = doc.createComment("This is a comment");
+ attrList = commentNode.getAttributes();
+ assertNull("createdCommentAttributesNull", attrList);
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_nodecommentnodeattributes";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(hc_nodecommentnodeattributes.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level1/core/hc_nodecommentnodename.java b/dom/src/test/java/org/w3c/domts/level1/core/hc_nodecommentnodename.java
new file mode 100644
index 0000000..b2a7de1
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level1/core/hc_nodecommentnodename.java
@@ -0,0 +1,100 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+Copyright (c) 2001-2003 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+*/
+
+package org.w3c.domts.level1.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The string returned by the "getNodeName()" method for a
+ * Comment Node is "#comment".
+ *
+ * Retrieve the Comment node in the XML file
+ * and check the string returned by the "getNodeName()"
+ * method. It should be equal to "#comment".
+* @author Curt Arnold
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-F68D095">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-F68D095</a>
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-1728279322">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-1728279322</a>
+* @see <a href="http://www.w3.org/Bugs/Public/show_bug.cgi?id=248">http://www.w3.org/Bugs/Public/show_bug.cgi?id=248</a>
+*/
+public final class hc_nodecommentnodename extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public hc_nodecommentnodename(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "hc_staff", false);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ NodeList elementList;
+ Node commentNode;
+ int nodeType;
+ String commentName;
+ String commentNodeName;
+ doc = (Document) load("hc_staff", false);
+ elementList = doc.getChildNodes();
+ for (int indexN10044 = 0; indexN10044 < elementList.getLength(); indexN10044++) {
+ commentNode = (Node) elementList.item(indexN10044);
+ nodeType = (int) commentNode.getNodeType();
+
+ if (equals(8, nodeType)) {
+ commentNodeName = commentNode.getNodeName();
+ assertEquals("existingNodeName", "#comment", commentNodeName);
+ }
+ }
+ commentNode = doc.createComment("This is a comment");
+ commentNodeName = commentNode.getNodeName();
+ assertEquals("createdNodeName", "#comment", commentNodeName);
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_nodecommentnodename";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(hc_nodecommentnodename.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level1/core/hc_nodecommentnodetype.java b/dom/src/test/java/org/w3c/domts/level1/core/hc_nodecommentnodetype.java
new file mode 100644
index 0000000..bfae3e2
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level1/core/hc_nodecommentnodetype.java
@@ -0,0 +1,99 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+Copyright (c) 2001-2003 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+*/
+
+package org.w3c.domts.level1.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The "getNodeType()" method for a Comment Node
+ * returns the constant value 8.
+ *
+ * Retrieve the nodes from the document and check for
+ * a comment node and invoke the "getNodeType()" method. This should
+ * return 8.
+* @author Curt Arnold
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-111237558">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-111237558</a>
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-1728279322">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-1728279322</a>
+* @see <a href="http://www.w3.org/Bugs/Public/show_bug.cgi?id=248">http://www.w3.org/Bugs/Public/show_bug.cgi?id=248</a>
+*/
+public final class hc_nodecommentnodetype extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public hc_nodecommentnodetype(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "hc_staff", false);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ NodeList testList;
+ Node commentNode;
+ String commentNodeName;
+ int nodeType;
+ doc = (Document) load("hc_staff", false);
+ testList = doc.getChildNodes();
+ for (int indexN10040 = 0; indexN10040 < testList.getLength(); indexN10040++) {
+ commentNode = (Node) testList.item(indexN10040);
+ commentNodeName = commentNode.getNodeName();
+
+ if (equals("#comment", commentNodeName)) {
+ nodeType = (int) commentNode.getNodeType();
+ assertEquals("existingCommentNodeType", 8, nodeType);
+ }
+ }
+ commentNode = doc.createComment("This is a comment");
+ nodeType = (int) commentNode.getNodeType();
+ assertEquals("createdCommentNodeType", 8, nodeType);
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_nodecommentnodetype";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(hc_nodecommentnodetype.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level1/core/hc_nodecommentnodevalue.java b/dom/src/test/java/org/w3c/domts/level1/core/hc_nodecommentnodevalue.java
new file mode 100644
index 0000000..a42fae8
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level1/core/hc_nodecommentnodevalue.java
@@ -0,0 +1,99 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+Copyright (c) 2001-2003 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+*/
+
+package org.w3c.domts.level1.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The string returned by the "getNodeValue()" method for a
+ * Comment Node is the content of the comment.
+ *
+ * Retrieve the comment in the XML file and
+ * check the string returned by the "getNodeValue()" method.
+ * It should be equal to "This is comment number 1".
+* @author Curt Arnold
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-F68D080">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-F68D080</a>
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-1728279322">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-1728279322</a>
+* @see <a href="http://www.w3.org/Bugs/Public/show_bug.cgi?id=248">http://www.w3.org/Bugs/Public/show_bug.cgi?id=248</a>
+*/
+public final class hc_nodecommentnodevalue extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public hc_nodecommentnodevalue(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "hc_staff", false);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ NodeList elementList;
+ Node commentNode;
+ String commentName;
+ String commentValue;
+ doc = (Document) load("hc_staff", false);
+ elementList = doc.getChildNodes();
+ for (int indexN10040 = 0; indexN10040 < elementList.getLength(); indexN10040++) {
+ commentNode = (Node) elementList.item(indexN10040);
+ commentName = commentNode.getNodeName();
+
+ if (equals("#comment", commentName)) {
+ commentValue = commentNode.getNodeValue();
+ assertEquals("value", " This is comment number 1.", commentValue);
+ }
+ }
+ commentNode = doc.createComment(" This is a comment");
+ commentValue = commentNode.getNodeValue();
+ assertEquals("createdCommentNodeValue", " This is a comment", commentValue);
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_nodecommentnodevalue";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(hc_nodecommentnodevalue.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level1/core/hc_nodedocumentfragmentnodename.java b/dom/src/test/java/org/w3c/domts/level1/core/hc_nodedocumentfragmentnodename.java
new file mode 100644
index 0000000..cbbc83e
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level1/core/hc_nodedocumentfragmentnodename.java
@@ -0,0 +1,86 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+Copyright (c) 2001 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+*/
+
+package org.w3c.domts.level1.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The string returned by the "getNodeName()" method for a
+ * DocumentFragment Node is "#document-frament".
+ * Retrieve the DOM document and invoke the
+ * "createDocumentFragment()" method and check the string
+ * returned by the "getNodeName()" method. It should be
+ * equal to "#document-fragment".
+* @author Curt Arnold
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-F68D095">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-F68D095</a>
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-B63ED1A3">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-B63ED1A3</a>
+*/
+public final class hc_nodedocumentfragmentnodename extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public hc_nodedocumentfragmentnodename(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "hc_staff", true);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ DocumentFragment docFragment;
+ String documentFragmentName;
+ doc = (Document) load("hc_staff", true);
+ docFragment = doc.createDocumentFragment();
+ documentFragmentName = docFragment.getNodeName();
+ assertEquals("nodeDocumentFragmentNodeNameAssert1", "#document-fragment", documentFragmentName);
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_nodedocumentfragmentnodename";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(hc_nodedocumentfragmentnodename.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level1/core/hc_nodedocumentfragmentnodetype.java b/dom/src/test/java/org/w3c/domts/level1/core/hc_nodedocumentfragmentnodetype.java
new file mode 100644
index 0000000..e2afd65
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level1/core/hc_nodedocumentfragmentnodetype.java
@@ -0,0 +1,86 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+Copyright (c) 2001 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+*/
+
+package org.w3c.domts.level1.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The "getNodeType()" method for a DocumentFragment Node
+ * returns the constant value 11.
+ * Invoke the "createDocumentFragment()" method and
+ * examine the NodeType of the document fragment
+ * returned by the "getNodeType()" method. The method
+ * should return 11.
+* @author Curt Arnold
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-111237558">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-111237558</a>
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-B63ED1A3">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-B63ED1A3</a>
+*/
+public final class hc_nodedocumentfragmentnodetype extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public hc_nodedocumentfragmentnodetype(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "hc_staff", true);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ DocumentFragment documentFragmentNode;
+ int nodeType;
+ doc = (Document) load("hc_staff", true);
+ documentFragmentNode = doc.createDocumentFragment();
+ nodeType = (int) documentFragmentNode.getNodeType();
+ assertEquals("nodeDocumentFragmentNodeTypeAssert1", 11, nodeType);
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_nodedocumentfragmentnodetype";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(hc_nodedocumentfragmentnodetype.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level1/core/hc_nodedocumentfragmentnodevalue.java b/dom/src/test/java/org/w3c/domts/level1/core/hc_nodedocumentfragmentnodevalue.java
new file mode 100644
index 0000000..1eb42bc
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level1/core/hc_nodedocumentfragmentnodevalue.java
@@ -0,0 +1,92 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+Copyright (c) 2001 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+*/
+
+package org.w3c.domts.level1.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The string returned by the "getNodeValue()" method for a
+ * DocumentFragment Node is null.
+ *
+ * Retrieve the DOM document and invoke the
+ * "createDocumentFragment()" method and check the string
+ * returned by the "getNodeValue()" method. It should be
+ * equal to null.
+* @author Curt Arnold
+* @author Curt Arnold
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-B63ED1A3">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-B63ED1A3</a>
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-F68D080">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-F68D080</a>
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-84CF096">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-84CF096</a>
+*/
+public final class hc_nodedocumentfragmentnodevalue extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public hc_nodedocumentfragmentnodevalue(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "hc_staff", true);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ DocumentFragment docFragment;
+ NamedNodeMap attrList;
+ String value;
+ doc = (Document) load("hc_staff", true);
+ docFragment = doc.createDocumentFragment();
+ attrList = docFragment.getAttributes();
+ assertNull("attributesNull", attrList);
+ value = docFragment.getNodeValue();
+ assertNull("initiallyNull", value);
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_nodedocumentfragmentnodevalue";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(hc_nodedocumentfragmentnodevalue.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level1/core/hc_nodedocumentnodeattribute.java b/dom/src/test/java/org/w3c/domts/level1/core/hc_nodedocumentnodeattribute.java
new file mode 100644
index 0000000..1c09dcb
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level1/core/hc_nodedocumentnodeattribute.java
@@ -0,0 +1,83 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+Copyright (c) 2001 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+*/
+
+package org.w3c.domts.level1.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The "getAttributes()" method invoked on a Document
+ * Node returns null.
+ * Retrieve the DOM Document and invoke the
+ * "getAttributes()" method on the Document Node.
+ * It should return null.
+* @author Curt Arnold
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-84CF096">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-84CF096</a>
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#i-Document">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#i-Document</a>
+*/
+public final class hc_nodedocumentnodeattribute extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public hc_nodedocumentnodeattribute(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "hc_staff", false);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ NamedNodeMap attrList;
+ doc = (Document) load("hc_staff", false);
+ attrList = doc.getAttributes();
+ assertNull("doc_attributes_is_null", attrList);
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_nodedocumentnodeattribute";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(hc_nodedocumentnodeattribute.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level1/core/hc_nodedocumentnodename.java b/dom/src/test/java/org/w3c/domts/level1/core/hc_nodedocumentnodename.java
new file mode 100644
index 0000000..6fb18c6
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level1/core/hc_nodedocumentnodename.java
@@ -0,0 +1,83 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+Copyright (c) 2001-2004 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+*/
+
+package org.w3c.domts.level1.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The string returned by the "getNodeName()" method for a
+ * Document Node is "#document".
+ * Retrieve the DOM document and check the string returned
+ * by the "getNodeName()" method. It should be equal to
+ * "#document".
+* @author Curt Arnold
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#i-Document">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#i-Document</a>
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-F68D095">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-F68D095</a>
+*/
+public final class hc_nodedocumentnodename extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public hc_nodedocumentnodename(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "hc_staff", false);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ String documentName;
+ doc = (Document) load("hc_staff", false);
+ documentName = doc.getNodeName();
+ assertEquals("documentNodeName", "#document", documentName);
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_nodedocumentnodename";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(hc_nodedocumentnodename.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level1/core/hc_nodedocumentnodetype.java b/dom/src/test/java/org/w3c/domts/level1/core/hc_nodedocumentnodetype.java
new file mode 100644
index 0000000..6bc4d42
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level1/core/hc_nodedocumentnodetype.java
@@ -0,0 +1,82 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+Copyright (c) 2001 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+*/
+
+package org.w3c.domts.level1.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The "getNodeType()" method for a Document Node
+ * returns the constant value 9.
+ * Retrieve the document and invoke the "getNodeType()"
+ * method. The method should return 9.
+* @author Curt Arnold
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#i-Document">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#i-Document</a>
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-111237558">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-111237558</a>
+*/
+public final class hc_nodedocumentnodetype extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public hc_nodedocumentnodetype(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "hc_staff", false);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ int nodeType;
+ doc = (Document) load("hc_staff", false);
+ nodeType = (int) doc.getNodeType();
+ assertEquals("nodeDocumentNodeTypeAssert1", 9, nodeType);
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_nodedocumentnodetype";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(hc_nodedocumentnodetype.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level1/core/hc_nodedocumentnodevalue.java b/dom/src/test/java/org/w3c/domts/level1/core/hc_nodedocumentnodevalue.java
new file mode 100644
index 0000000..4f70dd2
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level1/core/hc_nodedocumentnodevalue.java
@@ -0,0 +1,83 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+Copyright (c) 2001 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+*/
+
+package org.w3c.domts.level1.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The string returned by the "getNodeValue()" method for a
+ * Document Node is null.
+ * Retrieve the DOM Document and check the string returned
+ * by the "getNodeValue()" method. It should be equal to
+ * null.
+* @author Curt Arnold
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#i-Document">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#i-Document</a>
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-F68D080">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-F68D080</a>
+*/
+public final class hc_nodedocumentnodevalue extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public hc_nodedocumentnodevalue(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "hc_staff", false);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ String documentValue;
+ doc = (Document) load("hc_staff", false);
+ documentValue = doc.getNodeValue();
+ assertNull("documentNodeValue", documentValue);
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_nodedocumentnodevalue";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(hc_nodedocumentnodevalue.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level1/core/hc_nodeelementnodeattributes.java b/dom/src/test/java/org/w3c/domts/level1/core/hc_nodeelementnodeattributes.java
new file mode 100644
index 0000000..634a780
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level1/core/hc_nodeelementnodeattributes.java
@@ -0,0 +1,109 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+Copyright (c) 2001-2004 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+*/
+
+package org.w3c.domts.level1.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * Retrieve the third "acronym" element and evaluate Node.attributes.
+* @author Curt Arnold
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-84CF096">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-84CF096</a>
+* @see <a href="http://www.w3.org/Bugs/Public/show_bug.cgi?id=236">http://www.w3.org/Bugs/Public/show_bug.cgi?id=236</a>
+* @see <a href="http://lists.w3.org/Archives/Public/www-dom-ts/2003Jun/0011.html">http://lists.w3.org/Archives/Public/www-dom-ts/2003Jun/0011.html</a>
+* @see <a href="http://www.w3.org/Bugs/Public/show_bug.cgi?id=184">http://www.w3.org/Bugs/Public/show_bug.cgi?id=184</a>
+*/
+public final class hc_nodeelementnodeattributes extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public hc_nodeelementnodeattributes(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "hc_staff", false);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ NodeList elementList;
+ Element testAddr;
+ NamedNodeMap addrAttr;
+ Node attrNode;
+ String attrName;
+ java.util.Collection attrList = new java.util.ArrayList();
+
+ java.util.Collection htmlExpected = new java.util.ArrayList();
+ htmlExpected.add("title");
+ htmlExpected.add("class");
+
+ java.util.Collection expected = new java.util.ArrayList();
+ expected.add("title");
+ expected.add("class");
+ expected.add("dir");
+
+ doc = (Document) load("hc_staff", false);
+ elementList = doc.getElementsByTagName("acronym");
+ testAddr = (Element) elementList.item(2);
+ addrAttr = testAddr.getAttributes();
+ for (int indexN10070 = 0; indexN10070 < addrAttr.getLength(); indexN10070++) {
+ attrNode = (Node) addrAttr.item(indexN10070);
+ attrName = attrNode.getNodeName();
+ attrList.add(attrName);
+ }
+
+ if (("text/html".equals(getContentType()))) {
+ assertEqualsIgnoreCase("attrNames_html", htmlExpected, attrList);
+} else {
+ assertEquals("attrNames", expected, attrList);
+ }
+
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_nodeelementnodeattributes";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(hc_nodeelementnodeattributes.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level1/core/hc_nodeelementnodename.java b/dom/src/test/java/org/w3c/domts/level1/core/hc_nodeelementnodename.java
new file mode 100644
index 0000000..f66808a
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level1/core/hc_nodeelementnodename.java
@@ -0,0 +1,90 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+Copyright (c) 2001-2004 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+*/
+
+package org.w3c.domts.level1.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * Retrieve the first Element Node(Root Node) of the
+ * DOM object and check the string returned by the
+ * "getNodeName()" method. It should be equal to its
+ * tagName.
+* @author Curt Arnold
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-F68D095">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-F68D095</a>
+* @see <a href="http://www.w3.org/Bugs/Public/show_bug.cgi?id=251">http://www.w3.org/Bugs/Public/show_bug.cgi?id=251</a>
+*/
+public final class hc_nodeelementnodename extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public hc_nodeelementnodename(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "hc_staff", false);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ Element elementNode;
+ String elementName;
+ doc = (Document) load("hc_staff", false);
+ elementNode = doc.getDocumentElement();
+ elementName = elementNode.getNodeName();
+
+ if (("image/svg+xml".equals(getContentType()))) {
+ assertEquals("svgNodeName", "svg", elementName);
+ } else {
+ assertEqualsAutoCase("element", "nodeName", "html", elementName);
+ }
+
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_nodeelementnodename";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(hc_nodeelementnodename.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level1/core/hc_nodeelementnodetype.java b/dom/src/test/java/org/w3c/domts/level1/core/hc_nodeelementnodetype.java
new file mode 100644
index 0000000..cbefdca
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level1/core/hc_nodeelementnodetype.java
@@ -0,0 +1,84 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+Copyright (c) 2001 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+*/
+
+package org.w3c.domts.level1.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The "getNodeType()" method for an Element Node
+ * returns the constant value 1.
+ *
+ * Retrieve the root node and invoke the "getNodeType()"
+ * method. The method should return 1.
+* @author Curt Arnold
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-111237558">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-111237558</a>
+*/
+public final class hc_nodeelementnodetype extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public hc_nodeelementnodetype(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "hc_staff", false);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ Element rootNode;
+ int nodeType;
+ doc = (Document) load("hc_staff", false);
+ rootNode = doc.getDocumentElement();
+ nodeType = (int) rootNode.getNodeType();
+ assertEquals("nodeElementNodeTypeAssert1", 1, nodeType);
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_nodeelementnodetype";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(hc_nodeelementnodetype.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level1/core/hc_nodeelementnodevalue.java b/dom/src/test/java/org/w3c/domts/level1/core/hc_nodeelementnodevalue.java
new file mode 100644
index 0000000..b4cd515
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level1/core/hc_nodeelementnodevalue.java
@@ -0,0 +1,81 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+Copyright (c) 2001-2004 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+*/
+
+package org.w3c.domts.level1.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The string returned by the "getNodeValue()" method for an
+ * Element Node is null.
+* @author Curt Arnold
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-F68D080">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-F68D080</a>
+*/
+public final class hc_nodeelementnodevalue extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public hc_nodeelementnodevalue(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "hc_staff", false);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ Element elementNode;
+ String elementValue;
+ doc = (Document) load("hc_staff", false);
+ elementNode = doc.getDocumentElement();
+ elementValue = elementNode.getNodeValue();
+ assertNull("elementNodeValue", elementValue);
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_nodeelementnodevalue";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(hc_nodeelementnodevalue.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level1/core/hc_nodegetfirstchild.java b/dom/src/test/java/org/w3c/domts/level1/core/hc_nodegetfirstchild.java
new file mode 100644
index 0000000..29e6419
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level1/core/hc_nodegetfirstchild.java
@@ -0,0 +1,97 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+Copyright (c) 2001-2003 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+*/
+
+package org.w3c.domts.level1.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The "getFirstChild()" method returns the first child
+ * of this node.
+ *
+ * Retrieve the second employee and invoke the
+ * "getFirstChild()" method. The NodeName returned
+ * should be "#text" or "EM".
+* @author Curt Arnold
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-169727388">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-169727388</a>
+* @see <a href="http://www.w3.org/Bugs/Public/show_bug.cgi?id=246">http://www.w3.org/Bugs/Public/show_bug.cgi?id=246</a>
+*/
+public final class hc_nodegetfirstchild extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public hc_nodegetfirstchild(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "hc_staff", false);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ NodeList elementList;
+ Node employeeNode;
+ Node fchildNode;
+ String childName;
+ int nodeType;
+ doc = (Document) load("hc_staff", false);
+ elementList = doc.getElementsByTagName("p");
+ employeeNode = elementList.item(1);
+ fchildNode = employeeNode.getFirstChild();
+ childName = fchildNode.getNodeName();
+
+ if (equals("#text", childName)) {
+ assertEquals("firstChild_w_whitespace", "#text", childName);
+ } else {
+ assertEqualsAutoCase("element", "firstChild_wo_whitespace", "em", childName);
+ }
+
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_nodegetfirstchild";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(hc_nodegetfirstchild.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level1/core/hc_nodegetfirstchildnull.java b/dom/src/test/java/org/w3c/domts/level1/core/hc_nodegetfirstchildnull.java
new file mode 100644
index 0000000..1b6b5b1
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level1/core/hc_nodegetfirstchildnull.java
@@ -0,0 +1,88 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+Copyright (c) 2001-2003 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+*/
+
+package org.w3c.domts.level1.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * If there is not a first child then the "getFirstChild()"
+ * method returns null.
+ * Retrieve the text of the first "em" element and invoke the "getFirstChild()" method. It
+ * should return null.
+* @author Curt Arnold
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-169727388">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-169727388</a>
+* @see <a href="http://www.w3.org/Bugs/Public/show_bug.cgi?id=246">http://www.w3.org/Bugs/Public/show_bug.cgi?id=246</a>
+*/
+public final class hc_nodegetfirstchildnull extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public hc_nodegetfirstchildnull(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "hc_staff", false);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ NodeList emList;
+ Node emNode;
+ CharacterData emText;
+ Node nullChild;
+ doc = (Document) load("hc_staff", false);
+ emList = doc.getElementsByTagName("em");
+ emNode = emList.item(0);
+ emText = (CharacterData) emNode.getFirstChild();
+ nullChild = emText.getFirstChild();
+ assertNull("nullChild", nullChild);
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_nodegetfirstchildnull";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(hc_nodegetfirstchildnull.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level1/core/hc_nodegetlastchild.java b/dom/src/test/java/org/w3c/domts/level1/core/hc_nodegetlastchild.java
new file mode 100644
index 0000000..ea5dcd3
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level1/core/hc_nodegetlastchild.java
@@ -0,0 +1,89 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+Copyright (c) 2001 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+*/
+
+package org.w3c.domts.level1.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The "getLastChild()" method returns the last child
+ * of this node.
+ *
+ * Retrieve the second employee and invoke the
+ * "getLastChild()" method. The NodeName returned
+ * should be "#text".
+* @author Curt Arnold
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-61AD09FB">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-61AD09FB</a>
+*/
+public final class hc_nodegetlastchild extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public hc_nodegetlastchild(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "hc_staff", false);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ NodeList elementList;
+ Node employeeNode;
+ Node lchildNode;
+ String childName;
+ doc = (Document) load("hc_staff", false);
+ elementList = doc.getElementsByTagName("p");
+ employeeNode = elementList.item(1);
+ lchildNode = employeeNode.getLastChild();
+ childName = lchildNode.getNodeName();
+ assertEquals("whitespace", "#text", childName);
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_nodegetlastchild";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(hc_nodegetlastchild.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level1/core/hc_nodegetlastchildnull.java b/dom/src/test/java/org/w3c/domts/level1/core/hc_nodegetlastchildnull.java
new file mode 100644
index 0000000..02a6b0a
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level1/core/hc_nodegetlastchildnull.java
@@ -0,0 +1,88 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+Copyright (c) 2001-2003 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+*/
+
+package org.w3c.domts.level1.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * If there is not a last child then the "getLastChild()"
+ * method returns null.
+ * Retrieve the text of the first "em" element and invoke the "getFirstChild()" method. It
+ * should return null.
+* @author Curt Arnold
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-61AD09FB">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-61AD09FB</a>
+* @see <a href="http://www.w3.org/Bugs/Public/show_bug.cgi?id=246">http://www.w3.org/Bugs/Public/show_bug.cgi?id=246</a>
+*/
+public final class hc_nodegetlastchildnull extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public hc_nodegetlastchildnull(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "hc_staff", false);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ NodeList emList;
+ Node emNode;
+ CharacterData emText;
+ Node nullChild;
+ doc = (Document) load("hc_staff", false);
+ emList = doc.getElementsByTagName("em");
+ emNode = emList.item(0);
+ emText = (CharacterData) emNode.getFirstChild();
+ nullChild = emText.getLastChild();
+ assertNull("nullChild", nullChild);
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_nodegetlastchildnull";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(hc_nodegetlastchildnull.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level1/core/hc_nodegetnextsibling.java b/dom/src/test/java/org/w3c/domts/level1/core/hc_nodegetnextsibling.java
new file mode 100644
index 0000000..45b87f2
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level1/core/hc_nodegetnextsibling.java
@@ -0,0 +1,89 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+Copyright (c) 2001 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+*/
+
+package org.w3c.domts.level1.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The "getNextSibling()" method returns the node immediately
+ * following this node.
+ *
+ * Retrieve the first child of the second employee and
+ * invoke the "getNextSibling()" method. It should return
+ * a node with the NodeName of "#text".
+* @author Curt Arnold
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-6AC54C2F">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-6AC54C2F</a>
+*/
+public final class hc_nodegetnextsibling extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public hc_nodegetnextsibling(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "hc_staff", false);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ NodeList elementList;
+ Node emNode;
+ Node nsNode;
+ String nsName;
+ doc = (Document) load("hc_staff", false);
+ elementList = doc.getElementsByTagName("em");
+ emNode = elementList.item(1);
+ nsNode = emNode.getNextSibling();
+ nsName = nsNode.getNodeName();
+ assertEquals("whitespace", "#text", nsName);
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_nodegetnextsibling";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(hc_nodegetnextsibling.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level1/core/hc_nodegetnextsiblingnull.java b/dom/src/test/java/org/w3c/domts/level1/core/hc_nodegetnextsiblingnull.java
new file mode 100644
index 0000000..94701f2
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level1/core/hc_nodegetnextsiblingnull.java
@@ -0,0 +1,89 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+Copyright (c) 2001 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+*/
+
+package org.w3c.domts.level1.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * If there is not a node immediately following this node the
+ * "getNextSibling()" method returns null.
+ *
+ * Retrieve the first child of the second employee and
+ * invoke the "getNextSibling()" method. It should
+ * be set to null.
+* @author Curt Arnold
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-6AC54C2F">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-6AC54C2F</a>
+*/
+public final class hc_nodegetnextsiblingnull extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public hc_nodegetnextsiblingnull(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "hc_staff", false);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ NodeList elementList;
+ Node employeeNode;
+ Node lcNode;
+ Node nsNode;
+ doc = (Document) load("hc_staff", false);
+ elementList = doc.getElementsByTagName("p");
+ employeeNode = elementList.item(1);
+ lcNode = employeeNode.getLastChild();
+ nsNode = lcNode.getNextSibling();
+ assertNull("nodeGetNextSiblingNullAssert1", nsNode);
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_nodegetnextsiblingnull";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(hc_nodegetnextsiblingnull.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level1/core/hc_nodegetownerdocument.java b/dom/src/test/java/org/w3c/domts/level1/core/hc_nodegetownerdocument.java
new file mode 100644
index 0000000..309cfd9
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level1/core/hc_nodegetownerdocument.java
@@ -0,0 +1,93 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+Copyright (c) 2001-2004 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+*/
+
+package org.w3c.domts.level1.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * Evaluate Node.ownerDocument on the second "p" element.
+* @author Curt Arnold
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#node-ownerDoc">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#node-ownerDoc</a>
+* @see <a href="http://www.w3.org/Bugs/Public/show_bug.cgi?id=251">http://www.w3.org/Bugs/Public/show_bug.cgi?id=251</a>
+*/
+public final class hc_nodegetownerdocument extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public hc_nodegetownerdocument(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "hc_staff", false);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ NodeList elementList;
+ Node docNode;
+ Document ownerDocument;
+ Element docElement;
+ String elementName;
+ doc = (Document) load("hc_staff", false);
+ elementList = doc.getElementsByTagName("p");
+ docNode = elementList.item(1);
+ ownerDocument = docNode.getOwnerDocument();
+ docElement = ownerDocument.getDocumentElement();
+ elementName = docElement.getNodeName();
+
+ if (("image/svg+xml".equals(getContentType()))) {
+ assertEquals("svgNodeName", "svg", elementName);
+ } else {
+ assertEqualsAutoCase("element", "ownerDocElemTagName", "html", elementName);
+ }
+
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_nodegetownerdocument";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(hc_nodegetownerdocument.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level1/core/hc_nodegetownerdocumentnull.java b/dom/src/test/java/org/w3c/domts/level1/core/hc_nodegetownerdocumentnull.java
new file mode 100644
index 0000000..df1f508
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level1/core/hc_nodegetownerdocumentnull.java
@@ -0,0 +1,82 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+Copyright (c) 2001 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+*/
+
+package org.w3c.domts.level1.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The "getOwnerDocument()" method returns null if the target
+ * node itself is a document.
+ *
+ * Invoke the "getOwnerDocument()" method on the master
+ * document. The Document returned should be null.
+* @author Curt Arnold
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#node-ownerDoc">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#node-ownerDoc</a>
+*/
+public final class hc_nodegetownerdocumentnull extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public hc_nodegetownerdocumentnull(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "hc_staff", false);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ Document ownerDocument;
+ doc = (Document) load("hc_staff", false);
+ ownerDocument = doc.getOwnerDocument();
+ assertNull("nodeGetOwnerDocumentNullAssert1", ownerDocument);
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_nodegetownerdocumentnull";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(hc_nodegetownerdocumentnull.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level1/core/hc_nodegetprevioussibling.java b/dom/src/test/java/org/w3c/domts/level1/core/hc_nodegetprevioussibling.java
new file mode 100644
index 0000000..a0adc5f
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level1/core/hc_nodegetprevioussibling.java
@@ -0,0 +1,89 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+Copyright (c) 2001 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+*/
+
+package org.w3c.domts.level1.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The "getPreviousSibling()" method returns the node
+ * immediately preceding this node.
+ *
+ * Retrieve the second child of the second employee and
+ * invoke the "getPreviousSibling()" method. It should
+ * return a node with a NodeName of "#text".
+* @author Curt Arnold
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-640FB3C8">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-640FB3C8</a>
+*/
+public final class hc_nodegetprevioussibling extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public hc_nodegetprevioussibling(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "hc_staff", false);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ NodeList elementList;
+ Node nameNode;
+ Node psNode;
+ String psName;
+ doc = (Document) load("hc_staff", false);
+ elementList = doc.getElementsByTagName("strong");
+ nameNode = elementList.item(1);
+ psNode = nameNode.getPreviousSibling();
+ psName = psNode.getNodeName();
+ assertEquals("whitespace", "#text", psName);
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_nodegetprevioussibling";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(hc_nodegetprevioussibling.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level1/core/hc_nodegetprevioussiblingnull.java b/dom/src/test/java/org/w3c/domts/level1/core/hc_nodegetprevioussiblingnull.java
new file mode 100644
index 0000000..565d41e
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level1/core/hc_nodegetprevioussiblingnull.java
@@ -0,0 +1,89 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+Copyright (c) 2001 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+*/
+
+package org.w3c.domts.level1.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * If there is not a node immediately preceding this node the
+ * "getPreviousSibling()" method returns null.
+ *
+ * Retrieve the first child of the second employee and
+ * invoke the "getPreviousSibling()" method. It should
+ * be set to null.
+* @author Curt Arnold
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-640FB3C8">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-640FB3C8</a>
+*/
+public final class hc_nodegetprevioussiblingnull extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public hc_nodegetprevioussiblingnull(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "hc_staff", false);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ NodeList elementList;
+ Node employeeNode;
+ Node fcNode;
+ Node psNode;
+ doc = (Document) load("hc_staff", false);
+ elementList = doc.getElementsByTagName("p");
+ employeeNode = elementList.item(2);
+ fcNode = employeeNode.getFirstChild();
+ psNode = fcNode.getPreviousSibling();
+ assertNull("nodeGetPreviousSiblingNullAssert1", psNode);
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_nodegetprevioussiblingnull";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(hc_nodegetprevioussiblingnull.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level1/core/hc_nodehaschildnodes.java b/dom/src/test/java/org/w3c/domts/level1/core/hc_nodehaschildnodes.java
new file mode 100644
index 0000000..1d8bcf8
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level1/core/hc_nodehaschildnodes.java
@@ -0,0 +1,87 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+Copyright (c) 2001 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+*/
+
+package org.w3c.domts.level1.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The "hasChildNodes()" method returns true if the node
+ * has children.
+ *
+ * Retrieve the root node("staff") and invoke the
+ * "hasChildNodes()" method. It should return the boolean
+ * value "true".
+* @author Curt Arnold
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-810594187">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-810594187</a>
+*/
+public final class hc_nodehaschildnodes extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public hc_nodehaschildnodes(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "hc_staff", false);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ NodeList elementList;
+ Node employeeNode;
+ boolean state;
+ doc = (Document) load("hc_staff", false);
+ elementList = doc.getElementsByTagName("p");
+ employeeNode = elementList.item(1);
+ state = employeeNode.hasChildNodes();
+ assertTrue("nodeHasChildAssert1", state);
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_nodehaschildnodes";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(hc_nodehaschildnodes.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level1/core/hc_nodehaschildnodesfalse.java b/dom/src/test/java/org/w3c/domts/level1/core/hc_nodehaschildnodesfalse.java
new file mode 100644
index 0000000..fc19f6b
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level1/core/hc_nodehaschildnodesfalse.java
@@ -0,0 +1,90 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+Copyright (c) 2001-2003 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+*/
+
+package org.w3c.domts.level1.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The "hasChildNodes()" method returns false if the node
+ * does not have any children.
+ *
+ * Retrieve the text of the first "em" element and invoke the "hasChildNodes()" method. It
+ * should return false.
+* @author Curt Arnold
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-1451460987">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-1451460987</a>
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-810594187">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-810594187</a>
+* @see <a href="http://www.w3.org/Bugs/Public/show_bug.cgi?id=246">http://www.w3.org/Bugs/Public/show_bug.cgi?id=246</a>
+*/
+public final class hc_nodehaschildnodesfalse extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public hc_nodehaschildnodesfalse(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "hc_staff", false);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ NodeList emList;
+ Node emNode;
+ CharacterData emText;
+ boolean hasChild;
+ doc = (Document) load("hc_staff", false);
+ emList = doc.getElementsByTagName("em");
+ emNode = emList.item(0);
+ emText = (CharacterData) emNode.getFirstChild();
+ hasChild = emText.hasChildNodes();
+ assertFalse("hasChild", hasChild);
+}
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_nodehaschildnodesfalse";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(hc_nodehaschildnodesfalse.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level1/core/hc_nodeinsertbefore.java b/dom/src/test/java/org/w3c/domts/level1/core/hc_nodeinsertbefore.java
new file mode 100644
index 0000000..5962f7b
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level1/core/hc_nodeinsertbefore.java
@@ -0,0 +1,119 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+Copyright (c) 2001-2003 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+*/
+
+package org.w3c.domts.level1.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The "insertBefore(newChild,refChild)" method inserts the
+ * node "newChild" before the node "refChild".
+ *
+ * Insert a newly created Element node before the second
+ * sup element in the document and check the "newChild"
+ * and "refChild" after insertion for correct placement.
+* @author Curt Arnold
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-952280727">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-952280727</a>
+* @see <a href="http://www.w3.org/Bugs/Public/show_bug.cgi?id=246">http://www.w3.org/Bugs/Public/show_bug.cgi?id=246</a>
+* @see <a href="http://www.w3.org/Bugs/Public/show_bug.cgi?id=247">http://www.w3.org/Bugs/Public/show_bug.cgi?id=247</a>
+* @see <a href="http://www.w3.org/Bugs/Public/show_bug.cgi?id=261">http://www.w3.org/Bugs/Public/show_bug.cgi?id=261</a>
+*/
+public final class hc_nodeinsertbefore extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public hc_nodeinsertbefore(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "hc_staff", true);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ NodeList elementList;
+ Node employeeNode;
+ NodeList childList;
+ Node refChild;
+ Node newChild;
+ Node child;
+ String childName;
+ Node insertedNode;
+ java.util.List actual = new java.util.ArrayList();
+
+ java.util.List expected = new java.util.ArrayList();
+ expected.add("em");
+ expected.add("strong");
+ expected.add("code");
+ expected.add("br");
+ expected.add("sup");
+ expected.add("var");
+ expected.add("acronym");
+
+ int nodeType;
+ doc = (Document) load("hc_staff", true);
+ elementList = doc.getElementsByTagName("sup");
+ refChild = elementList.item(2);
+ employeeNode = refChild.getParentNode();
+ childList = employeeNode.getChildNodes();
+ newChild = doc.createElement("br");
+ insertedNode = employeeNode.insertBefore(newChild, refChild);
+ for (int indexN10091 = 0; indexN10091 < childList.getLength(); indexN10091++) {
+ child = (Node) childList.item(indexN10091);
+ nodeType = (int) child.getNodeType();
+
+ if (equals(1, nodeType)) {
+ childName = child.getNodeName();
+ actual.add(childName);
+ }
+ }
+ assertEqualsAutoCase("element", "nodeNames", expected, actual);
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_nodeinsertbefore";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(hc_nodeinsertbefore.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level1/core/hc_nodeinsertbeforedocfragment.java b/dom/src/test/java/org/w3c/domts/level1/core/hc_nodeinsertbeforedocfragment.java
new file mode 100644
index 0000000..a5fb102
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level1/core/hc_nodeinsertbeforedocfragment.java
@@ -0,0 +1,112 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+Copyright (c) 2001-2003 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+*/
+
+package org.w3c.domts.level1.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * If the "newChild" is a DocumentFragment object then all
+ * its children are inserted in the same order before the
+ * the "refChild".
+ *
+ * Create a DocumentFragment object and populate it with
+ * two Element nodes. Retrieve the second employee and
+ * insert the newly created DocumentFragment before its
+ * fourth child. The second employee should now have two
+ * extra children("newChild1" and "newChild2") at
+ * positions fourth and fifth respectively.
+* @author Curt Arnold
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-952280727">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-952280727</a>
+* @see <a href="http://www.w3.org/Bugs/Public/show_bug.cgi?id=247">http://www.w3.org/Bugs/Public/show_bug.cgi?id=247</a>
+*/
+public final class hc_nodeinsertbeforedocfragment extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public hc_nodeinsertbeforedocfragment(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "hc_staff", true);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ NodeList elementList;
+ Node employeeNode;
+ NodeList childList;
+ Node refChild;
+ DocumentFragment newdocFragment;
+ Node newChild1;
+ Node newChild2;
+ Node child;
+ String childName;
+ Node appendedChild;
+ Node insertedNode;
+ doc = (Document) load("hc_staff", true);
+ elementList = doc.getElementsByTagName("p");
+ employeeNode = elementList.item(1);
+ childList = employeeNode.getChildNodes();
+ refChild = childList.item(3);
+ newdocFragment = doc.createDocumentFragment();
+ newChild1 = doc.createElement("br");
+ newChild2 = doc.createElement("b");
+ appendedChild = newdocFragment.appendChild(newChild1);
+ appendedChild = newdocFragment.appendChild(newChild2);
+ insertedNode = employeeNode.insertBefore(newdocFragment, refChild);
+ child = childList.item(3);
+ childName = child.getNodeName();
+ assertEqualsAutoCase("element", "childName3", "br", childName);
+ child = childList.item(4);
+ childName = child.getNodeName();
+ assertEqualsAutoCase("element", "childName4", "b", childName);
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_nodeinsertbeforedocfragment";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(hc_nodeinsertbeforedocfragment.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level1/core/hc_nodeinsertbeforeinvalidnodetype.java b/dom/src/test/java/org/w3c/domts/level1/core/hc_nodeinsertbeforeinvalidnodetype.java
new file mode 100644
index 0000000..4b954a4
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level1/core/hc_nodeinsertbeforeinvalidnodetype.java
@@ -0,0 +1,108 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+Copyright (c) 2001-2003 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+*/
+
+package org.w3c.domts.level1.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The "insertBefore(newChild,refChild)" method raises a
+ * HIERARCHY_REQUEST_ERR DOMException if this node is of
+ * a type that does not allow children of the type "newChild"
+ * to be inserted.
+ *
+ * Retrieve the root node and attempt to insert a newly
+ * created Attr node. An Element node cannot have children
+ * of the "Attr" type, therefore the desired exception
+ * should be raised.
+* @author Curt Arnold
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-258A00AF')/constant[@name='HIERARCHY_REQUEST_ERR'])">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-258A00AF')/constant[@name='HIERARCHY_REQUEST_ERR'])</a>
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-952280727">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-952280727</a>
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-952280727')/raises/exception[@name='DOMException']/descr/p[substring-before(.,':')='HIERARCHY_REQUEST_ERR'])">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-952280727')/raises/exception[@name='DOMException']/descr/p[substring-before(.,':')='HIERARCHY_REQUEST_ERR'])</a>
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-952280727">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-952280727</a>
+* @see <a href="http://www.w3.org/Bugs/Public/show_bug.cgi?id=247">http://www.w3.org/Bugs/Public/show_bug.cgi?id=247</a>
+* @see <a href="http://www.w3.org/Bugs/Public/show_bug.cgi?id=249">http://www.w3.org/Bugs/Public/show_bug.cgi?id=249</a>
+* @see <a href="http://www.w3.org/Bugs/Public/show_bug.cgi?id=406">http://www.w3.org/Bugs/Public/show_bug.cgi?id=406</a>
+*/
+public final class hc_nodeinsertbeforeinvalidnodetype extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public hc_nodeinsertbeforeinvalidnodetype(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "hc_staff", true);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ Element rootNode;
+ Node newChild;
+ NodeList elementList;
+ Node refChild;
+ Node insertedNode;
+ doc = (Document) load("hc_staff", true);
+ newChild = doc.createAttribute("title");
+ elementList = doc.getElementsByTagName("p");
+ refChild = elementList.item(1);
+ rootNode = (Element) refChild.getParentNode();
+
+ {
+ boolean success = false;
+ try {
+ insertedNode = rootNode.insertBefore(newChild, refChild);
+ } catch (DOMException ex) {
+ success = (ex.code == DOMException.HIERARCHY_REQUEST_ERR);
+ }
+ assertTrue("throw_HIERARCHY_REQUEST_ERR", success);
+ }
+}
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_nodeinsertbeforeinvalidnodetype";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(hc_nodeinsertbeforeinvalidnodetype.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level1/core/hc_nodeinsertbeforenewchilddiffdocument.java b/dom/src/test/java/org/w3c/domts/level1/core/hc_nodeinsertbeforenewchilddiffdocument.java
new file mode 100644
index 0000000..a9713a3
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level1/core/hc_nodeinsertbeforenewchilddiffdocument.java
@@ -0,0 +1,109 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+Copyright (c) 2001-2003 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+*/
+
+package org.w3c.domts.level1.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The "insertBefore(newChild,refChild)" method raises a
+ * WRONG_DOCUMENT_ERR DOMException if the "newChild" was
+ * created from a different document than the one that
+ * created this node.
+ *
+ * Retrieve the second employee and attempt to insert a new
+ * child that was created from a different document than the
+ * one that created the second employee. An attempt to
+ * insert such a child should raise the desired exception.
+* @author Curt Arnold
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-258A00AF')/constant[@name='WRONG_DOCUMENT_ERR'])">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-258A00AF')/constant[@name='WRONG_DOCUMENT_ERR'])</a>
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-952280727">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-952280727</a>
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-952280727')/raises/exception[@name='DOMException']/descr/p[substring-before(.,':')='WRONG_DOCUMENT_ERR'])">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-952280727')/raises/exception[@name='DOMException']/descr/p[substring-before(.,':')='WRONG_DOCUMENT_ERR'])</a>
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-952280727">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-952280727</a>
+* @see <a href="http://www.w3.org/Bugs/Public/show_bug.cgi?id=247">http://www.w3.org/Bugs/Public/show_bug.cgi?id=247</a>
+*/
+public final class hc_nodeinsertbeforenewchilddiffdocument extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public hc_nodeinsertbeforenewchilddiffdocument(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "hc_staff", false);
+ preload(contentType, "hc_staff", true);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc1;
+ Document doc2;
+ Node refChild;
+ Node newChild;
+ NodeList elementList;
+ Node elementNode;
+ Node insertedNode;
+ doc1 = (Document) load("hc_staff", false);
+ doc2 = (Document) load("hc_staff", true);
+ newChild = doc1.createElement("br");
+ elementList = doc2.getElementsByTagName("p");
+ elementNode = elementList.item(1);
+ refChild = elementNode.getFirstChild();
+
+ {
+ boolean success = false;
+ try {
+ insertedNode = elementNode.insertBefore(newChild, refChild);
+ } catch (DOMException ex) {
+ success = (ex.code == DOMException.WRONG_DOCUMENT_ERR);
+ }
+ assertTrue("throw_WRONG_DOCUMENT_ERR", success);
+ }
+}
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_nodeinsertbeforenewchilddiffdocument";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(hc_nodeinsertbeforenewchilddiffdocument.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level1/core/hc_nodeinsertbeforenewchildexists.java b/dom/src/test/java/org/w3c/domts/level1/core/hc_nodeinsertbeforenewchildexists.java
new file mode 100644
index 0000000..dad71d0
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level1/core/hc_nodeinsertbeforenewchildexists.java
@@ -0,0 +1,119 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+Copyright (c) 2001-2003 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+*/
+
+package org.w3c.domts.level1.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * If the "newChild" is already in the tree, the
+ * "insertBefore(newChild,refChild)" method must first
+ * remove it before the insertion takes place.
+ *
+ * Insert a node Element ("em") that is already
+ * present in the tree. The existing node should be
+ * removed first and the new one inserted. The node is
+ * inserted at a different position in the tree to assure
+ * that it was indeed inserted.
+* @author Curt Arnold
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-952280727">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-952280727</a>
+* @see <a href="http://www.w3.org/Bugs/Public/show_bug.cgi?id=246">http://www.w3.org/Bugs/Public/show_bug.cgi?id=246</a>
+*/
+public final class hc_nodeinsertbeforenewchildexists extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public hc_nodeinsertbeforenewchildexists(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "hc_staff", true);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ NodeList elementList;
+ Node employeeNode;
+ NodeList childList;
+ Node refChild;
+ Node newChild;
+ Node child;
+ String childName;
+ Node insertedNode;
+ java.util.List expected = new java.util.ArrayList();
+ expected.add("strong");
+ expected.add("code");
+ expected.add("sup");
+ expected.add("var");
+ expected.add("em");
+ expected.add("acronym");
+
+ java.util.List result = new java.util.ArrayList();
+
+ int nodeType;
+ doc = (Document) load("hc_staff", true);
+ elementList = doc.getElementsByTagName("p");
+ employeeNode = elementList.item(1);
+ childList = ((Element) /*Node */employeeNode).getElementsByTagName("*");
+ refChild = childList.item(5);
+ newChild = childList.item(0);
+ insertedNode = employeeNode.insertBefore(newChild, refChild);
+ for (int indexN1008C = 0; indexN1008C < childList.getLength(); indexN1008C++) {
+ child = (Node) childList.item(indexN1008C);
+ nodeType = (int) child.getNodeType();
+
+ if (equals(1, nodeType)) {
+ childName = child.getNodeName();
+ result.add(childName);
+ }
+ }
+ assertEqualsAutoCase("element", "childNames", expected, result);
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_nodeinsertbeforenewchildexists";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(hc_nodeinsertbeforenewchildexists.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level1/core/hc_nodeinsertbeforenodeancestor.java b/dom/src/test/java/org/w3c/domts/level1/core/hc_nodeinsertbeforenodeancestor.java
new file mode 100644
index 0000000..0d69bd8
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level1/core/hc_nodeinsertbeforenodeancestor.java
@@ -0,0 +1,106 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+Copyright (c) 2001 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+*/
+
+package org.w3c.domts.level1.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The "insertBefore(newChild,refChild)" method raises a
+ * HIERARCHY_REQUEST_ERR DOMException if the node to be
+ * inserted is one of this nodes ancestors.
+ *
+ * Retrieve the second employee and attempt to insert a
+ * node that is one of its ancestors(root node). An
+ * attempt to insert such a node should raise the
+ * desired exception.
+* @author Curt Arnold
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-258A00AF')/constant[@name='HIERARCHY_REQUEST_ERR'])">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-258A00AF')/constant[@name='HIERARCHY_REQUEST_ERR'])</a>
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-952280727">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-952280727</a>
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-952280727')/raises/exception[@name='DOMException']/descr/p[substring-before(.,':')='HIERARCHY_REQUEST_ERR'])">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-952280727')/raises/exception[@name='DOMException']/descr/p[substring-before(.,':')='HIERARCHY_REQUEST_ERR'])</a>
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-952280727">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-952280727</a>
+*/
+public final class hc_nodeinsertbeforenodeancestor extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public hc_nodeinsertbeforenodeancestor(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "hc_staff", true);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ Node newChild;
+ NodeList elementList;
+ Node employeeNode;
+ NodeList childList;
+ Node refChild;
+ Node insertedNode;
+ doc = (Document) load("hc_staff", true);
+ newChild = doc.getDocumentElement();
+ elementList = doc.getElementsByTagName("p");
+ employeeNode = elementList.item(1);
+ childList = employeeNode.getChildNodes();
+ refChild = childList.item(0);
+
+ {
+ boolean success = false;
+ try {
+ insertedNode = employeeNode.insertBefore(newChild, refChild);
+ } catch (DOMException ex) {
+ success = (ex.code == DOMException.HIERARCHY_REQUEST_ERR);
+ }
+ assertTrue("throw_HIERARCHY_REQUEST_ERR", success);
+ }
+}
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_nodeinsertbeforenodeancestor";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(hc_nodeinsertbeforenodeancestor.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level1/core/hc_nodeinsertbeforenodename.java b/dom/src/test/java/org/w3c/domts/level1/core/hc_nodeinsertbeforenodename.java
new file mode 100644
index 0000000..1ada950
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level1/core/hc_nodeinsertbeforenodename.java
@@ -0,0 +1,98 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+Copyright (c) 2001-2003 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+*/
+
+package org.w3c.domts.level1.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The "insertBefore(newChild,refchild)" method returns
+ * the node being inserted.
+ *
+ * Insert an Element node before the fourth
+ * child of the second employee and check the node
+ * returned from the "insertBefore(newChild,refChild)"
+ * method. The node returned should be "newChild".
+* @author Curt Arnold
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-F68D095">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-F68D095</a>
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-952280727">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-952280727</a>
+* @see <a href="http://www.w3.org/Bugs/Public/show_bug.cgi?id=247">http://www.w3.org/Bugs/Public/show_bug.cgi?id=247</a>
+*/
+public final class hc_nodeinsertbeforenodename extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public hc_nodeinsertbeforenodename(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "hc_staff", true);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ NodeList elementList;
+ Node employeeNode;
+ NodeList childList;
+ Node refChild;
+ Node newChild;
+ Node insertedNode;
+ String childName;
+ doc = (Document) load("hc_staff", true);
+ elementList = doc.getElementsByTagName("p");
+ employeeNode = elementList.item(1);
+ childList = employeeNode.getChildNodes();
+ refChild = childList.item(3);
+ newChild = doc.createElement("br");
+ insertedNode = employeeNode.insertBefore(newChild, refChild);
+ childName = insertedNode.getNodeName();
+ assertEqualsAutoCase("element", "nodeName", "br", childName);
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_nodeinsertbeforenodename";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(hc_nodeinsertbeforenodename.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level1/core/hc_nodeinsertbeforerefchildnonexistent.java b/dom/src/test/java/org/w3c/domts/level1/core/hc_nodeinsertbeforerefchildnonexistent.java
new file mode 100644
index 0000000..f922595
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level1/core/hc_nodeinsertbeforerefchildnonexistent.java
@@ -0,0 +1,106 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+Copyright (c) 2001-2003 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+*/
+
+package org.w3c.domts.level1.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The "insertBefore(newChild,refChild)" method raises a
+ * NOT_FOUND_ERR DOMException if the reference child is
+ * not a child of this node.
+ *
+ * Retrieve the second employee and attempt to insert a
+ * new node before a reference node that is not a child
+ * of this node. An attempt to insert before a non child
+ * node should raise the desired exception.
+* @author Curt Arnold
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-258A00AF')/constant[@name='NOT_FOUND_ERR'])">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-258A00AF')/constant[@name='NOT_FOUND_ERR'])</a>
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-952280727">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-952280727</a>
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-952280727')/raises/exception[@name='DOMException']/descr/p[substring-before(.,':')='NOT_FOUND_ERR'])">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-952280727')/raises/exception[@name='DOMException']/descr/p[substring-before(.,':')='NOT_FOUND_ERR'])</a>
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-952280727">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-952280727</a>
+* @see <a href="http://www.w3.org/Bugs/Public/show_bug.cgi?id=247">http://www.w3.org/Bugs/Public/show_bug.cgi?id=247</a>
+* @see <a href="http://www.w3.org/Bugs/Public/show_bug.cgi?id=249">http://www.w3.org/Bugs/Public/show_bug.cgi?id=249</a>
+*/
+public final class hc_nodeinsertbeforerefchildnonexistent extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public hc_nodeinsertbeforerefchildnonexistent(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "hc_staff", true);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ Node refChild;
+ Node newChild;
+ NodeList elementList;
+ Node elementNode;
+ Node insertedNode;
+ doc = (Document) load("hc_staff", true);
+ newChild = doc.createElement("br");
+ refChild = doc.createElement("b");
+ elementList = doc.getElementsByTagName("p");
+ elementNode = elementList.item(1);
+
+ {
+ boolean success = false;
+ try {
+ insertedNode = elementNode.insertBefore(newChild, refChild);
+ } catch (DOMException ex) {
+ success = (ex.code == DOMException.NOT_FOUND_ERR);
+ }
+ assertTrue("throw_NOT_FOUND_ERR", success);
+ }
+}
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_nodeinsertbeforerefchildnonexistent";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(hc_nodeinsertbeforerefchildnonexistent.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level1/core/hc_nodeinsertbeforerefchildnull.java b/dom/src/test/java/org/w3c/domts/level1/core/hc_nodeinsertbeforerefchildnull.java
new file mode 100644
index 0000000..d39684b
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level1/core/hc_nodeinsertbeforerefchildnull.java
@@ -0,0 +1,102 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+Copyright (c) 2001-2003 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+*/
+
+package org.w3c.domts.level1.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * If the "refChild" is null then the
+ * "insertBefore(newChild,refChild)" method inserts the
+ * node "newChild" at the end of the list of children.
+ *
+ * Retrieve the second employee and invoke the
+ * "insertBefore(newChild,refChild)" method with
+ * refChild=null. Since "refChild" is null the "newChild"
+ * should be added to the end of the list. The last item
+ * in the list is checked after insertion. The last Element
+ * node of the list should be "newChild".
+* @author Curt Arnold
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-952280727">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-952280727</a>
+* @see <a href="http://www.w3.org/Bugs/Public/show_bug.cgi?id=247">http://www.w3.org/Bugs/Public/show_bug.cgi?id=247</a>
+*/
+public final class hc_nodeinsertbeforerefchildnull extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public hc_nodeinsertbeforerefchildnull(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "hc_staff", true);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ NodeList elementList;
+ Node employeeNode;
+ NodeList childList;
+ Node refChild = null;
+
+ Node newChild;
+ Node child;
+ String childName;
+ Node insertedNode;
+ doc = (Document) load("hc_staff", true);
+ elementList = doc.getElementsByTagName("p");
+ employeeNode = elementList.item(1);
+ childList = employeeNode.getChildNodes();
+ newChild = doc.createElement("br");
+ insertedNode = employeeNode.insertBefore(newChild, refChild);
+ child = employeeNode.getLastChild();
+ childName = child.getNodeName();
+ assertEqualsAutoCase("element", "nodeName", "br", childName);
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_nodeinsertbeforerefchildnull";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(hc_nodeinsertbeforerefchildnull.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level1/core/hc_nodelistindexequalzero.java b/dom/src/test/java/org/w3c/domts/level1/core/hc_nodelistindexequalzero.java
new file mode 100644
index 0000000..5556d46
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level1/core/hc_nodelistindexequalzero.java
@@ -0,0 +1,101 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+Copyright (c) 2001-2003 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+*/
+
+package org.w3c.domts.level1.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * Create a list of all the children elements of the third
+ * employee and access its first child by using an index
+ * of 0. This should result in the whitspace before "em" being
+ * selected (em when ignoring whitespace).
+ * Further we evaluate its content(by using
+ * the "getNodeName()" method) to ensure the proper
+ * element was accessed.
+* @author Curt Arnold
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-844377136">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-844377136</a>
+* @see <a href="http://www.w3.org/Bugs/Public/show_bug.cgi?id=246">http://www.w3.org/Bugs/Public/show_bug.cgi?id=246</a>
+*/
+public final class hc_nodelistindexequalzero extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public hc_nodelistindexequalzero(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "hc_staff", false);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ NodeList elementList;
+ Node employeeNode;
+ NodeList employeeList;
+ Node child;
+ String childName;
+ int length;
+ doc = (Document) load("hc_staff", false);
+ elementList = doc.getElementsByTagName("p");
+ employeeNode = elementList.item(2);
+ employeeList = employeeNode.getChildNodes();
+ length = (int) employeeList.getLength();
+ child = employeeList.item(0);
+ childName = child.getNodeName();
+
+ if (equals(13, length)) {
+ assertEquals("childName_w_whitespace", "#text", childName);
+ } else {
+ assertEqualsAutoCase("element", "childName_wo_whitespace", "em", childName);
+ }
+
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_nodelistindexequalzero";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(hc_nodelistindexequalzero.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level1/core/hc_nodelistindexgetlength.java b/dom/src/test/java/org/w3c/domts/level1/core/hc_nodelistindexgetlength.java
new file mode 100644
index 0000000..d965d9e
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level1/core/hc_nodelistindexgetlength.java
@@ -0,0 +1,96 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+Copyright (c) 2001-2003 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+*/
+
+package org.w3c.domts.level1.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The "getLength()" method returns the number of nodes
+ * in the list.
+ *
+ * Create a list of all the children elements of the third
+ * employee and invoke the "getLength()" method.
+ * It should contain the value 13.
+* @author Curt Arnold
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-203510337">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-203510337</a>
+* @see <a href="http://www.w3.org/Bugs/Public/show_bug.cgi?id=246">http://www.w3.org/Bugs/Public/show_bug.cgi?id=246</a>
+*/
+public final class hc_nodelistindexgetlength extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public hc_nodelistindexgetlength(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "hc_staff", false);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ NodeList elementList;
+ Node employeeNode;
+ NodeList employeeList;
+ int length;
+ doc = (Document) load("hc_staff", false);
+ elementList = doc.getElementsByTagName("p");
+ employeeNode = elementList.item(2);
+ employeeList = employeeNode.getChildNodes();
+ length = (int) employeeList.getLength();
+
+ if (equals(6, length)) {
+ assertEquals("length_wo_space", 6, length);
+ } else {
+ assertEquals("length_w_space", 13, length);
+ }
+
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_nodelistindexgetlength";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(hc_nodelistindexgetlength.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level1/core/hc_nodelistindexgetlengthofemptylist.java b/dom/src/test/java/org/w3c/domts/level1/core/hc_nodelistindexgetlengthofemptylist.java
new file mode 100644
index 0000000..45b9088
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level1/core/hc_nodelistindexgetlengthofemptylist.java
@@ -0,0 +1,93 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+Copyright (c) 2001-2003 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+*/
+
+package org.w3c.domts.level1.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The "getLength()" method returns the number of nodes
+ * in the list.(Test for EMPTY list)
+ *
+ * Create a list of all the children of the Text node
+ * inside the first child of the third employee and
+ * invoke the "getLength()" method. It should contain
+ * the value 0.
+* @author Curt Arnold
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-203510337">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-203510337</a>
+* @see <a href="http://www.w3.org/Bugs/Public/show_bug.cgi?id=246">http://www.w3.org/Bugs/Public/show_bug.cgi?id=246</a>
+*/
+public final class hc_nodelistindexgetlengthofemptylist extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public hc_nodelistindexgetlengthofemptylist(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "hc_staff", false);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ NodeList emList;
+ Node emNode;
+ Node textNode;
+ NodeList textList;
+ int length;
+ doc = (Document) load("hc_staff", false);
+ emList = doc.getElementsByTagName("em");
+ emNode = emList.item(2);
+ textNode = emNode.getFirstChild();
+ textList = textNode.getChildNodes();
+ length = (int) textList.getLength();
+ assertEquals("length", 0, length);
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_nodelistindexgetlengthofemptylist";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(hc_nodelistindexgetlengthofemptylist.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level1/core/hc_nodelistindexnotzero.java b/dom/src/test/java/org/w3c/domts/level1/core/hc_nodelistindexnotzero.java
new file mode 100644
index 0000000..84c9c82
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level1/core/hc_nodelistindexnotzero.java
@@ -0,0 +1,100 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+Copyright (c) 2001-2003 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+*/
+
+package org.w3c.domts.level1.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The items in the list are accessible via an integral
+ * index starting from zero.
+ * (Index not equal 0)
+ *
+ * Create a list of all the children elements of the third
+ * employee and access its fourth child by using an index
+ * of 3 and calling getNodeName() which should return
+ * "strong" (no whitespace) or "#text" (with whitespace).
+* @author Curt Arnold
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-844377136">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-844377136</a>
+* @see <a href="http://www.w3.org/Bugs/Public/show_bug.cgi?id=246">http://www.w3.org/Bugs/Public/show_bug.cgi?id=246</a>
+*/
+public final class hc_nodelistindexnotzero extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public hc_nodelistindexnotzero(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "hc_staff", false);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ NodeList elementList;
+ Node employeeNode;
+ NodeList employeeList;
+ Node child;
+ String childName;
+ doc = (Document) load("hc_staff", false);
+ elementList = doc.getElementsByTagName("p");
+ employeeNode = elementList.item(2);
+ employeeList = employeeNode.getChildNodes();
+ child = employeeList.item(3);
+ childName = child.getNodeName();
+
+ if (equals("#text", childName)) {
+ assertEquals("childName_space", "#text", childName);
+ } else {
+ assertEqualsAutoCase("element", "childName_strong", "strong", childName);
+ }
+
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_nodelistindexnotzero";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(hc_nodelistindexnotzero.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level1/core/hc_nodelistreturnfirstitem.java b/dom/src/test/java/org/w3c/domts/level1/core/hc_nodelistreturnfirstitem.java
new file mode 100644
index 0000000..3633204
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level1/core/hc_nodelistreturnfirstitem.java
@@ -0,0 +1,96 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+Copyright (c) 2001-2003 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+*/
+
+package org.w3c.domts.level1.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * Create a list of all the children elements of the third
+ * employee and access its first child by invoking the
+ * "item(index)" method with an index=0. This should
+ * result in node with a nodeName of "#text" or "em".
+* @author Curt Arnold
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-844377136">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-844377136</a>
+* @see <a href="http://www.w3.org/Bugs/Public/show_bug.cgi?id=246">http://www.w3.org/Bugs/Public/show_bug.cgi?id=246</a>
+*/
+public final class hc_nodelistreturnfirstitem extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public hc_nodelistreturnfirstitem(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "hc_staff", false);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ NodeList elementList;
+ Node employeeNode;
+ NodeList employeeList;
+ Node child;
+ String childName;
+ doc = (Document) load("hc_staff", false);
+ elementList = doc.getElementsByTagName("p");
+ employeeNode = elementList.item(2);
+ employeeList = employeeNode.getChildNodes();
+ child = employeeList.item(0);
+ childName = child.getNodeName();
+
+ if (equals("#text", childName)) {
+ assertEquals("nodeName_w_space", "#text", childName);
+ } else {
+ assertEqualsAutoCase("element", "nodeName_wo_space", "em", childName);
+ }
+
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_nodelistreturnfirstitem";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(hc_nodelistreturnfirstitem.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level1/core/hc_nodelistreturnlastitem.java b/dom/src/test/java/org/w3c/domts/level1/core/hc_nodelistreturnlastitem.java
new file mode 100644
index 0000000..eeb03dc
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level1/core/hc_nodelistreturnlastitem.java
@@ -0,0 +1,100 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+Copyright (c) 2001-2003 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+*/
+
+package org.w3c.domts.level1.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * Create a list of all the children elements of the third
+ * employee and access its last child by invoking the
+ * "item(index)" method with an index=length-1. This should
+ * result in node with nodeName="#text" or acronym.
+* @author Curt Arnold
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-844377136">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-844377136</a>
+* @see <a href="http://www.w3.org/Bugs/Public/show_bug.cgi?id=246">http://www.w3.org/Bugs/Public/show_bug.cgi?id=246</a>
+*/
+public final class hc_nodelistreturnlastitem extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public hc_nodelistreturnlastitem(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "hc_staff", false);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ NodeList elementList;
+ Node employeeNode;
+ NodeList employeeList;
+ Node child;
+ String childName;
+ int index;
+ doc = (Document) load("hc_staff", false);
+ elementList = doc.getElementsByTagName("p");
+ employeeNode = elementList.item(2);
+ employeeList = employeeNode.getChildNodes();
+ index = (int) employeeList.getLength();
+ index -= 1;
+ child = employeeList.item(((int) /*int */index));
+ childName = child.getNodeName();
+
+ if (equals(12, index)) {
+ assertEquals("lastNodeName_w_whitespace", "#text", childName);
+ } else {
+ assertEqualsAutoCase("element", "lastNodeName", "acronym", childName);
+ assertEquals("index", 5, index);
+ }
+
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_nodelistreturnlastitem";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(hc_nodelistreturnlastitem.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level1/core/hc_nodelisttraverselist.java b/dom/src/test/java/org/w3c/domts/level1/core/hc_nodelisttraverselist.java
new file mode 100644
index 0000000..29b1762
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level1/core/hc_nodelisttraverselist.java
@@ -0,0 +1,114 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+Copyright (c) 2001-2003 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+*/
+
+package org.w3c.domts.level1.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The range of valid child node indices is 0 thru length -1
+ *
+ * Create a list of all the children elements of the third
+ * employee and traverse the list from index=0 thru
+ * length -1.
+* @author Curt Arnold
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-203510337">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-203510337</a>
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-844377136">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-844377136</a>
+* @see <a href="http://www.w3.org/Bugs/Public/show_bug.cgi?id=246">http://www.w3.org/Bugs/Public/show_bug.cgi?id=246</a>
+*/
+public final class hc_nodelisttraverselist extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public hc_nodelisttraverselist(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "hc_staff", false);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ NodeList elementList;
+ Node employeeNode;
+ NodeList employeeList;
+ Node child;
+ String childName;
+ int nodeType;
+ java.util.List result = new java.util.ArrayList();
+
+ java.util.List expected = new java.util.ArrayList();
+ expected.add("em");
+ expected.add("strong");
+ expected.add("code");
+ expected.add("sup");
+ expected.add("var");
+ expected.add("acronym");
+
+ doc = (Document) load("hc_staff", false);
+ elementList = doc.getElementsByTagName("p");
+ employeeNode = elementList.item(2);
+ employeeList = employeeNode.getChildNodes();
+ for (int indexN10073 = 0; indexN10073 < employeeList.getLength(); indexN10073++) {
+ child = (Node) employeeList.item(indexN10073);
+ nodeType = (int) child.getNodeType();
+ childName = child.getNodeName();
+
+ if (equals(1, nodeType)) {
+ result.add(childName);
+ } else {
+ assertEquals("textNodeType", 3, nodeType);
+ assertEquals("textNodeName", "#text", childName);
+ }
+
+ }
+ assertEqualsAutoCase("element", "nodeNames", expected, result);
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_nodelisttraverselist";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(hc_nodelisttraverselist.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level1/core/hc_nodeparentnode.java b/dom/src/test/java/org/w3c/domts/level1/core/hc_nodeparentnode.java
new file mode 100644
index 0000000..87070f5
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level1/core/hc_nodeparentnode.java
@@ -0,0 +1,89 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+Copyright (c) 2001 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+*/
+
+package org.w3c.domts.level1.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The "getParentNode()" method returns the parent
+ * of this node.
+ *
+ * Retrieve the second employee and invoke the
+ * "getParentNode()" method on this node. It should
+ * be set to "body".
+* @author Curt Arnold
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-1060184317">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-1060184317</a>
+*/
+public final class hc_nodeparentnode extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public hc_nodeparentnode(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "hc_staff", false);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ NodeList elementList;
+ Node employeeNode;
+ Node parentNode;
+ String parentName;
+ doc = (Document) load("hc_staff", false);
+ elementList = doc.getElementsByTagName("p");
+ employeeNode = elementList.item(1);
+ parentNode = employeeNode.getParentNode();
+ parentName = parentNode.getNodeName();
+ assertEqualsAutoCase("element", "parentNodeName", "body", parentName);
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_nodeparentnode";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(hc_nodeparentnode.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level1/core/hc_nodeparentnodenull.java b/dom/src/test/java/org/w3c/domts/level1/core/hc_nodeparentnodenull.java
new file mode 100644
index 0000000..0896b81
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level1/core/hc_nodeparentnodenull.java
@@ -0,0 +1,86 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+Copyright (c) 2001 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+*/
+
+package org.w3c.domts.level1.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The "getParentNode()" method invoked on a node that has
+ * just been created and not yet added to the tree is null.
+ * Create a new "employee" Element node using the
+ * "createElement(name)" method from the Document interface.
+ * Since this new node has not yet been added to the tree,
+ * the "getParentNode()" method will return null.
+* @author Curt Arnold
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-1060184317">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-1060184317</a>
+* @see <a href="http://www.w3.org/Bugs/Public/show_bug.cgi?id=247">http://www.w3.org/Bugs/Public/show_bug.cgi?id=247</a>
+*/
+public final class hc_nodeparentnodenull extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public hc_nodeparentnodenull(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "hc_staff", false);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ Element createdNode;
+ Node parentNode;
+ doc = (Document) load("hc_staff", false);
+ createdNode = doc.createElement("br");
+ parentNode = createdNode.getParentNode();
+ assertNull("parentNode", parentNode);
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_nodeparentnodenull";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(hc_nodeparentnodenull.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level1/core/hc_noderemovechild.java b/dom/src/test/java/org/w3c/domts/level1/core/hc_noderemovechild.java
new file mode 100644
index 0000000..a905f46
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level1/core/hc_noderemovechild.java
@@ -0,0 +1,94 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+Copyright (c) 2001-2003 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+*/
+
+package org.w3c.domts.level1.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The "removeChild(oldChild)" method removes the child node
+ * indicated by "oldChild" from the list of children and
+ * returns it.
+ *
+ * Remove the first employee by invoking the
+ * "removeChild(oldChild)" method an checking the
+ * node returned by the "getParentNode()" method. It
+ * should be set to null.
+* @author Curt Arnold
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-1734834066">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-1734834066</a>
+* @see <a href="http://www.w3.org/Bugs/Public/show_bug.cgi?id=249">http://www.w3.org/Bugs/Public/show_bug.cgi?id=249</a>
+*/
+public final class hc_noderemovechild extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public hc_noderemovechild(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "hc_staff", true);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ Element rootNode;
+ NodeList childList;
+ Node childToRemove;
+ Node removedChild;
+ Node parentNode;
+ doc = (Document) load("hc_staff", true);
+ rootNode = doc.getDocumentElement();
+ childList = rootNode.getChildNodes();
+ childToRemove = childList.item(1);
+ removedChild = rootNode.removeChild(childToRemove);
+ parentNode = removedChild.getParentNode();
+ assertNull("parentNodeNull", parentNode);
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_noderemovechild";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(hc_noderemovechild.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level1/core/hc_noderemovechildgetnodename.java b/dom/src/test/java/org/w3c/domts/level1/core/hc_noderemovechildgetnodename.java
new file mode 100644
index 0000000..b8e9041
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level1/core/hc_noderemovechildgetnodename.java
@@ -0,0 +1,99 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+Copyright (c) 2001-2003 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+*/
+
+package org.w3c.domts.level1.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The "removeChild(oldChild)" method returns
+ * the node being removed.
+ *
+ * Remove the first child of the second employee
+ * and check the NodeName returned by the
+ * "removeChild(oldChild)" method. The returned node
+ * should have a NodeName equal to "#text".
+* @author Curt Arnold
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-F68D095">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-F68D095</a>
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-1734834066">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-1734834066</a>
+* @see <a href="http://www.w3.org/Bugs/Public/show_bug.cgi?id=246">http://www.w3.org/Bugs/Public/show_bug.cgi?id=246</a>
+*/
+public final class hc_noderemovechildgetnodename extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public hc_noderemovechildgetnodename(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "hc_staff", true);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ NodeList elementList;
+ Node employeeNode;
+ NodeList childList;
+ Node oldChild;
+ Node removedChild;
+ String childName;
+ String oldName;
+ doc = (Document) load("hc_staff", true);
+ elementList = doc.getElementsByTagName("p");
+ employeeNode = elementList.item(1);
+ childList = employeeNode.getChildNodes();
+ oldChild = childList.item(0);
+ oldName = oldChild.getNodeName();
+ removedChild = employeeNode.removeChild(oldChild);
+ assertNotNull("notnull", removedChild);
+ childName = removedChild.getNodeName();
+ assertEquals("nodeName", oldName, childName);
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_noderemovechildgetnodename";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(hc_noderemovechildgetnodename.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level1/core/hc_noderemovechildnode.java b/dom/src/test/java/org/w3c/domts/level1/core/hc_noderemovechildnode.java
new file mode 100644
index 0000000..132886c
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level1/core/hc_noderemovechildnode.java
@@ -0,0 +1,124 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+Copyright (c) 2001-2004 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+*/
+
+package org.w3c.domts.level1.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The "removeChild(oldChild)" method removes the node
+ * indicated by "oldChild".
+ *
+ * Retrieve the second p element and remove its first child.
+ * After the removal, the second p element should have 5 element
+ * children and the first child should now be the child
+ * that used to be at the second position in the list.
+* @author Curt Arnold
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-1734834066">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-1734834066</a>
+* @see <a href="http://www.w3.org/Bugs/Public/show_bug.cgi?id=246">http://www.w3.org/Bugs/Public/show_bug.cgi?id=246</a>
+*/
+public final class hc_noderemovechildnode extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public hc_noderemovechildnode(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "hc_staff", true);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ NodeList elementList;
+ NodeList emList;
+ Node employeeNode;
+ NodeList childList;
+ Node oldChild;
+ Node child;
+ String childName;
+ int length;
+ Node removedChild;
+ String removedName;
+ int nodeType;
+ java.util.List expected = new java.util.ArrayList();
+ expected.add("strong");
+ expected.add("code");
+ expected.add("sup");
+ expected.add("var");
+ expected.add("acronym");
+
+ java.util.List actual = new java.util.ArrayList();
+
+ doc = (Document) load("hc_staff", true);
+ elementList = doc.getElementsByTagName("p");
+ employeeNode = elementList.item(1);
+ childList = employeeNode.getChildNodes();
+ emList = ((Element) /*Node */employeeNode).getElementsByTagName("em");
+ oldChild = emList.item(0);
+ removedChild = employeeNode.removeChild(oldChild);
+ removedName = removedChild.getNodeName();
+ assertEqualsAutoCase("element", "removedName", "em", removedName);
+ for (int indexN10098 = 0; indexN10098 < childList.getLength(); indexN10098++) {
+ child = (Node) childList.item(indexN10098);
+ nodeType = (int) child.getNodeType();
+ childName = child.getNodeName();
+
+ if (equals(1, nodeType)) {
+ actual.add(childName);
+ } else {
+ assertEquals("textNodeType", 3, nodeType);
+ assertEquals("textNodeName", "#text", childName);
+ }
+
+ }
+ assertEqualsAutoCase("element", "childNames", expected, actual);
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_noderemovechildnode";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(hc_noderemovechildnode.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level1/core/hc_noderemovechildoldchildnonexistent.java b/dom/src/test/java/org/w3c/domts/level1/core/hc_noderemovechildoldchildnonexistent.java
new file mode 100644
index 0000000..b2422b2
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level1/core/hc_noderemovechildoldchildnonexistent.java
@@ -0,0 +1,102 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+Copyright (c) 2001-2003 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+*/
+
+package org.w3c.domts.level1.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The "removeChild(oldChild)" method raises a
+ * NOT_FOUND_ERR DOMException if the old child is
+ * not a child of this node.
+ *
+ * Retrieve the second employee and attempt to remove a
+ * node that is not one of its children. An attempt to
+ * remove such a node should raise the desired exception.
+* @author Curt Arnold
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-258A00AF')/constant[@name='NOT_FOUND_ERR'])">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-258A00AF')/constant[@name='NOT_FOUND_ERR'])</a>
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-1734834066">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-1734834066</a>
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-1734834066')/raises/exception[@name='DOMException']/descr/p[substring-before(.,':')='NOT_FOUND_ERR'])">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-1734834066')/raises/exception[@name='DOMException']/descr/p[substring-before(.,':')='NOT_FOUND_ERR'])</a>
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-1734834066">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-1734834066</a>
+* @see <a href="http://www.w3.org/Bugs/Public/show_bug.cgi?id=247">http://www.w3.org/Bugs/Public/show_bug.cgi?id=247</a>
+*/
+public final class hc_noderemovechildoldchildnonexistent extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public hc_noderemovechildoldchildnonexistent(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "hc_staff", true);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ Node oldChild;
+ NodeList elementList;
+ Node elementNode;
+ Node removedChild;
+ doc = (Document) load("hc_staff", true);
+ oldChild = doc.createElement("br");
+ elementList = doc.getElementsByTagName("p");
+ elementNode = elementList.item(1);
+
+ {
+ boolean success = false;
+ try {
+ removedChild = elementNode.removeChild(oldChild);
+ } catch (DOMException ex) {
+ success = (ex.code == DOMException.NOT_FOUND_ERR);
+ }
+ assertTrue("throw_NOT_FOUND_ERR", success);
+ }
+}
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_noderemovechildoldchildnonexistent";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(hc_noderemovechildoldchildnonexistent.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level1/core/hc_nodereplacechild.java b/dom/src/test/java/org/w3c/domts/level1/core/hc_nodereplacechild.java
new file mode 100644
index 0000000..49156c5
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level1/core/hc_nodereplacechild.java
@@ -0,0 +1,99 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+Copyright (c) 2001-2003 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+*/
+
+package org.w3c.domts.level1.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The "replaceChild(newChild,oldChild)" method replaces
+ * the node "oldChild" with the node "newChild".
+ *
+ * Replace the first element of the second employee with
+ * a newly created Element node. Check the first position
+ * after the replacement operation is completed. The new
+ * Element should be "newChild".
+* @author Curt Arnold
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-785887307">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-785887307</a>
+* @see <a href="http://www.w3.org/Bugs/Public/show_bug.cgi?id=247">http://www.w3.org/Bugs/Public/show_bug.cgi?id=247</a>
+*/
+public final class hc_nodereplacechild extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public hc_nodereplacechild(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "hc_staff", true);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ NodeList elementList;
+ Node employeeNode;
+ NodeList childList;
+ Node oldChild;
+ Node newChild;
+ Node child;
+ String childName;
+ Node replacedNode;
+ doc = (Document) load("hc_staff", true);
+ elementList = doc.getElementsByTagName("p");
+ employeeNode = elementList.item(1);
+ childList = employeeNode.getChildNodes();
+ oldChild = childList.item(0);
+ newChild = doc.createElement("br");
+ replacedNode = employeeNode.replaceChild(newChild, oldChild);
+ child = childList.item(0);
+ childName = child.getNodeName();
+ assertEqualsAutoCase("element", "nodeName", "br", childName);
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_nodereplacechild";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(hc_nodereplacechild.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level1/core/hc_nodereplacechildinvalidnodetype.java b/dom/src/test/java/org/w3c/domts/level1/core/hc_nodereplacechildinvalidnodetype.java
new file mode 100644
index 0000000..95c6371
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level1/core/hc_nodereplacechildinvalidnodetype.java
@@ -0,0 +1,108 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+Copyright (c) 2001-2003 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+*/
+
+package org.w3c.domts.level1.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The "replaceChild(newChild,oldChild)" method raises a
+ * HIERARCHY_REQUEST_ERR DOMException if this node is of
+ * a type that does not allow children of the type "newChild"
+ * to be inserted.
+ *
+ * Retrieve the root node and attempt to replace
+ * one of its children with a newly created Attr node.
+ * An Element node cannot have children of the "Attr"
+ * type, therefore the desired exception should be raised.
+* @author Curt Arnold
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-258A00AF')/constant[@name='HIERARCHY_REQUEST_ERR'])">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-258A00AF')/constant[@name='HIERARCHY_REQUEST_ERR'])</a>
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-785887307">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-785887307</a>
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-785887307')/raises/exception[@name='DOMException']/descr/p[substring-before(.,':')='HIERARCHY_REQUEST_ERR'])">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-785887307')/raises/exception[@name='DOMException']/descr/p[substring-before(.,':')='HIERARCHY_REQUEST_ERR'])</a>
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-785887307">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-785887307</a>
+* @see <a href="http://www.w3.org/Bugs/Public/show_bug.cgi?id=247">http://www.w3.org/Bugs/Public/show_bug.cgi?id=247</a>
+* @see <a href="http://www.w3.org/Bugs/Public/show_bug.cgi?id=249">http://www.w3.org/Bugs/Public/show_bug.cgi?id=249</a>
+* @see <a href="http://www.w3.org/Bugs/Public/show_bug.cgi?id=406">http://www.w3.org/Bugs/Public/show_bug.cgi?id=406</a>
+*/
+public final class hc_nodereplacechildinvalidnodetype extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public hc_nodereplacechildinvalidnodetype(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "hc_staff", true);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ Element rootNode;
+ Node newChild;
+ NodeList elementList;
+ Node oldChild;
+ Node replacedChild;
+ doc = (Document) load("hc_staff", true);
+ newChild = doc.createAttribute("lang");
+ elementList = doc.getElementsByTagName("p");
+ oldChild = elementList.item(1);
+ rootNode = (Element) oldChild.getParentNode();
+
+ {
+ boolean success = false;
+ try {
+ replacedChild = rootNode.replaceChild(newChild, oldChild);
+ } catch (DOMException ex) {
+ success = (ex.code == DOMException.HIERARCHY_REQUEST_ERR);
+ }
+ assertTrue("throw_HIERARCHY_REQUEST_ERR", success);
+ }
+}
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_nodereplacechildinvalidnodetype";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(hc_nodereplacechildinvalidnodetype.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level1/core/hc_nodereplacechildnewchilddiffdocument.java b/dom/src/test/java/org/w3c/domts/level1/core/hc_nodereplacechildnewchilddiffdocument.java
new file mode 100644
index 0000000..ddcdeee
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level1/core/hc_nodereplacechildnewchilddiffdocument.java
@@ -0,0 +1,109 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+Copyright (c) 2001-2003 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+*/
+
+package org.w3c.domts.level1.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The "replaceChild(newChild,oldChild)" method raises a
+ * WRONG_DOCUMENT_ERR DOMException if the "newChild" was
+ * created from a different document than the one that
+ * created this node.
+ *
+ * Retrieve the second employee and attempt to replace one
+ * of its children with a node created from a different
+ * document. An attempt to make such a replacement
+ * should raise the desired exception.
+* @author Curt Arnold
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-258A00AF')/constant[@name='NOT_FOUND_ERR'])">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-258A00AF')/constant[@name='NOT_FOUND_ERR'])</a>
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-785887307">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-785887307</a>
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-785887307')/raises/exception[@name='DOMException']/descr/p[substring-before(.,':')='NOT_FOUND_ERR'])">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-785887307')/raises/exception[@name='DOMException']/descr/p[substring-before(.,':')='NOT_FOUND_ERR'])</a>
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-785887307">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-785887307</a>
+* @see <a href="http://www.w3.org/Bugs/Public/show_bug.cgi?id=247">http://www.w3.org/Bugs/Public/show_bug.cgi?id=247</a>
+*/
+public final class hc_nodereplacechildnewchilddiffdocument extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public hc_nodereplacechildnewchilddiffdocument(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "hc_staff", false);
+ preload(contentType, "hc_staff", true);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc1;
+ Document doc2;
+ Node oldChild;
+ Node newChild;
+ NodeList elementList;
+ Node elementNode;
+ Node replacedChild;
+ doc1 = (Document) load("hc_staff", false);
+ doc2 = (Document) load("hc_staff", true);
+ newChild = doc1.createElement("br");
+ elementList = doc2.getElementsByTagName("p");
+ elementNode = elementList.item(1);
+ oldChild = elementNode.getFirstChild();
+
+ {
+ boolean success = false;
+ try {
+ replacedChild = elementNode.replaceChild(newChild, oldChild);
+ } catch (DOMException ex) {
+ success = (ex.code == DOMException.WRONG_DOCUMENT_ERR);
+ }
+ assertTrue("throw_WRONG_DOCUMENT_ERR", success);
+ }
+}
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_nodereplacechildnewchilddiffdocument";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(hc_nodereplacechildnewchilddiffdocument.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level1/core/hc_nodereplacechildnewchildexists.java b/dom/src/test/java/org/w3c/domts/level1/core/hc_nodereplacechildnewchildexists.java
new file mode 100644
index 0000000..89bd3eb
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level1/core/hc_nodereplacechildnewchildexists.java
@@ -0,0 +1,121 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+Copyright (c) 2001-2003 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+*/
+
+package org.w3c.domts.level1.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * If the "newChild" is already in the tree, it is first
+ * removed before the new one is added.
+ *
+ * Retrieve the second "p" and replace "acronym" with its "em".
+* @author Curt Arnold
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-785887307">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-785887307</a>
+* @see <a href="http://www.w3.org/Bugs/Public/show_bug.cgi?id=246">http://www.w3.org/Bugs/Public/show_bug.cgi?id=246</a>
+*/
+public final class hc_nodereplacechildnewchildexists extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public hc_nodereplacechildnewchildexists(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "hc_staff", true);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ NodeList elementList;
+ Node employeeNode;
+ NodeList childList;
+ Node oldChild = null;
+
+ Node newChild = null;
+
+ Node child;
+ String childName;
+ Node childNode;
+ java.util.List actual = new java.util.ArrayList();
+
+ java.util.List expected = new java.util.ArrayList();
+ expected.add("strong");
+ expected.add("code");
+ expected.add("sup");
+ expected.add("var");
+ expected.add("em");
+
+ Node replacedChild;
+ int nodeType;
+ doc = (Document) load("hc_staff", true);
+ elementList = doc.getElementsByTagName("p");
+ employeeNode = elementList.item(1);
+ childList = ((Element) /*Node */employeeNode).getElementsByTagName("*");
+ newChild = childList.item(0);
+ oldChild = childList.item(5);
+ replacedChild = employeeNode.replaceChild(newChild, oldChild);
+ assertSame("return_value_same", oldChild, replacedChild);
+for (int indexN10094 = 0; indexN10094 < childList.getLength(); indexN10094++) {
+ childNode = (Node) childList.item(indexN10094);
+ childName = childNode.getNodeName();
+ nodeType = (int) childNode.getNodeType();
+
+ if (equals(1, nodeType)) {
+ actual.add(childName);
+ } else {
+ assertEquals("textNodeType", 3, nodeType);
+ assertEquals("textNodeName", "#text", childName);
+ }
+
+ }
+ assertEqualsAutoCase("element", "childNames", expected, actual);
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_nodereplacechildnewchildexists";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(hc_nodereplacechildnewchildexists.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level1/core/hc_nodereplacechildnodeancestor.java b/dom/src/test/java/org/w3c/domts/level1/core/hc_nodereplacechildnodeancestor.java
new file mode 100644
index 0000000..eda7606
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level1/core/hc_nodereplacechildnodeancestor.java
@@ -0,0 +1,106 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+Copyright (c) 2001 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+*/
+
+package org.w3c.domts.level1.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The "replaceChild(newChild,oldChild)" method raises a
+ * HIERARCHY_REQUEST_ERR DOMException if the node to put
+ * in is one of this node's ancestors.
+ *
+ * Retrieve the second employee and attempt to replace
+ * one of its children with an ancestor node(root node).
+ * An attempt to make such a replacement should raise the
+ * desired exception.
+* @author Curt Arnold
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-258A00AF')/constant[@name='HIERARCHY_REQUEST_ERR'])">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-258A00AF')/constant[@name='HIERARCHY_REQUEST_ERR'])</a>
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-785887307">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-785887307</a>
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-785887307')/raises/exception[@name='DOMException']/descr/p[substring-before(.,':')='HIERARCHY_REQUEST_ERR'])">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-785887307')/raises/exception[@name='DOMException']/descr/p[substring-before(.,':')='HIERARCHY_REQUEST_ERR'])</a>
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-785887307">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-785887307</a>
+*/
+public final class hc_nodereplacechildnodeancestor extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public hc_nodereplacechildnodeancestor(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "hc_staff", true);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ Node newChild;
+ NodeList elementList;
+ Node employeeNode;
+ NodeList childList;
+ Node oldChild;
+ Node replacedNode;
+ doc = (Document) load("hc_staff", true);
+ newChild = doc.getDocumentElement();
+ elementList = doc.getElementsByTagName("p");
+ employeeNode = elementList.item(1);
+ childList = employeeNode.getChildNodes();
+ oldChild = childList.item(0);
+
+ {
+ boolean success = false;
+ try {
+ replacedNode = employeeNode.replaceChild(newChild, oldChild);
+ } catch (DOMException ex) {
+ success = (ex.code == DOMException.HIERARCHY_REQUEST_ERR);
+ }
+ assertTrue("throw_HIERARCHY_REQUEST_ERR", success);
+ }
+}
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_nodereplacechildnodeancestor";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(hc_nodereplacechildnodeancestor.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level1/core/hc_nodereplacechildnodename.java b/dom/src/test/java/org/w3c/domts/level1/core/hc_nodereplacechildnodename.java
new file mode 100644
index 0000000..6947d39
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level1/core/hc_nodereplacechildnodename.java
@@ -0,0 +1,99 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+Copyright (c) 2001-2003 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+*/
+
+package org.w3c.domts.level1.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The "replaceChild(newChild,oldChild)" method returns
+ * the node being replaced.
+ *
+ * Replace the second Element of the second employee with
+ * a newly created node Element and check the NodeName
+ * returned by the "replaceChild(newChild,oldChild)"
+ * method. The returned node should have a NodeName equal
+ * to "em".
+* @author Curt Arnold
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-F68D095">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-F68D095</a>
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-785887307">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-785887307</a>
+* @see <a href="http://www.w3.org/Bugs/Public/show_bug.cgi?id=247">http://www.w3.org/Bugs/Public/show_bug.cgi?id=247</a>
+*/
+public final class hc_nodereplacechildnodename extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public hc_nodereplacechildnodename(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "hc_staff", true);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ NodeList elementList;
+ Node employeeNode;
+ NodeList childList;
+ Node oldChild;
+ Node newChild;
+ Node replacedNode;
+ String childName;
+ doc = (Document) load("hc_staff", true);
+ elementList = doc.getElementsByTagName("p");
+ employeeNode = elementList.item(1);
+ childList = ((Element) /*Node */employeeNode).getElementsByTagName("em");
+ oldChild = childList.item(0);
+ newChild = doc.createElement("br");
+ replacedNode = employeeNode.replaceChild(newChild, oldChild);
+ childName = replacedNode.getNodeName();
+ assertEqualsAutoCase("element", "replacedNodeName", "em", childName);
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_nodereplacechildnodename";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(hc_nodereplacechildnodename.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level1/core/hc_nodereplacechildoldchildnonexistent.java b/dom/src/test/java/org/w3c/domts/level1/core/hc_nodereplacechildoldchildnonexistent.java
new file mode 100644
index 0000000..bbbda27
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level1/core/hc_nodereplacechildoldchildnonexistent.java
@@ -0,0 +1,104 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+Copyright (c) 2001-2003 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+*/
+
+package org.w3c.domts.level1.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The "replaceChild(newChild,oldChild)" method raises a
+ * NOT_FOUND_ERR DOMException if the old child is
+ * not a child of this node.
+ *
+ * Retrieve the second employee and attempt to replace a
+ * node that is not one of its children. An attempt to
+ * replace such a node should raise the desired exception.
+* @author Curt Arnold
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-258A00AF')/constant[@name='NOT_FOUND_ERR'])">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-258A00AF')/constant[@name='NOT_FOUND_ERR'])</a>
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-785887307">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-785887307</a>
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-785887307')/raises/exception[@name='DOMException']/descr/p[substring-before(.,':')='NOT_FOUND_ERR'])">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-785887307')/raises/exception[@name='DOMException']/descr/p[substring-before(.,':')='NOT_FOUND_ERR'])</a>
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-785887307">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-785887307</a>
+* @see <a href="http://www.w3.org/Bugs/Public/show_bug.cgi?id=247">http://www.w3.org/Bugs/Public/show_bug.cgi?id=247</a>
+*/
+public final class hc_nodereplacechildoldchildnonexistent extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public hc_nodereplacechildoldchildnonexistent(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "hc_staff", true);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ Node oldChild;
+ Node newChild;
+ NodeList elementList;
+ Node elementNode;
+ Node replacedNode;
+ doc = (Document) load("hc_staff", true);
+ newChild = doc.createElement("br");
+ oldChild = doc.createElement("b");
+ elementList = doc.getElementsByTagName("p");
+ elementNode = elementList.item(1);
+
+ {
+ boolean success = false;
+ try {
+ replacedNode = elementNode.replaceChild(newChild, oldChild);
+ } catch (DOMException ex) {
+ success = (ex.code == DOMException.NOT_FOUND_ERR);
+ }
+ assertTrue("throw_NOT_FOUND_ERR", success);
+ }
+}
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_nodereplacechildoldchildnonexistent";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(hc_nodereplacechildoldchildnonexistent.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level1/core/hc_nodetextnodeattribute.java b/dom/src/test/java/org/w3c/domts/level1/core/hc_nodetextnodeattribute.java
new file mode 100644
index 0000000..0744204
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level1/core/hc_nodetextnodeattribute.java
@@ -0,0 +1,89 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+Copyright (c) 2001 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+*/
+
+package org.w3c.domts.level1.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The "getAttributes()" method invoked on a Text
+ * Node returns null.
+ * Retrieve the Text node from the last child of the
+ * first employee and invoke the "getAttributes()" method
+ * on the Text Node. It should return null.
+* @author Curt Arnold
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-84CF096">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-84CF096</a>
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-1312295772">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-1312295772</a>
+*/
+public final class hc_nodetextnodeattribute extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public hc_nodetextnodeattribute(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "hc_staff", false);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ NodeList elementList;
+ Node testAddr;
+ Node textNode;
+ NamedNodeMap attrList;
+ doc = (Document) load("hc_staff", false);
+ elementList = doc.getElementsByTagName("acronym");
+ testAddr = elementList.item(0);
+ textNode = testAddr.getFirstChild();
+ attrList = textNode.getAttributes();
+ assertNull("text_attributes_is_null", attrList);
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_nodetextnodeattribute";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(hc_nodetextnodeattribute.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level1/core/hc_nodetextnodename.java b/dom/src/test/java/org/w3c/domts/level1/core/hc_nodetextnodename.java
new file mode 100644
index 0000000..830d086
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level1/core/hc_nodetextnodename.java
@@ -0,0 +1,85 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+Copyright (c) 2001-2004 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+*/
+
+package org.w3c.domts.level1.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The string returned by the "getNodeName()" method for a
+ * Text Node is "#text".
+* @author Curt Arnold
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-F68D095">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-F68D095</a>
+*/
+public final class hc_nodetextnodename extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public hc_nodetextnodename(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "hc_staff", false);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ NodeList elementList;
+ Element testAddr;
+ Node textNode;
+ String textName;
+ doc = (Document) load("hc_staff", false);
+ elementList = doc.getElementsByTagName("acronym");
+ testAddr = (Element) elementList.item(0);
+ textNode = testAddr.getFirstChild();
+ textName = textNode.getNodeName();
+ assertEquals("textNodeName", "#text", textName);
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_nodetextnodename";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(hc_nodetextnodename.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level1/core/hc_nodetextnodetype.java b/dom/src/test/java/org/w3c/domts/level1/core/hc_nodetextnodetype.java
new file mode 100644
index 0000000..f9c0862
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level1/core/hc_nodetextnodetype.java
@@ -0,0 +1,89 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+Copyright (c) 2001 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+*/
+
+package org.w3c.domts.level1.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The "getNodeType()" method for a Text Node
+ * returns the constant value 3.
+ *
+ * Retrieve the Text node from the last child of
+ * the first employee and invoke the "getNodeType()"
+ * method. The method should return 3.
+* @author Curt Arnold
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-111237558">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-111237558</a>
+*/
+public final class hc_nodetextnodetype extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public hc_nodetextnodetype(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "hc_staff", false);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ NodeList elementList;
+ Element testAddr;
+ Node textNode;
+ int nodeType;
+ doc = (Document) load("hc_staff", false);
+ elementList = doc.getElementsByTagName("acronym");
+ testAddr = (Element) elementList.item(0);
+ textNode = testAddr.getFirstChild();
+ nodeType = (int) textNode.getNodeType();
+ assertEquals("nodeTextNodeTypeAssert1", 3, nodeType);
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_nodetextnodetype";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(hc_nodetextnodetype.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level1/core/hc_nodetextnodevalue.java b/dom/src/test/java/org/w3c/domts/level1/core/hc_nodetextnodevalue.java
new file mode 100644
index 0000000..b647ebb
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level1/core/hc_nodetextnodevalue.java
@@ -0,0 +1,90 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+Copyright (c) 2001-2004 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+*/
+
+package org.w3c.domts.level1.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The string returned by the "getNodeValue()" method for a
+ * Text Node is the content of the Text node.
+ *
+ * Retrieve the Text node from the last child of the first
+ * employee and check the string returned by the
+ * "getNodeValue()" method. It should be equal to
+ * "1230 North Ave. Dallas, Texas 98551".
+* @author Curt Arnold
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-F68D080">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-F68D080</a>
+*/
+public final class hc_nodetextnodevalue extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public hc_nodetextnodevalue(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "hc_staff", false);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ NodeList elementList;
+ Element testAddr;
+ Node textNode;
+ String textValue;
+ doc = (Document) load("hc_staff", false);
+ elementList = doc.getElementsByTagName("acronym");
+ testAddr = (Element) elementList.item(0);
+ textNode = testAddr.getFirstChild();
+ textValue = textNode.getNodeValue();
+ assertEquals("textNodeValue", "1230 North Ave. Dallas, Texas 98551", textValue);
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_nodetextnodevalue";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(hc_nodetextnodevalue.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level1/core/hc_nodevalue01.java b/dom/src/test/java/org/w3c/domts/level1/core/hc_nodevalue01.java
new file mode 100644
index 0000000..1ef97f5
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level1/core/hc_nodevalue01.java
@@ -0,0 +1,85 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+Copyright (c) 2001 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+*/
+
+package org.w3c.domts.level1.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * An element is created, setNodeValue is called with a non-null argument, but getNodeValue
+ * should still return null.
+* @author Curt Arnold
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-F68D080">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-F68D080</a>
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#i-Document">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#i-Document</a>
+*/
+public final class hc_nodevalue01 extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public hc_nodevalue01(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "hc_staff", true);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ Element newNode;
+ String newValue;
+ doc = (Document) load("hc_staff", true);
+ newNode = doc.createElement("acronym");
+ newValue = newNode.getNodeValue();
+ assertNull("initiallyNull", newValue);
+ newNode.setNodeValue("This should have no effect");
+ newValue = newNode.getNodeValue();
+ assertNull("nullAfterAttemptedChange", newValue);
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_nodevalue01";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(hc_nodevalue01.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level1/core/hc_nodevalue02.java b/dom/src/test/java/org/w3c/domts/level1/core/hc_nodevalue02.java
new file mode 100644
index 0000000..89fb85e
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level1/core/hc_nodevalue02.java
@@ -0,0 +1,85 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+Copyright (c) 2001 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+*/
+
+package org.w3c.domts.level1.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * An comment is created, setNodeValue is called with a non-null argument, but getNodeValue
+ * should still return null.
+* @author Curt Arnold
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-F68D080">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-F68D080</a>
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-1728279322">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-1728279322</a>
+*/
+public final class hc_nodevalue02 extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public hc_nodevalue02(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "hc_staff", true);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ Node newNode;
+ String newValue;
+ doc = (Document) load("hc_staff", true);
+ newNode = doc.createComment("This is a new Comment node");
+ newValue = newNode.getNodeValue();
+ assertEquals("initial", "This is a new Comment node", newValue);
+ newNode.setNodeValue("This should have an effect");
+ newValue = newNode.getNodeValue();
+ assertEquals("afterChange", "This should have an effect", newValue);
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_nodevalue02";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(hc_nodevalue02.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level1/core/hc_nodevalue03.java b/dom/src/test/java/org/w3c/domts/level1/core/hc_nodevalue03.java
new file mode 100644
index 0000000..336b8e7
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level1/core/hc_nodevalue03.java
@@ -0,0 +1,101 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+Copyright (c) 2001 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+*/
+
+package org.w3c.domts.level1.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * An entity reference is created, setNodeValue is called with a non-null argument, but getNodeValue
+ * should still return null.
+* @author Curt Arnold
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-F68D080">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-F68D080</a>
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-11C98490">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-11C98490</a>
+*/
+public final class hc_nodevalue03 extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public hc_nodevalue03(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "hc_staff", true);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ Node newNode;
+ String newValue;
+ doc = (Document) load("hc_staff", true);
+
+ if (("text/html".equals(getContentType()))) {
+
+ {
+ boolean success = false;
+ try {
+ newNode = doc.createEntityReference("ent1");
+ } catch (DOMException ex) {
+ success = (ex.code == DOMException.NOT_SUPPORTED_ERR);
+ }
+ assertTrue("throw_NOT_SUPPORTED_ERR", success);
+ }
+} else {
+ newNode = doc.createEntityReference("ent1");
+ assertNotNull("createdEntRefNotNull", newNode);
+ newValue = newNode.getNodeValue();
+ assertNull("initiallyNull", newValue);
+ newNode.setNodeValue("This should have no effect");
+ newValue = newNode.getNodeValue();
+ assertNull("nullAfterAttemptedChange", newValue);
+ }
+
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_nodevalue03";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(hc_nodevalue03.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level1/core/hc_nodevalue04.java b/dom/src/test/java/org/w3c/domts/level1/core/hc_nodevalue04.java
new file mode 100644
index 0000000..c86fd47
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level1/core/hc_nodevalue04.java
@@ -0,0 +1,92 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+Copyright (c) 2001-2004 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+*/
+
+package org.w3c.domts.level1.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * An document type accessed, setNodeValue is called with a non-null argument, but getNodeValue
+ * should still return null.
+* @author Curt Arnold
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-F68D080">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-F68D080</a>
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-B63ED1A31">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-B63ED1A31</a>
+*/
+public final class hc_nodevalue04 extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public hc_nodevalue04(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "hc_staff", true);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ Node newNode;
+ String newValue;
+ doc = (Document) load("hc_staff", true);
+ newNode = doc.getDoctype();
+ assertTrue("docTypeNotNullOrDocIsHTML",
+ ((newNode != null) | ("text/html".equals(getContentType())))
+);
+
+ if ((newNode != null)) {
+ assertNotNull("docTypeNotNull", newNode);
+ newValue = newNode.getNodeValue();
+ assertNull("initiallyNull", newValue);
+ newNode.setNodeValue("This should have no effect");
+ newValue = newNode.getNodeValue();
+ assertNull("nullAfterAttemptedChange", newValue);
+ }
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_nodevalue04";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(hc_nodevalue04.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level1/core/hc_nodevalue05.java b/dom/src/test/java/org/w3c/domts/level1/core/hc_nodevalue05.java
new file mode 100644
index 0000000..bb71bc4
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level1/core/hc_nodevalue05.java
@@ -0,0 +1,85 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+Copyright (c) 2001 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+*/
+
+package org.w3c.domts.level1.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * A document fragment is created, setNodeValue is called with a non-null argument, but getNodeValue
+ * should still return null.
+* @author Curt Arnold
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-F68D080">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-F68D080</a>
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-B63ED1A3">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-B63ED1A3</a>
+*/
+public final class hc_nodevalue05 extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public hc_nodevalue05(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "hc_staff", true);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ Node newNode;
+ String newValue;
+ doc = (Document) load("hc_staff", true);
+ newNode = doc.createDocumentFragment();
+ newValue = newNode.getNodeValue();
+ assertNull("initiallyNull", newValue);
+ newNode.setNodeValue("This should have no effect");
+ newValue = newNode.getNodeValue();
+ assertNull("nullAfterAttemptedChange", newValue);
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_nodevalue05";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(hc_nodevalue05.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level1/core/hc_nodevalue06.java b/dom/src/test/java/org/w3c/domts/level1/core/hc_nodevalue06.java
new file mode 100644
index 0000000..79bafb3
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level1/core/hc_nodevalue06.java
@@ -0,0 +1,83 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+Copyright (c) 2001 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+*/
+
+package org.w3c.domts.level1.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * An document is accessed, setNodeValue is called with a non-null argument, but getNodeValue
+ * should still return null.
+* @author Curt Arnold
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-F68D080">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-F68D080</a>
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#i-Document">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#i-Document</a>
+*/
+public final class hc_nodevalue06 extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public hc_nodevalue06(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "hc_staff", true);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document newNode;
+ String newValue;
+ newNode = (Document) load("hc_staff", true);
+ newValue = newNode.getNodeValue();
+ assertNull("initiallyNull", newValue);
+ newNode.setNodeValue("This should have no effect");
+ newValue = newNode.getNodeValue();
+ assertNull("nullAfterAttemptedChange", newValue);
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_nodevalue06";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(hc_nodevalue06.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level1/core/hc_nodevalue07.java b/dom/src/test/java/org/w3c/domts/level1/core/hc_nodevalue07.java
new file mode 100644
index 0000000..b0a8217
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level1/core/hc_nodevalue07.java
@@ -0,0 +1,100 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+Copyright (c) 2001-2004 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+*/
+
+package org.w3c.domts.level1.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * An Entity is accessed, setNodeValue is called with a non-null argument, but getNodeValue
+ * should still return null.
+* @author Curt Arnold
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-F68D080">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-F68D080</a>
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-527DCFF2">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-527DCFF2</a>
+*/
+public final class hc_nodevalue07 extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public hc_nodevalue07(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+ if (factory.hasFeature("XML", null) != true) {
+ throw org.w3c.domts.DOMTestIncompatibleException.incompatibleFeature("XML", null);
+ }
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "hc_staff", true);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ Node newNode;
+ String newValue;
+ NamedNodeMap nodeMap;
+ DocumentType docType;
+ doc = (Document) load("hc_staff", true);
+ docType = doc.getDoctype();
+
+ if (
+ !(("text/html".equals(getContentType())))
+) {
+ assertNotNull("docTypeNotNull", docType);
+ nodeMap = docType.getEntities();
+ assertNotNull("entitiesNotNull", nodeMap);
+ newNode = nodeMap.getNamedItem("alpha");
+ assertNotNull("entityNotNull", newNode);
+ newValue = newNode.getNodeValue();
+ assertNull("initiallyNull", newValue);
+ newNode.setNodeValue("This should have no effect");
+ newValue = newNode.getNodeValue();
+ assertNull("nullAfterAttemptedChange", newValue);
+ }
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_nodevalue07";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(hc_nodevalue07.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level1/core/hc_nodevalue08.java b/dom/src/test/java/org/w3c/domts/level1/core/hc_nodevalue08.java
new file mode 100644
index 0000000..05bdf5b
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level1/core/hc_nodevalue08.java
@@ -0,0 +1,100 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+Copyright (c) 2001-2004 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+*/
+
+package org.w3c.domts.level1.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * An notation is accessed, setNodeValue is called with a non-null argument, but getNodeValue
+ * should still return null.
+* @author Curt Arnold
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-F68D080">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-F68D080</a>
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-5431D1B9">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-5431D1B9</a>
+*/
+public final class hc_nodevalue08 extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public hc_nodevalue08(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+ if (factory.hasFeature("XML", null) != true) {
+ throw org.w3c.domts.DOMTestIncompatibleException.incompatibleFeature("XML", null);
+ }
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "hc_staff", true);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ DocumentType docType;
+ Node newNode;
+ String newValue;
+ NamedNodeMap nodeMap;
+ doc = (Document) load("hc_staff", true);
+ docType = doc.getDoctype();
+
+ if (
+ !(("text/html".equals(getContentType())))
+) {
+ assertNotNull("docTypeNotNull", docType);
+ nodeMap = docType.getNotations();
+ assertNotNull("notationsNotNull", nodeMap);
+ newNode = nodeMap.getNamedItem("notation1");
+ assertNotNull("notationNotNull", newNode);
+ newValue = newNode.getNodeValue();
+ assertNull("initiallyNull", newValue);
+ newNode.setNodeValue("This should have no effect");
+ newValue = newNode.getNodeValue();
+ assertNull("nullAfterAttemptedChange", newValue);
+ }
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_nodevalue08";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(hc_nodevalue08.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level1/core/hc_notationsremovenameditem1.java b/dom/src/test/java/org/w3c/domts/level1/core/hc_notationsremovenameditem1.java
new file mode 100644
index 0000000..d088d3f
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level1/core/hc_notationsremovenameditem1.java
@@ -0,0 +1,101 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+Copyright (c) 2004 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+*/
+
+package org.w3c.domts.level1.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * An attempt to add remove an notation should result in a NO_MODIFICATION_ERR.
+* @author Curt Arnold
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-D46829EF">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-D46829EF</a>
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-D58B193">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-D58B193</a>
+*/
+public final class hc_notationsremovenameditem1 extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public hc_notationsremovenameditem1(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+ if (factory.hasFeature("XML", null) != true) {
+ throw org.w3c.domts.DOMTestIncompatibleException.incompatibleFeature("XML", null);
+ }
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "hc_staff", true);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ NamedNodeMap notations;
+ DocumentType docType;
+ Node retval;
+ doc = (Document) load("hc_staff", true);
+ docType = doc.getDoctype();
+
+ if (
+ !(("text/html".equals(getContentType())))
+) {
+ assertNotNull("docTypeNotNull", docType);
+ notations = docType.getNotations();
+ assertNotNull("notationsNotNull", notations);
+
+ {
+ boolean success = false;
+ try {
+ retval = notations.removeNamedItem("notation1");
+ } catch (DOMException ex) {
+ success = (ex.code == DOMException.NO_MODIFICATION_ALLOWED_ERR);
+ }
+ assertTrue("throw_NO_MODIFICATION_ALLOWED_ERR", success);
+ }
+}
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_notationsremovenameditem1";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(hc_notationsremovenameditem1.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level1/core/hc_notationssetnameditem1.java b/dom/src/test/java/org/w3c/domts/level1/core/hc_notationssetnameditem1.java
new file mode 100644
index 0000000..1e220bc
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level1/core/hc_notationssetnameditem1.java
@@ -0,0 +1,109 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+Copyright (c) 2004 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+*/
+
+package org.w3c.domts.level1.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * An attempt to add an element to the named node map returned by notations should
+ * result in a NO_MODIFICATION_ERR or HIERARCHY_REQUEST_ERR.
+* @author Curt Arnold
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-D46829EF">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-D46829EF</a>
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-1025163788">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-1025163788</a>
+*/
+public final class hc_notationssetnameditem1 extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public hc_notationssetnameditem1(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+ if (factory.hasFeature("XML", null) != true) {
+ throw org.w3c.domts.DOMTestIncompatibleException.incompatibleFeature("XML", null);
+ }
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "hc_staff", true);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ NamedNodeMap notations;
+ DocumentType docType;
+ Node retval;
+ Element elem;
+ doc = (Document) load("hc_staff", true);
+ docType = doc.getDoctype();
+
+ if (
+ !(("text/html".equals(getContentType())))
+) {
+ assertNotNull("docTypeNotNull", docType);
+ notations = docType.getNotations();
+ assertNotNull("notationsNotNull", notations);
+ elem = doc.createElement("br");
+
+ try {
+ retval = notations.setNamedItem(elem);
+ fail("throw_HIER_OR_NO_MOD_ERR");
+
+ } catch (DOMException ex) {
+ switch (ex.code) {
+ case 3 :
+ break;
+ case 7 :
+ break;
+ default:
+ throw ex;
+ }
+ }
+}
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_notationssetnameditem1";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(hc_notationssetnameditem1.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level1/core/hc_textindexsizeerrnegativeoffset.java b/dom/src/test/java/org/w3c/domts/level1/core/hc_textindexsizeerrnegativeoffset.java
new file mode 100644
index 0000000..5de7f34
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level1/core/hc_textindexsizeerrnegativeoffset.java
@@ -0,0 +1,107 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+Copyright (c) 2001 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+*/
+
+package org.w3c.domts.level1.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The "splitText(offset)" method raises an
+ * INDEX_SIZE_ERR DOMException if the specified offset is
+ * negative.
+ *
+ * Retrieve the textual data from the second child of the
+ * third employee and invoke the "splitText(offset)" method.
+ * The desired exception should be raised since the offset
+ * is a negative number.
+* @author Curt Arnold
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-258A00AF')/constant[@name='INDEX_SIZE_ERR'])">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-258A00AF')/constant[@name='INDEX_SIZE_ERR'])</a>
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-38853C1D">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-38853C1D</a>
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-38853C1D')/raises/exception[@name='DOMException']/descr/p[substring-before(.,':')='INDEX_SIZE_ERR'])">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-38853C1D')/raises/exception[@name='DOMException']/descr/p[substring-before(.,':')='INDEX_SIZE_ERR'])</a>
+*/
+public final class hc_textindexsizeerrnegativeoffset extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public hc_textindexsizeerrnegativeoffset(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+
+ org.w3c.domts.DocumentBuilderSetting[] settings =
+ new org.w3c.domts.DocumentBuilderSetting[] {
+org.w3c.domts.DocumentBuilderSetting.signed
+ };
+ DOMTestDocumentBuilderFactory testFactory = factory.newInstance(settings);
+ setFactory(testFactory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "hc_staff", true);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ NodeList elementList;
+ Node nameNode;
+ Text textNode;
+ Text splitNode;
+ doc = (Document) load("hc_staff", true);
+ elementList = doc.getElementsByTagName("strong");
+ nameNode = elementList.item(2);
+ textNode = (Text) nameNode.getFirstChild();
+
+ {
+ boolean success = false;
+ try {
+ splitNode = textNode.splitText(-69);
+ } catch (DOMException ex) {
+ success = (ex.code == DOMException.INDEX_SIZE_ERR);
+ }
+ assertTrue("throws_INDEX_SIZE_ERR", success);
+ }
+}
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_textindexsizeerrnegativeoffset";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(hc_textindexsizeerrnegativeoffset.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level1/core/hc_textindexsizeerroffsetoutofbounds.java b/dom/src/test/java/org/w3c/domts/level1/core/hc_textindexsizeerroffsetoutofbounds.java
new file mode 100644
index 0000000..1f58322
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level1/core/hc_textindexsizeerroffsetoutofbounds.java
@@ -0,0 +1,103 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+Copyright (c) 2001-2003 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+*/
+
+package org.w3c.domts.level1.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The "splitText(offset)" method raises an
+ * INDEX_SIZE_ERR DOMException if the specified offset is
+ * greater than the number of characters in the Text node.
+ *
+ * Retrieve the textual data from the second child of the
+ * third employee and invoke the "splitText(offset)" method.
+ * The desired exception should be raised since the offset
+ * is a greater than the number of characters in the Text
+ * node.
+* @author Curt Arnold
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-258A00AF')/constant[@name='INDEX_SIZE_ERR'])">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-258A00AF')/constant[@name='INDEX_SIZE_ERR'])</a>
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-38853C1D">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-38853C1D</a>
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-38853C1D')/raises/exception[@name='DOMException']/descr/p[substring-before(.,':')='INDEX_SIZE_ERR'])">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-38853C1D')/raises/exception[@name='DOMException']/descr/p[substring-before(.,':')='INDEX_SIZE_ERR'])</a>
+* @see <a href="http://www.w3.org/Bugs/Public/show_bug.cgi?id=249">http://www.w3.org/Bugs/Public/show_bug.cgi?id=249</a>
+*/
+public final class hc_textindexsizeerroffsetoutofbounds extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public hc_textindexsizeerroffsetoutofbounds(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "hc_staff", true);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ NodeList elementList;
+ Node nameNode;
+ Text textNode;
+ Text splitNode;
+ doc = (Document) load("hc_staff", true);
+ elementList = doc.getElementsByTagName("strong");
+ nameNode = elementList.item(2);
+ textNode = (Text) nameNode.getFirstChild();
+
+ {
+ boolean success = false;
+ try {
+ splitNode = textNode.splitText(300);
+ } catch (DOMException ex) {
+ success = (ex.code == DOMException.INDEX_SIZE_ERR);
+ }
+ assertTrue("throw_INDEX_SIZE_ERR", success);
+ }
+}
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_textindexsizeerroffsetoutofbounds";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(hc_textindexsizeerroffsetoutofbounds.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level1/core/hc_textparseintolistofelements.java b/dom/src/test/java/org/w3c/domts/level1/core/hc_textparseintolistofelements.java
new file mode 100644
index 0000000..5694a4a
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level1/core/hc_textparseintolistofelements.java
@@ -0,0 +1,125 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+Copyright (c) 2001-2004 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+*/
+
+package org.w3c.domts.level1.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * Retrieve the textual data from the last child of the
+ * second employee. That node is composed of two
+ * EntityReference nodes and two Text nodes. After
+ * the content node is parsed, the "acronym" Element
+ * should contain four children with each one of the
+ * EntityReferences containing one child.
+* @author Curt Arnold
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-1451460987">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-1451460987</a>
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-11C98490">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-11C98490</a>
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-745549614">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-745549614</a>
+*/
+public final class hc_textparseintolistofelements extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public hc_textparseintolistofelements(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "hc_staff", false);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ NodeList elementList;
+ Node addressNode;
+ NodeList childList;
+ Node child;
+ String value;
+ Node grandChild;
+ int length;
+ java.util.List result = new java.util.ArrayList();
+
+ java.util.List expectedNormal = new java.util.ArrayList();
+ expectedNormal.add("β");
+ expectedNormal.add(" Dallas, ");
+ expectedNormal.add("γ");
+ expectedNormal.add("\n 98554");
+
+ java.util.List expectedExpanded = new java.util.ArrayList();
+ expectedExpanded.add("β Dallas, γ\n 98554");
+
+ doc = (Document) load("hc_staff", false);
+ elementList = doc.getElementsByTagName("acronym");
+ addressNode = elementList.item(1);
+ childList = addressNode.getChildNodes();
+ length = (int) childList.getLength();
+ for (int indexN1007C = 0; indexN1007C < childList.getLength(); indexN1007C++) {
+ child = (Node) childList.item(indexN1007C);
+ value = child.getNodeValue();
+
+ if ((value == null)) {
+ grandChild = child.getFirstChild();
+ assertNotNull("grandChildNotNull", grandChild);
+ value = grandChild.getNodeValue();
+ result.add(value);
+ } else {
+ result.add(value);
+ }
+
+ }
+
+ if (equals(1, length)) {
+ assertEquals("assertEqCoalescing", expectedExpanded, result);
+ } else {
+ assertEquals("assertEqNormal", expectedNormal, result);
+ }
+
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_textparseintolistofelements";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(hc_textparseintolistofelements.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level1/core/hc_textsplittextfour.java b/dom/src/test/java/org/w3c/domts/level1/core/hc_textsplittextfour.java
new file mode 100644
index 0000000..beafa42
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level1/core/hc_textsplittextfour.java
@@ -0,0 +1,94 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+Copyright (c) 2001 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+*/
+
+package org.w3c.domts.level1.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The "splitText(offset)" method returns the new Text node.
+ *
+ * Retrieve the textual data from the last child of the
+ * first employee and invoke the "splitText(offset)" method.
+ * The method should return the new Text node. The offset
+ * value used for this test is 30. The "getNodeValue()"
+ * method is called to check that the new node now contains
+ * the characters at and after position 30.
+ * (Starting count at 0)
+* @author Curt Arnold
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-38853C1D">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-38853C1D</a>
+*/
+public final class hc_textsplittextfour extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public hc_textsplittextfour(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "hc_staff", true);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ NodeList elementList;
+ Node addressNode;
+ Text textNode;
+ Text splitNode;
+ String value;
+ doc = (Document) load("hc_staff", true);
+ elementList = doc.getElementsByTagName("acronym");
+ addressNode = elementList.item(0);
+ textNode = (Text) addressNode.getFirstChild();
+ splitNode = textNode.splitText(30);
+ value = splitNode.getNodeValue();
+ assertEquals("textSplitTextFourAssert", "98551", value);
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_textsplittextfour";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(hc_textsplittextfour.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level1/core/hc_textsplittextone.java b/dom/src/test/java/org/w3c/domts/level1/core/hc_textsplittextone.java
new file mode 100644
index 0000000..24f8bd3
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level1/core/hc_textsplittextone.java
@@ -0,0 +1,97 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+Copyright (c) 2001 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+*/
+
+package org.w3c.domts.level1.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The "splitText(offset)" method breaks the Text node into
+ * two Text nodes at the specified offset keeping each node
+ * as siblings in the tree.
+ *
+ * Retrieve the textual data from the second child of the
+ * third employee and invoke the "splitText(offset)" method.
+ * The method splits the Text node into two new sibling
+ * Text nodes keeping both of them in the tree. This test
+ * checks the "nextSibling()" method of the original node
+ * to ensure that the two nodes are indeed siblings.
+* @author Curt Arnold
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-38853C1D">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-38853C1D</a>
+*/
+public final class hc_textsplittextone extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public hc_textsplittextone(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "hc_staff", true);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ NodeList elementList;
+ Node nameNode;
+ Text textNode;
+ Text splitNode;
+ Node secondPart;
+ String value;
+ doc = (Document) load("hc_staff", true);
+ elementList = doc.getElementsByTagName("strong");
+ nameNode = elementList.item(2);
+ textNode = (Text) nameNode.getFirstChild();
+ splitNode = textNode.splitText(7);
+ secondPart = textNode.getNextSibling();
+ value = secondPart.getNodeValue();
+ assertEquals("textSplitTextOneAssert", "Jones", value);
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_textsplittextone";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(hc_textsplittextone.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level1/core/hc_textsplittextthree.java b/dom/src/test/java/org/w3c/domts/level1/core/hc_textsplittextthree.java
new file mode 100644
index 0000000..e607c7a
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level1/core/hc_textsplittextthree.java
@@ -0,0 +1,96 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+Copyright (c) 2001 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+*/
+
+package org.w3c.domts.level1.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * After the "splitText(offset)" method breaks the Text node
+ * into two Text nodes, the new Text node contains all the
+ * content at and after the offset point.
+ *
+ * Retrieve the textual data from the second child of the
+ * third employee and invoke the "splitText(offset)" method.
+ * The new Text node should contain all the content
+ * at and after the offset point. The "getNodeValue()"
+ * method is called to check that the new node now contains
+ * the characters at and after position seven.
+ * (Starting count at 0)
+* @author Curt Arnold
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-38853C1D">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-38853C1D</a>
+*/
+public final class hc_textsplittextthree extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public hc_textsplittextthree(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "hc_staff", true);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ NodeList elementList;
+ Node nameNode;
+ Text textNode;
+ Text splitNode;
+ String value;
+ doc = (Document) load("hc_staff", true);
+ elementList = doc.getElementsByTagName("strong");
+ nameNode = elementList.item(2);
+ textNode = (Text) nameNode.getFirstChild();
+ splitNode = textNode.splitText(6);
+ value = splitNode.getNodeValue();
+ assertEquals("textSplitTextThreeAssert", " Jones", value);
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_textsplittextthree";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(hc_textsplittextthree.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level1/core/hc_textsplittexttwo.java b/dom/src/test/java/org/w3c/domts/level1/core/hc_textsplittexttwo.java
new file mode 100644
index 0000000..da925c7
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level1/core/hc_textsplittexttwo.java
@@ -0,0 +1,95 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+Copyright (c) 2001 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+*/
+
+package org.w3c.domts.level1.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * After the "splitText(offset)" method breaks the Text node
+ * into two Text nodes, the original node contains all the
+ * content up to the offset point.
+ *
+ * Retrieve the textual data from the second child of the
+ * third employee and invoke the "splitText(offset)" method.
+ * The original Text node should contain all the content
+ * up to the offset point. The "getNodeValue()" method
+ * is called to check that the original node now contains
+ * the first five characters.
+* @author Curt Arnold
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-38853C1D">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-38853C1D</a>
+*/
+public final class hc_textsplittexttwo extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public hc_textsplittexttwo(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "hc_staff", true);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ NodeList elementList;
+ Node nameNode;
+ Text textNode;
+ Text splitNode;
+ String value;
+ doc = (Document) load("hc_staff", true);
+ elementList = doc.getElementsByTagName("strong");
+ nameNode = elementList.item(2);
+ textNode = (Text) nameNode.getFirstChild();
+ splitNode = textNode.splitText(5);
+ value = textNode.getNodeValue();
+ assertEquals("textSplitTextTwoAssert", "Roger", value);
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_textsplittexttwo";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(hc_textsplittexttwo.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level1/core/hc_textwithnomarkup.java b/dom/src/test/java/org/w3c/domts/level1/core/hc_textwithnomarkup.java
new file mode 100644
index 0000000..8ff96c2
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level1/core/hc_textwithnomarkup.java
@@ -0,0 +1,94 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+Copyright (c) 2001 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+*/
+
+package org.w3c.domts.level1.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * If there is not any markup inside an Element or Attr node
+ * content, then the text is contained in a single object
+ * implementing the Text interface that is the only child
+ * of the element.
+ *
+ * Retrieve the textual data from the second child of the
+ * third employee. That Text node contains a block of
+ * multiple text lines without markup, so they should be
+ * treated as a single Text node. The "getNodeValue()"
+ * method should contain the combination of the two lines.
+* @author Curt Arnold
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-1312295772">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-1312295772</a>
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-F68D080">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-F68D080</a>
+*/
+public final class hc_textwithnomarkup extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public hc_textwithnomarkup(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "hc_staff", false);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ NodeList elementList;
+ Node nameNode;
+ Node nodeV;
+ String value;
+ doc = (Document) load("hc_staff", false);
+ elementList = doc.getElementsByTagName("strong");
+ nameNode = elementList.item(2);
+ nodeV = nameNode.getFirstChild();
+ value = nodeV.getNodeValue();
+ assertEquals("textWithNoMarkupAssert", "Roger\n Jones", value);
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_textwithnomarkup";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(hc_textwithnomarkup.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level1/core/namednodemapchildnoderange.java b/dom/src/test/java/org/w3c/domts/level1/core/namednodemapchildnoderange.java
new file mode 100644
index 0000000..007ee0a
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level1/core/namednodemapchildnoderange.java
@@ -0,0 +1,95 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+Copyright (c) 2001 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+*/
+
+package org.w3c.domts.level1.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The range of valid child node indices is 0 to Length -1.
+ *
+ * Create a NamedNodeMap object from the attributes of the
+ * last child of the third employee and traverse the
+ * list from index 0 thru length -1. All indices should
+ * be valid.
+* @author NIST
+* @author Mary Brady
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-84CF096">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-84CF096</a>
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-349467F9">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-349467F9</a>
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-6D0FB19E">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-6D0FB19E</a>
+*/
+public final class namednodemapchildnoderange extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public namednodemapchildnoderange(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "staff", true);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ NodeList elementList;
+ Node testEmployee;
+ NamedNodeMap attributes;
+ Node child;
+ int length;
+ doc = (Document) load("staff", true);
+ elementList = doc.getElementsByTagName("address");
+ testEmployee = elementList.item(2);
+ attributes = testEmployee.getAttributes();
+ length = (int) attributes.getLength();
+ assertEquals("length", 2, length);
+ child = attributes.item(0);
+ child = attributes.item(1);
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/namednodemapchildnoderange";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(namednodemapchildnoderange.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level1/core/namednodemapgetnameditem.java b/dom/src/test/java/org/w3c/domts/level1/core/namednodemapgetnameditem.java
new file mode 100644
index 0000000..fea0691
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level1/core/namednodemapgetnameditem.java
@@ -0,0 +1,95 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+Copyright (c) 2001 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+*/
+
+package org.w3c.domts.level1.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The "getNamedItem(name)" method retrieves a node
+ * specified by name.
+ *
+ * Retrieve the second employee and create a NamedNodeMap
+ * listing of the attributes of the last child. Once the
+ * list is created an invocation of the "getNamedItem(name)"
+ * method is done with name="domestic". This should result
+ * in the domestic Attr node being returned.
+* @author NIST
+* @author Mary Brady
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-1074577549">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-1074577549</a>
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-349467F9">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-349467F9</a>
+*/
+public final class namednodemapgetnameditem extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public namednodemapgetnameditem(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "staff", false);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ NodeList elementList;
+ Node testEmployee;
+ NamedNodeMap attributes;
+ Attr domesticAttr;
+ String attrName;
+ doc = (Document) load("staff", false);
+ elementList = doc.getElementsByTagName("address");
+ testEmployee = elementList.item(1);
+ attributes = testEmployee.getAttributes();
+ domesticAttr = (Attr) attributes.getNamedItem("domestic");
+ attrName = domesticAttr.getNodeName();
+ assertEquals("namednodemapGetNamedItemAssert", "domestic", attrName);
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/namednodemapgetnameditem";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(namednodemapgetnameditem.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level1/core/namednodemapinuseattributeerr.java b/dom/src/test/java/org/w3c/domts/level1/core/namednodemapinuseattributeerr.java
new file mode 100644
index 0000000..ebe7a2e
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level1/core/namednodemapinuseattributeerr.java
@@ -0,0 +1,110 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+Copyright (c) 2001-2003 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+*/
+
+package org.w3c.domts.level1.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The "setNamedItem(arg)" method raises a
+ * INUSE_ATTRIBUTE_ERR DOMException if "arg" is an
+ * Attr that is already in an attribute of another Element.
+ * Create a NamedNodeMap object from the attributes of the
+ * last child of the third employee and attempt to add
+ * an attribute that is already being used by the first
+ * employee. This should raise the desired exception.
+* @author NIST
+* @author Mary Brady
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-258A00AF')/constant[@name='INUSE_ATTRIBUTE_ERR'])">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-258A00AF')/constant[@name='INUSE_ATTRIBUTE_ERR'])</a>
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-1025163788">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-1025163788</a>
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-1025163788')/raises/exception[@name='DOMException']/descr/p[substring-before(.,':')='INUSE_ATTRIBUTE_ERR'])">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-1025163788')/raises/exception[@name='DOMException']/descr/p[substring-before(.,':')='INUSE_ATTRIBUTE_ERR'])</a>
+* @see <a href="http://www.w3.org/Bugs/Public/show_bug.cgi?id=249">http://www.w3.org/Bugs/Public/show_bug.cgi?id=249</a>
+*/
+public final class namednodemapinuseattributeerr extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public namednodemapinuseattributeerr(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "staff", true);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ NodeList elementList;
+ Element firstNode;
+ Node testNode;
+ NamedNodeMap attributes;
+ Attr domesticAttr;
+ Attr setAttr;
+ Node setNode;
+ doc = (Document) load("staff", true);
+ elementList = doc.getElementsByTagName("address");
+ firstNode = (Element) elementList.item(0);
+ domesticAttr = doc.createAttribute("domestic");
+ domesticAttr.setValue("Yes");
+ setAttr = firstNode.setAttributeNode(domesticAttr);
+ elementList = doc.getElementsByTagName("address");
+ testNode = elementList.item(2);
+ attributes = testNode.getAttributes();
+
+ {
+ boolean success = false;
+ try {
+ setNode = attributes.setNamedItem(domesticAttr);
+ } catch (DOMException ex) {
+ success = (ex.code == DOMException.INUSE_ATTRIBUTE_ERR);
+ }
+ assertTrue("throw_INUSE_ATTRIBUTE_ERR", success);
+ }
+}
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/namednodemapinuseattributeerr";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(namednodemapinuseattributeerr.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level1/core/namednodemapnotfounderr.java b/dom/src/test/java/org/w3c/domts/level1/core/namednodemapnotfounderr.java
new file mode 100644
index 0000000..bfd93f4
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level1/core/namednodemapnotfounderr.java
@@ -0,0 +1,103 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+Copyright (c) 2001 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+*/
+
+package org.w3c.domts.level1.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The "removeNamedItem(name)" method raises a
+ * NOT_FOUND_ERR DOMException if there is not a node
+ * named "name" in the map.
+ *
+ * Create a NamedNodeMap object from the attributes of the
+ * last child of the third employee and attempt to remove
+ * the "district" attribute. There is not a node named
+ * "district" in the list and therefore the desired
+ * exception should be raised.
+* @author NIST
+* @author Mary Brady
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-258A00AF')/constant[@name='INUSE_ATTRIBUTE_ERR'])">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-258A00AF')/constant[@name='INUSE_ATTRIBUTE_ERR'])</a>
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-D58B193">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-D58B193</a>
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-D58B193')/raises/exception[@name='DOMException']/descr/p[substring-before(.,':')='INUSE_ATTRIBUTE_ERR'])">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-D58B193')/raises/exception[@name='DOMException']/descr/p[substring-before(.,':')='INUSE_ATTRIBUTE_ERR'])</a>
+*/
+public final class namednodemapnotfounderr extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public namednodemapnotfounderr(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "staff", true);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ NodeList elementList;
+ Element testEmployee;
+ NamedNodeMap attributes;
+ Node removedNode;
+ doc = (Document) load("staff", true);
+ elementList = doc.getElementsByTagName("address");
+ testEmployee = (Element) elementList.item(2);
+ attributes = testEmployee.getAttributes();
+
+ {
+ boolean success = false;
+ try {
+ removedNode = attributes.removeNamedItem("district");
+ } catch (DOMException ex) {
+ success = (ex.code == DOMException.NOT_FOUND_ERR);
+ }
+ assertTrue("throw_NOT_FOUND_ERR", success);
+ }
+}
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/namednodemapnotfounderr";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(namednodemapnotfounderr.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level1/core/namednodemapnumberofnodes.java b/dom/src/test/java/org/w3c/domts/level1/core/namednodemapnumberofnodes.java
new file mode 100644
index 0000000..2209735
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level1/core/namednodemapnumberofnodes.java
@@ -0,0 +1,92 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+Copyright (c) 2001 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+*/
+
+package org.w3c.domts.level1.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The "getLength()" method returns the number of nodes
+ * in the map.
+ *
+ * Retrieve the second employee and create a NamedNodeMap
+ * listing of the attributes of the last child. Once the
+ * list is created an invocation of the "getLength()"
+ * method is executed. The number of nodes should be 2.
+* @author NIST
+* @author Mary Brady
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-84CF096">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-84CF096</a>
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-6D0FB19E">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-6D0FB19E</a>
+*/
+public final class namednodemapnumberofnodes extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public namednodemapnumberofnodes(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "staff", true);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ NodeList elementList;
+ Node testEmployee;
+ NamedNodeMap attributes;
+ int length;
+ doc = (Document) load("staff", true);
+ elementList = doc.getElementsByTagName("address");
+ testEmployee = elementList.item(2);
+ attributes = testEmployee.getAttributes();
+ length = (int) attributes.getLength();
+ assertEquals("length", 2, length);
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/namednodemapnumberofnodes";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(namednodemapnumberofnodes.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level1/core/namednodemapremovenameditem.java b/dom/src/test/java/org/w3c/domts/level1/core/namednodemapremovenameditem.java
new file mode 100644
index 0000000..667c7f8
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level1/core/namednodemapremovenameditem.java
@@ -0,0 +1,107 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+Copyright (c) 2001-2004 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+*/
+
+package org.w3c.domts.level1.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The "removeNamedItem(name)" method removes a node
+ * specified by name.
+ *
+ * Retrieve the third employee and create a NamedNodeMap
+ * object of the attributes of the last child. Once the
+ * list is created invoke the "removeNamedItem(name)"
+ * method with name="street". This should result
+ * in the removal of the specified attribute and
+ * the "getSpecified()" method should return false.
+* @author NIST
+* @author Mary Brady
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-D58B193">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-D58B193</a>
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-349467F9">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-349467F9</a>
+* @see <a href="http://lists.w3.org/Archives/Public/www-dom-ts/2002Mar/0002.html">http://lists.w3.org/Archives/Public/www-dom-ts/2002Mar/0002.html</a>
+*/
+public final class namednodemapremovenameditem extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public namednodemapremovenameditem(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+
+ org.w3c.domts.DocumentBuilderSetting[] settings =
+ new org.w3c.domts.DocumentBuilderSetting[] {
+org.w3c.domts.DocumentBuilderSetting.validating
+ };
+ DOMTestDocumentBuilderFactory testFactory = factory.newInstance(settings);
+ setFactory(testFactory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "staff", true);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ NodeList elementList;
+ Node testAddress;
+ NamedNodeMap attributes;
+ Attr streetAttr;
+ boolean specified;
+ Node removedNode;
+ doc = (Document) load("staff", true);
+ elementList = doc.getElementsByTagName("address");
+ testAddress = elementList.item(2);
+ attributes = testAddress.getAttributes();
+ assertNotNull("attributesNotNull", attributes);
+ removedNode = attributes.removeNamedItem("street");
+ streetAttr = (Attr) attributes.getNamedItem("street");
+ assertNotNull("streetAttrNotNull", streetAttr);
+ specified = streetAttr.getSpecified();
+ assertFalse("attrNotSpecified", specified);
+}
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/namednodemapremovenameditem";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(namednodemapremovenameditem.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level1/core/namednodemapremovenameditemgetvalue.java b/dom/src/test/java/org/w3c/domts/level1/core/namednodemapremovenameditemgetvalue.java
new file mode 100644
index 0000000..bd431bb
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level1/core/namednodemapremovenameditemgetvalue.java
@@ -0,0 +1,109 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+Copyright (c) 2001-2004 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+*/
+
+package org.w3c.domts.level1.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * If the node removed by the "removeNamedItem(name)" method
+ * is an Attr node with a default value it is immediately
+ * replaced.
+ *
+ * Retrieve the third employee and create a NamedNodeMap
+ * object of the attributes of the last child. Once the
+ * list is created invoke the "removeNamedItem(name)"
+ * method with name="street". The "removeNamedItem(name)"
+ * method should remove the "street" attribute and since
+ * it has a default value of "Yes", that value should
+ * immediately be the attributes value.
+* @author NIST
+* @author Mary Brady
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-D58B193">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-D58B193</a>
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-349467F9">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-349467F9</a>
+* @see <a href="http://lists.w3.org/Archives/Public/www-dom-ts/2002Mar/0002.html">http://lists.w3.org/Archives/Public/www-dom-ts/2002Mar/0002.html</a>
+*/
+public final class namednodemapremovenameditemgetvalue extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public namednodemapremovenameditemgetvalue(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+
+ org.w3c.domts.DocumentBuilderSetting[] settings =
+ new org.w3c.domts.DocumentBuilderSetting[] {
+org.w3c.domts.DocumentBuilderSetting.validating
+ };
+ DOMTestDocumentBuilderFactory testFactory = factory.newInstance(settings);
+ setFactory(testFactory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "staff", true);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ NodeList elementList;
+ Node testEmployee;
+ NamedNodeMap attributes;
+ Attr streetAttr;
+ String value;
+ Node removedNode;
+ doc = (Document) load("staff", true);
+ elementList = doc.getElementsByTagName("address");
+ testEmployee = elementList.item(2);
+ attributes = testEmployee.getAttributes();
+ assertNotNull("attributesNotNull", attributes);
+ removedNode = attributes.removeNamedItem("street");
+ streetAttr = (Attr) attributes.getNamedItem("street");
+ assertNotNull("streetAttrNotNull", streetAttr);
+ value = streetAttr.getValue();
+ assertEquals("namednodemapRemoveNamedItemGetValueAssert", "Yes", value);
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/namednodemapremovenameditemgetvalue";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(namednodemapremovenameditemgetvalue.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level1/core/namednodemapremovenameditemreturnnodevalue.java b/dom/src/test/java/org/w3c/domts/level1/core/namednodemapremovenameditemreturnnodevalue.java
new file mode 100644
index 0000000..e057132
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level1/core/namednodemapremovenameditemreturnnodevalue.java
@@ -0,0 +1,96 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+Copyright (c) 2001 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+*/
+
+package org.w3c.domts.level1.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The "removeNamedItem(name)" method returns the node
+ * removed from the map.
+ *
+ * Retrieve the third employee and create a NamedNodeMap
+ * object of the attributes of the last child. Once the
+ * list is created invoke the "removeNamedItem(name)"
+ * method with name="street". The "removeNamedItem(name)"
+ * method should remove the existing "street" attribute
+ * and return it.
+* @author NIST
+* @author Mary Brady
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-D58B193">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-D58B193</a>
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-349467F9">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-349467F9</a>
+*/
+public final class namednodemapremovenameditemreturnnodevalue extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public namednodemapremovenameditemreturnnodevalue(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "staff", true);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ NodeList elementList;
+ Node testAddress;
+ NamedNodeMap attributes;
+ Node removedNode;
+ String value;
+ doc = (Document) load("staff", true);
+ elementList = doc.getElementsByTagName("address");
+ testAddress = elementList.item(2);
+ attributes = testAddress.getAttributes();
+ removedNode = attributes.removeNamedItem("street");
+ value = removedNode.getNodeValue();
+ assertEquals("namednodemapRemoveNamedItemReturnNodeValueAssert", "No", value);
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/namednodemapremovenameditemreturnnodevalue";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(namednodemapremovenameditemreturnnodevalue.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level1/core/namednodemapreturnattrnode.java b/dom/src/test/java/org/w3c/domts/level1/core/namednodemapreturnattrnode.java
new file mode 100644
index 0000000..92d7a40
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level1/core/namednodemapreturnattrnode.java
@@ -0,0 +1,100 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+Copyright (c) 2001 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+*/
+
+package org.w3c.domts.level1.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The "getNamedItem(name)" method returns a node of any
+ * type specified by name.
+ *
+ * Retrieve the second employee and create a NamedNodeMap
+ * listing of the attributes of the last child. Once the
+ * list is created an invocation of the "getNamedItem(name)"
+ * method is done with name="street". This should result
+ * in the method returning an Attr node.
+* @author NIST
+* @author Mary Brady
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-1074577549">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-1074577549</a>
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-84CF096">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-84CF096</a>
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-637646024">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-637646024</a>
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-1112119403">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-1112119403</a>
+*/
+public final class namednodemapreturnattrnode extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public namednodemapreturnattrnode(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "staff", false);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ NodeList elementList;
+ Node testEmployee;
+ NamedNodeMap attributes;
+ Node streetAttr;
+ String attrName;
+ doc = (Document) load("staff", false);
+ elementList = doc.getElementsByTagName("address");
+ testEmployee = elementList.item(1);
+ attributes = testEmployee.getAttributes();
+ streetAttr = attributes.getNamedItem("street");
+ assertInstanceOf("typeAssert", Attr.class, streetAttr);
+attrName = streetAttr.getNodeName();
+ assertEquals("nodeName", "street", attrName);
+ attrName = ((Attr) /*Node */streetAttr).getName();
+ assertEquals("attrName", "street", attrName);
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/namednodemapreturnattrnode";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(namednodemapreturnattrnode.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level1/core/namednodemapreturnfirstitem.java b/dom/src/test/java/org/w3c/domts/level1/core/namednodemapreturnfirstitem.java
new file mode 100644
index 0000000..9071160
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level1/core/namednodemapreturnfirstitem.java
@@ -0,0 +1,97 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+Copyright (c) 2001 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+*/
+
+package org.w3c.domts.level1.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The "item(index)" method returns the indexth item in
+ * the map(test for first item).
+ *
+ * Retrieve the second employee and create a NamedNodeMap
+ * listing of the attributes of the last child. Since the
+ * DOM does not specify an order of these nodes the contents
+ * of the FIRST node can contain either "domestic" or "street".
+ * The test should return "true" if the FIRST node is either
+ * of these values.
+* @author NIST
+* @author Mary Brady
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-349467F9">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-349467F9</a>
+*/
+public final class namednodemapreturnfirstitem extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public namednodemapreturnfirstitem(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "staff", true);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ NodeList elementList;
+ Node testAddress;
+ NamedNodeMap attributes;
+ Node child;
+ String name;
+ doc = (Document) load("staff", true);
+ elementList = doc.getElementsByTagName("address");
+ testAddress = elementList.item(1);
+ attributes = testAddress.getAttributes();
+ child = attributes.item(0);
+ name = child.getNodeName();
+ assertTrue("namednodemapReturnFirstItemAssert",
+ (equals("domestic", name) | equals("street", name))
+);
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/namednodemapreturnfirstitem";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(namednodemapreturnfirstitem.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level1/core/namednodemapreturnlastitem.java b/dom/src/test/java/org/w3c/domts/level1/core/namednodemapreturnlastitem.java
new file mode 100644
index 0000000..e047363
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level1/core/namednodemapreturnlastitem.java
@@ -0,0 +1,97 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+Copyright (c) 2001 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+*/
+
+package org.w3c.domts.level1.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The "item(index)" method returns the indexth item in
+ * the map(test for last item).
+ *
+ * Retrieve the second employee and create a NamedNodeMap
+ * listing of the attributes of the last child. Since the
+ * DOM does not specify an order of these nodes the contents
+ * of the LAST node can contain either "domestic" or "street".
+ * The test should return "true" if the LAST node is either
+ * of these values.
+* @author NIST
+* @author Mary Brady
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-349467F9">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-349467F9</a>
+*/
+public final class namednodemapreturnlastitem extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public namednodemapreturnlastitem(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "staff", true);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ NodeList elementList;
+ Node testEmployee;
+ NamedNodeMap attributes;
+ Node child;
+ String name;
+ doc = (Document) load("staff", true);
+ elementList = doc.getElementsByTagName("address");
+ testEmployee = elementList.item(1);
+ attributes = testEmployee.getAttributes();
+ child = attributes.item(1);
+ name = child.getNodeName();
+ assertTrue("namednodemapReturnLastItemAssert",
+ (equals("domestic", name) | equals("street", name))
+);
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/namednodemapreturnlastitem";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(namednodemapreturnlastitem.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level1/core/namednodemapreturnnull.java b/dom/src/test/java/org/w3c/domts/level1/core/namednodemapreturnnull.java
new file mode 100644
index 0000000..4537f52
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level1/core/namednodemapreturnnull.java
@@ -0,0 +1,93 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+Copyright (c) 2001 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+*/
+
+package org.w3c.domts.level1.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The "getNamedItem(name)" method returns null of the
+ * specified name did not identify any node in the map.
+ *
+ * Retrieve the second employee and create a NamedNodeMap
+ * listing of the attributes of the last child. Once the
+ * list is created an invocation of the "getNamedItem(name)"
+ * method is done with name="district". This name does not
+ * match any names in the list therefore the method should
+ * return null.
+* @author NIST
+* @author Mary Brady
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-1074577549">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-1074577549</a>
+*/
+public final class namednodemapreturnnull extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public namednodemapreturnnull(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "staff", false);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ NodeList elementList;
+ Node testEmployee;
+ NamedNodeMap attributes;
+ Attr districtNode;
+ doc = (Document) load("staff", false);
+ elementList = doc.getElementsByTagName("address");
+ testEmployee = elementList.item(1);
+ attributes = testEmployee.getAttributes();
+ districtNode = (Attr) attributes.getNamedItem("district");
+ assertNull("namednodemapReturnNullAssert", districtNode);
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/namednodemapreturnnull";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(namednodemapreturnnull.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level1/core/namednodemapsetnameditem.java b/dom/src/test/java/org/w3c/domts/level1/core/namednodemapsetnameditem.java
new file mode 100644
index 0000000..bffaf29
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level1/core/namednodemapsetnameditem.java
@@ -0,0 +1,105 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+Copyright (c) 2001 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+*/
+
+package org.w3c.domts.level1.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The "setNamedItem(arg)" method adds a node using its
+ * nodeName attribute.
+ *
+ * Retrieve the second employee and create a NamedNodeMap
+ * object from the attributes of the last child by
+ * invoking the "getAttributes()" method. Once the
+ * list is created an invocation of the "setNamedItem(arg)"
+ * method is done with arg=newAttr, where newAttr is a
+ * new Attr Node previously created. The "setNamedItem(arg)"
+ * method should add then new node to the NamedNodeItem
+ * object by using its "nodeName" attribute("district').
+ * This node is then retrieved using the "getNamedItem(name)"
+ * method. This test uses the "createAttribute(name)"
+ * method from the document interface.
+* @author NIST
+* @author Mary Brady
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-1025163788">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-1025163788</a>
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-349467F9">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-349467F9</a>
+*/
+public final class namednodemapsetnameditem extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public namednodemapsetnameditem(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "staff", true);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ NodeList elementList;
+ Attr newAttribute;
+ Node testAddress;
+ NamedNodeMap attributes;
+ Attr districtNode;
+ String attrName;
+ Node setNode;
+ doc = (Document) load("staff", true);
+ elementList = doc.getElementsByTagName("address");
+ testAddress = elementList.item(1);
+ newAttribute = doc.createAttribute("district");
+ attributes = testAddress.getAttributes();
+ setNode = attributes.setNamedItem(newAttribute);
+ districtNode = (Attr) attributes.getNamedItem("district");
+ attrName = districtNode.getNodeName();
+ assertEquals("namednodemapSetNamedItemAssert", "district", attrName);
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/namednodemapsetnameditem";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(namednodemapsetnameditem.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level1/core/namednodemapsetnameditemreturnvalue.java b/dom/src/test/java/org/w3c/domts/level1/core/namednodemapsetnameditemreturnvalue.java
new file mode 100644
index 0000000..baa80d39
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level1/core/namednodemapsetnameditemreturnvalue.java
@@ -0,0 +1,104 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+Copyright (c) 2001 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+*/
+
+package org.w3c.domts.level1.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * If the "setNamedItem(arg)" method replaces an already
+ * existing node with the same name then the already
+ * existing node is returned.
+ *
+ * Retrieve the third employee and create a NamedNodeMap
+ * object from the attributes of the last child by
+ * invoking the "getAttributes()" method. Once the
+ * list is created an invocation of the "setNamedItem(arg)"
+ * method is done with arg=newAttr, where newAttr is a
+ * new Attr Node previously created and whose node name
+ * already exists in the map. The "setNamedItem(arg)"
+ * method should replace the already existing node with
+ * the new one and return the existing node.
+ * This test uses the "createAttribute(name)" method from
+ * the document interface.
+* @author NIST
+* @author Mary Brady
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-1025163788">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-1025163788</a>
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-349467F9">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-349467F9</a>
+*/
+public final class namednodemapsetnameditemreturnvalue extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public namednodemapsetnameditemreturnvalue(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "staff", true);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ NodeList elementList;
+ Attr newAttribute;
+ Node testAddress;
+ NamedNodeMap attributes;
+ Node newNode;
+ String attrValue;
+ doc = (Document) load("staff", true);
+ elementList = doc.getElementsByTagName("address");
+ testAddress = elementList.item(2);
+ newAttribute = doc.createAttribute("street");
+ attributes = testAddress.getAttributes();
+ newNode = attributes.setNamedItem(newAttribute);
+ attrValue = newNode.getNodeValue();
+ assertEquals("returnedNodeValue", "No", attrValue);
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/namednodemapsetnameditemreturnvalue";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(namednodemapsetnameditemreturnvalue.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level1/core/namednodemapsetnameditemthatexists.java b/dom/src/test/java/org/w3c/domts/level1/core/namednodemapsetnameditemthatexists.java
new file mode 100644
index 0000000..cd88d92
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level1/core/namednodemapsetnameditemthatexists.java
@@ -0,0 +1,107 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+Copyright (c) 2001-2004 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+*/
+
+package org.w3c.domts.level1.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * If the node to be added by the "setNamedItem(arg)" method
+ * already exists in the NamedNodeMap, it is replaced by
+ * the new one.
+ *
+ * Retrieve the second employee and create a NamedNodeMap
+ * object from the attributes of the last child by
+ * invoking the "getAttributes()" method. Once the
+ * list is created an invocation of the "setNamedItem(arg)"
+ * method is done with arg=newAttr, where newAttr is a
+ * new Attr Node previously created and whose node name
+ * already exists in the map. The "setNamedItem(arg)"
+ * method should replace the already existing node with
+ * the new one.
+ * This node is then retrieved using the "getNamedItem(name)"
+ * method. This test uses the "createAttribute(name)"
+ * method from the document interface
+* @author NIST
+* @author Mary Brady
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-1025163788">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-1025163788</a>
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-349467F9">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-349467F9</a>
+*/
+public final class namednodemapsetnameditemthatexists extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public namednodemapsetnameditemthatexists(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "staff", true);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ NodeList elementList;
+ Attr newAttribute;
+ Node testAddress;
+ NamedNodeMap attributes;
+ Attr districtNode;
+ String attrValue;
+ Node setNode;
+ doc = (Document) load("staff", true);
+ elementList = doc.getElementsByTagName("address");
+ testAddress = elementList.item(1);
+ newAttribute = doc.createAttribute("street");
+ attributes = testAddress.getAttributes();
+ setNode = attributes.setNamedItem(newAttribute);
+ districtNode = (Attr) attributes.getNamedItem("street");
+ attrValue = districtNode.getNodeValue();
+ assertEquals("streetValue", "", attrValue);
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/namednodemapsetnameditemthatexists";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(namednodemapsetnameditemthatexists.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level1/core/namednodemapsetnameditemwithnewvalue.java b/dom/src/test/java/org/w3c/domts/level1/core/namednodemapsetnameditemwithnewvalue.java
new file mode 100644
index 0000000..91d7b25
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level1/core/namednodemapsetnameditemwithnewvalue.java
@@ -0,0 +1,99 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+Copyright (c) 2001-2004 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+*/
+
+package org.w3c.domts.level1.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * If the "setNamedItem(arg)" method does not replace an
+ * existing node with the same name then it returns null.
+ *
+ * Retrieve the third employee and create a NamedNodeMap
+ * object from the attributes of the last child.
+ * Once the list is created the "setNamedItem(arg)" method
+ * is invoked with arg=newAttr, where newAttr is a
+ * newly created Attr Node and whose node name
+ * already exists in the map. The "setNamedItem(arg)"
+ * method should add the new node and return null.
+ * This test uses the "createAttribute(name)" method from
+ * the document interface.
+* @author NIST
+* @author Mary Brady
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-1025163788">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-1025163788</a>
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-349467F9">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-349467F9</a>
+*/
+public final class namednodemapsetnameditemwithnewvalue extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public namednodemapsetnameditemwithnewvalue(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "staff", true);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ NodeList elementList;
+ Attr newAttribute;
+ Node testAddress;
+ NamedNodeMap attributes;
+ Node newNode;
+ doc = (Document) load("staff", true);
+ elementList = doc.getElementsByTagName("address");
+ testAddress = elementList.item(2);
+ newAttribute = doc.createAttribute("district");
+ attributes = testAddress.getAttributes();
+ newNode = attributes.setNamedItem(newAttribute);
+ assertNull("returnedNodeNull", newNode);
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/namednodemapsetnameditemwithnewvalue";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(namednodemapsetnameditemwithnewvalue.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level1/core/namednodemapwrongdocumenterr.java b/dom/src/test/java/org/w3c/domts/level1/core/namednodemapwrongdocumenterr.java
new file mode 100644
index 0000000..81393d4
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level1/core/namednodemapwrongdocumenterr.java
@@ -0,0 +1,111 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+Copyright (c) 2001-2003 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+*/
+
+package org.w3c.domts.level1.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The "setNamedItem(arg)" method raises a
+ * WRONG_DOCUMENT_ERR DOMException if "arg" was created
+ * from a different document than the one that created
+ * the NamedNodeMap.
+ *
+ * Create a NamedNodeMap object from the attributes of the
+ * last child of the third employee and attempt to add
+ * another Attr node to it that was created from a
+ * different DOM document. This should raise the desired
+ * exception. This method uses the "createAttribute(name)"
+ * method from the Document interface.
+* @author NIST
+* @author Mary Brady
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-258A00AF')/constant[@name='WRONG_DOCUMENT_ERR'])">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-258A00AF')/constant[@name='WRONG_DOCUMENT_ERR'])</a>
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-1025163788">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-1025163788</a>
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-1025163788')/raises/exception[@name='DOMException']/descr/p[substring-before(.,':')='WRONG_DOCUMENT_ERR'])">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-1025163788')/raises/exception[@name='DOMException']/descr/p[substring-before(.,':')='WRONG_DOCUMENT_ERR'])</a>
+* @see <a href="http://www.w3.org/Bugs/Public/show_bug.cgi?id=249">http://www.w3.org/Bugs/Public/show_bug.cgi?id=249</a>
+*/
+public final class namednodemapwrongdocumenterr extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public namednodemapwrongdocumenterr(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "staff", true);
+ preload(contentType, "staff", true);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc1;
+ Document doc2;
+ NodeList elementList;
+ Node testAddress;
+ NamedNodeMap attributes;
+ Node newAttribute;
+ Node setNode;
+ doc1 = (Document) load("staff", true);
+ doc2 = (Document) load("staff", true);
+ elementList = doc1.getElementsByTagName("address");
+ testAddress = elementList.item(2);
+ newAttribute = doc2.createAttribute("newAttribute");
+ attributes = testAddress.getAttributes();
+
+ {
+ boolean success = false;
+ try {
+ setNode = attributes.setNamedItem(newAttribute);
+ } catch (DOMException ex) {
+ success = (ex.code == DOMException.WRONG_DOCUMENT_ERR);
+ }
+ assertTrue("throw_WRONG_DOCUMENT_ERR", success);
+ }
+}
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/namednodemapwrongdocumenterr";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(namednodemapwrongdocumenterr.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level1/core/nodeappendchild.java b/dom/src/test/java/org/w3c/domts/level1/core/nodeappendchild.java
new file mode 100644
index 0000000..20fe4f9
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level1/core/nodeappendchild.java
@@ -0,0 +1,98 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+Copyright (c) 2001 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+*/
+
+package org.w3c.domts.level1.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The "appendChild(newChild)" method adds the node
+ * "newChild" to the end of the list of children of the
+ * node.
+ *
+ * Retrieve the second employee and append a new Element
+ * node to the list of children. The last node in the list
+ * is then retrieved and its NodeName examined. The
+ * "getNodeName()" method should return "newChild".
+* @author NIST
+* @author Mary Brady
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-184E7107">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-184E7107</a>
+*/
+public final class nodeappendchild extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public nodeappendchild(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "staff", true);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ NodeList elementList;
+ Node employeeNode;
+ NodeList childList;
+ Node createdNode;
+ Node lchild;
+ String childName;
+ Node appendedChild;
+ doc = (Document) load("staff", true);
+ elementList = doc.getElementsByTagName("employee");
+ employeeNode = elementList.item(1);
+ childList = employeeNode.getChildNodes();
+ createdNode = doc.createElement("newChild");
+ appendedChild = employeeNode.appendChild(createdNode);
+ lchild = employeeNode.getLastChild();
+ childName = lchild.getNodeName();
+ assertEquals("nodeAppendChildAssert1", "newChild", childName);
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/nodeappendchild";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(nodeappendchild.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level1/core/nodeappendchildchildexists.java b/dom/src/test/java/org/w3c/domts/level1/core/nodeappendchildchildexists.java
new file mode 100644
index 0000000..674ddac
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level1/core/nodeappendchildchildexists.java
@@ -0,0 +1,110 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+Copyright (c) 2001-2004 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+*/
+
+package org.w3c.domts.level1.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * If the "newChild" is already in the tree, it is first
+ * removed before the new one is appended.
+ *
+ * Retrieve the first child of the second employee and
+ * append the first child to the end of the list. After
+ * the "appendChild(newChild)" method is invoked the first
+ * child should be the one that was second and the last
+ * child should be the one that was first.
+* @author NIST
+* @author Mary Brady
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-184E7107">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-184E7107</a>
+*/
+public final class nodeappendchildchildexists extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public nodeappendchildchildexists(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "staff", true);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ NodeList elementList;
+ Node childNode;
+ Node newChild;
+ Node lchild;
+ Node fchild;
+ String lchildName;
+ String fchildName;
+ Node appendedChild;
+ String initialName;
+ doc = (Document) load("staff", true);
+ elementList = doc.getElementsByTagName("employee");
+ childNode = elementList.item(1);
+ newChild = childNode.getFirstChild();
+ initialName = newChild.getNodeName();
+ appendedChild = childNode.appendChild(newChild);
+ fchild = childNode.getFirstChild();
+ fchildName = fchild.getNodeName();
+ lchild = childNode.getLastChild();
+ lchildName = lchild.getNodeName();
+
+ if (equals("employeeId", initialName)) {
+ assertEquals("assert1_nowhitespace", "name", fchildName);
+ assertEquals("assert2_nowhitespace", "employeeId", lchildName);
+ } else {
+ assertEquals("assert1", "employeeId", fchildName);
+ assertEquals("assert2", "#text", lchildName);
+ }
+
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/nodeappendchildchildexists";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(nodeappendchildchildexists.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level1/core/nodeappendchilddocfragment.java b/dom/src/test/java/org/w3c/domts/level1/core/nodeappendchilddocfragment.java
new file mode 100644
index 0000000..e059ef8
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level1/core/nodeappendchilddocfragment.java
@@ -0,0 +1,121 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+Copyright (c) 2001-2004 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+*/
+
+package org.w3c.domts.level1.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * Create and populate a new DocumentFragment object and
+ * append it to the second employee. After the
+ * "appendChild(newChild)" method is invoked retrieve the
+ * new nodes at the end of the list, they should be the
+ * two Element nodes from the DocumentFragment.
+* @author NIST
+* @author Mary Brady
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-184E7107">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-184E7107</a>
+*/
+public final class nodeappendchilddocfragment extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public nodeappendchilddocfragment(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "staff", true);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ NodeList elementList;
+ Node employeeNode;
+ NodeList childList;
+ DocumentFragment newdocFragment;
+ Node newChild1;
+ Node newChild2;
+ Node child;
+ String childName;
+ java.util.List result = new java.util.ArrayList();
+
+ int nodeType;
+ Node appendedChild;
+ java.util.List expected = new java.util.ArrayList();
+ expected.add("employeeId");
+ expected.add("name");
+ expected.add("position");
+ expected.add("salary");
+ expected.add("gender");
+ expected.add("address");
+ expected.add("newChild1");
+ expected.add("newChild2");
+
+ doc = (Document) load("staff", true);
+ elementList = doc.getElementsByTagName("employee");
+ employeeNode = elementList.item(1);
+ childList = employeeNode.getChildNodes();
+ newdocFragment = doc.createDocumentFragment();
+ newChild1 = doc.createElement("newChild1");
+ newChild2 = doc.createElement("newChild2");
+ appendedChild = newdocFragment.appendChild(newChild1);
+ appendedChild = newdocFragment.appendChild(newChild2);
+ appendedChild = employeeNode.appendChild(newdocFragment);
+ for (int indexN1009F = 0; indexN1009F < childList.getLength(); indexN1009F++) {
+ child = (Node) childList.item(indexN1009F);
+ nodeType = (int) child.getNodeType();
+
+ if (equals(1, nodeType)) {
+ childName = child.getNodeName();
+ result.add(childName);
+ }
+ }
+ assertEquals("elementNames", expected, result);
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/nodeappendchilddocfragment";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(nodeappendchilddocfragment.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level1/core/nodeappendchildgetnodename.java b/dom/src/test/java/org/w3c/domts/level1/core/nodeappendchildgetnodename.java
new file mode 100644
index 0000000..c3c16b9
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level1/core/nodeappendchildgetnodename.java
@@ -0,0 +1,95 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+Copyright (c) 2001 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+*/
+
+package org.w3c.domts.level1.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The "appendChild(newChild)" method returns the node
+ * added.
+ *
+ * Append a newly created node to the child list of the
+ * second employee and check the NodeName returned. The
+ * "getNodeName()" method should return "newChild".
+* @author NIST
+* @author Mary Brady
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-F68D095">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-F68D095</a>
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-184E7107">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-184E7107</a>
+*/
+public final class nodeappendchildgetnodename extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public nodeappendchildgetnodename(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "staff", true);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ NodeList elementList;
+ Node employeeNode;
+ NodeList childList;
+ Node newChild;
+ Node appendNode;
+ String childName;
+ doc = (Document) load("staff", true);
+ elementList = doc.getElementsByTagName("employee");
+ employeeNode = elementList.item(1);
+ childList = employeeNode.getChildNodes();
+ newChild = doc.createElement("newChild");
+ appendNode = employeeNode.appendChild(newChild);
+ childName = appendNode.getNodeName();
+ assertEquals("nodeAppendChildGetNodeNameAssert1", "newChild", childName);
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/nodeappendchildgetnodename";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(nodeappendchildgetnodename.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level1/core/nodeappendchildinvalidnodetype.java b/dom/src/test/java/org/w3c/domts/level1/core/nodeappendchildinvalidnodetype.java
new file mode 100644
index 0000000..65a137f
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level1/core/nodeappendchildinvalidnodetype.java
@@ -0,0 +1,103 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+Copyright (c) 2001-2003 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+*/
+
+package org.w3c.domts.level1.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The "appendChild(newChild)" method raises a
+ * HIERARCHY_REQUEST_ERR DOMException if this node is of
+ * a type that does not allow children of the type "newChild"
+ * to be inserted.
+ *
+ * Retrieve the root node and attempt to append a newly
+ * created Attr node. An Element node cannot have children
+ * of the "Attr" type, therefore the desired exception
+ * should be raised.
+* @author NIST
+* @author Mary Brady
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-258A00AF')/constant[@name='HIERARCHY_REQUEST_ERR'])">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-258A00AF')/constant[@name='HIERARCHY_REQUEST_ERR'])</a>
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-184E7107">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-184E7107</a>
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-184E7107')/raises/exception[@name='DOMException']/descr/p[substring-before(.,':')='HIERARCHY_REQUEST_ERR'])">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-184E7107')/raises/exception[@name='DOMException']/descr/p[substring-before(.,':')='HIERARCHY_REQUEST_ERR'])</a>
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-184E7107">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-184E7107</a>
+* @see <a href="http://www.w3.org/Bugs/Public/show_bug.cgi?id=249">http://www.w3.org/Bugs/Public/show_bug.cgi?id=249</a>
+*/
+public final class nodeappendchildinvalidnodetype extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public nodeappendchildinvalidnodetype(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "staff", true);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ Element rootNode;
+ Node newChild;
+ Node appendedChild;
+ doc = (Document) load("staff", true);
+ rootNode = doc.getDocumentElement();
+ newChild = doc.createAttribute("newAttribute");
+
+ {
+ boolean success = false;
+ try {
+ appendedChild = rootNode.appendChild(newChild);
+ } catch (DOMException ex) {
+ success = (ex.code == DOMException.HIERARCHY_REQUEST_ERR);
+ }
+ assertTrue("throw_HIERARCHY_REQUEST_ERR", success);
+ }
+}
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/nodeappendchildinvalidnodetype";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(nodeappendchildinvalidnodetype.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level1/core/nodeappendchildnewchilddiffdocument.java b/dom/src/test/java/org/w3c/domts/level1/core/nodeappendchildnewchilddiffdocument.java
new file mode 100644
index 0000000..13a61a5
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level1/core/nodeappendchildnewchilddiffdocument.java
@@ -0,0 +1,108 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+Copyright (c) 2001-2003 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+*/
+
+package org.w3c.domts.level1.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The "appendChild(newChild)" method raises a
+ * WRONG_DOCUMENT_ERR DOMException if the "newChild" was
+ * created from a different document than the one that
+ * created this node.
+ *
+ * Retrieve the second employee and attempt to append
+ * a node created from a different document. An attempt
+ * to make such a replacement should raise the desired
+ * exception.
+* @author NIST
+* @author Mary Brady
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-258A00AF')/constant[@name='NOT_FOUND_ERR'])">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-258A00AF')/constant[@name='NOT_FOUND_ERR'])</a>
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-184E7107">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-184E7107</a>
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-184E7107')/raises/exception[@name='DOMException']/descr/p[substring-before(.,':')='NOT_FOUND_ERR'])">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-184E7107')/raises/exception[@name='DOMException']/descr/p[substring-before(.,':')='NOT_FOUND_ERR'])</a>
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-184E7107">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-184E7107</a>
+* @see <a href="http://www.w3.org/Bugs/Public/show_bug.cgi?id=249">http://www.w3.org/Bugs/Public/show_bug.cgi?id=249</a>
+*/
+public final class nodeappendchildnewchilddiffdocument extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public nodeappendchildnewchilddiffdocument(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "staff", false);
+ preload(contentType, "staff", true);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc1;
+ Document doc2;
+ Node newChild;
+ NodeList elementList;
+ Node elementNode;
+ Node appendedChild;
+ doc1 = (Document) load("staff", false);
+ doc2 = (Document) load("staff", true);
+ newChild = doc1.createElement("newChild");
+ elementList = doc2.getElementsByTagName("employee");
+ elementNode = elementList.item(1);
+
+ {
+ boolean success = false;
+ try {
+ appendedChild = elementNode.appendChild(newChild);
+ } catch (DOMException ex) {
+ success = (ex.code == DOMException.WRONG_DOCUMENT_ERR);
+ }
+ assertTrue("throw_WRONG_DOCUMENT_ERR", success);
+ }
+}
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/nodeappendchildnewchilddiffdocument";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(nodeappendchildnewchilddiffdocument.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level1/core/nodeappendchildnodeancestor.java b/dom/src/test/java/org/w3c/domts/level1/core/nodeappendchildnodeancestor.java
new file mode 100644
index 0000000..40b40e5
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level1/core/nodeappendchildnodeancestor.java
@@ -0,0 +1,104 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+Copyright (c) 2001-2003 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+*/
+
+package org.w3c.domts.level1.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The "appendChild(newChild)" method raises a
+ * HIERARCHY_REQUEST_ERR DOMException if the node to
+ * append is one of this node's ancestors.
+ *
+ * Retrieve the second employee and attempt to append
+ * an ancestor node(root node) to it.
+ * An attempt to make such an addition should raise the
+ * desired exception.
+* @author NIST
+* @author Mary Brady
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-258A00AF')/constant[@name='HIERARCHY_REQUEST_ERR'])">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-258A00AF')/constant[@name='HIERARCHY_REQUEST_ERR'])</a>
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-184E7107">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-184E7107</a>
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-184E7107')/raises/exception[@name='DOMException']/descr/p[substring-before(.,':')='HIERARCHY_REQUEST_ERR'])">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-184E7107')/raises/exception[@name='DOMException']/descr/p[substring-before(.,':')='HIERARCHY_REQUEST_ERR'])</a>
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-184E7107">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-184E7107</a>
+* @see <a href="http://www.w3.org/Bugs/Public/show_bug.cgi?id=249">http://www.w3.org/Bugs/Public/show_bug.cgi?id=249</a>
+*/
+public final class nodeappendchildnodeancestor extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public nodeappendchildnodeancestor(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "staff", true);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ Node newChild;
+ NodeList elementList;
+ Node employeeNode;
+ Node appendedChild;
+ doc = (Document) load("staff", true);
+ newChild = doc.getDocumentElement();
+ elementList = doc.getElementsByTagName("employee");
+ employeeNode = elementList.item(1);
+
+ {
+ boolean success = false;
+ try {
+ appendedChild = employeeNode.appendChild(newChild);
+ } catch (DOMException ex) {
+ success = (ex.code == DOMException.HIERARCHY_REQUEST_ERR);
+ }
+ assertTrue("throw_HIERARCHY_REQUEST_ERR", success);
+ }
+}
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/nodeappendchildnodeancestor";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(nodeappendchildnodeancestor.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level1/core/nodeappendchildnomodificationallowederr.java b/dom/src/test/java/org/w3c/domts/level1/core/nodeappendchildnomodificationallowederr.java
new file mode 100644
index 0000000..53bef85
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level1/core/nodeappendchildnomodificationallowederr.java
@@ -0,0 +1,116 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+Copyright (c) 2001-2004 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+*/
+
+package org.w3c.domts.level1.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The "appendChild(newChild)" method causes the
+ * DOMException NO_MODIFICATION_ALLOWED_ERR to be raised
+ * if the node is readonly.
+ *
+ * Obtain the children of the THIRD "gender" element. The elements
+ * content is an entity reference. Get the FIRST item
+ * from the entity reference and execute the "appendChild(newChild)" method.
+ * This causes a NO_MODIFICATION_ALLOWED_ERR DOMException to be thrown.
+* @author NIST
+* @author Mary Brady
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-258A00AF')/constant[@name='NO_MODIFICATION_ALLOWED_ERR'])">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-258A00AF')/constant[@name='NO_MODIFICATION_ALLOWED_ERR'])</a>
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-184E7107">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-184E7107</a>
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-184E7107')/raises/exception[@name='DOMException']/descr/p[substring-before(.,':')='NO_MODIFICATION_ALLOWED_ERR'])">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-184E7107')/raises/exception[@name='DOMException']/descr/p[substring-before(.,':')='NO_MODIFICATION_ALLOWED_ERR'])</a>
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-184E7107">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-184E7107</a>
+*/
+public final class nodeappendchildnomodificationallowederr extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public nodeappendchildnomodificationallowederr(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "staff", true);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ NodeList genderList;
+ Node genderNode;
+ Node entRef;
+ Node entElement;
+ Node createdNode;
+ Node appendedNode;
+ int nodeType;
+ doc = (Document) load("staff", true);
+ genderList = doc.getElementsByTagName("gender");
+ genderNode = genderList.item(2);
+ entRef = genderNode.getFirstChild();
+ assertNotNull("entRefNotNull", entRef);
+ nodeType = (int) entRef.getNodeType();
+
+ if (equals(1, nodeType)) {
+ entRef = doc.createEntityReference("ent4");
+ assertNotNull("createdEntRefNotNull", entRef);
+ }
+ entElement = entRef.getFirstChild();
+ assertNotNull("entElementNotNull", entElement);
+ createdNode = doc.createElement("text3");
+
+ {
+ boolean success = false;
+ try {
+ appendedNode = entElement.appendChild(createdNode);
+ } catch (DOMException ex) {
+ success = (ex.code == DOMException.NO_MODIFICATION_ALLOWED_ERR);
+ }
+ assertTrue("throw_NO_MODIFICATION_ALLOWED_ERR", success);
+ }
+}
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/nodeappendchildnomodificationallowederr";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(nodeappendchildnomodificationallowederr.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level1/core/nodeappendchildnomodificationallowederrEE.java b/dom/src/test/java/org/w3c/domts/level1/core/nodeappendchildnomodificationallowederrEE.java
new file mode 100644
index 0000000..52a0b6d
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level1/core/nodeappendchildnomodificationallowederrEE.java
@@ -0,0 +1,100 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+Copyright (c) 2001-2004 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+*/
+
+package org.w3c.domts.level1.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The "appendChild(newChild)" method causes the
+ * DOMException NO_MODIFICATION_ALLOWED_ERR to be raised
+ * if the node is readonly.
+ *
+ * Create an ent4 entity reference and the "appendChild(newChild)" method.
+ * This causes a NO_MODIFICATION_ALLOWED_ERR DOMException to be thrown.
+* @author Curt Arnold
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-258A00AF')/constant[@name='NO_MODIFICATION_ALLOWED_ERR'])">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-258A00AF')/constant[@name='NO_MODIFICATION_ALLOWED_ERR'])</a>
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-184E7107">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-184E7107</a>
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-184E7107')/raises/exception[@name='DOMException']/descr/p[substring-before(.,':')='NO_MODIFICATION_ALLOWED_ERR'])">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-184E7107')/raises/exception[@name='DOMException']/descr/p[substring-before(.,':')='NO_MODIFICATION_ALLOWED_ERR'])</a>
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-184E7107">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-184E7107</a>
+* @see <a href="http://www.w3.org/2001/DOM-Test-Suite/level1/core/nodeappendchildnomodificationallowederr.xml">http://www.w3.org/2001/DOM-Test-Suite/level1/core/nodeappendchildnomodificationallowederr.xml</a>
+*/
+public final class nodeappendchildnomodificationallowederrEE extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public nodeappendchildnomodificationallowederrEE(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "staff", true);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ Node entRef;
+ Node createdNode;
+ Node appendedNode;
+ doc = (Document) load("staff", true);
+ entRef = doc.createEntityReference("ent4");
+ assertNotNull("createdEntRefNotNull", entRef);
+ createdNode = doc.createElement("text3");
+
+ {
+ boolean success = false;
+ try {
+ appendedNode = entRef.appendChild(createdNode);
+ } catch (DOMException ex) {
+ success = (ex.code == DOMException.NO_MODIFICATION_ALLOWED_ERR);
+ }
+ assertTrue("throw_NO_MODIFICATION_ALLOWED_ERR", success);
+ }
+}
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/nodeappendchildnomodificationallowederrEE";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(nodeappendchildnomodificationallowederrEE.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level1/core/nodeattributenodeattribute.java b/dom/src/test/java/org/w3c/domts/level1/core/nodeattributenodeattribute.java
new file mode 100644
index 0000000..7b32755
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level1/core/nodeattributenodeattribute.java
@@ -0,0 +1,92 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+Copyright (c) 2001 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+*/
+
+package org.w3c.domts.level1.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The "getAttributes()" method invoked on an Attribute
+ * Node returns null.
+ * Retrieve the first attribute from the last child of the
+ * first employee and invoke the "getAttributes()" method
+ * on the Attribute Node. It should return null.
+* @author NIST
+* @author Mary Brady
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-84CF096">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-84CF096</a>
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-637646024">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-637646024</a>
+*/
+public final class nodeattributenodeattribute extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public nodeattributenodeattribute(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "staff", false);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ NodeList elementList;
+ Element testAddr;
+ NamedNodeMap addrAttr;
+ Node attrNode;
+ NamedNodeMap attrList;
+ doc = (Document) load("staff", false);
+ elementList = doc.getElementsByTagName("address");
+ testAddr = (Element) elementList.item(0);
+ addrAttr = testAddr.getAttributes();
+ attrNode = addrAttr.item(0);
+ attrList = attrNode.getAttributes();
+ assertNull("nodeAttributeNodeAttributeAssert1", attrList);
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/nodeattributenodeattribute";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(nodeattributenodeattribute.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level1/core/nodeattributenodename.java b/dom/src/test/java/org/w3c/domts/level1/core/nodeattributenodename.java
new file mode 100644
index 0000000..b41c160
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level1/core/nodeattributenodename.java
@@ -0,0 +1,91 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+Copyright (c) 2001 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+*/
+
+package org.w3c.domts.level1.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The string returned by the "getNodeName()" method for an
+ * Attribute Node is the name of the Attribute.
+ *
+ * Retrieve the Attribute named "domestic" from the last
+ * child of the first employee and check the string returned
+ * by the "getNodeName()" method. It should be equal to
+ * "domestic".
+* @author NIST
+* @author Mary Brady
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-F68D095">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-F68D095</a>
+*/
+public final class nodeattributenodename extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public nodeattributenodename(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "staff", false);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ NodeList elementList;
+ Element testAddr;
+ Attr addrAttr;
+ String attrName;
+ doc = (Document) load("staff", false);
+ elementList = doc.getElementsByTagName("address");
+ testAddr = (Element) elementList.item(0);
+ addrAttr = testAddr.getAttributeNode("domestic");
+ attrName = addrAttr.getNodeName();
+ assertEquals("nodeAttributeNodeNameAssert1", "domestic", attrName);
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/nodeattributenodename";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(nodeattributenodename.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level1/core/nodeattributenodetype.java b/dom/src/test/java/org/w3c/domts/level1/core/nodeattributenodetype.java
new file mode 100644
index 0000000..4777617
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level1/core/nodeattributenodetype.java
@@ -0,0 +1,90 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+Copyright (c) 2001 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+*/
+
+package org.w3c.domts.level1.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The "getNodeType()" method for an Attribute Node
+ * returns the constant value 2.
+ *
+ * Retrieve the first attribute from the last child of
+ * the first employee and invoke the "getNodeType()"
+ * method. The method should return 2.
+* @author NIST
+* @author Mary Brady
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-111237558">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-111237558</a>
+*/
+public final class nodeattributenodetype extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public nodeattributenodetype(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "staff", false);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ NodeList elementList;
+ Element testAddr;
+ Attr addrAttr;
+ int nodeType;
+ doc = (Document) load("staff", false);
+ elementList = doc.getElementsByTagName("address");
+ testAddr = (Element) elementList.item(0);
+ addrAttr = testAddr.getAttributeNode("domestic");
+ nodeType = (int) addrAttr.getNodeType();
+ assertEquals("nodeAttrNodeTypeAssert1", 2, nodeType);
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/nodeattributenodetype";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(nodeattributenodetype.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level1/core/nodeattributenodevalue.java b/dom/src/test/java/org/w3c/domts/level1/core/nodeattributenodevalue.java
new file mode 100644
index 0000000..f5afeab
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level1/core/nodeattributenodevalue.java
@@ -0,0 +1,91 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+Copyright (c) 2001 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+*/
+
+package org.w3c.domts.level1.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The string returned by the "getNodeValue()" method for an
+ * Attribute Node is the value of the Attribute.
+ *
+ * Retrieve the Attribute named "domestic" from the last
+ * child of the first employee and check the string returned
+ * by the "getNodeValue()" method. It should be equal to
+ * "Yes".
+* @author NIST
+* @author Mary Brady
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-F68D080">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-F68D080</a>
+*/
+public final class nodeattributenodevalue extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public nodeattributenodevalue(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "staff", false);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ NodeList elementList;
+ Element testAddr;
+ Attr addrAttr;
+ String attrValue;
+ doc = (Document) load("staff", false);
+ elementList = doc.getElementsByTagName("address");
+ testAddr = (Element) elementList.item(0);
+ addrAttr = testAddr.getAttributeNode("domestic");
+ attrValue = addrAttr.getNodeValue();
+ assertEquals("nodeAttributeNodeValueAssert1", "Yes", attrValue);
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/nodeattributenodevalue";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(nodeattributenodevalue.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level1/core/nodecdatasectionnodeattribute.java b/dom/src/test/java/org/w3c/domts/level1/core/nodecdatasectionnodeattribute.java
new file mode 100644
index 0000000..ae47004
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level1/core/nodecdatasectionnodeattribute.java
@@ -0,0 +1,97 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+Copyright (c) 2001-2004 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+*/
+
+package org.w3c.domts.level1.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The "getAttributes()" method invoked on a CDATASection
+ * Node returns null.
+ * Retrieve the CDATASection node contained inside the
+ * second child of the second employee and invoke the
+ * "getAttributes()" method on the CDATASection node.
+ * It should return null.
+* @author NIST
+* @author Mary Brady
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-84CF096">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-84CF096</a>
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-667469212">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-667469212</a>
+*/
+public final class nodecdatasectionnodeattribute extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public nodecdatasectionnodeattribute(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "staff", false);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ NodeList elementList;
+ Element cdataName;
+ Node cdataNode;
+ NamedNodeMap attrList;
+ int nodeType;
+ doc = (Document) load("staff", false);
+ elementList = doc.getElementsByTagName("name");
+ cdataName = (Element) elementList.item(1);
+ cdataNode = cdataName.getLastChild();
+ nodeType = (int) cdataNode.getNodeType();
+
+ if (!equals(4, nodeType)) {
+ cdataNode = doc.createCDATASection("");
+ }
+ attrList = cdataNode.getAttributes();
+ assertNull("cdataSection", attrList);
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/nodecdatasectionnodeattribute";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(nodecdatasectionnodeattribute.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level1/core/nodecdatasectionnodename.java b/dom/src/test/java/org/w3c/domts/level1/core/nodecdatasectionnodename.java
new file mode 100644
index 0000000..7eda90a
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level1/core/nodecdatasectionnodename.java
@@ -0,0 +1,98 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+Copyright (c) 2001-2004 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+*/
+
+package org.w3c.domts.level1.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The string returned by the "getNodeName()" method for a
+ * CDATASection Node is #cdata-section".
+ *
+ * Retrieve the CDATASection node inside the second child
+ * of the second employee and check the string returned
+ * by the "getNodeName()" method. It should be equal to
+ * "#cdata-section".
+* @author NIST
+* @author Mary Brady
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-F68D095">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-F68D095</a>
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-667469212">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-667469212</a>
+*/
+public final class nodecdatasectionnodename extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public nodecdatasectionnodename(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "staff", false);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ NodeList elementList;
+ Element cdataName;
+ Node cdataNode;
+ int nodeType;
+ String cdataNodeName;
+ doc = (Document) load("staff", false);
+ elementList = doc.getElementsByTagName("name");
+ cdataName = (Element) elementList.item(1);
+ cdataNode = cdataName.getLastChild();
+ nodeType = (int) cdataNode.getNodeType();
+
+ if (!equals(4, nodeType)) {
+ cdataNode = doc.createCDATASection("");
+ }
+ cdataNodeName = cdataNode.getNodeName();
+ assertEquals("cdataNodeName", "#cdata-section", cdataNodeName);
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/nodecdatasectionnodename";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(nodecdatasectionnodename.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level1/core/nodecdatasectionnodetype.java b/dom/src/test/java/org/w3c/domts/level1/core/nodecdatasectionnodetype.java
new file mode 100644
index 0000000..90f9506
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level1/core/nodecdatasectionnodetype.java
@@ -0,0 +1,102 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+Copyright (c) 2001-2004 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+*/
+
+package org.w3c.domts.level1.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The "getNodeType()" method for a CDATASection Node
+ * returns the constant value 4.
+ *
+ * Retrieve the CDATASection node contained inside the
+ * second child of the second employee and invoke the
+ * "getNodeType()" method. The method should return 4.
+* @author NIST
+* @author Mary Brady
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-111237558">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-111237558</a>
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-667469212">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-667469212</a>
+*/
+public final class nodecdatasectionnodetype extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public nodecdatasectionnodetype(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+
+ org.w3c.domts.DocumentBuilderSetting[] settings =
+ new org.w3c.domts.DocumentBuilderSetting[] {
+org.w3c.domts.DocumentBuilderSetting.notCoalescing
+ };
+ DOMTestDocumentBuilderFactory testFactory = factory.newInstance(settings);
+ setFactory(testFactory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "staff", false);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ NodeList elementList;
+ Element testName;
+ Node cdataNode;
+ int nodeType;
+ doc = (Document) load("staff", false);
+ elementList = doc.getElementsByTagName("name");
+ testName = (Element) elementList.item(1);
+ cdataNode = testName.getLastChild();
+ nodeType = (int) cdataNode.getNodeType();
+
+ if (equals(3, nodeType)) {
+ cdataNode = doc.createCDATASection("");
+ nodeType = (int) cdataNode.getNodeType();
+ }
+ assertEquals("nodeTypeCDATA", 4, nodeType);
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/nodecdatasectionnodetype";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(nodecdatasectionnodetype.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level1/core/nodecdatasectionnodevalue.java b/dom/src/test/java/org/w3c/domts/level1/core/nodecdatasectionnodevalue.java
new file mode 100644
index 0000000..9883b27
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level1/core/nodecdatasectionnodevalue.java
@@ -0,0 +1,105 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+Copyright (c) 2001-2004 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+*/
+
+package org.w3c.domts.level1.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The string returned by the "getNodeValue()" method for a
+ * CDATASection Node is the content of the CDATASection.
+ *
+ * Retrieve the CDATASection node inside the second child
+ * of the second employee and check the string returned
+ * by the "getNodeValue()" method. It should be equal to
+ * "This is a CDATA Section with EntityReference number 2
+ * &ent2;".
+* @author NIST
+* @author Mary Brady
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-F68D080">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-F68D080</a>
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-667469212">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-667469212</a>
+*/
+public final class nodecdatasectionnodevalue extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public nodecdatasectionnodevalue(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+
+ org.w3c.domts.DocumentBuilderSetting[] settings =
+ new org.w3c.domts.DocumentBuilderSetting[] {
+org.w3c.domts.DocumentBuilderSetting.notCoalescing
+ };
+ DOMTestDocumentBuilderFactory testFactory = factory.newInstance(settings);
+ setFactory(testFactory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "staff", false);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ NodeList elementList;
+ Element cdataName;
+ NodeList childList;
+ Node child;
+ String cdataNodeValue;
+ doc = (Document) load("staff", false);
+ elementList = doc.getElementsByTagName("name");
+ cdataName = (Element) elementList.item(1);
+ childList = cdataName.getChildNodes();
+ child = childList.item(1);
+
+ if ((child == null)) {
+ child = doc.createCDATASection("This is a CDATASection with EntityReference number 2 &ent2;");
+ }
+ cdataNodeValue = child.getNodeValue();
+ assertEquals("value", "This is a CDATASection with EntityReference number 2 &ent2;", cdataNodeValue);
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/nodecdatasectionnodevalue";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(nodecdatasectionnodevalue.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level1/core/nodechildnodes.java b/dom/src/test/java/org/w3c/domts/level1/core/nodechildnodes.java
new file mode 100644
index 0000000..859d8e6
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level1/core/nodechildnodes.java
@@ -0,0 +1,105 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+Copyright (c) 2001-2004 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+*/
+
+package org.w3c.domts.level1.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * Collect the element names from Node.childNodes and check against expectations.
+* @author NIST
+* @author Mary Brady
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-1451460987">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-1451460987</a>
+*/
+public final class nodechildnodes extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public nodechildnodes(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "staff", false);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ NodeList elementList;
+ Node employeeNode;
+ NodeList childNodes;
+ Node childNode;
+ int childType;
+ String childName;
+ java.util.List elementNames = new java.util.ArrayList();
+
+ java.util.List expectedElementNames = new java.util.ArrayList();
+ expectedElementNames.add("employeeId");
+ expectedElementNames.add("name");
+ expectedElementNames.add("position");
+ expectedElementNames.add("salary");
+ expectedElementNames.add("gender");
+ expectedElementNames.add("address");
+
+ doc = (Document) load("staff", false);
+ elementList = doc.getElementsByTagName("employee");
+ employeeNode = elementList.item(1);
+ childNodes = employeeNode.getChildNodes();
+ for (int indexN1006C = 0; indexN1006C < childNodes.getLength(); indexN1006C++) {
+ childNode = (Node) childNodes.item(indexN1006C);
+ childType = (int) childNode.getNodeType();
+
+ if (equals(1, childType)) {
+ childName = childNode.getNodeName();
+ elementNames.add(childName);
+ }
+ }
+ assertEquals("elementNames", expectedElementNames, elementNames);
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/nodechildnodes";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(nodechildnodes.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level1/core/nodechildnodesappendchild.java b/dom/src/test/java/org/w3c/domts/level1/core/nodechildnodesappendchild.java
new file mode 100644
index 0000000..4fb86c8
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level1/core/nodechildnodesappendchild.java
@@ -0,0 +1,93 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+Copyright (c) 2001-2004 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+*/
+
+package org.w3c.domts.level1.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * Add an element and check that the previously retrieved childNodes NodeList
+ * is live.
+* @author NIST
+* @author Mary Brady
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-1451460987">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-1451460987</a>
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-184E7107">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-184E7107</a>
+*/
+public final class nodechildnodesappendchild extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public nodechildnodesappendchild(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "staff", true);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ NodeList elementList;
+ Node employeeNode;
+ NodeList childList;
+ Node createdNode;
+ int expectedLength;
+ int length;
+ doc = (Document) load("staff", true);
+ elementList = doc.getElementsByTagName("employee");
+ employeeNode = elementList.item(1);
+ childList = employeeNode.getChildNodes();
+ expectedLength = (int) childList.getLength();
+ expectedLength += 1;
+ createdNode = doc.createElement("text3");
+ employeeNode = employeeNode.appendChild(createdNode);
+ length = (int) childList.getLength();
+ assertEquals("childNodeLength", expectedLength, length);
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/nodechildnodesappendchild";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(nodechildnodesappendchild.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level1/core/nodechildnodesempty.java b/dom/src/test/java/org/w3c/domts/level1/core/nodechildnodesempty.java
new file mode 100644
index 0000000..8a26abf
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level1/core/nodechildnodesempty.java
@@ -0,0 +1,95 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+Copyright (c) 2001-2004 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+*/
+
+package org.w3c.domts.level1.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The "getChildNodes()" method returns a NodeList
+ * that contains all children of this node. If there
+ * are not any children, this is a NodeList that does not
+ * contain any nodes.
+ * Retrieve the Text node from the second child of the second
+ * employee and invoke the "getChildNodes()" method. The
+ * NodeList returned should not have any nodes.
+* @author NIST
+* @author Mary Brady
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-1451460987">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-1451460987</a>
+*/
+public final class nodechildnodesempty extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public nodechildnodesempty(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "staff", false);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ NodeList elementList;
+ Node employeeNode;
+ NodeList childList;
+ Node secondCNode;
+ Node textNode;
+ NodeList childNodesList;
+ doc = (Document) load("staff", false);
+ elementList = doc.getElementsByTagName("employee");
+ employeeNode = elementList.item(1);
+ childList = employeeNode.getChildNodes();
+ secondCNode = childList.item(1);
+ textNode = secondCNode.getFirstChild();
+ childNodesList = textNode.getChildNodes();
+ assertSize("nodeChildNodesEmptyAssert1", 0, childNodesList);
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/nodechildnodesempty";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(nodechildnodesempty.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level1/core/nodecloneattributescopied.java b/dom/src/test/java/org/w3c/domts/level1/core/nodecloneattributescopied.java
new file mode 100644
index 0000000..981403b
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level1/core/nodecloneattributescopied.java
@@ -0,0 +1,105 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+Copyright (c) 2001 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+*/
+
+package org.w3c.domts.level1.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * If the cloneNode method is used to clone an
+ * Element node, all the attributes of the Element are
+ * copied along with their values.
+ *
+ * Retrieve the last child of the second employee and invoke
+ * the cloneNode method. The
+ * duplicate node returned by the method should copy the
+ * attributes associated with this node.
+* @author NIST
+* @author Mary Brady
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-84CF096">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-84CF096</a>
+*/
+public final class nodecloneattributescopied extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public nodecloneattributescopied(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "staff", true);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ NodeList elementList;
+ Node addressNode;
+ Node clonedNode;
+ NamedNodeMap attributes;
+ Node attributeNode;
+ String attributeName;
+ java.util.Collection result = new java.util.ArrayList();
+
+ java.util.Collection expectedResult = new java.util.ArrayList();
+ expectedResult.add("domestic");
+ expectedResult.add("street");
+
+ doc = (Document) load("staff", true);
+ elementList = doc.getElementsByTagName("address");
+ addressNode = elementList.item(1);
+ clonedNode = addressNode.cloneNode(false);
+ attributes = clonedNode.getAttributes();
+ for (int indexN10065 = 0; indexN10065 < attributes.getLength(); indexN10065++) {
+ attributeNode = (Node) attributes.item(indexN10065);
+ attributeName = attributeNode.getNodeName();
+ result.add(attributeName);
+ }
+ assertEquals("nodeCloneAttributesCopiedAssert1", expectedResult, result);
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/nodecloneattributescopied";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(nodecloneattributescopied.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level1/core/nodeclonefalsenocopytext.java b/dom/src/test/java/org/w3c/domts/level1/core/nodeclonefalsenocopytext.java
new file mode 100644
index 0000000..858abab
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level1/core/nodeclonefalsenocopytext.java
@@ -0,0 +1,95 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+Copyright (c) 2001 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+*/
+
+package org.w3c.domts.level1.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The "cloneNode(deep)" method does not copy text unless it
+ * is deep cloned.(Test for deep=false)
+ *
+ * Retrieve the fourth child of the second employee and
+ * the "cloneNode(deep)" method with deep=false. The
+ * duplicate node returned by the method should not copy
+ * any text data contained in this node.
+* @author NIST
+* @author Mary Brady
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-3A0ED0A4">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-3A0ED0A4</a>
+*/
+public final class nodeclonefalsenocopytext extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public nodeclonefalsenocopytext(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "staff", true);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ NodeList elementList;
+ Node employeeNode;
+ NodeList childList;
+ Node childNode;
+ Node clonedNode;
+ Node lastChildNode;
+ doc = (Document) load("staff", true);
+ elementList = doc.getElementsByTagName("employee");
+ employeeNode = elementList.item(1);
+ childList = employeeNode.getChildNodes();
+ childNode = childList.item(3);
+ clonedNode = childNode.cloneNode(false);
+ lastChildNode = clonedNode.getLastChild();
+ assertNull("noTextNodes", lastChildNode);
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/nodeclonefalsenocopytext";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(nodeclonefalsenocopytext.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level1/core/nodeclonegetparentnull.java b/dom/src/test/java/org/w3c/domts/level1/core/nodeclonegetparentnull.java
new file mode 100644
index 0000000..6ad1f8a
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level1/core/nodeclonegetparentnull.java
@@ -0,0 +1,91 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+Copyright (c) 2001 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+*/
+
+package org.w3c.domts.level1.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The duplicate node returned by the "cloneNode(deep)"
+ * method does not have a ParentNode.
+ *
+ * Retrieve the second employee and invoke the
+ * "cloneNode(deep)" method with deep=false. The
+ * duplicate node returned should return null when the
+ * "getParentNode()" is invoked.
+* @author NIST
+* @author Mary Brady
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-3A0ED0A4">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-3A0ED0A4</a>
+*/
+public final class nodeclonegetparentnull extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public nodeclonegetparentnull(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "staff", true);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ NodeList elementList;
+ Node employeeNode;
+ Node clonedNode;
+ Node parentNode;
+ doc = (Document) load("staff", true);
+ elementList = doc.getElementsByTagName("employee");
+ employeeNode = elementList.item(1);
+ clonedNode = employeeNode.cloneNode(false);
+ parentNode = clonedNode.getParentNode();
+ assertNull("nodeCloneGetParentNullAssert1", parentNode);
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/nodeclonegetparentnull";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(nodeclonegetparentnull.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level1/core/nodeclonenodefalse.java b/dom/src/test/java/org/w3c/domts/level1/core/nodeclonenodefalse.java
new file mode 100644
index 0000000..7be253e
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level1/core/nodeclonenodefalse.java
@@ -0,0 +1,98 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+Copyright (c) 2001 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+*/
+
+package org.w3c.domts.level1.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The "cloneNode(deep)" method returns a copy of the node
+ * only if deep=false.
+ *
+ * Retrieve the second employee and invoke the
+ * "cloneNode(deep)" method with deep=false. The
+ * method should only clone this node. The NodeName and
+ * length of the NodeList are checked. The "getNodeName()"
+ * method should return "employee" and the "getLength()"
+ * method should return 0.
+* @author NIST
+* @author Mary Brady
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-3A0ED0A4">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-3A0ED0A4</a>
+*/
+public final class nodeclonenodefalse extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public nodeclonenodefalse(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "staff", true);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ NodeList elementList;
+ Node employeeNode;
+ Node clonedNode;
+ String cloneName;
+ NodeList cloneChildren;
+ int length;
+ doc = (Document) load("staff", true);
+ elementList = doc.getElementsByTagName("employee");
+ employeeNode = elementList.item(1);
+ clonedNode = employeeNode.cloneNode(false);
+ cloneName = clonedNode.getNodeName();
+ assertEquals("name", "employee", cloneName);
+ cloneChildren = clonedNode.getChildNodes();
+ length = (int) cloneChildren.getLength();
+ assertEquals("length", 0, length);
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/nodeclonenodefalse";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(nodeclonenodefalse.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level1/core/nodeclonenodetrue.java b/dom/src/test/java/org/w3c/domts/level1/core/nodeclonenodetrue.java
new file mode 100644
index 0000000..d952d29
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level1/core/nodeclonenodetrue.java
@@ -0,0 +1,135 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+Copyright (c) 2001-2004 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+*/
+
+package org.w3c.domts.level1.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The "cloneNode(deep)" method returns a copy of the node
+ * and the subtree under it if deep=true.
+ *
+ * Retrieve the second employee and invoke the
+ * "cloneNode(deep)" method with deep=true. The
+ * method should clone this node and the subtree under it.
+ * The NodeName of each child in the returned node is
+ * checked to insure the entire subtree under the second
+ * employee was cloned.
+* @author NIST
+* @author Mary Brady
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-3A0ED0A4">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-3A0ED0A4</a>
+*/
+public final class nodeclonenodetrue extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public nodeclonenodetrue(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "staff", true);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ NodeList elementList;
+ Node employeeNode;
+ NodeList childList;
+ Node clonedNode;
+ NodeList clonedList;
+ Node clonedChild;
+ String clonedChildName;
+ int length;
+ java.util.List result = new java.util.ArrayList();
+
+ java.util.List expectedWhitespace = new java.util.ArrayList();
+ expectedWhitespace.add("#text");
+ expectedWhitespace.add("employeeId");
+ expectedWhitespace.add("#text");
+ expectedWhitespace.add("name");
+ expectedWhitespace.add("#text");
+ expectedWhitespace.add("position");
+ expectedWhitespace.add("#text");
+ expectedWhitespace.add("salary");
+ expectedWhitespace.add("#text");
+ expectedWhitespace.add("gender");
+ expectedWhitespace.add("#text");
+ expectedWhitespace.add("address");
+ expectedWhitespace.add("#text");
+
+ java.util.List expectedNoWhitespace = new java.util.ArrayList();
+ expectedNoWhitespace.add("employeeId");
+ expectedNoWhitespace.add("name");
+ expectedNoWhitespace.add("position");
+ expectedNoWhitespace.add("salary");
+ expectedNoWhitespace.add("gender");
+ expectedNoWhitespace.add("address");
+
+ doc = (Document) load("staff", true);
+ elementList = doc.getElementsByTagName("employee");
+ employeeNode = elementList.item(1);
+ childList = employeeNode.getChildNodes();
+ length = (int) childList.getLength();
+ clonedNode = employeeNode.cloneNode(true);
+ clonedList = clonedNode.getChildNodes();
+ for (int indexN100AE = 0; indexN100AE < clonedList.getLength(); indexN100AE++) {
+ clonedChild = (Node) clonedList.item(indexN100AE);
+ clonedChildName = clonedChild.getNodeName();
+ result.add(clonedChildName);
+ }
+
+ if (equals(6, length)) {
+ assertEquals("nowhitespace", expectedNoWhitespace, result);
+ } else {
+ assertEquals("whitespace", expectedWhitespace, result);
+ }
+
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/nodeclonenodetrue";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(nodeclonenodetrue.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level1/core/nodeclonetruecopytext.java b/dom/src/test/java/org/w3c/domts/level1/core/nodeclonetruecopytext.java
new file mode 100644
index 0000000..0676e39
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level1/core/nodeclonetruecopytext.java
@@ -0,0 +1,91 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+Copyright (c) 2001-2004 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+*/
+
+package org.w3c.domts.level1.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * Retrieve the second salary and
+ * the "cloneNode(deep)" method with deep=true. The
+ * duplicate node returned by the method should copy
+ * any text data contained in this node.
+* @author NIST
+* @author Mary Brady
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-3A0ED0A4">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-3A0ED0A4</a>
+*/
+public final class nodeclonetruecopytext extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public nodeclonetruecopytext(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "staff", true);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ NodeList elementList;
+ NodeList childList;
+ Node childNode;
+ Node clonedNode;
+ Node lastChildNode;
+ String childValue;
+ doc = (Document) load("staff", true);
+ elementList = doc.getElementsByTagName("salary");
+ childNode = elementList.item(1);
+ clonedNode = childNode.cloneNode(true);
+ lastChildNode = clonedNode.getLastChild();
+ childValue = lastChildNode.getNodeValue();
+ assertEquals("nodeCloneTrueCopyTextAssert1", "35,000", childValue);
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/nodeclonetruecopytext";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(nodeclonetruecopytext.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level1/core/nodecommentnodeattributes.java b/dom/src/test/java/org/w3c/domts/level1/core/nodecommentnodeattributes.java
new file mode 100644
index 0000000..7fe33b8
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level1/core/nodecommentnodeattributes.java
@@ -0,0 +1,100 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+Copyright (c) 2001-2003 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+*/
+
+package org.w3c.domts.level1.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The "getAttributes()" method invoked on a Comment
+ * Node returns null.
+ * Find any comment that is an immediate child of the root
+ * and assert that Node.attributes is null. Then create
+ * a new comment node (in case they had been omitted) and
+ * make the assertion.
+* @author NIST
+* @author Mary Brady
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-84CF096">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-84CF096</a>
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-1728279322">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-1728279322</a>
+* @see <a href="http://www.w3.org/Bugs/Public/show_bug.cgi?id=248">http://www.w3.org/Bugs/Public/show_bug.cgi?id=248</a>
+*/
+public final class nodecommentnodeattributes extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public nodecommentnodeattributes(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "staff", false);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ NodeList childList;
+ Node childNode;
+ NamedNodeMap attrList;
+ int nodeType;
+ doc = (Document) load("staff", false);
+ childList = doc.getChildNodes();
+ for (int indexN10043 = 0; indexN10043 < childList.getLength(); indexN10043++) {
+ childNode = (Node) childList.item(indexN10043);
+ nodeType = (int) childNode.getNodeType();
+
+ if (equals(8, nodeType)) {
+ attrList = childNode.getAttributes();
+ assertNull("attributesNull", attrList);
+ }
+ }
+ childNode = doc.createComment("This is a comment");
+ attrList = childNode.getAttributes();
+ assertNull("createdAttributesNull", attrList);
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/nodecommentnodeattributes";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(nodecommentnodeattributes.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level1/core/nodecommentnodename.java b/dom/src/test/java/org/w3c/domts/level1/core/nodecommentnodename.java
new file mode 100644
index 0000000..fd49ac3
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level1/core/nodecommentnodename.java
@@ -0,0 +1,96 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+Copyright (c) 2001 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+*/
+
+package org.w3c.domts.level1.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The string returned by the "getNodeName()" method for a
+ * Comment Node is "#comment".
+ *
+ * Retrieve the Comment node in the XML file
+ * and check the string returned by the "getNodeName()"
+ * method. It should be equal to "#comment".
+* @author NIST
+* @author Mary Brady
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-F68D095">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-F68D095</a>
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-1728279322">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-1728279322</a>
+*/
+public final class nodecommentnodename extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public nodecommentnodename(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "staff", false);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ NodeList elementList;
+ Node commentNode;
+ int nodeType;
+ String commentNodeName;
+ doc = (Document) load("staff", false);
+ elementList = doc.getChildNodes();
+ for (int indexN10040 = 0; indexN10040 < elementList.getLength(); indexN10040++) {
+ commentNode = (Node) elementList.item(indexN10040);
+ nodeType = (int) commentNode.getNodeType();
+
+ if (equals(8, nodeType)) {
+ commentNodeName = commentNode.getNodeName();
+ assertEquals("commentNodeName", "#comment", commentNodeName);
+ }
+ }
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/nodecommentnodename";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(nodecommentnodename.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level1/core/nodecommentnodetype.java b/dom/src/test/java/org/w3c/domts/level1/core/nodecommentnodetype.java
new file mode 100644
index 0000000..33d2060
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level1/core/nodecommentnodetype.java
@@ -0,0 +1,96 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+Copyright (c) 2001 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+*/
+
+package org.w3c.domts.level1.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The "getNodeType()" method for a Comment Node
+ * returns the constant value 8.
+ *
+ * Retrieve the nodes from the document and check for
+ * a comment node and invoke the "getNodeType()" method. This should
+ * return 8.
+* @author NIST
+* @author Mary Brady
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-111237558">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-111237558</a>
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-1728279322">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-1728279322</a>
+*/
+public final class nodecommentnodetype extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public nodecommentnodetype(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "staff", false);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ NodeList testList;
+ Node commentNode;
+ String commentNodeName;
+ int nodeType;
+ doc = (Document) load("staff", false);
+ testList = doc.getChildNodes();
+ for (int indexN10040 = 0; indexN10040 < testList.getLength(); indexN10040++) {
+ commentNode = (Node) testList.item(indexN10040);
+ commentNodeName = commentNode.getNodeName();
+
+ if (equals("#comment", commentNodeName)) {
+ nodeType = (int) commentNode.getNodeType();
+ assertEquals("nodeCommentNodeTypeAssert1", 8, nodeType);
+ }
+ }
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/nodecommentnodetype";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(nodecommentnodetype.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level1/core/nodecommentnodevalue.java b/dom/src/test/java/org/w3c/domts/level1/core/nodecommentnodevalue.java
new file mode 100644
index 0000000..b10df5f
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level1/core/nodecommentnodevalue.java
@@ -0,0 +1,96 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+Copyright (c) 2001 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+*/
+
+package org.w3c.domts.level1.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The string returned by the "getNodeValue()" method for a
+ * Comment Node is the content of the comment.
+ *
+ * Retrieve the comment in the XML file and
+ * check the string returned by the "getNodeValue()" method.
+ * It should be equal to "This is comment number 1".
+* @author NIST
+* @author Mary Brady
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-F68D080">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-F68D080</a>
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-1728279322">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-1728279322</a>
+*/
+public final class nodecommentnodevalue extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public nodecommentnodevalue(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "staff", false);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ NodeList elementList;
+ Node commentNode;
+ String commentName;
+ String commentValue;
+ doc = (Document) load("staff", false);
+ elementList = doc.getChildNodes();
+ for (int indexN10040 = 0; indexN10040 < elementList.getLength(); indexN10040++) {
+ commentNode = (Node) elementList.item(indexN10040);
+ commentName = commentNode.getNodeName();
+
+ if (equals("#comment", commentName)) {
+ commentValue = commentNode.getNodeValue();
+ assertEquals("value", " This is comment number 1.", commentValue);
+ }
+ }
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/nodecommentnodevalue";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(nodecommentnodevalue.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level1/core/nodedocumentfragmentnodename.java b/dom/src/test/java/org/w3c/domts/level1/core/nodedocumentfragmentnodename.java
new file mode 100644
index 0000000..a49cebd
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level1/core/nodedocumentfragmentnodename.java
@@ -0,0 +1,87 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+Copyright (c) 2001 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+*/
+
+package org.w3c.domts.level1.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The string returned by the "getNodeName()" method for a
+ * DocumentFragment Node is "#document-frament".
+ * Retrieve the DOM document and invoke the
+ * "createDocumentFragment()" method and check the string
+ * returned by the "getNodeName()" method. It should be
+ * equal to "#document-fragment".
+* @author NIST
+* @author Mary Brady
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-F68D095">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-F68D095</a>
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-B63ED1A3">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-B63ED1A3</a>
+*/
+public final class nodedocumentfragmentnodename extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public nodedocumentfragmentnodename(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "staff", true);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ DocumentFragment docFragment;
+ String documentFragmentName;
+ doc = (Document) load("staff", true);
+ docFragment = doc.createDocumentFragment();
+ documentFragmentName = docFragment.getNodeName();
+ assertEquals("nodeDocumentFragmentNodeNameAssert1", "#document-fragment", documentFragmentName);
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/nodedocumentfragmentnodename";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(nodedocumentfragmentnodename.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level1/core/nodedocumentfragmentnodetype.java b/dom/src/test/java/org/w3c/domts/level1/core/nodedocumentfragmentnodetype.java
new file mode 100644
index 0000000..13778a7
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level1/core/nodedocumentfragmentnodetype.java
@@ -0,0 +1,87 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+Copyright (c) 2001 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+*/
+
+package org.w3c.domts.level1.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The "getNodeType()" method for a DocumentFragment Node
+ * returns the constant value 11.
+ * Invoke the "createDocumentFragment()" method and
+ * examine the NodeType of the document fragment
+ * returned by the "getNodeType()" method. The method
+ * should return 11.
+* @author NIST
+* @author Mary Brady
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-111237558">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-111237558</a>
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-B63ED1A3">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-B63ED1A3</a>
+*/
+public final class nodedocumentfragmentnodetype extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public nodedocumentfragmentnodetype(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "staff", true);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ DocumentFragment documentFragmentNode;
+ int nodeType;
+ doc = (Document) load("staff", true);
+ documentFragmentNode = doc.createDocumentFragment();
+ nodeType = (int) documentFragmentNode.getNodeType();
+ assertEquals("nodeDocumentFragmentNodeTypeAssert1", 11, nodeType);
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/nodedocumentfragmentnodetype";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(nodedocumentfragmentnodetype.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level1/core/nodedocumentfragmentnodevalue.java b/dom/src/test/java/org/w3c/domts/level1/core/nodedocumentfragmentnodevalue.java
new file mode 100644
index 0000000..6a3bd3c
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level1/core/nodedocumentfragmentnodevalue.java
@@ -0,0 +1,93 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+Copyright (c) 2001 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+*/
+
+package org.w3c.domts.level1.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The string returned by the "getNodeValue()" method for a
+ * DocumentFragment Node is null.
+ *
+ * Retrieve the DOM document and invoke the
+ * "createDocumentFragment()" method and check the string
+ * returned by the "getNodeValue()" method. It should be
+ * equal to null.
+* @author NIST
+* @author Mary Brady
+* @author Curt Arnold
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-B63ED1A3">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-B63ED1A3</a>
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-F68D080">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-F68D080</a>
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-84CF096">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-84CF096</a>
+*/
+public final class nodedocumentfragmentnodevalue extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public nodedocumentfragmentnodevalue(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "staff", true);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ DocumentFragment docFragment;
+ NamedNodeMap attrList;
+ String value;
+ doc = (Document) load("staff", true);
+ docFragment = doc.createDocumentFragment();
+ attrList = docFragment.getAttributes();
+ assertNull("attributesNull", attrList);
+ value = docFragment.getNodeValue();
+ assertNull("initiallyNull", value);
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/nodedocumentfragmentnodevalue";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(nodedocumentfragmentnodevalue.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level1/core/nodedocumentnodeattribute.java b/dom/src/test/java/org/w3c/domts/level1/core/nodedocumentnodeattribute.java
new file mode 100644
index 0000000..570d2fb
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level1/core/nodedocumentnodeattribute.java
@@ -0,0 +1,81 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+Copyright (c) 2001-2004 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+*/
+
+package org.w3c.domts.level1.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The "getAttributes()" method invoked on a Document
+ * Node returns null.
+* @author NIST
+* @author Mary Brady
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-84CF096">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-84CF096</a>
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#i-Document">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#i-Document</a>
+*/
+public final class nodedocumentnodeattribute extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public nodedocumentnodeattribute(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "staff", false);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ NamedNodeMap attrList;
+ doc = (Document) load("staff", false);
+ attrList = doc.getAttributes();
+ assertNull("documentAttributesNull", attrList);
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/nodedocumentnodeattribute";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(nodedocumentnodeattribute.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level1/core/nodedocumentnodename.java b/dom/src/test/java/org/w3c/domts/level1/core/nodedocumentnodename.java
new file mode 100644
index 0000000..e0da8cd
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level1/core/nodedocumentnodename.java
@@ -0,0 +1,84 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+Copyright (c) 2001 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+*/
+
+package org.w3c.domts.level1.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The string returned by the "getNodeName()" method for a
+ * Document Node is "#document".
+ * Retrieve the DOM document and check the string returned
+ * by the "getNodeName()" method. It should be equal to
+ * "#document".
+* @author NIST
+* @author Mary Brady
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#i-Document">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#i-Document</a>
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-F68D095">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-F68D095</a>
+*/
+public final class nodedocumentnodename extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public nodedocumentnodename(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "staff", false);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ String documentName;
+ doc = (Document) load("staff", false);
+ documentName = doc.getNodeName();
+ assertEquals("documentNodeName", "#document", documentName);
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/nodedocumentnodename";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(nodedocumentnodename.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level1/core/nodedocumentnodetype.java b/dom/src/test/java/org/w3c/domts/level1/core/nodedocumentnodetype.java
new file mode 100644
index 0000000..bb3d32b
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level1/core/nodedocumentnodetype.java
@@ -0,0 +1,83 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+Copyright (c) 2001 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+*/
+
+package org.w3c.domts.level1.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The "getNodeType()" method for a Document Node
+ * returns the constant value 9.
+ * Retrieve the document and invoke the "getNodeType()"
+ * method. The method should return 9.
+* @author NIST
+* @author Mary Brady
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#i-Document">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#i-Document</a>
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-111237558">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-111237558</a>
+*/
+public final class nodedocumentnodetype extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public nodedocumentnodetype(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "staff", false);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ int nodeType;
+ doc = (Document) load("staff", false);
+ nodeType = (int) doc.getNodeType();
+ assertEquals("nodeDocumentNodeTypeAssert1", 9, nodeType);
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/nodedocumentnodetype";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(nodedocumentnodetype.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level1/core/nodedocumentnodevalue.java b/dom/src/test/java/org/w3c/domts/level1/core/nodedocumentnodevalue.java
new file mode 100644
index 0000000..3caa1cb
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level1/core/nodedocumentnodevalue.java
@@ -0,0 +1,84 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+Copyright (c) 2001 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+*/
+
+package org.w3c.domts.level1.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The string returned by the "getNodeValue()" method for a
+ * Document Node is null.
+ * Retrieve the DOM Document and check the string returned
+ * by the "getNodeValue()" method. It should be equal to
+ * null.
+* @author NIST
+* @author Mary Brady
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#i-Document">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#i-Document</a>
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-F68D080">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-F68D080</a>
+*/
+public final class nodedocumentnodevalue extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public nodedocumentnodevalue(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "staff", false);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ String documentValue;
+ doc = (Document) load("staff", false);
+ documentValue = doc.getNodeValue();
+ assertNull("documentNodeValueNull", documentValue);
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/nodedocumentnodevalue";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(nodedocumentnodevalue.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level1/core/nodedocumenttypenodename.java b/dom/src/test/java/org/w3c/domts/level1/core/nodedocumenttypenodename.java
new file mode 100644
index 0000000..7853a5a
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level1/core/nodedocumenttypenodename.java
@@ -0,0 +1,90 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+Copyright (c) 2001-2004 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+*/
+
+package org.w3c.domts.level1.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * Retrieve the DOCTYPE declaration from the XML file and
+ * check the string returned by the "getNodeName()"
+ * method. It should be equal to "staff" or "svg".
+* @author NIST
+* @author Mary Brady
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-F68D095">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-F68D095</a>
+*/
+public final class nodedocumenttypenodename extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public nodedocumenttypenodename(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "staff", false);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ DocumentType docType;
+ String documentTypeName;
+ doc = (Document) load("staff", false);
+ docType = doc.getDoctype();
+ assertNotNull("docTypeNotNull", docType);
+ documentTypeName = docType.getNodeName();
+
+ if (("image/svg+xml".equals(getContentType()))) {
+ assertEquals("doctypeNameSVG", "svg", documentTypeName);
+ } else {
+ assertEquals("documentName", "staff", documentTypeName);
+ }
+
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/nodedocumenttypenodename";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(nodedocumenttypenodename.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level1/core/nodedocumenttypenodetype.java b/dom/src/test/java/org/w3c/domts/level1/core/nodedocumenttypenodetype.java
new file mode 100644
index 0000000..d6d90f0
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level1/core/nodedocumenttypenodetype.java
@@ -0,0 +1,83 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+Copyright (c) 2001-2004 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+*/
+
+package org.w3c.domts.level1.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The "getNodeType()" method for a DocumentType Node
+ * returns the constant value 10.
+* @author NIST
+* @author Mary Brady
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-111237558">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-111237558</a>
+*/
+public final class nodedocumenttypenodetype extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public nodedocumenttypenodetype(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "staff", false);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ DocumentType documentTypeNode;
+ int nodeType;
+ doc = (Document) load("staff", false);
+ documentTypeNode = doc.getDoctype();
+ assertNotNull("doctypeNotNull", documentTypeNode);
+ nodeType = (int) documentTypeNode.getNodeType();
+ assertEquals("nodeType", 10, nodeType);
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/nodedocumenttypenodetype";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(nodedocumenttypenodetype.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level1/core/nodedocumenttypenodevalue.java b/dom/src/test/java/org/w3c/domts/level1/core/nodedocumenttypenodevalue.java
new file mode 100644
index 0000000..5b013d9
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level1/core/nodedocumenttypenodevalue.java
@@ -0,0 +1,82 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+Copyright (c) 2001-2004 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+*/
+
+package org.w3c.domts.level1.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The string returned by the "getNodeValue()" method for a
+ * DocumentType Node is null.
+* @author NIST
+* @author Mary Brady
+*/
+public final class nodedocumenttypenodevalue extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public nodedocumenttypenodevalue(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "staff", false);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ DocumentType docType;
+ NamedNodeMap attrList;
+ doc = (Document) load("staff", false);
+ docType = doc.getDoctype();
+ assertNotNull("docTypeNotNull", docType);
+ attrList = docType.getAttributes();
+ assertNull("doctypeAttributesNull", attrList);
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/nodedocumenttypenodevalue";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(nodedocumenttypenodevalue.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level1/core/nodeelementnodeattributes.java b/dom/src/test/java/org/w3c/domts/level1/core/nodeelementnodeattributes.java
new file mode 100644
index 0000000..c318c9d
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level1/core/nodeelementnodeattributes.java
@@ -0,0 +1,103 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+Copyright (c) 2001 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+*/
+
+package org.w3c.domts.level1.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The "getAttributes()" method invoked on an Element
+ * Node returns a NamedNodeMap containing the attributes
+ * of this node.
+ *
+ * Retrieve the last child of the third employee and
+ * invoke the "getAttributes()" method. It should return
+ * a NamedNodeMap containing the attributes of the Element
+ * node.
+* @author NIST
+* @author Mary Brady
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-84CF096">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-84CF096</a>
+*/
+public final class nodeelementnodeattributes extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public nodeelementnodeattributes(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "staff", false);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ NodeList elementList;
+ Element testAddr;
+ NamedNodeMap addrAttr;
+ Node attrNode;
+ String attrName;
+ java.util.Collection attrList = new java.util.ArrayList();
+
+ java.util.Collection expected = new java.util.ArrayList();
+ expected.add("domestic");
+ expected.add("street");
+
+ doc = (Document) load("staff", false);
+ elementList = doc.getElementsByTagName("address");
+ testAddr = (Element) elementList.item(2);
+ addrAttr = testAddr.getAttributes();
+ for (int indexN1005C = 0; indexN1005C < addrAttr.getLength(); indexN1005C++) {
+ attrNode = (Node) addrAttr.item(indexN1005C);
+ attrName = attrNode.getNodeName();
+ attrList.add(attrName);
+ }
+ assertEquals("nodeElementNodeValueAssert1", expected, attrList);
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/nodeelementnodeattributes";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(nodeelementnodeattributes.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level1/core/nodeelementnodename.java b/dom/src/test/java/org/w3c/domts/level1/core/nodeelementnodename.java
new file mode 100644
index 0000000..892f1aa
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level1/core/nodeelementnodename.java
@@ -0,0 +1,94 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+Copyright (c) 2001 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+*/
+
+package org.w3c.domts.level1.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The string returned by the "getNodeName()" method for an
+ * Element Node is its tagName.
+ *
+ * Retrieve the first Element Node(Root Node) of the
+ * DOM object and check the string returned by the
+ * "getNodeName()" method. It should be equal to its
+ * tagName.
+* @author NIST
+* @author Mary Brady
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-F68D095">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-F68D095</a>
+* @see <a href="http://www.w3.org/Bugs/Public/show_bug.cgi?id=251">http://www.w3.org/Bugs/Public/show_bug.cgi?id=251</a>
+*/
+public final class nodeelementnodename extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public nodeelementnodename(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "staff", false);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ Element elementNode;
+ String elementName;
+ doc = (Document) load("staff", false);
+ elementNode = doc.getDocumentElement();
+ elementName = elementNode.getNodeName();
+
+ if (("image/svg+xml".equals(getContentType()))) {
+ assertEquals("svgNodeName", "svg", elementName);
+ } else {
+ assertEquals("nodeElementNodeNameAssert1", "staff", elementName);
+ }
+
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/nodeelementnodename";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(nodeelementnodename.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level1/core/nodeelementnodetype.java b/dom/src/test/java/org/w3c/domts/level1/core/nodeelementnodetype.java
new file mode 100644
index 0000000..5766859
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level1/core/nodeelementnodetype.java
@@ -0,0 +1,85 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+Copyright (c) 2001 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+*/
+
+package org.w3c.domts.level1.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The "getNodeType()" method for an Element Node
+ * returns the constant value 1.
+ *
+ * Retrieve the root node and invoke the "getNodeType()"
+ * method. The method should return 1.
+* @author NIST
+* @author Mary Brady
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-111237558">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-111237558</a>
+*/
+public final class nodeelementnodetype extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public nodeelementnodetype(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "staff", false);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ Element rootNode;
+ int nodeType;
+ doc = (Document) load("staff", false);
+ rootNode = doc.getDocumentElement();
+ nodeType = (int) rootNode.getNodeType();
+ assertEquals("nodeElementNodeTypeAssert1", 1, nodeType);
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/nodeelementnodetype";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(nodeelementnodetype.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level1/core/nodeelementnodevalue.java b/dom/src/test/java/org/w3c/domts/level1/core/nodeelementnodevalue.java
new file mode 100644
index 0000000..6fe3a9d
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level1/core/nodeelementnodevalue.java
@@ -0,0 +1,82 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+Copyright (c) 2001-2004 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+*/
+
+package org.w3c.domts.level1.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The string returned by the "getNodeValue()" method for an
+ * Element Node is null.
+* @author NIST
+* @author Mary Brady
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-F68D080">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-F68D080</a>
+*/
+public final class nodeelementnodevalue extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public nodeelementnodevalue(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "staff", false);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ Element elementNode;
+ String elementValue;
+ doc = (Document) load("staff", false);
+ elementNode = doc.getDocumentElement();
+ elementValue = elementNode.getNodeValue();
+ assertNull("elementNodeValueNull", elementValue);
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/nodeelementnodevalue";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(nodeelementnodevalue.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level1/core/nodeentitynodeattributes.java b/dom/src/test/java/org/w3c/domts/level1/core/nodeentitynodeattributes.java
new file mode 100644
index 0000000..2d83fe1
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level1/core/nodeentitynodeattributes.java
@@ -0,0 +1,89 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+Copyright (c) 2001-2004 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+*/
+
+package org.w3c.domts.level1.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The "getAttributes()" method invoked on an Entity
+ * Node returns null.
+* @author NIST
+* @author Mary Brady
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-84CF096">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-84CF096</a>
+*/
+public final class nodeentitynodeattributes extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public nodeentitynodeattributes(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "staff", false);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ DocumentType docType;
+ NamedNodeMap entities;
+ Node entityNode;
+ NamedNodeMap attrList;
+ doc = (Document) load("staff", false);
+ docType = doc.getDoctype();
+ assertNotNull("docTypeNotNull", docType);
+ entities = docType.getEntities();
+ assertNotNull("entitiesNotNull", entities);
+ entityNode = entities.getNamedItem("ent1");
+ assertNotNull("ent1NotNull", entityNode);
+ attrList = entityNode.getAttributes();
+ assertNull("entityAttributesNull", attrList);
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/nodeentitynodeattributes";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(nodeentitynodeattributes.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level1/core/nodeentitynodename.java b/dom/src/test/java/org/w3c/domts/level1/core/nodeentitynodename.java
new file mode 100644
index 0000000..279b5bd
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level1/core/nodeentitynodename.java
@@ -0,0 +1,88 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+Copyright (c) 2001-2004 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+*/
+
+package org.w3c.domts.level1.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * Check the nodeName of the entity returned by DocumentType.entities.getNamedItem("ent1").
+* @author NIST
+* @author Mary Brady
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-F68D095">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-F68D095</a>
+*/
+public final class nodeentitynodename extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public nodeentitynodename(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "staff", false);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ DocumentType docType;
+ NamedNodeMap entities;
+ Node entityNode;
+ String entityName;
+ doc = (Document) load("staff", false);
+ docType = doc.getDoctype();
+ assertNotNull("docTypeNotNull", docType);
+ entities = docType.getEntities();
+ assertNotNull("entitiesNotNull", entities);
+ entityNode = entities.getNamedItem("ent1");
+ assertNotNull("entityNodeNotNull", entityNode);
+ entityName = entityNode.getNodeName();
+ assertEquals("entityNodeName", "ent1", entityName);
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/nodeentitynodename";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(nodeentitynodename.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level1/core/nodeentitynodetype.java b/dom/src/test/java/org/w3c/domts/level1/core/nodeentitynodetype.java
new file mode 100644
index 0000000..ad6dc69
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level1/core/nodeentitynodetype.java
@@ -0,0 +1,89 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+Copyright (c) 2001-2004 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+*/
+
+package org.w3c.domts.level1.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The "getNodeType()" method for an Entity Node
+ * returns the constant value 6.
+* @author NIST
+* @author Mary Brady
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-111237558">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-111237558</a>
+*/
+public final class nodeentitynodetype extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public nodeentitynodetype(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "staff", false);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ DocumentType docType;
+ NamedNodeMap entities;
+ Node entityNode;
+ int nodeType;
+ doc = (Document) load("staff", false);
+ docType = doc.getDoctype();
+ assertNotNull("docTypeNotNull", docType);
+ entities = docType.getEntities();
+ assertNotNull("entitiesNotNull", entities);
+ entityNode = entities.getNamedItem("ent1");
+ assertNotNull("ent1NotNull", entityNode);
+ nodeType = (int) entityNode.getNodeType();
+ assertEquals("entityNodeType", 6, nodeType);
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/nodeentitynodetype";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(nodeentitynodetype.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level1/core/nodeentitynodevalue.java b/dom/src/test/java/org/w3c/domts/level1/core/nodeentitynodevalue.java
new file mode 100644
index 0000000..5432d49
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level1/core/nodeentitynodevalue.java
@@ -0,0 +1,89 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+Copyright (c) 2001-2004 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+*/
+
+package org.w3c.domts.level1.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The string returned by the "getNodeValue()" method for an
+ * Entity Node is null.
+* @author NIST
+* @author Mary Brady
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-F68D080">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-F68D080</a>
+*/
+public final class nodeentitynodevalue extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public nodeentitynodevalue(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "staff", false);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ DocumentType docType;
+ NamedNodeMap entities;
+ Node entityNode;
+ String entityValue;
+ doc = (Document) load("staff", false);
+ docType = doc.getDoctype();
+ assertNotNull("docTypeNotNull", docType);
+ entities = docType.getEntities();
+ assertNotNull("entitiesNotNull", entities);
+ entityNode = entities.getNamedItem("ent1");
+ assertNotNull("ent1NotNull", entityNode);
+ entityValue = entityNode.getNodeValue();
+ assertNull("entityNodeValue", entityValue);
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/nodeentitynodevalue";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(nodeentitynodevalue.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level1/core/nodeentityreferencenodeattributes.java b/dom/src/test/java/org/w3c/domts/level1/core/nodeentityreferencenodeattributes.java
new file mode 100644
index 0000000..36d8ea3
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level1/core/nodeentityreferencenodeattributes.java
@@ -0,0 +1,93 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+Copyright (c) 2001-2004 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+*/
+
+package org.w3c.domts.level1.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The "getAttributes()" method invoked on an EntityReference
+ * Node returns null.
+* @author NIST
+* @author Mary Brady
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-84CF096">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-84CF096</a>
+*/
+public final class nodeentityreferencenodeattributes extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public nodeentityreferencenodeattributes(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "staff", true);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ NodeList elementList;
+ Element entRefAddr;
+ Node entRefNode;
+ NamedNodeMap attrList;
+ int nodeType;
+ doc = (Document) load("staff", true);
+ elementList = doc.getElementsByTagName("address");
+ entRefAddr = (Element) elementList.item(1);
+ entRefNode = entRefAddr.getFirstChild();
+ nodeType = (int) entRefNode.getNodeType();
+
+ if (!equals(5, nodeType)) {
+ entRefNode = doc.createEntityReference("ent2");
+ assertNotNull("createdEntRefNotNull", entRefNode);
+ }
+ attrList = entRefNode.getAttributes();
+ assertNull("attrList", attrList);
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/nodeentityreferencenodeattributes";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(nodeentityreferencenodeattributes.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level1/core/nodeentityreferencenodename.java b/dom/src/test/java/org/w3c/domts/level1/core/nodeentityreferencenodename.java
new file mode 100644
index 0000000..eef2b16
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level1/core/nodeentityreferencenodename.java
@@ -0,0 +1,98 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+Copyright (c) 2001-2004 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+*/
+
+package org.w3c.domts.level1.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The string returned by the "getNodeName()" method for an
+ * EntityReference Node is the name of the entity referenced.
+ *
+ * Retrieve the first Entity Reference node from the last
+ * child of the second employee and check the string
+ * returned by the "getNodeName()" method. It should be
+ * equal to "ent2".
+* @author NIST
+* @author Mary Brady
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-F68D095">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-F68D095</a>
+*/
+public final class nodeentityreferencenodename extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public nodeentityreferencenodename(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "staff", false);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ NodeList elementList;
+ Element entRefAddr;
+ Node entRefNode;
+ String entRefName;
+ int nodeType;
+ doc = (Document) load("staff", false);
+ elementList = doc.getElementsByTagName("address");
+ entRefAddr = (Element) elementList.item(1);
+ entRefNode = entRefAddr.getFirstChild();
+ nodeType = (int) entRefNode.getNodeType();
+
+ if (!equals(5, nodeType)) {
+ entRefNode = doc.createEntityReference("ent2");
+ assertNotNull("createdEntRefNotNull", entRefNode);
+ }
+ entRefName = entRefNode.getNodeName();
+ assertEquals("nodeEntityReferenceNodeNameAssert1", "ent2", entRefName);
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/nodeentityreferencenodename";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(nodeentityreferencenodename.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level1/core/nodeentityreferencenodetype.java b/dom/src/test/java/org/w3c/domts/level1/core/nodeentityreferencenodetype.java
new file mode 100644
index 0000000..c426cae
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level1/core/nodeentityreferencenodetype.java
@@ -0,0 +1,96 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+Copyright (c) 2001-2004 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+*/
+
+package org.w3c.domts.level1.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The "getNodeType()" method for an EntityReference Node
+ * returns the constant value 5.
+ *
+ * Retrieve the EntityReference node from the last child
+ * of the second employee and invoke the "getNodeType()"
+ * method. The method should return 5.
+* @author NIST
+* @author Mary Brady
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-111237558">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-111237558</a>
+*/
+public final class nodeentityreferencenodetype extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public nodeentityreferencenodetype(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "staff", false);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ NodeList elementList;
+ Element entRefAddr;
+ Node entRefNode;
+ int nodeType;
+ doc = (Document) load("staff", false);
+ elementList = doc.getElementsByTagName("address");
+ entRefAddr = (Element) elementList.item(1);
+ entRefNode = entRefAddr.getFirstChild();
+ nodeType = (int) entRefNode.getNodeType();
+
+ if (equals(3, nodeType)) {
+ entRefNode = doc.createEntityReference("ent2");
+ assertNotNull("createdEntRefNotNull", entRefNode);
+ nodeType = (int) entRefNode.getNodeType();
+ }
+ assertEquals("entityNodeType", 5, nodeType);
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/nodeentityreferencenodetype";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(nodeentityreferencenodetype.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level1/core/nodeentityreferencenodevalue.java b/dom/src/test/java/org/w3c/domts/level1/core/nodeentityreferencenodevalue.java
new file mode 100644
index 0000000..631b247
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level1/core/nodeentityreferencenodevalue.java
@@ -0,0 +1,98 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+Copyright (c) 2001-2004 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+*/
+
+package org.w3c.domts.level1.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The string returned by the "getNodeValue()" method for an
+ * EntityReference Node is null.
+ *
+ * Retrieve the first Entity Reference node from the last
+ * child of the second employee and check the string
+ * returned by the "getNodeValue()" method. It should be
+ * equal to null.
+* @author NIST
+* @author Mary Brady
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-F68D080">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-F68D080</a>
+*/
+public final class nodeentityreferencenodevalue extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public nodeentityreferencenodevalue(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "staff", false);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ NodeList elementList;
+ Element entRefAddr;
+ Node entRefNode;
+ String entRefValue;
+ int nodeType;
+ doc = (Document) load("staff", false);
+ elementList = doc.getElementsByTagName("address");
+ entRefAddr = (Element) elementList.item(1);
+ entRefNode = entRefAddr.getFirstChild();
+ nodeType = (int) entRefNode.getNodeType();
+
+ if (equals(3, nodeType)) {
+ entRefNode = doc.createEntityReference("ent2");
+ assertNotNull("createdEntRefNotNull", entRefNode);
+ }
+ entRefValue = entRefNode.getNodeValue();
+ assertNull("entRefNodeValue", entRefValue);
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/nodeentityreferencenodevalue";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(nodeentityreferencenodevalue.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level1/core/nodeentitysetnodevalue.java b/dom/src/test/java/org/w3c/domts/level1/core/nodeentitysetnodevalue.java
new file mode 100644
index 0000000..2561790
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level1/core/nodeentitysetnodevalue.java
@@ -0,0 +1,90 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+Copyright (c) 2001-2004 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+*/
+
+package org.w3c.domts.level1.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The string returned by the "getNodeValue()" method for an
+ * Entity Node is always null and "setNodeValue" should have no effect.
+* @author Curt Arnold
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-F68D080">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-F68D080</a>
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-527DCFF2">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-527DCFF2</a>
+*/
+public final class nodeentitysetnodevalue extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public nodeentitysetnodevalue(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "staff", true);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ DocumentType docType;
+ NamedNodeMap entities;
+ Node entityNode;
+ String entityValue;
+ doc = (Document) load("staff", true);
+ docType = doc.getDoctype();
+ assertNotNull("docTypeNotNull", docType);
+ entities = docType.getEntities();
+ assertNotNull("entitiesNotNull", entities);
+ entityNode = entities.getNamedItem("ent1");
+ assertNotNull("ent1NotNull", entityNode);
+ entityNode.setNodeValue("This should have no effect");
+ entityValue = entityNode.getNodeValue();
+ assertNull("nodeValueNull", entityValue);
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/nodeentitysetnodevalue";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(nodeentitysetnodevalue.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level1/core/nodegetfirstchild.java b/dom/src/test/java/org/w3c/domts/level1/core/nodegetfirstchild.java
new file mode 100644
index 0000000..1f5c273
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level1/core/nodegetfirstchild.java
@@ -0,0 +1,91 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+Copyright (c) 2001-2004 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+*/
+
+package org.w3c.domts.level1.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The "getFirstChild()" method returns the first child
+ * of this node.
+* @author NIST
+* @author Mary Brady
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-169727388">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-169727388</a>
+*/
+public final class nodegetfirstchild extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public nodegetfirstchild(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "staff", false);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ NodeList elementList;
+ Node employeeNode;
+ Node fchildNode;
+ String childName;
+ doc = (Document) load("staff", false);
+ elementList = doc.getElementsByTagName("employee");
+ employeeNode = elementList.item(1);
+ fchildNode = employeeNode.getFirstChild();
+ childName = fchildNode.getNodeName();
+
+ if (equals("#text", childName)) {
+ fchildNode = fchildNode.getNextSibling();
+ childName = fchildNode.getNodeName();
+ }
+ assertEquals("nodeName", "employeeId", childName);
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/nodegetfirstchild";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(nodegetfirstchild.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level1/core/nodegetfirstchildnull.java b/dom/src/test/java/org/w3c/domts/level1/core/nodegetfirstchildnull.java
new file mode 100644
index 0000000..3041735
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level1/core/nodegetfirstchildnull.java
@@ -0,0 +1,94 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+Copyright (c) 2001 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+*/
+
+package org.w3c.domts.level1.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * If there is not a first child then the "getFirstChild()"
+ * method returns null.
+ *
+ * Retrieve the Text node form the second child of the first
+ * employee and invoke the "getFirstChild()" method. It
+ * should return null.
+* @author NIST
+* @author Mary Brady
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-169727388">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-169727388</a>
+*/
+public final class nodegetfirstchildnull extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public nodegetfirstchildnull(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "staff", false);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ NodeList elementList;
+ Node employeeNode;
+ NodeList employeeList;
+ Node secondChildNode;
+ Node textNode;
+ Node noChildNode;
+ doc = (Document) load("staff", false);
+ elementList = doc.getElementsByTagName("employee");
+ employeeNode = elementList.item(0);
+ employeeList = employeeNode.getChildNodes();
+ secondChildNode = employeeList.item(1);
+ textNode = secondChildNode.getFirstChild();
+ noChildNode = textNode.getFirstChild();
+ assertNull("nodeGetFirstChildNullAssert1", noChildNode);
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/nodegetfirstchildnull";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(nodegetfirstchildnull.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level1/core/nodegetlastchild.java b/dom/src/test/java/org/w3c/domts/level1/core/nodegetlastchild.java
new file mode 100644
index 0000000..5e335fc
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level1/core/nodegetlastchild.java
@@ -0,0 +1,91 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+Copyright (c) 2001-2004 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+*/
+
+package org.w3c.domts.level1.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The "getLastChild()" method returns the last child
+ * of this node.
+* @author NIST
+* @author Mary Brady
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-61AD09FB">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-61AD09FB</a>
+*/
+public final class nodegetlastchild extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public nodegetlastchild(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "staff", false);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ NodeList elementList;
+ Node employeeNode;
+ Node lchildNode;
+ String childName;
+ doc = (Document) load("staff", false);
+ elementList = doc.getElementsByTagName("employee");
+ employeeNode = elementList.item(1);
+ lchildNode = employeeNode.getLastChild();
+ childName = lchildNode.getNodeName();
+
+ if (equals("#text", childName)) {
+ lchildNode = lchildNode.getPreviousSibling();
+ childName = lchildNode.getNodeName();
+ }
+ assertEquals("nodeName", "address", childName);
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/nodegetlastchild";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(nodegetlastchild.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level1/core/nodegetlastchildnull.java b/dom/src/test/java/org/w3c/domts/level1/core/nodegetlastchildnull.java
new file mode 100644
index 0000000..b64c7c7
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level1/core/nodegetlastchildnull.java
@@ -0,0 +1,94 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+Copyright (c) 2001 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+*/
+
+package org.w3c.domts.level1.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * If there is not a last child then the "getLastChild()"
+ * method returns null.
+ *
+ * Retrieve the Text node from the second child of the first
+ * employee and invoke the "getLastChild()" method. It
+ * should return null.
+* @author NIST
+* @author Mary Brady
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-61AD09FB">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-61AD09FB</a>
+*/
+public final class nodegetlastchildnull extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public nodegetlastchildnull(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "staff", false);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ NodeList elementList;
+ Node employeeNode;
+ NodeList employeeList;
+ Node secondChildNode;
+ Node textNode;
+ Node noChildNode;
+ doc = (Document) load("staff", false);
+ elementList = doc.getElementsByTagName("employee");
+ employeeNode = elementList.item(0);
+ employeeList = employeeNode.getChildNodes();
+ secondChildNode = employeeList.item(1);
+ textNode = secondChildNode.getFirstChild();
+ noChildNode = textNode.getLastChild();
+ assertNull("nodeGetLastChildNullAssert1", noChildNode);
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/nodegetlastchildnull";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(nodegetlastchildnull.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level1/core/nodegetnextsibling.java b/dom/src/test/java/org/w3c/domts/level1/core/nodegetnextsibling.java
new file mode 100644
index 0000000..5917212
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level1/core/nodegetnextsibling.java
@@ -0,0 +1,91 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+Copyright (c) 2001-2004 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+*/
+
+package org.w3c.domts.level1.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The "getNextSibling()" method returns the node immediately
+ * following this node.
+* @author NIST
+* @author Mary Brady
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-6AC54C2F">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-6AC54C2F</a>
+*/
+public final class nodegetnextsibling extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public nodegetnextsibling(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "staff", false);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ NodeList elementList;
+ Node employeeIdNode;
+ Node nsNode;
+ String nsName;
+ doc = (Document) load("staff", false);
+ elementList = doc.getElementsByTagName("employeeId");
+ employeeIdNode = elementList.item(1);
+ nsNode = employeeIdNode.getNextSibling();
+ nsName = nsNode.getNodeName();
+
+ if (equals("#text", nsName)) {
+ nsNode = nsNode.getNextSibling();
+ nsName = nsNode.getNodeName();
+ }
+ assertEquals("nodeName", "name", nsName);
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/nodegetnextsibling";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(nodegetnextsibling.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level1/core/nodegetnextsiblingnull.java b/dom/src/test/java/org/w3c/domts/level1/core/nodegetnextsiblingnull.java
new file mode 100644
index 0000000..5e1bfbd
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level1/core/nodegetnextsiblingnull.java
@@ -0,0 +1,90 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+Copyright (c) 2001 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+*/
+
+package org.w3c.domts.level1.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * If there is not a node immediately following this node the
+ * "getNextSibling()" method returns null.
+ *
+ * Retrieve the first child of the second employee and
+ * invoke the "getNextSibling()" method. It should
+ * be set to null.
+* @author NIST
+* @author Mary Brady
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-6AC54C2F">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-6AC54C2F</a>
+*/
+public final class nodegetnextsiblingnull extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public nodegetnextsiblingnull(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "staff", false);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ NodeList elementList;
+ Node employeeNode;
+ Node lcNode;
+ Node nsNode;
+ doc = (Document) load("staff", false);
+ elementList = doc.getElementsByTagName("employee");
+ employeeNode = elementList.item(1);
+ lcNode = employeeNode.getLastChild();
+ nsNode = lcNode.getNextSibling();
+ assertNull("nodeGetNextSiblingNullAssert1", nsNode);
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/nodegetnextsiblingnull";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(nodegetnextsiblingnull.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level1/core/nodegetownerdocument.java b/dom/src/test/java/org/w3c/domts/level1/core/nodegetownerdocument.java
new file mode 100644
index 0000000..757edd2
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level1/core/nodegetownerdocument.java
@@ -0,0 +1,100 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+Copyright (c) 2001-2003 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+*/
+
+package org.w3c.domts.level1.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The "getOwnerDocument()" method returns the Document
+ * object associated with this node.
+ *
+ * Retrieve the second employee and examine Document
+ * returned by the "getOwnerDocument()" method. Invoke
+ * the "getDocumentElement()" on the Document which will
+ * return an Element that is equal to "staff".
+* @author NIST
+* @author Mary Brady
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#node-ownerDoc">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#node-ownerDoc</a>
+* @see <a href="http://www.w3.org/Bugs/Public/show_bug.cgi?id=251">http://www.w3.org/Bugs/Public/show_bug.cgi?id=251</a>
+*/
+public final class nodegetownerdocument extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public nodegetownerdocument(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "staff", false);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ NodeList elementList;
+ Node docNode;
+ Document ownerDocument;
+ Element docElement;
+ String elementName;
+ doc = (Document) load("staff", false);
+ elementList = doc.getElementsByTagName("employee");
+ docNode = elementList.item(1);
+ ownerDocument = docNode.getOwnerDocument();
+ docElement = ownerDocument.getDocumentElement();
+ elementName = docElement.getNodeName();
+
+ if (("image/svg+xml".equals(getContentType()))) {
+ assertEquals("svgTagName", "svg", elementName);
+ } else {
+ assertEquals("nodeGetOwnerDocumentAssert1", "staff", elementName);
+ }
+
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/nodegetownerdocument";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(nodegetownerdocument.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level1/core/nodegetownerdocumentnull.java b/dom/src/test/java/org/w3c/domts/level1/core/nodegetownerdocumentnull.java
new file mode 100644
index 0000000..b853523
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level1/core/nodegetownerdocumentnull.java
@@ -0,0 +1,80 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+Copyright (c) 2001-2004 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+*/
+
+package org.w3c.domts.level1.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The "getOwnerDocument()" method returns null if the target
+ * node itself is a document.
+* @author NIST
+* @author Mary Brady
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#node-ownerDoc">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#node-ownerDoc</a>
+*/
+public final class nodegetownerdocumentnull extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public nodegetownerdocumentnull(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "staff", false);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ Document ownerDocument;
+ doc = (Document) load("staff", false);
+ ownerDocument = doc.getOwnerDocument();
+ assertNull("documentOwnerDocumentNull", ownerDocument);
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/nodegetownerdocumentnull";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(nodegetownerdocumentnull.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level1/core/nodegetprevioussibling.java b/dom/src/test/java/org/w3c/domts/level1/core/nodegetprevioussibling.java
new file mode 100644
index 0000000..a896394
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level1/core/nodegetprevioussibling.java
@@ -0,0 +1,91 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+Copyright (c) 2001-2004 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+*/
+
+package org.w3c.domts.level1.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The "getPreviousSibling()" method returns the node
+ * immediately preceding this node.
+* @author NIST
+* @author Mary Brady
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-640FB3C8">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-640FB3C8</a>
+*/
+public final class nodegetprevioussibling extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public nodegetprevioussibling(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "staff", false);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ NodeList elementList;
+ Node nameNode;
+ Node psNode;
+ String psName;
+ doc = (Document) load("staff", false);
+ elementList = doc.getElementsByTagName("name");
+ nameNode = elementList.item(1);
+ psNode = nameNode.getPreviousSibling();
+ psName = psNode.getNodeName();
+
+ if (equals("#text", psName)) {
+ psNode = psNode.getPreviousSibling();
+ psName = psNode.getNodeName();
+ }
+ assertEquals("nodeName", "employeeId", psName);
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/nodegetprevioussibling";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(nodegetprevioussibling.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level1/core/nodegetprevioussiblingnull.java b/dom/src/test/java/org/w3c/domts/level1/core/nodegetprevioussiblingnull.java
new file mode 100644
index 0000000..7eba475
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level1/core/nodegetprevioussiblingnull.java
@@ -0,0 +1,90 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+Copyright (c) 2001 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+*/
+
+package org.w3c.domts.level1.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * If there is not a node immediately preceding this node the
+ * "getPreviousSibling()" method returns null.
+ *
+ * Retrieve the first child of the second employee and
+ * invoke the "getPreviousSibling()" method. It should
+ * be set to null.
+* @author NIST
+* @author Mary Brady
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-640FB3C8">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-640FB3C8</a>
+*/
+public final class nodegetprevioussiblingnull extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public nodegetprevioussiblingnull(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "staff", false);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ NodeList elementList;
+ Node employeeNode;
+ Node fcNode;
+ Node psNode;
+ doc = (Document) load("staff", false);
+ elementList = doc.getElementsByTagName("employee");
+ employeeNode = elementList.item(2);
+ fcNode = employeeNode.getFirstChild();
+ psNode = fcNode.getPreviousSibling();
+ assertNull("nodeGetPreviousSiblingNullAssert1", psNode);
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/nodegetprevioussiblingnull";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(nodegetprevioussiblingnull.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level1/core/nodehaschildnodes.java b/dom/src/test/java/org/w3c/domts/level1/core/nodehaschildnodes.java
new file mode 100644
index 0000000..e4b1bdb
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level1/core/nodehaschildnodes.java
@@ -0,0 +1,88 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+Copyright (c) 2001 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+*/
+
+package org.w3c.domts.level1.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The "hasChildNodes()" method returns true if the node
+ * has children.
+ *
+ * Retrieve the root node("staff") and invoke the
+ * "hasChildNodes()" method. It should return the boolean
+ * value "true".
+* @author NIST
+* @author Mary Brady
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-810594187">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-810594187</a>
+*/
+public final class nodehaschildnodes extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public nodehaschildnodes(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "staff", false);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ NodeList elementList;
+ Node employeeNode;
+ boolean state;
+ doc = (Document) load("staff", false);
+ elementList = doc.getElementsByTagName("employee");
+ employeeNode = elementList.item(1);
+ state = employeeNode.hasChildNodes();
+ assertTrue("nodeHasChildAssert1", state);
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/nodehaschildnodes";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(nodehaschildnodes.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level1/core/nodehaschildnodesfalse.java b/dom/src/test/java/org/w3c/domts/level1/core/nodehaschildnodesfalse.java
new file mode 100644
index 0000000..afac51e
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level1/core/nodehaschildnodesfalse.java
@@ -0,0 +1,95 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+Copyright (c) 2001 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+*/
+
+package org.w3c.domts.level1.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The "hasChildNodes()" method returns false if the node
+ * does not have any children.
+ *
+ * Retrieve the Text node inside the first child of the
+ * second employee and invoke the "hasChildNodes()" method.
+ * It should return the boolean value "false".
+* @author NIST
+* @author Mary Brady
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-1451460987">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-1451460987</a>
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-810594187">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-810594187</a>
+*/
+public final class nodehaschildnodesfalse extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public nodehaschildnodesfalse(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "staff", false);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ NodeList elementList;
+ Node child;
+ NodeList employeeIdList;
+ Node employeeNode;
+ Node textNode;
+ boolean state;
+ doc = (Document) load("staff", false);
+ elementList = doc.getElementsByTagName("employee");
+ child = elementList.item(1);
+ employeeIdList = child.getChildNodes();
+ employeeNode = employeeIdList.item(1);
+ textNode = employeeNode.getFirstChild();
+ state = textNode.hasChildNodes();
+ assertFalse("nodeHasChildFalseAssert1", state);
+}
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/nodehaschildnodesfalse";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(nodehaschildnodesfalse.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level1/core/nodeinsertbefore.java b/dom/src/test/java/org/w3c/domts/level1/core/nodeinsertbefore.java
new file mode 100644
index 0000000..985d113
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level1/core/nodeinsertbefore.java
@@ -0,0 +1,140 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+Copyright (c) 2001 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+*/
+
+package org.w3c.domts.level1.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The "insertBefore(newChild,refChild)" method inserts the
+ * node "newChild" before the node "refChild".
+ *
+ * Insert a newly created Element node before the eigth
+ * child of the second employee and check the "newChild"
+ * and "refChild" after insertion for correct placement.
+* @author NIST
+* @author Mary Brady
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-952280727">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-952280727</a>
+*/
+public final class nodeinsertbefore extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public nodeinsertbefore(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "staff", true);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ NodeList elementList;
+ Node employeeNode;
+ NodeList childList;
+ Node refChild;
+ Node newChild;
+ Node child;
+ String childName;
+ int length;
+ Node insertedNode;
+ java.util.List actual = new java.util.ArrayList();
+
+ java.util.List expectedWithWhitespace = new java.util.ArrayList();
+ expectedWithWhitespace.add("#text");
+ expectedWithWhitespace.add("employeeId");
+ expectedWithWhitespace.add("#text");
+ expectedWithWhitespace.add("name");
+ expectedWithWhitespace.add("#text");
+ expectedWithWhitespace.add("position");
+ expectedWithWhitespace.add("#text");
+ expectedWithWhitespace.add("newChild");
+ expectedWithWhitespace.add("salary");
+ expectedWithWhitespace.add("#text");
+ expectedWithWhitespace.add("gender");
+ expectedWithWhitespace.add("#text");
+ expectedWithWhitespace.add("address");
+ expectedWithWhitespace.add("#text");
+
+ java.util.List expectedWithoutWhitespace = new java.util.ArrayList();
+ expectedWithoutWhitespace.add("employeeId");
+ expectedWithoutWhitespace.add("name");
+ expectedWithoutWhitespace.add("position");
+ expectedWithoutWhitespace.add("newChild");
+ expectedWithoutWhitespace.add("salary");
+ expectedWithoutWhitespace.add("gender");
+ expectedWithoutWhitespace.add("address");
+
+ java.util.List expected = new java.util.ArrayList();
+
+ doc = (Document) load("staff", true);
+ elementList = doc.getElementsByTagName("employee");
+ employeeNode = elementList.item(1);
+ childList = employeeNode.getChildNodes();
+ length = (int) childList.getLength();
+
+ if (equals(6, length)) {
+ refChild = childList.item(3);
+ expected = expectedWithoutWhitespace;
+ } else {
+ refChild = childList.item(7);
+ expected = expectedWithWhitespace;
+ }
+
+ newChild = doc.createElement("newChild");
+ insertedNode = employeeNode.insertBefore(newChild, refChild);
+ for (int indexN100DC = 0; indexN100DC < childList.getLength(); indexN100DC++) {
+ child = (Node) childList.item(indexN100DC);
+ childName = child.getNodeName();
+ actual.add(childName);
+ }
+ assertEquals("nodeNames", expected, actual);
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/nodeinsertbefore";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(nodeinsertbefore.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level1/core/nodeinsertbeforedocfragment.java b/dom/src/test/java/org/w3c/domts/level1/core/nodeinsertbeforedocfragment.java
new file mode 100644
index 0000000..5f2ee14
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level1/core/nodeinsertbeforedocfragment.java
@@ -0,0 +1,112 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+Copyright (c) 2001 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+*/
+
+package org.w3c.domts.level1.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * If the "newChild" is a DocumentFragment object then all
+ * its children are inserted in the same order before the
+ * the "refChild".
+ *
+ * Create a DocumentFragment object and populate it with
+ * two Element nodes. Retrieve the second employee and
+ * insert the newly created DocumentFragment before its
+ * fourth child. The second employee should now have two
+ * extra children("newChild1" and "newChild2") at
+ * positions fourth and fifth respectively.
+* @author NIST
+* @author Mary Brady
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-952280727">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-952280727</a>
+*/
+public final class nodeinsertbeforedocfragment extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public nodeinsertbeforedocfragment(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "staff", true);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ NodeList elementList;
+ Node employeeNode;
+ NodeList childList;
+ Node refChild;
+ DocumentFragment newdocFragment;
+ Node newChild1;
+ Node newChild2;
+ Node child;
+ String childName;
+ Node appendedChild;
+ Node insertedNode;
+ doc = (Document) load("staff", true);
+ elementList = doc.getElementsByTagName("employee");
+ employeeNode = elementList.item(1);
+ childList = employeeNode.getChildNodes();
+ refChild = childList.item(3);
+ newdocFragment = doc.createDocumentFragment();
+ newChild1 = doc.createElement("newChild1");
+ newChild2 = doc.createElement("newChild2");
+ appendedChild = newdocFragment.appendChild(newChild1);
+ appendedChild = newdocFragment.appendChild(newChild2);
+ insertedNode = employeeNode.insertBefore(newdocFragment, refChild);
+ child = childList.item(3);
+ childName = child.getNodeName();
+ assertEquals("childName3", "newChild1", childName);
+ child = childList.item(4);
+ childName = child.getNodeName();
+ assertEquals("childName4", "newChild2", childName);
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/nodeinsertbeforedocfragment";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(nodeinsertbeforedocfragment.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level1/core/nodeinsertbeforeinvalidnodetype.java b/dom/src/test/java/org/w3c/domts/level1/core/nodeinsertbeforeinvalidnodetype.java
new file mode 100644
index 0000000..2136d7d
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level1/core/nodeinsertbeforeinvalidnodetype.java
@@ -0,0 +1,107 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+Copyright (c) 2001-2003 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+*/
+
+package org.w3c.domts.level1.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The "insertBefore(newChild,refChild)" method raises a
+ * HIERARCHY_REQUEST_ERR DOMException if this node is of
+ * a type that does not allow children of the type "newChild"
+ * to be inserted.
+ *
+ * Retrieve the root node and attempt to insert a newly
+ * created Attr node. An Element node cannot have children
+ * of the "Attr" type, therefore the desired exception
+ * should be raised.
+* @author NIST
+* @author Mary Brady
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-258A00AF')/constant[@name='HIERARCHY_REQUEST_ERR'])">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-258A00AF')/constant[@name='HIERARCHY_REQUEST_ERR'])</a>
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-952280727">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-952280727</a>
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-952280727')/raises/exception[@name='DOMException']/descr/p[substring-before(.,':')='HIERARCHY_REQUEST_ERR'])">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-952280727')/raises/exception[@name='DOMException']/descr/p[substring-before(.,':')='HIERARCHY_REQUEST_ERR'])</a>
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-952280727">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-952280727</a>
+* @see <a href="http://www.w3.org/Bugs/Public/show_bug.cgi?id=249">http://www.w3.org/Bugs/Public/show_bug.cgi?id=249</a>
+*/
+public final class nodeinsertbeforeinvalidnodetype extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public nodeinsertbeforeinvalidnodetype(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "staff", true);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ Element rootNode;
+ Node newChild;
+ NodeList elementList;
+ Node refChild;
+ Node insertedNode;
+ doc = (Document) load("staff", true);
+ rootNode = doc.getDocumentElement();
+ newChild = doc.createAttribute("newAttribute");
+ elementList = doc.getElementsByTagName("employee");
+ refChild = elementList.item(1);
+
+ {
+ boolean success = false;
+ try {
+ insertedNode = rootNode.insertBefore(newChild, refChild);
+ } catch (DOMException ex) {
+ success = (ex.code == DOMException.HIERARCHY_REQUEST_ERR);
+ }
+ assertTrue("throw_HIERARCHY_REQUEST_ERR", success);
+ }
+}
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/nodeinsertbeforeinvalidnodetype";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(nodeinsertbeforeinvalidnodetype.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level1/core/nodeinsertbeforenewchilddiffdocument.java b/dom/src/test/java/org/w3c/domts/level1/core/nodeinsertbeforenewchilddiffdocument.java
new file mode 100644
index 0000000..4a8be1f
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level1/core/nodeinsertbeforenewchilddiffdocument.java
@@ -0,0 +1,109 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+Copyright (c) 2001 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+*/
+
+package org.w3c.domts.level1.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The "insertBefore(newChild,refChild)" method raises a
+ * WRONG_DOCUMENT_ERR DOMException if the "newChild" was
+ * created from a different document than the one that
+ * created this node.
+ *
+ * Retrieve the second employee and attempt to insert a new
+ * child that was created from a different document than the
+ * one that created the second employee. An attempt to
+ * insert such a child should raise the desired exception.
+* @author NIST
+* @author Mary Brady
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-258A00AF')/constant[@name='WRONG_DOCUMENT_ERR'])">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-258A00AF')/constant[@name='WRONG_DOCUMENT_ERR'])</a>
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-952280727">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-952280727</a>
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-952280727')/raises/exception[@name='DOMException']/descr/p[substring-before(.,':')='WRONG_DOCUMENT_ERR'])">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-952280727')/raises/exception[@name='DOMException']/descr/p[substring-before(.,':')='WRONG_DOCUMENT_ERR'])</a>
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-952280727">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-952280727</a>
+*/
+public final class nodeinsertbeforenewchilddiffdocument extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public nodeinsertbeforenewchilddiffdocument(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "staff", false);
+ preload(contentType, "staff", true);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc1;
+ Document doc2;
+ Node refChild;
+ Node newChild;
+ NodeList elementList;
+ Node elementNode;
+ Node insertedNode;
+ doc1 = (Document) load("staff", false);
+ doc2 = (Document) load("staff", true);
+ newChild = doc1.createElement("newChild");
+ elementList = doc2.getElementsByTagName("employee");
+ elementNode = elementList.item(1);
+ refChild = elementNode.getFirstChild();
+
+ {
+ boolean success = false;
+ try {
+ insertedNode = elementNode.insertBefore(newChild, refChild);
+ } catch (DOMException ex) {
+ success = (ex.code == DOMException.WRONG_DOCUMENT_ERR);
+ }
+ assertTrue("throw_WRONG_DOCUMENT_ERR", success);
+ }
+}
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/nodeinsertbeforenewchilddiffdocument";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(nodeinsertbeforenewchilddiffdocument.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level1/core/nodeinsertbeforenewchildexists.java b/dom/src/test/java/org/w3c/domts/level1/core/nodeinsertbeforenewchildexists.java
new file mode 100644
index 0000000..bdd1c73
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level1/core/nodeinsertbeforenewchildexists.java
@@ -0,0 +1,142 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+Copyright (c) 2001-2004 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+*/
+
+package org.w3c.domts.level1.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * If the "newChild" is already in the tree, the
+ * "insertBefore(newChild,refChild)" method must first
+ * remove it before the insertion takes place.
+ *
+ * Insert a node Element ("employeeId") that is already
+ * present in the tree. The existing node should be
+ * removed first and the new one inserted. The node is
+ * inserted at a different position in the tree to assure
+ * that it was indeed inserted.
+* @author NIST
+* @author Mary Brady
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-952280727">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-952280727</a>
+*/
+public final class nodeinsertbeforenewchildexists extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public nodeinsertbeforenewchildexists(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "staff", true);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ NodeList elementList;
+ Node employeeNode;
+ NodeList childList;
+ Node refChild;
+ Node newChild;
+ Node child;
+ int length;
+ String childName;
+ Node insertedNode;
+ java.util.List expectedWhitespace = new java.util.ArrayList();
+ expectedWhitespace.add("#text");
+ expectedWhitespace.add("#text");
+ expectedWhitespace.add("name");
+ expectedWhitespace.add("#text");
+ expectedWhitespace.add("position");
+ expectedWhitespace.add("#text");
+ expectedWhitespace.add("salary");
+ expectedWhitespace.add("#text");
+ expectedWhitespace.add("gender");
+ expectedWhitespace.add("#text");
+ expectedWhitespace.add("employeeId");
+ expectedWhitespace.add("address");
+ expectedWhitespace.add("#text");
+
+ java.util.List expectedNoWhitespace = new java.util.ArrayList();
+ expectedNoWhitespace.add("name");
+ expectedNoWhitespace.add("position");
+ expectedNoWhitespace.add("salary");
+ expectedNoWhitespace.add("gender");
+ expectedNoWhitespace.add("employeeId");
+ expectedNoWhitespace.add("address");
+
+ java.util.List expected = new java.util.ArrayList();
+
+ java.util.List result = new java.util.ArrayList();
+
+ doc = (Document) load("staff", true);
+ elementList = doc.getElementsByTagName("employee");
+ employeeNode = elementList.item(1);
+ childList = employeeNode.getChildNodes();
+ length = (int) childList.getLength();
+
+ if (equals(6, length)) {
+ expected = expectedNoWhitespace;
+ refChild = childList.item(5);
+ newChild = childList.item(0);
+ } else {
+ expected = expectedWhitespace;
+ refChild = childList.item(11);
+ newChild = childList.item(1);
+ }
+
+ insertedNode = employeeNode.insertBefore(newChild, refChild);
+ for (int indexN100DD = 0; indexN100DD < childList.getLength(); indexN100DD++) {
+ child = (Node) childList.item(indexN100DD);
+ childName = child.getNodeName();
+ result.add(childName);
+ }
+ assertEquals("childNames", expected, result);
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/nodeinsertbeforenewchildexists";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(nodeinsertbeforenewchildexists.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level1/core/nodeinsertbeforenodeancestor.java b/dom/src/test/java/org/w3c/domts/level1/core/nodeinsertbeforenodeancestor.java
new file mode 100644
index 0000000..f02f7fc
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level1/core/nodeinsertbeforenodeancestor.java
@@ -0,0 +1,108 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+Copyright (c) 2001-2003 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+*/
+
+package org.w3c.domts.level1.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The "insertBefore(newChild,refChild)" method raises a
+ * HIERARCHY_REQUEST_ERR DOMException if the node to be
+ * inserted is one of this nodes ancestors.
+ *
+ * Retrieve the second employee and attempt to insert a
+ * node that is one of its ancestors(root node). An
+ * attempt to insert such a node should raise the
+ * desired exception.
+* @author NIST
+* @author Mary Brady
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-258A00AF')/constant[@name='HIERARCHY_REQUEST_ERR'])">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-258A00AF')/constant[@name='HIERARCHY_REQUEST_ERR'])</a>
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-952280727">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-952280727</a>
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-952280727')/raises/exception[@name='DOMException']/descr/p[substring-before(.,':')='HIERARCHY_REQUEST_ERR'])">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-952280727')/raises/exception[@name='DOMException']/descr/p[substring-before(.,':')='HIERARCHY_REQUEST_ERR'])</a>
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-952280727">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-952280727</a>
+* @see <a href="http://www.w3.org/Bugs/Public/show_bug.cgi?id=249">http://www.w3.org/Bugs/Public/show_bug.cgi?id=249</a>
+*/
+public final class nodeinsertbeforenodeancestor extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public nodeinsertbeforenodeancestor(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "staff", true);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ Node newChild;
+ NodeList elementList;
+ Node employeeNode;
+ NodeList childList;
+ Node refChild;
+ Node insertedNode;
+ doc = (Document) load("staff", true);
+ newChild = doc.getDocumentElement();
+ elementList = doc.getElementsByTagName("employee");
+ employeeNode = elementList.item(1);
+ childList = employeeNode.getChildNodes();
+ refChild = childList.item(0);
+
+ {
+ boolean success = false;
+ try {
+ insertedNode = employeeNode.insertBefore(newChild, refChild);
+ } catch (DOMException ex) {
+ success = (ex.code == DOMException.HIERARCHY_REQUEST_ERR);
+ }
+ assertTrue("throw_HIERARCHY_REQUEST_ERR", success);
+ }
+}
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/nodeinsertbeforenodeancestor";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(nodeinsertbeforenodeancestor.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level1/core/nodeinsertbeforenodename.java b/dom/src/test/java/org/w3c/domts/level1/core/nodeinsertbeforenodename.java
new file mode 100644
index 0000000..4494053
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level1/core/nodeinsertbeforenodename.java
@@ -0,0 +1,98 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+Copyright (c) 2001 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+*/
+
+package org.w3c.domts.level1.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The "insertBefore(newChild,refchild)" method returns
+ * the node being inserted.
+ *
+ * Insert an Element node before the fourth
+ * child of the second employee and check the node
+ * returned from the "insertBefore(newChild,refChild)"
+ * method. The node returned should be "newChild".
+* @author NIST
+* @author Mary Brady
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-F68D095">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-F68D095</a>
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-952280727">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-952280727</a>
+*/
+public final class nodeinsertbeforenodename extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public nodeinsertbeforenodename(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "staff", true);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ NodeList elementList;
+ Node employeeNode;
+ NodeList childList;
+ Node refChild;
+ Node newChild;
+ Node insertedNode;
+ String childName;
+ doc = (Document) load("staff", true);
+ elementList = doc.getElementsByTagName("employee");
+ employeeNode = elementList.item(1);
+ childList = employeeNode.getChildNodes();
+ refChild = childList.item(3);
+ newChild = doc.createElement("newChild");
+ insertedNode = employeeNode.insertBefore(newChild, refChild);
+ childName = insertedNode.getNodeName();
+ assertEquals("nodeInsertBeforeNodeNameAssert1", "newChild", childName);
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/nodeinsertbeforenodename";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(nodeinsertbeforenodename.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level1/core/nodeinsertbeforenomodificationallowederr.java b/dom/src/test/java/org/w3c/domts/level1/core/nodeinsertbeforenomodificationallowederr.java
new file mode 100644
index 0000000..6ccb2a0
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level1/core/nodeinsertbeforenomodificationallowederr.java
@@ -0,0 +1,118 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+Copyright (c) 2001-2004 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+*/
+
+package org.w3c.domts.level1.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The "insertBefore(newChild,refChild)" method causes the
+ * DOMException NO_MODIFICATION_ALLOWED_ERR to be raised
+ * if the node is readonly.
+ *
+ * Obtain the children of the THIRD "gender" element. The elements
+ * content is an entity reference. Get the FIRST item
+ * from the entity reference and execute the "insertBefore(newChild,refChild)" method.
+ * This causes a NO_MODIFICATION_ALLOWED_ERR DOMException to be thrown.
+* @author NIST
+* @author Mary Brady
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-258A00AF')/constant[@name='NO_MODIFICATION_ALLOWED_ERR'])">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-258A00AF')/constant[@name='NO_MODIFICATION_ALLOWED_ERR'])</a>
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-952280727">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-952280727</a>
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-952280727')/raises/exception[@name='DOMException']/descr/p[substring-before(.,':')='NO_MODIFICATION_ALLOWED_ERR'])">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-952280727')/raises/exception[@name='DOMException']/descr/p[substring-before(.,':')='NO_MODIFICATION_ALLOWED_ERR'])</a>
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-952280727">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-952280727</a>
+*/
+public final class nodeinsertbeforenomodificationallowederr extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public nodeinsertbeforenomodificationallowederr(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "staff", true);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ NodeList genderList;
+ Node genderNode;
+ Node entRef;
+ Node entElement;
+ Node createdNode;
+ Node insertedNode;
+ Node refChild = null;
+
+ int nodeType;
+ doc = (Document) load("staff", true);
+ genderList = doc.getElementsByTagName("gender");
+ genderNode = genderList.item(2);
+ entRef = genderNode.getFirstChild();
+ assertNotNull("entRefNotNull", entRef);
+ nodeType = (int) entRef.getNodeType();
+
+ if (equals(1, nodeType)) {
+ entRef = doc.createEntityReference("ent4");
+ assertNotNull("createdEntRefNotNull", entRef);
+ }
+ entElement = entRef.getFirstChild();
+ assertNotNull("entElementNotNull", entElement);
+ createdNode = doc.createElement("text3");
+
+ {
+ boolean success = false;
+ try {
+ insertedNode = entElement.insertBefore(createdNode, refChild);
+ } catch (DOMException ex) {
+ success = (ex.code == DOMException.NO_MODIFICATION_ALLOWED_ERR);
+ }
+ assertTrue("throw_NOT_MODIFICATION_ALLOWED_ERR", success);
+ }
+}
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/nodeinsertbeforenomodificationallowederr";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(nodeinsertbeforenomodificationallowederr.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level1/core/nodeinsertbeforenomodificationallowederrEE.java b/dom/src/test/java/org/w3c/domts/level1/core/nodeinsertbeforenomodificationallowederrEE.java
new file mode 100644
index 0000000..de42fb4
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level1/core/nodeinsertbeforenomodificationallowederrEE.java
@@ -0,0 +1,102 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+Copyright (c) 2001 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+*/
+
+package org.w3c.domts.level1.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The "insertBefore(newChild,refChild)" method causes the
+ * DOMException NO_MODIFICATION_ALLOWED_ERR to be raised
+ * if the node is readonly.
+ *
+ * Create an ent4 entity reference and and execute the "insertBefore(newChild,refChild)" method.
+ * This causes a NO_MODIFICATION_ALLOWED_ERR DOMException to be thrown.
+* @author Curt Arnold
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-258A00AF')/constant[@name='NO_MODIFICATION_ALLOWED_ERR'])">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-258A00AF')/constant[@name='NO_MODIFICATION_ALLOWED_ERR'])</a>
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-952280727">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-952280727</a>
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-952280727')/raises/exception[@name='DOMException']/descr/p[substring-before(.,':')='NO_MODIFICATION_ALLOWED_ERR'])">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-952280727')/raises/exception[@name='DOMException']/descr/p[substring-before(.,':')='NO_MODIFICATION_ALLOWED_ERR'])</a>
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-952280727">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-952280727</a>
+* @see <a href="http://www.w3.org/2001/DOM-Test-Suite/level1/core/nodeinsertbeforenomodificationallowederr.xml">http://www.w3.org/2001/DOM-Test-Suite/level1/core/nodeinsertbeforenomodificationallowederr.xml</a>
+*/
+public final class nodeinsertbeforenomodificationallowederrEE extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public nodeinsertbeforenomodificationallowederrEE(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "staff", true);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ Node entRef;
+ Node createdNode;
+ Node insertedNode;
+ Node refChild = null;
+
+ doc = (Document) load("staff", true);
+ entRef = doc.createEntityReference("ent4");
+ assertNotNull("createdEntRefNotNull", entRef);
+ createdNode = doc.createElement("text3");
+
+ {
+ boolean success = false;
+ try {
+ insertedNode = entRef.insertBefore(createdNode, refChild);
+ } catch (DOMException ex) {
+ success = (ex.code == DOMException.NO_MODIFICATION_ALLOWED_ERR);
+ }
+ assertTrue("throw_NO_MODIFICATION_ALLOWED_ERR", success);
+ }
+}
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/nodeinsertbeforenomodificationallowederrEE";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(nodeinsertbeforenomodificationallowederrEE.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level1/core/nodeinsertbeforerefchildnonexistent.java b/dom/src/test/java/org/w3c/domts/level1/core/nodeinsertbeforerefchildnonexistent.java
new file mode 100644
index 0000000..f58c6fd
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level1/core/nodeinsertbeforerefchildnonexistent.java
@@ -0,0 +1,106 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+Copyright (c) 2001-2003 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+*/
+
+package org.w3c.domts.level1.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The "insertBefore(newChild,refChild)" method raises a
+ * NOT_FOUND_ERR DOMException if the reference child is
+ * not a child of this node.
+ *
+ * Retrieve the second employee and attempt to insert a
+ * new node before a reference node that is not a child
+ * of this node. An attempt to insert before a non child
+ * node should raise the desired exception.
+* @author NIST
+* @author Mary Brady
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-258A00AF')/constant[@name='NOT_FOUND_ERR'])">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-258A00AF')/constant[@name='NOT_FOUND_ERR'])</a>
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-952280727">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-952280727</a>
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-952280727')/raises/exception[@name='DOMException']/descr/p[substring-before(.,':')='NOT_FOUND_ERR'])">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-952280727')/raises/exception[@name='DOMException']/descr/p[substring-before(.,':')='NOT_FOUND_ERR'])</a>
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-952280727">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-952280727</a>
+* @see <a href="http://www.w3.org/Bugs/Public/show_bug.cgi?id=249">http://www.w3.org/Bugs/Public/show_bug.cgi?id=249</a>
+*/
+public final class nodeinsertbeforerefchildnonexistent extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public nodeinsertbeforerefchildnonexistent(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "staff", true);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ Node refChild;
+ Node newChild;
+ NodeList elementList;
+ Node elementNode;
+ Node insertedNode;
+ doc = (Document) load("staff", true);
+ newChild = doc.createElement("newChild");
+ refChild = doc.createElement("refChild");
+ elementList = doc.getElementsByTagName("employee");
+ elementNode = elementList.item(1);
+
+ {
+ boolean success = false;
+ try {
+ insertedNode = elementNode.insertBefore(newChild, refChild);
+ } catch (DOMException ex) {
+ success = (ex.code == DOMException.NOT_FOUND_ERR);
+ }
+ assertTrue("throw_NOT_FOUND_ERR", success);
+ }
+}
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/nodeinsertbeforerefchildnonexistent";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(nodeinsertbeforerefchildnonexistent.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level1/core/nodeinsertbeforerefchildnull.java b/dom/src/test/java/org/w3c/domts/level1/core/nodeinsertbeforerefchildnull.java
new file mode 100644
index 0000000..c1bd9fb
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level1/core/nodeinsertbeforerefchildnull.java
@@ -0,0 +1,102 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+Copyright (c) 2001 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+*/
+
+package org.w3c.domts.level1.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * If the "refChild" is null then the
+ * "insertBefore(newChild,refChild)" method inserts the
+ * node "newChild" at the end of the list of children.
+ *
+ * Retrieve the second employee and invoke the
+ * "insertBefore(newChild,refChild)" method with
+ * refChild=null. Since "refChild" is null the "newChild"
+ * should be added to the end of the list. The last item
+ * in the list is checked after insertion. The last Element
+ * node of the list should be "newChild".
+* @author NIST
+* @author Mary Brady
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-952280727">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-952280727</a>
+*/
+public final class nodeinsertbeforerefchildnull extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public nodeinsertbeforerefchildnull(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "staff", true);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ NodeList elementList;
+ Node employeeNode;
+ NodeList childList;
+ Node refChild = null;
+
+ Node newChild;
+ Node child;
+ String childName;
+ Node insertedNode;
+ doc = (Document) load("staff", true);
+ elementList = doc.getElementsByTagName("employee");
+ employeeNode = elementList.item(1);
+ childList = employeeNode.getChildNodes();
+ newChild = doc.createElement("newChild");
+ insertedNode = employeeNode.insertBefore(newChild, refChild);
+ child = employeeNode.getLastChild();
+ childName = child.getNodeName();
+ assertEquals("nodeInsertBeforeRefChildNullAssert1", "newChild", childName);
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/nodeinsertbeforerefchildnull";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(nodeinsertbeforerefchildnull.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level1/core/nodelistindexequalzero.java b/dom/src/test/java/org/w3c/domts/level1/core/nodelistindexequalzero.java
new file mode 100644
index 0000000..67629b7
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level1/core/nodelistindexequalzero.java
@@ -0,0 +1,92 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+Copyright (c) 2001-2004 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+*/
+
+package org.w3c.domts.level1.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * Create a list of all the children elements of the third
+ * employee and access its first child by using an index
+ * of 0.
+* @author NIST
+* @author Mary Brady
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-844377136">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-844377136</a>
+*/
+public final class nodelistindexequalzero extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public nodelistindexequalzero(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "staff", false);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ NodeList elementList;
+ Node employeeNode;
+ NodeList employeeList;
+ Node child;
+ String childName;
+ doc = (Document) load("staff", false);
+ elementList = doc.getElementsByTagName("employee");
+ employeeNode = elementList.item(2);
+ employeeList = employeeNode.getChildNodes();
+ child = employeeList.item(0);
+ childName = child.getNodeName();
+
+ if (!equals("#text", childName)) {
+ assertEquals("childName", "employeeId", childName);
+ }
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/nodelistindexequalzero";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(nodelistindexequalzero.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level1/core/nodelistindexgetlength.java b/dom/src/test/java/org/w3c/domts/level1/core/nodelistindexgetlength.java
new file mode 100644
index 0000000..c1d1409
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level1/core/nodelistindexgetlength.java
@@ -0,0 +1,89 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+Copyright (c) 2001-2004 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+*/
+
+package org.w3c.domts.level1.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The "getLength()" method returns the number of nodes
+ * in the list should be 6 (no whitespace) or 13.
+* @author NIST
+* @author Mary Brady
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-203510337">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-203510337</a>
+*/
+public final class nodelistindexgetlength extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public nodelistindexgetlength(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "staff", false);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ NodeList elementList;
+ Node employeeNode;
+ NodeList employeeList;
+ int length;
+ int expectedCount = 0;
+ doc = (Document) load("staff", false);
+ elementList = doc.getElementsByTagName("employee");
+ employeeNode = elementList.item(2);
+ employeeList = employeeNode.getChildNodes();
+ length = (int) employeeList.getLength();
+ assertTrue("lengthIs6or13",
+ (equals(6, length) | equals(13, length))
+);
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/nodelistindexgetlength";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(nodelistindexgetlength.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level1/core/nodelistindexgetlengthofemptylist.java b/dom/src/test/java/org/w3c/domts/level1/core/nodelistindexgetlengthofemptylist.java
new file mode 100644
index 0000000..433771f
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level1/core/nodelistindexgetlengthofemptylist.java
@@ -0,0 +1,95 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+Copyright (c) 2001 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+*/
+
+package org.w3c.domts.level1.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The "getLength()" method returns the number of nodes
+ * in the list.(Test for EMPTY list)
+ *
+ * Create a list of all the children of the Text node
+ * inside the first child of the third employee and
+ * invoke the "getLength()" method. It should contain
+ * the value 0.
+* @author NIST
+* @author Mary Brady
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-203510337">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-203510337</a>
+*/
+public final class nodelistindexgetlengthofemptylist extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public nodelistindexgetlengthofemptylist(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "staff", false);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ NodeList elementList;
+ Node employeeNode;
+ NodeList employeeList;
+ Node childNode;
+ Node textNode;
+ NodeList textList;
+ doc = (Document) load("staff", false);
+ elementList = doc.getElementsByTagName("employee");
+ employeeNode = elementList.item(2);
+ employeeList = employeeNode.getChildNodes();
+ childNode = employeeList.item(1);
+ textNode = childNode.getFirstChild();
+ textList = textNode.getChildNodes();
+ assertSize("nodelistIndexGetLengthOfEmptyListAssert", 0, textList);
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/nodelistindexgetlengthofemptylist";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(nodelistindexgetlengthofemptylist.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level1/core/nodelistindexnotzero.java b/dom/src/test/java/org/w3c/domts/level1/core/nodelistindexnotzero.java
new file mode 100644
index 0000000..63de8d8
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level1/core/nodelistindexnotzero.java
@@ -0,0 +1,100 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+Copyright (c) 2001-2004 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+*/
+
+package org.w3c.domts.level1.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * Create a list of all the children elements of the third
+ * employee and access its fourth child by using an index
+ * of 3. This should result in "name" being
+ * selected. Further we evaluate its content(by using
+ * the "getNodeName()" method) to ensure the proper
+ * element was accessed.
+* @author NIST
+* @author Mary Brady
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-844377136">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-844377136</a>
+*/
+public final class nodelistindexnotzero extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public nodelistindexnotzero(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "staff", false);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ NodeList elementList;
+ Node employeeNode;
+ NodeList employeeList;
+ Node child;
+ int length;
+ String childName;
+ doc = (Document) load("staff", false);
+ elementList = doc.getElementsByTagName("employee");
+ employeeNode = elementList.item(2);
+ employeeList = employeeNode.getChildNodes();
+ length = (int) employeeList.getLength();
+
+ if (equals(6, length)) {
+ child = employeeList.item(1);
+ } else {
+ child = employeeList.item(3);
+ }
+
+ childName = child.getNodeName();
+ assertEquals("nodeName", "name", childName);
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/nodelistindexnotzero";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(nodelistindexnotzero.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level1/core/nodelistreturnfirstitem.java b/dom/src/test/java/org/w3c/domts/level1/core/nodelistreturnfirstitem.java
new file mode 100644
index 0000000..e321588
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level1/core/nodelistreturnfirstitem.java
@@ -0,0 +1,96 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+Copyright (c) 2001-2004 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+*/
+
+package org.w3c.domts.level1.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * Get the first child of the third employee using NodeList.item(0)
+ * which will either be a Text node (whitespace) or employeeId element.
+* @author NIST
+* @author Mary Brady
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-844377136">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-844377136</a>
+*/
+public final class nodelistreturnfirstitem extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public nodelistreturnfirstitem(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "staff", false);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ NodeList elementList;
+ Node employeeNode;
+ NodeList employeeList;
+ Node child;
+ String childName;
+ int length;
+ doc = (Document) load("staff", false);
+ elementList = doc.getElementsByTagName("employee");
+ employeeNode = elementList.item(2);
+ employeeList = employeeNode.getChildNodes();
+ child = employeeList.item(0);
+ childName = child.getNodeName();
+ length = (int) employeeList.getLength();
+
+ if (equals(6, length)) {
+ assertEqualsIgnoreCase("firstChildNoWhitespace", "employeeId", childName);
+} else {
+ assertEqualsIgnoreCase("firstChildWithWhitespace", "#text", childName);
+}
+
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/nodelistreturnfirstitem";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(nodelistreturnfirstitem.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level1/core/nodelistreturnlastitem.java b/dom/src/test/java/org/w3c/domts/level1/core/nodelistreturnlastitem.java
new file mode 100644
index 0000000..de97ab0
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level1/core/nodelistreturnlastitem.java
@@ -0,0 +1,98 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+Copyright (c) 2001-2004 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+*/
+
+package org.w3c.domts.level1.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * Get this last child of the third employee using NodeList.item(NodeList.length - 1)
+ * and check that it is either a Text element (with whitespace) or an address element.
+* @author NIST
+* @author Mary Brady
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-844377136">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-844377136</a>
+*/
+public final class nodelistreturnlastitem extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public nodelistreturnlastitem(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "staff", false);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ NodeList elementList;
+ Node employeeNode;
+ NodeList employeeList;
+ Node child;
+ String childName;
+ int length;
+ doc = (Document) load("staff", false);
+ elementList = doc.getElementsByTagName("employee");
+ employeeNode = elementList.item(2);
+ employeeList = employeeNode.getChildNodes();
+ length = (int) employeeList.getLength();
+
+ if (equals(6, length)) {
+ child = employeeList.item(5);
+ childName = child.getNodeName();
+ assertEquals("nodeName1", "address", childName);
+ } else {
+ child = employeeList.item(12);
+ childName = child.getNodeName();
+ assertEquals("nodeName2", "#text", childName);
+ }
+
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/nodelistreturnlastitem";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(nodelistreturnlastitem.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level1/core/nodelisttraverselist.java b/dom/src/test/java/org/w3c/domts/level1/core/nodelisttraverselist.java
new file mode 100644
index 0000000..85cbc48
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level1/core/nodelisttraverselist.java
@@ -0,0 +1,128 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+Copyright (c) 2001-2004 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+*/
+
+package org.w3c.domts.level1.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The range of valid child node indices is 0 thru length -1
+ *
+ * Create a list of all the children elements of the third
+ * employee and traverse the list from index=0 thru
+ * length -1.
+* @author NIST
+* @author Mary Brady
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-203510337">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-203510337</a>
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-844377136">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-844377136</a>
+*/
+public final class nodelisttraverselist extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public nodelisttraverselist(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "staff", false);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ NodeList elementList;
+ Node employeeNode;
+ NodeList employeeList;
+ Node child;
+ String childName;
+ java.util.List result = new java.util.ArrayList();
+
+ int length;
+ java.util.List expectedWhitespace = new java.util.ArrayList();
+ expectedWhitespace.add("#text");
+ expectedWhitespace.add("employeeId");
+ expectedWhitespace.add("#text");
+ expectedWhitespace.add("name");
+ expectedWhitespace.add("#text");
+ expectedWhitespace.add("position");
+ expectedWhitespace.add("#text");
+ expectedWhitespace.add("salary");
+ expectedWhitespace.add("#text");
+ expectedWhitespace.add("gender");
+ expectedWhitespace.add("#text");
+ expectedWhitespace.add("address");
+ expectedWhitespace.add("#text");
+
+ java.util.List expectedNoWhitespace = new java.util.ArrayList();
+ expectedNoWhitespace.add("employeeId");
+ expectedNoWhitespace.add("name");
+ expectedNoWhitespace.add("position");
+ expectedNoWhitespace.add("salary");
+ expectedNoWhitespace.add("gender");
+ expectedNoWhitespace.add("address");
+
+ doc = (Document) load("staff", false);
+ elementList = doc.getElementsByTagName("employee");
+ employeeNode = elementList.item(2);
+ employeeList = employeeNode.getChildNodes();
+ length = (int) employeeList.getLength();
+ for (int indexN100A4 = 0; indexN100A4 < employeeList.getLength(); indexN100A4++) {
+ child = (Node) employeeList.item(indexN100A4);
+ childName = child.getNodeName();
+ result.add(childName);
+ }
+
+ if (equals(6, length)) {
+ assertEquals("nowhitespace", expectedNoWhitespace, result);
+ } else {
+ assertEquals("whitespace", expectedWhitespace, result);
+ }
+
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/nodelisttraverselist";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(nodelisttraverselist.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level1/core/nodenotationnodeattributes.java b/dom/src/test/java/org/w3c/domts/level1/core/nodenotationnodeattributes.java
new file mode 100644
index 0000000..5eaf42c
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level1/core/nodenotationnodeattributes.java
@@ -0,0 +1,92 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+Copyright (c) 2001-2004 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+*/
+
+package org.w3c.domts.level1.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The "getAttributes()" method invoked on a Notation
+ * Node returns null.
+ * Retrieve the Notation declaration inside the DocumentType
+ * node and invoke the "getAttributes()" method on the
+ * Notation Node. It should return null.
+* @author NIST
+* @author Mary Brady
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-84CF096">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-84CF096</a>
+*/
+public final class nodenotationnodeattributes extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public nodenotationnodeattributes(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "staff", false);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ DocumentType docType;
+ NamedNodeMap notations;
+ Node notationNode;
+ NamedNodeMap attrList;
+ doc = (Document) load("staff", false);
+ docType = doc.getDoctype();
+ assertNotNull("docTypeNotNull", docType);
+ notations = docType.getNotations();
+ assertNotNull("notationsNotNull", notations);
+ notationNode = notations.getNamedItem("notation1");
+ assertNotNull("notationNotNull", notationNode);
+ attrList = notationNode.getAttributes();
+ assertNull("nodeNotationNodeAttributesAssert1", attrList);
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/nodenotationnodeattributes";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(nodenotationnodeattributes.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level1/core/nodenotationnodename.java b/dom/src/test/java/org/w3c/domts/level1/core/nodenotationnodename.java
new file mode 100644
index 0000000..8b25e31
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level1/core/nodenotationnodename.java
@@ -0,0 +1,93 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+Copyright (c) 2001-2004 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+*/
+
+package org.w3c.domts.level1.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The string returned by the "getNodeName()" method for a
+ * Notation Node is the name of the notation.
+ * Retrieve the Notation declaration inside the
+ * DocumentType node and check the string returned
+ * by the "getNodeName()" method. It should be equal to
+ * "notation1".
+* @author NIST
+* @author Mary Brady
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-F68D095">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-F68D095</a>
+*/
+public final class nodenotationnodename extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public nodenotationnodename(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "staff", false);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ DocumentType docType;
+ NamedNodeMap notations;
+ Node notationNode;
+ String notationName;
+ doc = (Document) load("staff", false);
+ docType = doc.getDoctype();
+ assertNotNull("docTypeNotNull", docType);
+ notations = docType.getNotations();
+ assertNotNull("notationsNotNull", notations);
+ notationNode = notations.getNamedItem("notation1");
+ assertNotNull("notationNotNull", notationNode);
+ notationName = notationNode.getNodeName();
+ assertEquals("nodeName", "notation1", notationName);
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/nodenotationnodename";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(nodenotationnodename.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level1/core/nodenotationnodetype.java b/dom/src/test/java/org/w3c/domts/level1/core/nodenotationnodetype.java
new file mode 100644
index 0000000..93cbe23
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level1/core/nodenotationnodetype.java
@@ -0,0 +1,92 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+Copyright (c) 2001-2004 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+*/
+
+package org.w3c.domts.level1.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The "getNodeType()" method for an Notation Node
+ * returns the constant value 12.
+ * Retrieve the Notation declaration in the DocumentType
+ * node and invoke the "getNodeType()" method. The method
+ * should return 12.
+* @author NIST
+* @author Mary Brady
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-111237558">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-111237558</a>
+*/
+public final class nodenotationnodetype extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public nodenotationnodetype(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "staff", false);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ DocumentType docType;
+ NamedNodeMap notations;
+ Notation notationNode;
+ int nodeType;
+ doc = (Document) load("staff", false);
+ docType = doc.getDoctype();
+ assertNotNull("docTypeNotNull", docType);
+ notations = docType.getNotations();
+ assertNotNull("notationsNotNull", notations);
+ notationNode = (Notation) notations.getNamedItem("notation1");
+ assertNotNull("notationNotNull", notationNode);
+ nodeType = (int) notationNode.getNodeType();
+ assertEquals("nodeNotationNodeTypeAssert1", 12, nodeType);
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/nodenotationnodetype";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(nodenotationnodetype.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level1/core/nodenotationnodevalue.java b/dom/src/test/java/org/w3c/domts/level1/core/nodenotationnodevalue.java
new file mode 100644
index 0000000..d291273
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level1/core/nodenotationnodevalue.java
@@ -0,0 +1,93 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+Copyright (c) 2001-2004 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+*/
+
+package org.w3c.domts.level1.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The string returned by the "getNodeValue()" method for a
+ * Notation Node is null.
+ * Retrieve the Notation declaration inside the
+ * DocumentType node and check the string returned
+ * by the "getNodeValue()" method. It should be equal to
+ * null.
+* @author NIST
+* @author Mary Brady
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-F68D080">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-F68D080</a>
+*/
+public final class nodenotationnodevalue extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public nodenotationnodevalue(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "staff", false);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ DocumentType docType;
+ NamedNodeMap notations;
+ Node notationNode;
+ String notationValue;
+ doc = (Document) load("staff", false);
+ docType = doc.getDoctype();
+ assertNotNull("docTypeNotNull", docType);
+ notations = docType.getNotations();
+ assertNotNull("notationsNotNull", notations);
+ notationNode = notations.getNamedItem("notation1");
+ assertNotNull("notationNotNull", notationNode);
+ notationValue = notationNode.getNodeValue();
+ assertNull("nodeValue", notationValue);
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/nodenotationnodevalue";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(nodenotationnodevalue.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level1/core/nodeparentnode.java b/dom/src/test/java/org/w3c/domts/level1/core/nodeparentnode.java
new file mode 100644
index 0000000..527c53c
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level1/core/nodeparentnode.java
@@ -0,0 +1,97 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+Copyright (c) 2001-2003 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+*/
+
+package org.w3c.domts.level1.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The "getParentNode()" method returns the parent
+ * of this node.
+ *
+ * Retrieve the second employee and invoke the
+ * "getParentNode()" method on this node. It should
+ * be set to "staff".
+* @author NIST
+* @author Mary Brady
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-1060184317">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-1060184317</a>
+* @see <a href="http://www.w3.org/Bugs/Public/show_bug.cgi?id=251">http://www.w3.org/Bugs/Public/show_bug.cgi?id=251</a>
+*/
+public final class nodeparentnode extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public nodeparentnode(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "staff", false);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ NodeList elementList;
+ Node employeeNode;
+ Node parentNode;
+ String parentName;
+ doc = (Document) load("staff", false);
+ elementList = doc.getElementsByTagName("employee");
+ employeeNode = elementList.item(1);
+ parentNode = employeeNode.getParentNode();
+ parentName = parentNode.getNodeName();
+
+ if (("image/svg+xml".equals(getContentType()))) {
+ assertEquals("svgTagName", "svg", parentName);
+ } else {
+ assertEquals("nodeParentNodeAssert1", "staff", parentName);
+ }
+
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/nodeparentnode";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(nodeparentnode.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level1/core/nodeparentnodenull.java b/dom/src/test/java/org/w3c/domts/level1/core/nodeparentnodenull.java
new file mode 100644
index 0000000..6c1a9dc
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level1/core/nodeparentnodenull.java
@@ -0,0 +1,86 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+Copyright (c) 2001 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+*/
+
+package org.w3c.domts.level1.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The "getParentNode()" method invoked on a node that has
+ * just been created and not yet added to the tree is null.
+ * Create a new "employee" Element node using the
+ * "createElement(name)" method from the Document interface.
+ * Since this new node has not yet been added to the tree,
+ * the "getParentNode()" method will return null.
+* @author NIST
+* @author Mary Brady
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-1060184317">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-1060184317</a>
+*/
+public final class nodeparentnodenull extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public nodeparentnodenull(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "staff", false);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ Element createdNode;
+ Node parentNode;
+ doc = (Document) load("staff", false);
+ createdNode = doc.createElement("employee");
+ parentNode = createdNode.getParentNode();
+ assertNull("parentNode", parentNode);
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/nodeparentnodenull";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(nodeparentnodenull.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level1/core/nodeprocessinginstructionnodeattributes.java b/dom/src/test/java/org/w3c/domts/level1/core/nodeprocessinginstructionnodeattributes.java
new file mode 100644
index 0000000..5e24547
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level1/core/nodeprocessinginstructionnodeattributes.java
@@ -0,0 +1,87 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+Copyright (c) 2001 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+*/
+
+package org.w3c.domts.level1.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The "getAttributes()" method invoked on a Processing
+ * Instruction Node returns null.
+ *
+ * Retrieve the Processing Instruction node and invoke
+ * the "getAttributes()" method. It should return null.
+* @author NIST
+* @author Mary Brady
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-84CF096">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-84CF096</a>
+*/
+public final class nodeprocessinginstructionnodeattributes extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public nodeprocessinginstructionnodeattributes(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "staff", false);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ NodeList testList;
+ Node piNode;
+ NamedNodeMap attrList;
+ doc = (Document) load("staff", false);
+ testList = doc.getChildNodes();
+ piNode = testList.item(0);
+ attrList = piNode.getAttributes();
+ assertNull("nodeProcessingInstructionNodeAttrAssert1", attrList);
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/nodeprocessinginstructionnodeattributes";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(nodeprocessinginstructionnodeattributes.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level1/core/nodeprocessinginstructionnodename.java b/dom/src/test/java/org/w3c/domts/level1/core/nodeprocessinginstructionnodename.java
new file mode 100644
index 0000000..c02f031
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level1/core/nodeprocessinginstructionnodename.java
@@ -0,0 +1,88 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+Copyright (c) 2001 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+*/
+
+package org.w3c.domts.level1.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The string returned by the "getNodeName()" method for a
+ * Processing Instruction Node is the target.
+ *
+ * Retrieve the Processing Instruction Node in the XML file
+ * and check the string returned by the "getNodeName()"
+ * method. It should be equal to "XML-STYLE".
+* @author NIST
+* @author Mary Brady
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-F68D095">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-F68D095</a>
+*/
+public final class nodeprocessinginstructionnodename extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public nodeprocessinginstructionnodename(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "staff", false);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ NodeList testList;
+ Node piNode;
+ String piName;
+ doc = (Document) load("staff", false);
+ testList = doc.getChildNodes();
+ piNode = testList.item(0);
+ piName = piNode.getNodeName();
+ assertEquals("nodeProcessingInstructionNodeNameAssert1", "TEST-STYLE", piName);
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/nodeprocessinginstructionnodename";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(nodeprocessinginstructionnodename.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level1/core/nodeprocessinginstructionnodetype.java b/dom/src/test/java/org/w3c/domts/level1/core/nodeprocessinginstructionnodetype.java
new file mode 100644
index 0000000..8356bdc
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level1/core/nodeprocessinginstructionnodetype.java
@@ -0,0 +1,88 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+Copyright (c) 2001 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+*/
+
+package org.w3c.domts.level1.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The "getNodeType()" method for a Processing Instruction
+ * node returns the constant value 7.
+ *
+ * Retrieve a NodeList of child elements from the document.
+ * Retrieve the first child and invoke the "getNodeType()"
+ * method. The method should return 7.
+* @author NIST
+* @author Mary Brady
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-111237558">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-111237558</a>
+*/
+public final class nodeprocessinginstructionnodetype extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public nodeprocessinginstructionnodetype(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "staff", false);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ NodeList testList;
+ Node piNode;
+ int nodeType;
+ doc = (Document) load("staff", false);
+ testList = doc.getChildNodes();
+ piNode = testList.item(0);
+ nodeType = (int) piNode.getNodeType();
+ assertEquals("nodeProcessingInstructionNodeTypeAssert1", 7, nodeType);
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/nodeprocessinginstructionnodetype";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(nodeprocessinginstructionnodetype.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level1/core/nodeprocessinginstructionnodevalue.java b/dom/src/test/java/org/w3c/domts/level1/core/nodeprocessinginstructionnodevalue.java
new file mode 100644
index 0000000..f484caa
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level1/core/nodeprocessinginstructionnodevalue.java
@@ -0,0 +1,89 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+Copyright (c) 2001 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+*/
+
+package org.w3c.domts.level1.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The string returned by the "getNodeValue()" method for a
+ * Processing Instruction Node is the content of the
+ * Processing Instruction(exclude the target).
+ *
+ * Retrieve the Processing Instruction node in the XML file
+ * and check the string returned by the "getNodeValue()"
+ * method. It should be equal to "PIDATA".
+* @author NIST
+* @author Mary Brady
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-F68D080">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-F68D080</a>
+*/
+public final class nodeprocessinginstructionnodevalue extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public nodeprocessinginstructionnodevalue(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "staff", false);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ NodeList testList;
+ Node piNode;
+ String piValue;
+ doc = (Document) load("staff", false);
+ testList = doc.getChildNodes();
+ piNode = testList.item(0);
+ piValue = piNode.getNodeValue();
+ assertEquals("value", "PIDATA", piValue);
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/nodeprocessinginstructionnodevalue";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(nodeprocessinginstructionnodevalue.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level1/core/nodeprocessinginstructionsetnodevalue.java b/dom/src/test/java/org/w3c/domts/level1/core/nodeprocessinginstructionsetnodevalue.java
new file mode 100644
index 0000000..e4e8fdd
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level1/core/nodeprocessinginstructionsetnodevalue.java
@@ -0,0 +1,89 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+Copyright (c) 2001-2003 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+*/
+
+package org.w3c.domts.level1.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * Setting the nodeValue should change the value returned by
+ * nodeValue and ProcessingInstruction.getData.
+* @author Curt Arnold
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-F68D080">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-F68D080</a>
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-1004215813">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-1004215813</a>
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-837822393">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-837822393</a>
+* @see <a href="http://www.w3.org/Bugs/Public/show_bug.cgi?id=181">http://www.w3.org/Bugs/Public/show_bug.cgi?id=181</a>
+*/
+public final class nodeprocessinginstructionsetnodevalue extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public nodeprocessinginstructionsetnodevalue(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "staff", true);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ NodeList testList;
+ Node piNode;
+ String piValue;
+ doc = (Document) load("staff", true);
+ testList = doc.getChildNodes();
+ piNode = testList.item(0);
+ piNode.setNodeValue("Something different");
+ piValue = piNode.getNodeValue();
+ assertEquals("nodeValue", "Something different", piValue);
+ piValue = ((ProcessingInstruction) /*Node */piNode).getData();
+ assertEquals("data", "Something different", piValue);
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/nodeprocessinginstructionsetnodevalue";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(nodeprocessinginstructionsetnodevalue.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level1/core/noderemovechild.java b/dom/src/test/java/org/w3c/domts/level1/core/noderemovechild.java
new file mode 100644
index 0000000..517ed7a
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level1/core/noderemovechild.java
@@ -0,0 +1,94 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+Copyright (c) 2001 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+*/
+
+package org.w3c.domts.level1.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The "removeChild(oldChild)" method removes the child node
+ * indicated by "oldChild" from the list of children and
+ * returns it.
+ *
+ * Remove the first employee by invoking the
+ * "removeChild(oldChild)" method an checking the
+ * node returned by the "getParentNode()" method. It
+ * should be set to null.
+* @author NIST
+* @author Mary Brady
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-1734834066">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-1734834066</a>
+*/
+public final class noderemovechild extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public noderemovechild(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "staff", true);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ Element rootNode;
+ NodeList childList;
+ Node childToRemove;
+ Node removedChild;
+ Node parentNode;
+ doc = (Document) load("staff", true);
+ rootNode = doc.getDocumentElement();
+ childList = rootNode.getChildNodes();
+ childToRemove = childList.item(1);
+ removedChild = rootNode.removeChild(childToRemove);
+ parentNode = removedChild.getParentNode();
+ assertNull("nodeRemoveChildAssert1", parentNode);
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/noderemovechild";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(noderemovechild.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level1/core/noderemovechildgetnodename.java b/dom/src/test/java/org/w3c/domts/level1/core/noderemovechildgetnodename.java
new file mode 100644
index 0000000..3c2e61c
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level1/core/noderemovechildgetnodename.java
@@ -0,0 +1,101 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+Copyright (c) 2001 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+*/
+
+package org.w3c.domts.level1.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * Remove the first child of the second employee
+ * and check the NodeName returned by the
+ * "removeChild(oldChild)" method. The returned node
+ * should have a NodeName equal to "#text" or employeeId depending on whitespace.
+* @author NIST
+* @author Mary Brady
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-F68D095">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-F68D095</a>
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-1734834066">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-1734834066</a>
+*/
+public final class noderemovechildgetnodename extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public noderemovechildgetnodename(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "staff", true);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ NodeList elementList;
+ Node employeeNode;
+ NodeList childList;
+ Node oldChild;
+ Node removedChild;
+ String childName;
+ int length;
+ doc = (Document) load("staff", true);
+ elementList = doc.getElementsByTagName("employee");
+ employeeNode = elementList.item(1);
+ childList = employeeNode.getChildNodes();
+ length = (int) childList.getLength();
+ oldChild = childList.item(0);
+ removedChild = employeeNode.removeChild(oldChild);
+ childName = removedChild.getNodeName();
+
+ if (equals(6, length)) {
+ assertEquals("nowhitespace", "employeeId", childName);
+ } else {
+ assertEquals("whitespace", "#text", childName);
+ }
+
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/noderemovechildgetnodename";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(noderemovechildgetnodename.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level1/core/noderemovechildnode.java b/dom/src/test/java/org/w3c/domts/level1/core/noderemovechildnode.java
new file mode 100644
index 0000000..ad21ade
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level1/core/noderemovechildnode.java
@@ -0,0 +1,107 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+Copyright (c) 2001-2004 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+*/
+
+package org.w3c.domts.level1.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * Retrieve the second employee and remove its first child.
+ * After the removal, the second employee should have five or twelve
+ * children and the first child should now be the child
+ * that used to be at the second position in the list.
+* @author NIST
+* @author Mary Brady
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-1734834066">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-1734834066</a>
+*/
+public final class noderemovechildnode extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public noderemovechildnode(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "staff", true);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ NodeList elementList;
+ Node employeeNode;
+ NodeList childList;
+ Node oldChild;
+ Node child;
+ String childName;
+ int length;
+ Node removedChild;
+ String removedName;
+ doc = (Document) load("staff", true);
+ elementList = doc.getElementsByTagName("employee");
+ employeeNode = elementList.item(1);
+ childList = employeeNode.getChildNodes();
+ oldChild = childList.item(0);
+ removedChild = employeeNode.removeChild(oldChild);
+ removedName = removedChild.getNodeName();
+ child = childList.item(0);
+ childName = child.getNodeName();
+ length = (int) childList.getLength();
+
+ if (equals(5, length)) {
+ assertEquals("removedNameNoWhitespace", "employeeId", removedName);
+ assertEquals("childNameNoWhitespace", "name", childName);
+ } else {
+ assertEquals("removedName", "#text", removedName);
+ assertEquals("childName", "employeeId", childName);
+ assertEquals("length", 12, length);
+ }
+
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/noderemovechildnode";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(noderemovechildnode.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level1/core/noderemovechildnomodificationallowederr.java b/dom/src/test/java/org/w3c/domts/level1/core/noderemovechildnomodificationallowederr.java
new file mode 100644
index 0000000..f760c68
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level1/core/noderemovechildnomodificationallowederr.java
@@ -0,0 +1,114 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+Copyright (c) 2001 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+*/
+
+package org.w3c.domts.level1.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The "removeChild(oldChild)" method causes the
+ * DOMException NO_MODIFICATION_ALLOWED_ERR to be raised
+ * if the node is readonly.
+ *
+ * Obtain the children of the THIRD "gender" element. The elements
+ * content is an entity reference. Get the FIRST item
+ * from the entity reference and execute the "removeChild(oldChild)" method.
+ * This causes a NO_MODIFICATION_ALLOWED_ERR DOMException to be thrown.
+* @author NIST
+* @author Mary Brady
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-258A00AF')/constant[@name='NO_MODIFICATION_ALLOWED_ERR'])">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-258A00AF')/constant[@name='NO_MODIFICATION_ALLOWED_ERR'])</a>
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-1734834066">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-1734834066</a>
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-1734834066')/raises/exception[@name='DOMException']/descr/p[substring-before(.,':')='NO_MODIFICATION_ALLOWED_ERR'])">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-1734834066')/raises/exception[@name='DOMException']/descr/p[substring-before(.,':')='NO_MODIFICATION_ALLOWED_ERR'])</a>
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-1734834066">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-1734834066</a>
+*/
+public final class noderemovechildnomodificationallowederr extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public noderemovechildnomodificationallowederr(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "staff", true);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ NodeList genderList;
+ Node genderNode;
+ Node entRef;
+ Node entElement;
+ Node removedNode;
+ int nodeType;
+ doc = (Document) load("staff", true);
+ genderList = doc.getElementsByTagName("gender");
+ genderNode = genderList.item(2);
+ entRef = genderNode.getFirstChild();
+ assertNotNull("entRefNotNull", entRef);
+ nodeType = (int) entRef.getNodeType();
+
+ if (equals(1, nodeType)) {
+ entRef = doc.createEntityReference("ent4");
+ assertNotNull("createdEntRefNotNull", entRef);
+ }
+ entElement = entRef.getFirstChild();
+ assertNotNull("entElementNotNull", entElement);
+
+ {
+ boolean success = false;
+ try {
+ removedNode = entRef.removeChild(entElement);
+ } catch (DOMException ex) {
+ success = (ex.code == DOMException.NO_MODIFICATION_ALLOWED_ERR);
+ }
+ assertTrue("throw_NO_MODIFICATION_ALLOWED_ERR", success);
+ }
+}
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/noderemovechildnomodificationallowederr";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(noderemovechildnomodificationallowederr.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level1/core/noderemovechildnomodificationallowederrEE.java b/dom/src/test/java/org/w3c/domts/level1/core/noderemovechildnomodificationallowederrEE.java
new file mode 100644
index 0000000..2dbff22
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level1/core/noderemovechildnomodificationallowederrEE.java
@@ -0,0 +1,101 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+Copyright (c) 2001-2004 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+*/
+
+package org.w3c.domts.level1.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The "removeChild(oldChild)" method causes the
+ * DOMException NO_MODIFICATION_ALLOWED_ERR to be raised
+ * if the node is readonly.
+ *
+ * Create an entity reference and execute the "removeChild(oldChild)" method.
+ * This causes a NO_MODIFICATION_ALLOWED_ERR DOMException to be thrown.
+* @author Curt Arnold
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-258A00AF')/constant[@name='NO_MODIFICATION_ALLOWED_ERR'])">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-258A00AF')/constant[@name='NO_MODIFICATION_ALLOWED_ERR'])</a>
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-1734834066">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-1734834066</a>
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-1734834066')/raises/exception[@name='DOMException']/descr/p[substring-before(.,':')='NO_MODIFICATION_ALLOWED_ERR'])">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-1734834066')/raises/exception[@name='DOMException']/descr/p[substring-before(.,':')='NO_MODIFICATION_ALLOWED_ERR'])</a>
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-1734834066">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-1734834066</a>
+* @see <a href="http://www.w3.org/2001/DOM-Test-Suite/level1/core/noderemovechildnomodificationallowederr.xml">http://www.w3.org/2001/DOM-Test-Suite/level1/core/noderemovechildnomodificationallowederr.xml</a>
+*/
+public final class noderemovechildnomodificationallowederrEE extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public noderemovechildnomodificationallowederrEE(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "staff", true);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ Node entRef;
+ Node entText;
+ Node removedNode;
+ doc = (Document) load("staff", true);
+ entRef = doc.createEntityReference("ent4");
+ assertNotNull("createdEntRefNotNull", entRef);
+ entText = entRef.getFirstChild();
+ assertNotNull("entTextNotNull", entText);
+
+ {
+ boolean success = false;
+ try {
+ removedNode = entRef.removeChild(entText);
+ } catch (DOMException ex) {
+ success = (ex.code == DOMException.NO_MODIFICATION_ALLOWED_ERR);
+ }
+ assertTrue("throw_NO_MODIFICATION_ALLOWED_ERR", success);
+ }
+}
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/noderemovechildnomodificationallowederrEE";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(noderemovechildnomodificationallowederrEE.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level1/core/noderemovechildoldchildnonexistent.java b/dom/src/test/java/org/w3c/domts/level1/core/noderemovechildoldchildnonexistent.java
new file mode 100644
index 0000000..5c63409
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level1/core/noderemovechildoldchildnonexistent.java
@@ -0,0 +1,103 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+Copyright (c) 2001-2003 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+*/
+
+package org.w3c.domts.level1.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The "removeChild(oldChild)" method raises a
+ * NOT_FOUND_ERR DOMException if the old child is
+ * not a child of this node.
+ *
+ * Retrieve the second employee and attempt to remove a
+ * node that is not one of its children. An attempt to
+ * remove such a node should raise the desired exception.
+* @author NIST
+* @author Mary Brady
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-258A00AF')/constant[@name='NOT_FOUND_ERR'])">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-258A00AF')/constant[@name='NOT_FOUND_ERR'])</a>
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-1734834066">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-1734834066</a>
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-1734834066')/raises/exception[@name='DOMException']/descr/p[substring-before(.,':')='NOT_FOUND_ERR'])">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-1734834066')/raises/exception[@name='DOMException']/descr/p[substring-before(.,':')='NOT_FOUND_ERR'])</a>
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-1734834066">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-1734834066</a>
+* @see <a href="http://www.w3.org/Bugs/Public/show_bug.cgi?id=249">http://www.w3.org/Bugs/Public/show_bug.cgi?id=249</a>
+*/
+public final class noderemovechildoldchildnonexistent extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public noderemovechildoldchildnonexistent(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "staff", true);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ Node oldChild;
+ NodeList elementList;
+ Node elementNode;
+ Node removedChild;
+ doc = (Document) load("staff", true);
+ oldChild = doc.createElement("oldChild");
+ elementList = doc.getElementsByTagName("employee");
+ elementNode = elementList.item(1);
+
+ {
+ boolean success = false;
+ try {
+ removedChild = elementNode.removeChild(oldChild);
+ } catch (DOMException ex) {
+ success = (ex.code == DOMException.NOT_FOUND_ERR);
+ }
+ assertTrue("throw_NOT_FOUND_ERR", success);
+ }
+}
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/noderemovechildoldchildnonexistent";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(noderemovechildoldchildnonexistent.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level1/core/nodereplacechild.java b/dom/src/test/java/org/w3c/domts/level1/core/nodereplacechild.java
new file mode 100644
index 0000000..ebe0736
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level1/core/nodereplacechild.java
@@ -0,0 +1,99 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+Copyright (c) 2001 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+*/
+
+package org.w3c.domts.level1.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The "replaceChild(newChild,oldChild)" method replaces
+ * the node "oldChild" with the node "newChild".
+ *
+ * Replace the first element of the second employee with
+ * a newly created Element node. Check the first position
+ * after the replacement operation is completed. The new
+ * Element should be "newChild".
+* @author NIST
+* @author Mary Brady
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-785887307">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-785887307</a>
+*/
+public final class nodereplacechild extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public nodereplacechild(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "staff", true);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ NodeList elementList;
+ Node employeeNode;
+ NodeList childList;
+ Node oldChild;
+ Node newChild;
+ Node child;
+ String childName;
+ Node replacedNode;
+ doc = (Document) load("staff", true);
+ elementList = doc.getElementsByTagName("employee");
+ employeeNode = elementList.item(1);
+ childList = employeeNode.getChildNodes();
+ oldChild = childList.item(0);
+ newChild = doc.createElement("newChild");
+ replacedNode = employeeNode.replaceChild(newChild, oldChild);
+ child = childList.item(0);
+ childName = child.getNodeName();
+ assertEquals("nodeReplaceChildAssert1", "newChild", childName);
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/nodereplacechild";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(nodereplacechild.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level1/core/nodereplacechildinvalidnodetype.java b/dom/src/test/java/org/w3c/domts/level1/core/nodereplacechildinvalidnodetype.java
new file mode 100644
index 0000000..f7bc5a9
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level1/core/nodereplacechildinvalidnodetype.java
@@ -0,0 +1,107 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+Copyright (c) 2001-2003 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+*/
+
+package org.w3c.domts.level1.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The "replaceChild(newChild,oldChild)" method raises a
+ * HIERARCHY_REQUEST_ERR DOMException if this node is of
+ * a type that does not allow children of the type "newChild"
+ * to be inserted.
+ *
+ * Retrieve the root node and attempt to replace
+ * one of its children with a newly created Attr node.
+ * An Element node cannot have children of the "Attr"
+ * type, therefore the desired exception should be raised.
+* @author NIST
+* @author Mary Brady
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-258A00AF')/constant[@name='HIERARCHY_REQUEST_ERR'])">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-258A00AF')/constant[@name='HIERARCHY_REQUEST_ERR'])</a>
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-785887307">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-785887307</a>
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-785887307')/raises/exception[@name='DOMException']/descr/p[substring-before(.,':')='HIERARCHY_REQUEST_ERR'])">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-785887307')/raises/exception[@name='DOMException']/descr/p[substring-before(.,':')='HIERARCHY_REQUEST_ERR'])</a>
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-785887307">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-785887307</a>
+* @see <a href="http://www.w3.org/Bugs/Public/show_bug.cgi?id=249">http://www.w3.org/Bugs/Public/show_bug.cgi?id=249</a>
+*/
+public final class nodereplacechildinvalidnodetype extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public nodereplacechildinvalidnodetype(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "staff", true);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ Element rootNode;
+ Node newChild;
+ NodeList elementList;
+ Node oldChild;
+ Node replacedChild;
+ doc = (Document) load("staff", true);
+ rootNode = doc.getDocumentElement();
+ newChild = doc.createAttribute("newAttribute");
+ elementList = doc.getElementsByTagName("employee");
+ oldChild = elementList.item(1);
+
+ {
+ boolean success = false;
+ try {
+ replacedChild = rootNode.replaceChild(newChild, oldChild);
+ } catch (DOMException ex) {
+ success = (ex.code == DOMException.HIERARCHY_REQUEST_ERR);
+ }
+ assertTrue("throw_HIERARCHY_REQUEST_ERR", success);
+ }
+}
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/nodereplacechildinvalidnodetype";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(nodereplacechildinvalidnodetype.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level1/core/nodereplacechildnewchilddiffdocument.java b/dom/src/test/java/org/w3c/domts/level1/core/nodereplacechildnewchilddiffdocument.java
new file mode 100644
index 0000000..97a862a
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level1/core/nodereplacechildnewchilddiffdocument.java
@@ -0,0 +1,109 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+Copyright (c) 2001 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+*/
+
+package org.w3c.domts.level1.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The "replaceChild(newChild,oldChild)" method raises a
+ * WRONG_DOCUMENT_ERR DOMException if the "newChild" was
+ * created from a different document than the one that
+ * created this node.
+ *
+ * Retrieve the second employee and attempt to replace one
+ * of its children with a node created from a different
+ * document. An attempt to make such a replacement
+ * should raise the desired exception.
+* @author NIST
+* @author Mary Brady
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-258A00AF')/constant[@name='NOT_FOUND_ERR'])">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-258A00AF')/constant[@name='NOT_FOUND_ERR'])</a>
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-785887307">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-785887307</a>
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-785887307')/raises/exception[@name='DOMException']/descr/p[substring-before(.,':')='NOT_FOUND_ERR'])">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-785887307')/raises/exception[@name='DOMException']/descr/p[substring-before(.,':')='NOT_FOUND_ERR'])</a>
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-785887307">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-785887307</a>
+*/
+public final class nodereplacechildnewchilddiffdocument extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public nodereplacechildnewchilddiffdocument(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "staff", false);
+ preload(contentType, "staff", true);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc1;
+ Document doc2;
+ Node oldChild;
+ Node newChild;
+ NodeList elementList;
+ Node elementNode;
+ Node replacedChild;
+ doc1 = (Document) load("staff", false);
+ doc2 = (Document) load("staff", true);
+ newChild = doc1.createElement("newChild");
+ elementList = doc2.getElementsByTagName("employee");
+ elementNode = elementList.item(1);
+ oldChild = elementNode.getFirstChild();
+
+ {
+ boolean success = false;
+ try {
+ replacedChild = elementNode.replaceChild(newChild, oldChild);
+ } catch (DOMException ex) {
+ success = (ex.code == DOMException.WRONG_DOCUMENT_ERR);
+ }
+ assertTrue("throw_WRONG_DOCUMENT_ERR", success);
+ }
+}
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/nodereplacechildnewchilddiffdocument";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(nodereplacechildnewchilddiffdocument.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level1/core/nodereplacechildnewchildexists.java b/dom/src/test/java/org/w3c/domts/level1/core/nodereplacechildnewchildexists.java
new file mode 100644
index 0000000..aab45b5
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level1/core/nodereplacechildnewchildexists.java
@@ -0,0 +1,139 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+Copyright (c) 2001-2004 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+*/
+
+package org.w3c.domts.level1.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * Retrieve the second employee and replace its TWELFTH
+ * child(address) with its SECOND child(employeeId). After the
+ * replacement the second child should now be the one that used
+ * to be at the third position and the TWELFTH child should be the
+ * one that used to be at the SECOND position.
+* @author NIST
+* @author Mary Brady
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-785887307">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-785887307</a>
+*/
+public final class nodereplacechildnewchildexists extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public nodereplacechildnewchildexists(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "staff", true);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ NodeList elementList;
+ Node employeeNode;
+ NodeList childList;
+ Node oldChild = null;
+
+ Node newChild = null;
+
+ String childName;
+ Node childNode;
+ int length;
+ java.util.List actual = new java.util.ArrayList();
+
+ java.util.List expected = new java.util.ArrayList();
+
+ java.util.List expectedWithoutWhitespace = new java.util.ArrayList();
+ expectedWithoutWhitespace.add("name");
+ expectedWithoutWhitespace.add("position");
+ expectedWithoutWhitespace.add("salary");
+ expectedWithoutWhitespace.add("gender");
+ expectedWithoutWhitespace.add("employeeId");
+
+ java.util.List expectedWithWhitespace = new java.util.ArrayList();
+ expectedWithWhitespace.add("#text");
+ expectedWithWhitespace.add("#text");
+ expectedWithWhitespace.add("name");
+ expectedWithWhitespace.add("#text");
+ expectedWithWhitespace.add("position");
+ expectedWithWhitespace.add("#text");
+ expectedWithWhitespace.add("salary");
+ expectedWithWhitespace.add("#text");
+ expectedWithWhitespace.add("gender");
+ expectedWithWhitespace.add("#text");
+ expectedWithWhitespace.add("employeeId");
+ expectedWithWhitespace.add("#text");
+
+ Node replacedChild;
+ doc = (Document) load("staff", true);
+ elementList = doc.getElementsByTagName("employee");
+ employeeNode = elementList.item(1);
+ childList = employeeNode.getChildNodes();
+ length = (int) childList.getLength();
+
+ if (equals(13, length)) {
+ newChild = childList.item(1);
+ oldChild = childList.item(11);
+ expected = expectedWithWhitespace;
+ } else {
+ newChild = childList.item(0);
+ oldChild = childList.item(5);
+ expected = expectedWithoutWhitespace;
+ }
+
+ replacedChild = employeeNode.replaceChild(newChild, oldChild);
+ assertSame("return_value_same", oldChild, replacedChild);
+for (int indexN100DE = 0; indexN100DE < childList.getLength(); indexN100DE++) {
+ childNode = (Node) childList.item(indexN100DE);
+ childName = childNode.getNodeName();
+ actual.add(childName);
+ }
+ assertEquals("childNames", expected, actual);
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/nodereplacechildnewchildexists";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(nodereplacechildnewchildexists.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level1/core/nodereplacechildnodeancestor.java b/dom/src/test/java/org/w3c/domts/level1/core/nodereplacechildnodeancestor.java
new file mode 100644
index 0000000..03b620e
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level1/core/nodereplacechildnodeancestor.java
@@ -0,0 +1,108 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+Copyright (c) 2001-2003 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+*/
+
+package org.w3c.domts.level1.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The "replaceChild(newChild,oldChild)" method raises a
+ * HIERARCHY_REQUEST_ERR DOMException if the node to put
+ * in is one of this node's ancestors.
+ *
+ * Retrieve the second employee and attempt to replace
+ * one of its children with an ancestor node(root node).
+ * An attempt to make such a replacement should raise the
+ * desired exception.
+* @author NIST
+* @author Mary Brady
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-258A00AF')/constant[@name='HIERARCHY_REQUEST_ERR'])">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-258A00AF')/constant[@name='HIERARCHY_REQUEST_ERR'])</a>
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-785887307">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-785887307</a>
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-785887307')/raises/exception[@name='DOMException']/descr/p[substring-before(.,':')='HIERARCHY_REQUEST_ERR'])">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-785887307')/raises/exception[@name='DOMException']/descr/p[substring-before(.,':')='HIERARCHY_REQUEST_ERR'])</a>
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-785887307">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-785887307</a>
+* @see <a href="http://www.w3.org/Bugs/Public/show_bug.cgi?id=249">http://www.w3.org/Bugs/Public/show_bug.cgi?id=249</a>
+*/
+public final class nodereplacechildnodeancestor extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public nodereplacechildnodeancestor(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "staff", true);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ Node newChild;
+ NodeList elementList;
+ Node employeeNode;
+ NodeList childList;
+ Node oldChild;
+ Node replacedNode;
+ doc = (Document) load("staff", true);
+ newChild = doc.getDocumentElement();
+ elementList = doc.getElementsByTagName("employee");
+ employeeNode = elementList.item(1);
+ childList = employeeNode.getChildNodes();
+ oldChild = childList.item(0);
+
+ {
+ boolean success = false;
+ try {
+ replacedNode = employeeNode.replaceChild(newChild, oldChild);
+ } catch (DOMException ex) {
+ success = (ex.code == DOMException.HIERARCHY_REQUEST_ERR);
+ }
+ assertTrue("throw_HIERARCHY_REQUEST_ERR", success);
+ }
+}
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/nodereplacechildnodeancestor";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(nodereplacechildnodeancestor.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level1/core/nodereplacechildnodename.java b/dom/src/test/java/org/w3c/domts/level1/core/nodereplacechildnodename.java
new file mode 100644
index 0000000..7f29907
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level1/core/nodereplacechildnodename.java
@@ -0,0 +1,104 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+Copyright (c) 2001-2004 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+*/
+
+package org.w3c.domts.level1.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * Replace the second Element of the second employee with
+ * a newly created node Element and check the NodeName
+ * returned by the "replaceChild(newChild,oldChild)"
+ * method. The returned node should have a NodeName equal
+ * to "employeeId".
+* @author NIST
+* @author Mary Brady
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-F68D095">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-F68D095</a>
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-785887307">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-785887307</a>
+*/
+public final class nodereplacechildnodename extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public nodereplacechildnodename(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "staff", true);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ NodeList elementList;
+ Node employeeNode;
+ NodeList childList;
+ Node oldChild;
+ Node newChild;
+ Node replacedNode;
+ int length;
+ String childName;
+ doc = (Document) load("staff", true);
+ elementList = doc.getElementsByTagName("employee");
+ employeeNode = elementList.item(1);
+ childList = employeeNode.getChildNodes();
+ length = (int) childList.getLength();
+ oldChild = childList.item(1);
+ newChild = doc.createElement("newChild");
+ replacedNode = employeeNode.replaceChild(newChild, oldChild);
+ childName = replacedNode.getNodeName();
+
+ if (equals(6, length)) {
+ assertEquals("nowhitespace", "name", childName);
+ } else {
+ assertEquals("whitespace", "employeeId", childName);
+ }
+
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/nodereplacechildnodename";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(nodereplacechildnodename.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level1/core/nodereplacechildnomodificationallowederr.java b/dom/src/test/java/org/w3c/domts/level1/core/nodereplacechildnomodificationallowederr.java
new file mode 100644
index 0000000..cb29e19
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level1/core/nodereplacechildnomodificationallowederr.java
@@ -0,0 +1,115 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+Copyright (c) 2001 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+*/
+
+package org.w3c.domts.level1.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The "replaceChild(newChild,oldChild)" method causes the
+ * DOMException NO_MODIFICATION_ALLOWED_ERR to be raised
+ * if the node is readonly.
+ *
+ * Obtain the children of the THIRD "gender" element. The elements
+ * content is an entity reference. Get the FIRST item
+ * from the entity reference and execute the "replaceChild(newChild,oldChild)" method.
+ * This causes a NO_MODIFICATION_ALLOWED_ERR DOMException to be thrown.
+* @author NIST
+* @author Mary Brady
+* @author Curt Arnold
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-258A00AF')/constant[@name='NO_MODIFICATION_ALLOWED_ERR'])">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-258A00AF')/constant[@name='NO_MODIFICATION_ALLOWED_ERR'])</a>
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-785887307">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-785887307</a>
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-785887307')/raises/exception[@name='DOMException']/descr/p[substring-before(.,':')='NO_MODIFICATION_ALLOWED_ERR'])">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-785887307')/raises/exception[@name='DOMException']/descr/p[substring-before(.,':')='NO_MODIFICATION_ALLOWED_ERR'])</a>
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-785887307">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-785887307</a>
+*/
+public final class nodereplacechildnomodificationallowederr extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public nodereplacechildnomodificationallowederr(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "staff", true);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ NodeList genderList;
+ Node genderNode;
+ Node entRef;
+ Node entElement;
+ Node createdNode;
+ Node replacedChild;
+ int nodeType;
+ doc = (Document) load("staff", true);
+ genderList = doc.getElementsByTagName("gender");
+ genderNode = genderList.item(2);
+ entRef = genderNode.getFirstChild();
+ nodeType = (int) entRef.getNodeType();
+
+ if (equals(1, nodeType)) {
+ entRef = doc.createEntityReference("ent4");
+ assertNotNull("createdEntRefNotNull", entRef);
+ }
+ entElement = entRef.getFirstChild();
+ createdNode = doc.createElement("newChild");
+
+ {
+ boolean success = false;
+ try {
+ replacedChild = entRef.replaceChild(createdNode, entElement);
+ } catch (DOMException ex) {
+ success = (ex.code == DOMException.NO_MODIFICATION_ALLOWED_ERR);
+ }
+ assertTrue("throw_NO_MODIFICATION_ALLOWED_ERR", success);
+ }
+}
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/nodereplacechildnomodificationallowederr";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(nodereplacechildnomodificationallowederr.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level1/core/nodereplacechildnomodificationallowederrEE.java b/dom/src/test/java/org/w3c/domts/level1/core/nodereplacechildnomodificationallowederrEE.java
new file mode 100644
index 0000000..a68fd78
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level1/core/nodereplacechildnomodificationallowederrEE.java
@@ -0,0 +1,102 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+Copyright (c) 2001 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+*/
+
+package org.w3c.domts.level1.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The "replaceChild(newChild,oldChild)" method causes the
+ * DOMException NO_MODIFICATION_ALLOWED_ERR to be raised
+ * if the node is readonly.
+ *
+ * Create an entity reference execute the "replaceChild(newChild,oldChild)" method.
+ * This causes a NO_MODIFICATION_ALLOWED_ERR DOMException to be thrown.
+* @author Curt Arnold
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-258A00AF')/constant[@name='NO_MODIFICATION_ALLOWED_ERR'])">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-258A00AF')/constant[@name='NO_MODIFICATION_ALLOWED_ERR'])</a>
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-785887307">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-785887307</a>
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-785887307')/raises/exception[@name='DOMException']/descr/p[substring-before(.,':')='NO_MODIFICATION_ALLOWED_ERR'])">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-785887307')/raises/exception[@name='DOMException']/descr/p[substring-before(.,':')='NO_MODIFICATION_ALLOWED_ERR'])</a>
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-785887307">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-785887307</a>
+* @see <a href="http://www.w3.org/2001/DOM-Test-Suite/level1/core/nodereplacechildnomodificationallowederr.xml">http://www.w3.org/2001/DOM-Test-Suite/level1/core/nodereplacechildnomodificationallowederr.xml</a>
+*/
+public final class nodereplacechildnomodificationallowederrEE extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public nodereplacechildnomodificationallowederrEE(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "staff", true);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ Node entRef;
+ Node entText;
+ Node createdNode;
+ Node replacedChild;
+ doc = (Document) load("staff", true);
+ entRef = doc.createEntityReference("ent4");
+ assertNotNull("createdEntRefNotNull", entRef);
+ entText = entRef.getFirstChild();
+ createdNode = doc.createElement("newChild");
+
+ {
+ boolean success = false;
+ try {
+ replacedChild = entRef.replaceChild(createdNode, entText);
+ } catch (DOMException ex) {
+ success = (ex.code == DOMException.NO_MODIFICATION_ALLOWED_ERR);
+ }
+ assertTrue("throw_NO_MODIFICATION_ALLOWED_ERR", success);
+ }
+}
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/nodereplacechildnomodificationallowederrEE";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(nodereplacechildnomodificationallowederrEE.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level1/core/nodereplacechildoldchildnonexistent.java b/dom/src/test/java/org/w3c/domts/level1/core/nodereplacechildoldchildnonexistent.java
new file mode 100644
index 0000000..fe19ea9
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level1/core/nodereplacechildoldchildnonexistent.java
@@ -0,0 +1,105 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+Copyright (c) 2001-2003 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+*/
+
+package org.w3c.domts.level1.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The "replaceChild(newChild,oldChild)" method raises a
+ * NOT_FOUND_ERR DOMException if the old child is
+ * not a child of this node.
+ *
+ * Retrieve the second employee and attempt to replace a
+ * node that is not one of its children. An attempt to
+ * replace such a node should raise the desired exception.
+* @author NIST
+* @author Mary Brady
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-258A00AF')/constant[@name='NOT_FOUND_ERR'])">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-258A00AF')/constant[@name='NOT_FOUND_ERR'])</a>
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-785887307">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-785887307</a>
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-785887307')/raises/exception[@name='DOMException']/descr/p[substring-before(.,':')='NOT_FOUND_ERR'])">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-785887307')/raises/exception[@name='DOMException']/descr/p[substring-before(.,':')='NOT_FOUND_ERR'])</a>
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-785887307">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-785887307</a>
+* @see <a href="http://www.w3.org/Bugs/Public/show_bug.cgi?id=249">http://www.w3.org/Bugs/Public/show_bug.cgi?id=249</a>
+*/
+public final class nodereplacechildoldchildnonexistent extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public nodereplacechildoldchildnonexistent(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "staff", true);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ Node oldChild;
+ Node newChild;
+ NodeList elementList;
+ Node elementNode;
+ Node replacedNode;
+ doc = (Document) load("staff", true);
+ newChild = doc.createElement("newChild");
+ oldChild = doc.createElement("oldChild");
+ elementList = doc.getElementsByTagName("employee");
+ elementNode = elementList.item(1);
+
+ {
+ boolean success = false;
+ try {
+ replacedNode = elementNode.replaceChild(newChild, oldChild);
+ } catch (DOMException ex) {
+ success = (ex.code == DOMException.NOT_FOUND_ERR);
+ }
+ assertTrue("throw_NOT_FOUND_ERR", success);
+ }
+}
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/nodereplacechildoldchildnonexistent";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(nodereplacechildoldchildnonexistent.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level1/core/nodesetnodevaluenomodificationallowederr.java b/dom/src/test/java/org/w3c/domts/level1/core/nodesetnodevaluenomodificationallowederr.java
new file mode 100644
index 0000000..5a08853
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level1/core/nodesetnodevaluenomodificationallowederr.java
@@ -0,0 +1,117 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+Copyright (c) 2001 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+*/
+
+package org.w3c.domts.level1.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The "setNodeValue(nodeValue)" method causes the
+ * DOMException NO_MODIFICATION_ALLOWED_ERR to be raised
+ * if the node is readonly.
+ *
+ * Obtain the children of the THIRD "gender" element. The elements
+ * content is an entity reference. Get the SECOND item
+ * from the entity reference and execute the "setNodeValue(nodeValue)" method.
+ * This causes a NO_MODIFICATION_ALLOWED_ERR DOMException to be thrown.
+* @author NIST
+* @author Mary Brady
+* @author Curt Arnold
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-258A00AF')/constant[@name='NO_MODIFICATION_ALLOWED_ERR'])">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-258A00AF')/constant[@name='NO_MODIFICATION_ALLOWED_ERR'])</a>
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-F68D080">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-F68D080</a>
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-F68D080')/setraises/exception[@name='DOMException']/descr/p[substring-before(.,':')='NO_MODIFICATION_ALLOWED_ERR'])">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-F68D080')/setraises/exception[@name='DOMException']/descr/p[substring-before(.,':')='NO_MODIFICATION_ALLOWED_ERR'])</a>
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-F68D080">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-F68D080</a>
+*/
+public final class nodesetnodevaluenomodificationallowederr extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public nodesetnodevaluenomodificationallowederr(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "staff", true);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ NodeList genderList;
+ Node genderNode;
+ EntityReference entRef;
+ Element entElement;
+ CharacterData entElementText;
+ int nodeType;
+ doc = (Document) load("staff", true);
+ genderList = doc.getElementsByTagName("gender");
+ genderNode = genderList.item(2);
+ entRef = (EntityReference) genderNode.getFirstChild();
+ assertNotNull("entRefNotNull", entRef);
+ nodeType = (int) entRef.getNodeType();
+
+ if (equals(1, nodeType)) {
+ entRef = doc.createEntityReference("ent4");
+ assertNotNull("createdEntRefNotNull", entRef);
+ }
+ entElement = (Element) entRef.getFirstChild();
+ assertNotNull("entElementNotNull", entElement);
+ entElementText = (CharacterData) entElement.getFirstChild();
+ assertNotNull("entElementTextNotNull", entElementText);
+
+ {
+ boolean success = false;
+ try {
+ entElementText.setNodeValue("newValue");
+ } catch (DOMException ex) {
+ success = (ex.code == DOMException.NO_MODIFICATION_ALLOWED_ERR);
+ }
+ assertTrue("throw_NO_MODIFICATION_ALLOWED_ERR", success);
+ }
+}
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/nodesetnodevaluenomodificationallowederr";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(nodesetnodevaluenomodificationallowederr.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level1/core/nodesetnodevaluenomodificationallowederrEE.java b/dom/src/test/java/org/w3c/domts/level1/core/nodesetnodevaluenomodificationallowederrEE.java
new file mode 100644
index 0000000..b72da49
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level1/core/nodesetnodevaluenomodificationallowederrEE.java
@@ -0,0 +1,96 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+Copyright (c) 2001-2004 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+*/
+
+package org.w3c.domts.level1.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * Create an entity reference and execute the "setNodeValue(nodeValue)" method.
+ * This causes a NO_MODIFICATION_ALLOWED_ERR DOMException to be thrown.
+* @author Curt Arnold
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-258A00AF')/constant[@name='NO_MODIFICATION_ALLOWED_ERR'])">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-258A00AF')/constant[@name='NO_MODIFICATION_ALLOWED_ERR'])</a>
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-F68D080">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-F68D080</a>
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-F68D080')/setraises/exception[@name='DOMException']/descr/p[substring-before(.,':')='NO_MODIFICATION_ALLOWED_ERR'])">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-F68D080')/setraises/exception[@name='DOMException']/descr/p[substring-before(.,':')='NO_MODIFICATION_ALLOWED_ERR'])</a>
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-F68D080">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-F68D080</a>
+* @see <a href="http://www.w3.org/2001/DOM-Test-Suite/level1/core/nodesetnodevaluenomodificationallowederr.xml">http://www.w3.org/2001/DOM-Test-Suite/level1/core/nodesetnodevaluenomodificationallowederr.xml</a>
+*/
+public final class nodesetnodevaluenomodificationallowederrEE extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public nodesetnodevaluenomodificationallowederrEE(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "staff", true);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ EntityReference entRef;
+ CharacterData entText;
+ doc = (Document) load("staff", true);
+ entRef = doc.createEntityReference("ent3");
+ assertNotNull("createdEntRefNotNull", entRef);
+ entText = (CharacterData) entRef.getFirstChild();
+ assertNotNull("entTextNotNull", entText);
+
+ {
+ boolean success = false;
+ try {
+ entText.setNodeValue("newValue");
+ } catch (DOMException ex) {
+ success = (ex.code == DOMException.NO_MODIFICATION_ALLOWED_ERR);
+ }
+ assertTrue("throw_NO_MODIFICATION_ALLOWED_ERR", success);
+ }
+}
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/nodesetnodevaluenomodificationallowederrEE";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(nodesetnodevaluenomodificationallowederrEE.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level1/core/nodetextnodeattribute.java b/dom/src/test/java/org/w3c/domts/level1/core/nodetextnodeattribute.java
new file mode 100644
index 0000000..1a4c5de
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level1/core/nodetextnodeattribute.java
@@ -0,0 +1,90 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+Copyright (c) 2001 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+*/
+
+package org.w3c.domts.level1.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The "getAttributes()" method invoked on a Text
+ * Node returns null.
+ * Retrieve the Text node from the last child of the
+ * first employee and invoke the "getAttributes()" method
+ * on the Text Node. It should return null.
+* @author NIST
+* @author Mary Brady
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-84CF096">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-84CF096</a>
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-1312295772">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-1312295772</a>
+*/
+public final class nodetextnodeattribute extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public nodetextnodeattribute(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "staff", false);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ NodeList elementList;
+ Node testAddr;
+ Node textNode;
+ NamedNodeMap attrList;
+ doc = (Document) load("staff", false);
+ elementList = doc.getElementsByTagName("address");
+ testAddr = elementList.item(0);
+ textNode = testAddr.getFirstChild();
+ attrList = textNode.getAttributes();
+ assertNull("nodeTextNodeAttributesAssert1", attrList);
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/nodetextnodeattribute";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(nodetextnodeattribute.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level1/core/nodetextnodename.java b/dom/src/test/java/org/w3c/domts/level1/core/nodetextnodename.java
new file mode 100644
index 0000000..e88f03d
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level1/core/nodetextnodename.java
@@ -0,0 +1,91 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+Copyright (c) 2001 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+*/
+
+package org.w3c.domts.level1.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The string returned by the "getNodeName()" method for a
+ * Text Node is "#text".
+ *
+ * Retrieve the Text Node from the last child of the
+ * first employee and check the string returned
+ * by the "getNodeName()" method. It should be equal to
+ * "#text".
+* @author NIST
+* @author Mary Brady
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-F68D095">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-F68D095</a>
+*/
+public final class nodetextnodename extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public nodetextnodename(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "staff", false);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ NodeList elementList;
+ Element testAddr;
+ Node textNode;
+ String textName;
+ doc = (Document) load("staff", false);
+ elementList = doc.getElementsByTagName("address");
+ testAddr = (Element) elementList.item(0);
+ textNode = testAddr.getFirstChild();
+ textName = textNode.getNodeName();
+ assertEquals("nodeTextNodeNameAssert1", "#text", textName);
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/nodetextnodename";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(nodetextnodename.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level1/core/nodetextnodetype.java b/dom/src/test/java/org/w3c/domts/level1/core/nodetextnodetype.java
new file mode 100644
index 0000000..978d9ae
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level1/core/nodetextnodetype.java
@@ -0,0 +1,90 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+Copyright (c) 2001 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+*/
+
+package org.w3c.domts.level1.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The "getNodeType()" method for a Text Node
+ * returns the constant value 3.
+ *
+ * Retrieve the Text node from the last child of
+ * the first employee and invoke the "getNodeType()"
+ * method. The method should return 3.
+* @author NIST
+* @author Mary Brady
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-111237558">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-111237558</a>
+*/
+public final class nodetextnodetype extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public nodetextnodetype(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "staff", false);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ NodeList elementList;
+ Element testAddr;
+ Node textNode;
+ int nodeType;
+ doc = (Document) load("staff", false);
+ elementList = doc.getElementsByTagName("address");
+ testAddr = (Element) elementList.item(0);
+ textNode = testAddr.getFirstChild();
+ nodeType = (int) textNode.getNodeType();
+ assertEquals("nodeTextNodeTypeAssert1", 3, nodeType);
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/nodetextnodetype";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(nodetextnodetype.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level1/core/nodetextnodevalue.java b/dom/src/test/java/org/w3c/domts/level1/core/nodetextnodevalue.java
new file mode 100644
index 0000000..61bcdd8
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level1/core/nodetextnodevalue.java
@@ -0,0 +1,91 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+Copyright (c) 2001 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+*/
+
+package org.w3c.domts.level1.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The string returned by the "getNodeValue()" method for a
+ * Text Node is the content of the Text node.
+ *
+ * Retrieve the Text node from the last child of the first
+ * employee and check the string returned by the
+ * "getNodeValue()" method. It should be equal to
+ * "1230 North Ave. Dallas, Texas 98551".
+* @author NIST
+* @author Mary Brady
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-F68D080">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-F68D080</a>
+*/
+public final class nodetextnodevalue extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public nodetextnodevalue(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "staff", false);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ NodeList elementList;
+ Element testAddr;
+ Node textNode;
+ String textValue;
+ doc = (Document) load("staff", false);
+ elementList = doc.getElementsByTagName("address");
+ testAddr = (Element) elementList.item(0);
+ textNode = testAddr.getFirstChild();
+ textValue = textNode.getNodeValue();
+ assertEquals("nodeTextNodeValueAssert1", "1230 North Ave. Dallas, Texas 98551", textValue);
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/nodetextnodevalue";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(nodetextnodevalue.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level1/core/nodevalue01.java b/dom/src/test/java/org/w3c/domts/level1/core/nodevalue01.java
new file mode 100644
index 0000000..fe4d8b2
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level1/core/nodevalue01.java
@@ -0,0 +1,85 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+Copyright (c) 2001 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+*/
+
+package org.w3c.domts.level1.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * An element is created, setNodeValue is called with a non-null argument, but getNodeValue
+ * should still return null.
+* @author Curt Arnold
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-F68D080">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-F68D080</a>
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#i-Document">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#i-Document</a>
+*/
+public final class nodevalue01 extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public nodevalue01(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "staff", true);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ Element newNode;
+ String newValue;
+ doc = (Document) load("staff", true);
+ newNode = doc.createElement("address");
+ newValue = newNode.getNodeValue();
+ assertNull("initiallyNull", newValue);
+ newNode.setNodeValue("This should have no effect");
+ newValue = newNode.getNodeValue();
+ assertNull("nullAfterAttemptedChange", newValue);
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/nodevalue01";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(nodevalue01.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level1/core/nodevalue02.java b/dom/src/test/java/org/w3c/domts/level1/core/nodevalue02.java
new file mode 100644
index 0000000..c541f6e
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level1/core/nodevalue02.java
@@ -0,0 +1,85 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+Copyright (c) 2001 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+*/
+
+package org.w3c.domts.level1.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * An comment is created, setNodeValue is called with a non-null argument, but getNodeValue
+ * should still return null.
+* @author Curt Arnold
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-F68D080">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-F68D080</a>
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-1728279322">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-1728279322</a>
+*/
+public final class nodevalue02 extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public nodevalue02(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "staff", true);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ Node newNode;
+ String newValue;
+ doc = (Document) load("staff", true);
+ newNode = doc.createComment("This is a new Comment node");
+ newValue = newNode.getNodeValue();
+ assertEquals("initial", "This is a new Comment node", newValue);
+ newNode.setNodeValue("This should have an effect");
+ newValue = newNode.getNodeValue();
+ assertEquals("afterChange", "This should have an effect", newValue);
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/nodevalue02";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(nodevalue02.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level1/core/nodevalue03.java b/dom/src/test/java/org/w3c/domts/level1/core/nodevalue03.java
new file mode 100644
index 0000000..b81d0ef
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level1/core/nodevalue03.java
@@ -0,0 +1,86 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+Copyright (c) 2001-2004 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+*/
+
+package org.w3c.domts.level1.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * An entity reference is created, setNodeValue is called with a non-null argument, but getNodeValue
+ * should still return null.
+* @author Curt Arnold
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-F68D080">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-F68D080</a>
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-11C98490">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-11C98490</a>
+*/
+public final class nodevalue03 extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public nodevalue03(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "staff", true);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ Node newNode;
+ String newValue;
+ doc = (Document) load("staff", true);
+ newNode = doc.createEntityReference("ent1");
+ assertNotNull("createdEntRefNotNull", newNode);
+ newValue = newNode.getNodeValue();
+ assertNull("initiallyNull", newValue);
+ newNode.setNodeValue("This should have no effect");
+ newValue = newNode.getNodeValue();
+ assertNull("nullAfterAttemptedChange", newValue);
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/nodevalue03";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(nodevalue03.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level1/core/nodevalue04.java b/dom/src/test/java/org/w3c/domts/level1/core/nodevalue04.java
new file mode 100644
index 0000000..cc2cacf
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level1/core/nodevalue04.java
@@ -0,0 +1,86 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+Copyright (c) 2001-2004 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+*/
+
+package org.w3c.domts.level1.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * An document type accessed, setNodeValue is called with a non-null argument, but getNodeValue
+ * should still return null.
+* @author Curt Arnold
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-F68D080">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-F68D080</a>
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-B63ED1A31">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-B63ED1A31</a>
+*/
+public final class nodevalue04 extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public nodevalue04(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "staff", true);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ Node newNode;
+ String newValue;
+ doc = (Document) load("staff", true);
+ newNode = doc.getDoctype();
+ assertNotNull("docTypeNotNull", newNode);
+ newValue = newNode.getNodeValue();
+ assertNull("initiallyNull", newValue);
+ newNode.setNodeValue("This should have no effect");
+ newValue = newNode.getNodeValue();
+ assertNull("nullAfterAttemptedChange", newValue);
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/nodevalue04";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(nodevalue04.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level1/core/nodevalue05.java b/dom/src/test/java/org/w3c/domts/level1/core/nodevalue05.java
new file mode 100644
index 0000000..6594b4c
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level1/core/nodevalue05.java
@@ -0,0 +1,85 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+Copyright (c) 2001 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+*/
+
+package org.w3c.domts.level1.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * A document fragment is created, setNodeValue is called with a non-null argument, but getNodeValue
+ * should still return null.
+* @author Curt Arnold
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-F68D080">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-F68D080</a>
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-B63ED1A3">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-B63ED1A3</a>
+*/
+public final class nodevalue05 extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public nodevalue05(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "staff", true);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ Node newNode;
+ String newValue;
+ doc = (Document) load("staff", true);
+ newNode = doc.createDocumentFragment();
+ newValue = newNode.getNodeValue();
+ assertNull("initiallyNull", newValue);
+ newNode.setNodeValue("This should have no effect");
+ newValue = newNode.getNodeValue();
+ assertNull("nullAfterAttemptedChange", newValue);
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/nodevalue05";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(nodevalue05.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level1/core/nodevalue06.java b/dom/src/test/java/org/w3c/domts/level1/core/nodevalue06.java
new file mode 100644
index 0000000..824f8f4
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level1/core/nodevalue06.java
@@ -0,0 +1,83 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+Copyright (c) 2001 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+*/
+
+package org.w3c.domts.level1.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * An document is accessed, setNodeValue is called with a non-null argument, but getNodeValue
+ * should still return null.
+* @author Curt Arnold
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-F68D080">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-F68D080</a>
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#i-Document">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#i-Document</a>
+*/
+public final class nodevalue06 extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public nodevalue06(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "staff", true);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document newNode;
+ String newValue;
+ newNode = (Document) load("staff", true);
+ newValue = newNode.getNodeValue();
+ assertNull("initiallyNull", newValue);
+ newNode.setNodeValue("This should have no effect");
+ newValue = newNode.getNodeValue();
+ assertNull("nullAfterAttemptedChange", newValue);
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/nodevalue06";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(nodevalue06.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level1/core/nodevalue07.java b/dom/src/test/java/org/w3c/domts/level1/core/nodevalue07.java
new file mode 100644
index 0000000..607bd35
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level1/core/nodevalue07.java
@@ -0,0 +1,92 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+Copyright (c) 2001-2004 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+*/
+
+package org.w3c.domts.level1.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * An Entity is accessed, setNodeValue is called with a non-null argument, but getNodeValue
+ * should still return null.
+* @author Curt Arnold
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-F68D080">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-F68D080</a>
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-527DCFF2">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-527DCFF2</a>
+*/
+public final class nodevalue07 extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public nodevalue07(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "staff", true);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ Node newNode;
+ String newValue;
+ NamedNodeMap nodeMap;
+ DocumentType docType;
+ doc = (Document) load("staff", true);
+ docType = doc.getDoctype();
+ assertNotNull("docTypeNotNull", docType);
+ nodeMap = docType.getEntities();
+ assertNotNull("entitiesNotNull", nodeMap);
+ newNode = nodeMap.getNamedItem("ent1");
+ assertNotNull("entityNotNull", newNode);
+ newValue = newNode.getNodeValue();
+ assertNull("initiallyNull", newValue);
+ newNode.setNodeValue("This should have no effect");
+ newValue = newNode.getNodeValue();
+ assertNull("nullAfterAttemptedChange", newValue);
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/nodevalue07";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(nodevalue07.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level1/core/nodevalue08.java b/dom/src/test/java/org/w3c/domts/level1/core/nodevalue08.java
new file mode 100644
index 0000000..fdea9ee
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level1/core/nodevalue08.java
@@ -0,0 +1,92 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+Copyright (c) 2001-2004 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+*/
+
+package org.w3c.domts.level1.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * An notation is accessed, setNodeValue is called with a non-null argument, but getNodeValue
+ * should still return null.
+* @author Curt Arnold
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-F68D080">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-F68D080</a>
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-5431D1B9">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-5431D1B9</a>
+*/
+public final class nodevalue08 extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public nodevalue08(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "staff", true);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ DocumentType docType;
+ Node newNode;
+ String newValue;
+ NamedNodeMap nodeMap;
+ doc = (Document) load("staff", true);
+ docType = doc.getDoctype();
+ assertNotNull("docTypeNotNull", docType);
+ nodeMap = docType.getNotations();
+ assertNotNull("notationsNotNull", nodeMap);
+ newNode = nodeMap.getNamedItem("notation1");
+ assertNotNull("notationNotNull", newNode);
+ newValue = newNode.getNodeValue();
+ assertNull("initiallyNull", newValue);
+ newNode.setNodeValue("This should have no effect");
+ newValue = newNode.getNodeValue();
+ assertNull("nullAfterAttemptedChange", newValue);
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/nodevalue08";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(nodevalue08.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level1/core/nodevalue09.java b/dom/src/test/java/org/w3c/domts/level1/core/nodevalue09.java
new file mode 100644
index 0000000..832e7f0
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level1/core/nodevalue09.java
@@ -0,0 +1,85 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+Copyright (c) 2001 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+*/
+
+package org.w3c.domts.level1.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * An processing instruction is created, setNodeValue is called with a non-null argument, but getNodeValue
+ * should still return null.
+* @author Curt Arnold
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-F68D080">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-F68D080</a>
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-1004215813">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-1004215813</a>
+*/
+public final class nodevalue09 extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public nodevalue09(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "staff", true);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ Node newNode;
+ String newValue;
+ doc = (Document) load("staff", true);
+ newNode = doc.createProcessingInstruction("TARGET", "DATA");
+ newValue = newNode.getNodeValue();
+ assertEquals("initial", "DATA", newValue);
+ newNode.setNodeValue("This should have an effect");
+ newValue = newNode.getNodeValue();
+ assertEquals("after", "This should have an effect", newValue);
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/nodevalue09";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(nodevalue09.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level1/core/notationgetnotationname.java b/dom/src/test/java/org/w3c/domts/level1/core/notationgetnotationname.java
new file mode 100644
index 0000000..8bc1128
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level1/core/notationgetnotationname.java
@@ -0,0 +1,90 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+Copyright (c) 2001-2004 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+*/
+
+package org.w3c.domts.level1.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * Retrieve the notation named "notation1" and access its
+ * name by invoking the "getNodeName()" method inherited
+ * from the Node interface.
+* @author NIST
+* @author Mary Brady
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-F68D095">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-F68D095</a>
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-5431D1B9">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-5431D1B9</a>
+*/
+public final class notationgetnotationname extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public notationgetnotationname(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "staff", false);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ DocumentType docType;
+ NamedNodeMap notations;
+ Notation notationNode;
+ String notationName;
+ doc = (Document) load("staff", false);
+ docType = doc.getDoctype();
+ assertNotNull("docTypeNotNull", docType);
+ notations = docType.getNotations();
+ assertNotNull("notationsNotNull", notations);
+ notationNode = (Notation) notations.getNamedItem("notation1");
+ notationName = notationNode.getNodeName();
+ assertEquals("notationGetNotationNameAssert", "notation1", notationName);
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/notationgetnotationname";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(notationgetnotationname.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level1/core/notationgetpublicid.java b/dom/src/test/java/org/w3c/domts/level1/core/notationgetpublicid.java
new file mode 100644
index 0000000..be1598d
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level1/core/notationgetpublicid.java
@@ -0,0 +1,89 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+Copyright (c) 2001-2004 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+*/
+
+package org.w3c.domts.level1.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * Retrieve the notation named "notation1" and access its
+ * public identifier. The string "notation1File" should be
+ * returned.
+* @author NIST
+* @author Mary Brady
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-54F2B4D0">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-54F2B4D0</a>
+*/
+public final class notationgetpublicid extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public notationgetpublicid(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "staff", false);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ DocumentType docType;
+ NamedNodeMap notations;
+ Notation notationNode;
+ String publicId;
+ doc = (Document) load("staff", false);
+ docType = doc.getDoctype();
+ assertNotNull("docTypeNotNull", docType);
+ notations = docType.getNotations();
+ assertNotNull("notationsNotNull", notations);
+ notationNode = (Notation) notations.getNamedItem("notation1");
+ publicId = notationNode.getPublicId();
+ assertEquals("publicId", "notation1File", publicId);
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/notationgetpublicid";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(notationgetpublicid.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level1/core/notationgetpublicidnull.java b/dom/src/test/java/org/w3c/domts/level1/core/notationgetpublicidnull.java
new file mode 100644
index 0000000..28bce45
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level1/core/notationgetpublicidnull.java
@@ -0,0 +1,94 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+Copyright (c) 2001-2004 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+*/
+
+package org.w3c.domts.level1.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The "getPublicId()" method of a Notation node contains
+ * the public identifier associated with the notation, if
+ * one was not specified a null value should be returned.
+ *
+ * Retrieve the notation named "notation2" and access its
+ * public identifier. Since a public identifier was not
+ * specified for this notation, the "getPublicId()" method
+ * should return null.
+* @author NIST
+* @author Mary Brady
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-54F2B4D0">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-54F2B4D0</a>
+*/
+public final class notationgetpublicidnull extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public notationgetpublicidnull(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "staff", false);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ DocumentType docType;
+ NamedNodeMap notations;
+ Notation notationNode;
+ String publicId;
+ doc = (Document) load("staff", false);
+ docType = doc.getDoctype();
+ assertNotNull("docTypeNotNull", docType);
+ notations = docType.getNotations();
+ assertNotNull("notationsNotNull", notations);
+ notationNode = (Notation) notations.getNamedItem("notation2");
+ publicId = notationNode.getPublicId();
+ assertNull("publicId", publicId);
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/notationgetpublicidnull";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(notationgetpublicidnull.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level1/core/notationgetsystemid.java b/dom/src/test/java/org/w3c/domts/level1/core/notationgetsystemid.java
new file mode 100644
index 0000000..dce7fca
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level1/core/notationgetsystemid.java
@@ -0,0 +1,94 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+Copyright (c) 2001-2004 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+*/
+
+package org.w3c.domts.level1.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The "getSystemId()" method of a Notation node contains
+ * the system identifier associated with the notation, if
+ * one was specified.
+ *
+ * Retrieve the notation named "notation2" and access its
+ * system identifier. The string "notation2File" should be
+ * returned.
+* @author NIST
+* @author Mary Brady
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-E8AAB1D0">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-E8AAB1D0</a>
+*/
+public final class notationgetsystemid extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public notationgetsystemid(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "staff", false);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ DocumentType docType;
+ NamedNodeMap notations;
+ Notation notationNode;
+ String systemId;
+ int index;
+ doc = (Document) load("staff", false);
+ docType = doc.getDoctype();
+ assertNotNull("docTypeNotNull", docType);
+ notations = docType.getNotations();
+ assertNotNull("notationsNotNull", notations);
+ notationNode = (Notation) notations.getNamedItem("notation2");
+ systemId = notationNode.getSystemId();
+ assertURIEquals("uriEquals", null, null, null, "notation2File", null, null, null, null, systemId);
+}
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/notationgetsystemid";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(notationgetsystemid.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level1/core/notationgetsystemidnull.java b/dom/src/test/java/org/w3c/domts/level1/core/notationgetsystemidnull.java
new file mode 100644
index 0000000..2866336
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level1/core/notationgetsystemidnull.java
@@ -0,0 +1,90 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+Copyright (c) 2001-2004 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+*/
+
+package org.w3c.domts.level1.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * Retrieve the notation named "notation1" and access its
+ * system identifier. Since a system identifier was not
+ * specified for this notation, the "getSystemId()" method
+ * should return null.
+* @author NIST
+* @author Mary Brady
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-E8AAB1D0">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-E8AAB1D0</a>
+*/
+public final class notationgetsystemidnull extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public notationgetsystemidnull(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "staff", false);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ DocumentType docType;
+ NamedNodeMap notations;
+ Notation notationNode;
+ String systemId;
+ doc = (Document) load("staff", false);
+ docType = doc.getDoctype();
+ assertNotNull("docTypeNotNull", docType);
+ notations = docType.getNotations();
+ assertNotNull("notationsNotNull", notations);
+ notationNode = (Notation) notations.getNamedItem("notation1");
+ systemId = notationNode.getSystemId();
+ assertNull("systemId", systemId);
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/notationgetsystemidnull";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(notationgetsystemidnull.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level1/core/processinginstructiongetdata.java b/dom/src/test/java/org/w3c/domts/level1/core/processinginstructiongetdata.java
new file mode 100644
index 0000000..80002e7
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level1/core/processinginstructiongetdata.java
@@ -0,0 +1,92 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+Copyright (c) 2001-2004 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+*/
+
+package org.w3c.domts.level1.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The "getData()" method returns the content of the
+ * processing instruction. It starts at the first non
+ * white character following the target and ends at the
+ * character immediately preceding the "?>".
+ *
+ * Retrieve the ProcessingInstruction node located
+ * immediately after the prolog. Create a nodelist of the
+ * child nodes of this document. Invoke the "getData()"
+ * method on the first child in the list. This should
+ * return the content of the ProcessingInstruction.
+* @author NIST
+* @author Mary Brady
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-837822393">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-837822393</a>
+*/
+public final class processinginstructiongetdata extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public processinginstructiongetdata(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "staff", false);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ NodeList childNodes;
+ ProcessingInstruction piNode;
+ String data;
+ doc = (Document) load("staff", false);
+ childNodes = doc.getChildNodes();
+ piNode = (ProcessingInstruction) childNodes.item(0);
+ data = piNode.getData();
+ assertEquals("processinginstructionGetTargetAssert", "PIDATA", data);
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/processinginstructiongetdata";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(processinginstructiongetdata.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level1/core/processinginstructiongettarget.java b/dom/src/test/java/org/w3c/domts/level1/core/processinginstructiongettarget.java
new file mode 100644
index 0000000..3bb01a9
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level1/core/processinginstructiongettarget.java
@@ -0,0 +1,91 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+Copyright (c) 2001-2004 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+*/
+
+package org.w3c.domts.level1.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The "getTarget()" method returns the target of the
+ * processing instruction. It is the first token following
+ * the markup that begins the processing instruction.
+ *
+ * Retrieve the ProcessingInstruction node located
+ * immediately after the prolog. Create a nodelist of the
+ * child nodes of this document. Invoke the "getTarget()"
+ * method on the first child in the list. This should
+ * return the target of the ProcessingInstruction.
+* @author NIST
+* @author Mary Brady
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-1478689192">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-1478689192</a>
+*/
+public final class processinginstructiongettarget extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public processinginstructiongettarget(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "staff", false);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ NodeList childNodes;
+ ProcessingInstruction piNode;
+ String target;
+ doc = (Document) load("staff", false);
+ childNodes = doc.getChildNodes();
+ piNode = (ProcessingInstruction) childNodes.item(0);
+ target = piNode.getTarget();
+ assertEquals("processinginstructionGetTargetAssert", "TEST-STYLE", target);
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/processinginstructiongettarget";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(processinginstructiongettarget.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level1/core/processinginstructionsetdatanomodificationallowederr.java b/dom/src/test/java/org/w3c/domts/level1/core/processinginstructionsetdatanomodificationallowederr.java
new file mode 100644
index 0000000..edbe9d5
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level1/core/processinginstructionsetdatanomodificationallowederr.java
@@ -0,0 +1,112 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+Copyright (c) 2001-2004 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+*/
+
+package org.w3c.domts.level1.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The "setData(data)" method for a processing instruction causes the
+ * DOMException NO_MODIFICATION_ALLOWED_ERR to be raised
+ * if the node is readonly.
+ *
+ * Obtain the children of the THIRD "gender" element. The elements
+ * content is an entity reference. Try to remove the "domestic" attribute
+ * from the entity reference by executing the "setData(data)" method.
+ * This causes a NO_MODIFICATION_ALLOWED_ERR DOMException to be thrown.
+* @author NIST
+* @author Mary Brady
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-258A00AF')/constant[@name='NO_MODIFICATION_ALLOWED_ERR'])">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-258A00AF')/constant[@name='NO_MODIFICATION_ALLOWED_ERR'])</a>
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-837822393">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-837822393</a>
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-837822393')/setraises/exception[@name='DOMException']/descr/p[substring-before(.,':')='NO_MODIFICATION_ALLOWED_ERR'])">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-837822393')/setraises/exception[@name='DOMException']/descr/p[substring-before(.,':')='NO_MODIFICATION_ALLOWED_ERR'])</a>
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-837822393">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-837822393</a>
+*/
+public final class processinginstructionsetdatanomodificationallowederr extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public processinginstructionsetdatanomodificationallowederr(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+
+ org.w3c.domts.DocumentBuilderSetting[] settings =
+ new org.w3c.domts.DocumentBuilderSetting[] {
+org.w3c.domts.DocumentBuilderSetting.notExpandEntityReferences
+ };
+ DOMTestDocumentBuilderFactory testFactory = factory.newInstance(settings);
+ setFactory(testFactory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "staff", true);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ NodeList genderList;
+ Node gender;
+ Node entRef;
+ ProcessingInstruction piNode;
+ doc = (Document) load("staff", true);
+ genderList = doc.getElementsByTagName("gender");
+ gender = genderList.item(2);
+ entRef = gender.getFirstChild();
+ assertNotNull("entRefNotNull", entRef);
+ piNode = (ProcessingInstruction) entRef.getLastChild();
+ assertNotNull("piNodeNotNull", piNode);
+
+ {
+ boolean success = false;
+ try {
+ piNode.setData("newData");
+ } catch (DOMException ex) {
+ success = (ex.code == DOMException.NO_MODIFICATION_ALLOWED_ERR);
+ }
+ assertTrue("throw_NO_MODIFICATION_ALLOWED_ERR", success);
+ }
+}
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/processinginstructionsetdatanomodificationallowederr";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(processinginstructionsetdatanomodificationallowederr.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level1/core/processinginstructionsetdatanomodificationallowederrEE.java b/dom/src/test/java/org/w3c/domts/level1/core/processinginstructionsetdatanomodificationallowederrEE.java
new file mode 100644
index 0000000..1856181
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level1/core/processinginstructionsetdatanomodificationallowederrEE.java
@@ -0,0 +1,110 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+Copyright (c) 2001-2004 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+*/
+
+package org.w3c.domts.level1.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The "setData(data)" method for a processing instruction causes the
+ * DOMException NO_MODIFICATION_ALLOWED_ERR to be raised
+ * if the node is readonly.
+ *
+ * Create an ent4 entity reference and add to document of the THIRD "gender" element. The elements
+ * content is an entity reference. Try to remove the "domestic" attribute
+ * from the entity reference by executing the "setData(data)" method.
+ * This causes a NO_MODIFICATION_ALLOWED_ERR DOMException to be thrown.
+* @author Curt Arnold
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-258A00AF')/constant[@name='NO_MODIFICATION_ALLOWED_ERR'])">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-258A00AF')/constant[@name='NO_MODIFICATION_ALLOWED_ERR'])</a>
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-837822393">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-837822393</a>
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-837822393')/setraises/exception[@name='DOMException']/descr/p[substring-before(.,':')='NO_MODIFICATION_ALLOWED_ERR'])">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-837822393')/setraises/exception[@name='DOMException']/descr/p[substring-before(.,':')='NO_MODIFICATION_ALLOWED_ERR'])</a>
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-837822393">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-837822393</a>
+* @see <a href="http://lists.w3.org/Archives/Public/www-dom-ts/2002Apr/0053.html">http://lists.w3.org/Archives/Public/www-dom-ts/2002Apr/0053.html</a>
+* @see <a href="http://www.w3.org/2001/DOM-Test-Suite/level1/core/processinginstructionsetdatanomodificationallowederr.xml">http://www.w3.org/2001/DOM-Test-Suite/level1/core/processinginstructionsetdatanomodificationallowederr.xml</a>
+*/
+public final class processinginstructionsetdatanomodificationallowederrEE extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public processinginstructionsetdatanomodificationallowederrEE(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "staff", true);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ NodeList genderList;
+ Node gender;
+ Node entRef;
+ ProcessingInstruction piNode;
+ Node appendedChild;
+ doc = (Document) load("staff", true);
+ genderList = doc.getElementsByTagName("gender");
+ gender = genderList.item(2);
+ entRef = doc.createEntityReference("ent4");
+ appendedChild = gender.appendChild(entRef);
+ entRef = gender.getLastChild();
+ assertNotNull("entRefNotNull", entRef);
+ piNode = (ProcessingInstruction) entRef.getLastChild();
+ assertNotNull("piNodeNotNull", piNode);
+
+ {
+ boolean success = false;
+ try {
+ piNode.setData("newData");
+ } catch (DOMException ex) {
+ success = (ex.code == DOMException.NO_MODIFICATION_ALLOWED_ERR);
+ }
+ assertTrue("throw_NO_MODIFICATION_ALLOWED_ERR", success);
+ }
+}
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/processinginstructionsetdatanomodificationallowederrEE";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(processinginstructionsetdatanomodificationallowederrEE.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level1/core/textindexsizeerrnegativeoffset.java b/dom/src/test/java/org/w3c/domts/level1/core/textindexsizeerrnegativeoffset.java
new file mode 100644
index 0000000..4a870a8
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level1/core/textindexsizeerrnegativeoffset.java
@@ -0,0 +1,108 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+Copyright (c) 2001 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+*/
+
+package org.w3c.domts.level1.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The "splitText(offset)" method raises an
+ * INDEX_SIZE_ERR DOMException if the specified offset is
+ * negative.
+ *
+ * Retrieve the textual data from the second child of the
+ * third employee and invoke the "splitText(offset)" method.
+ * The desired exception should be raised since the offset
+ * is a negative number.
+* @author NIST
+* @author Mary Brady
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-258A00AF')/constant[@name='INDEX_SIZE_ERR'])">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-258A00AF')/constant[@name='INDEX_SIZE_ERR'])</a>
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-38853C1D">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-38853C1D</a>
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-38853C1D')/raises/exception[@name='DOMException']/descr/p[substring-before(.,':')='INDEX_SIZE_ERR'])">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-38853C1D')/raises/exception[@name='DOMException']/descr/p[substring-before(.,':')='INDEX_SIZE_ERR'])</a>
+*/
+public final class textindexsizeerrnegativeoffset extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public textindexsizeerrnegativeoffset(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+
+ org.w3c.domts.DocumentBuilderSetting[] settings =
+ new org.w3c.domts.DocumentBuilderSetting[] {
+org.w3c.domts.DocumentBuilderSetting.signed
+ };
+ DOMTestDocumentBuilderFactory testFactory = factory.newInstance(settings);
+ setFactory(testFactory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "staff", true);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ NodeList elementList;
+ Node nameNode;
+ Text textNode;
+ Text splitNode;
+ doc = (Document) load("staff", true);
+ elementList = doc.getElementsByTagName("name");
+ nameNode = elementList.item(2);
+ textNode = (Text) nameNode.getFirstChild();
+
+ {
+ boolean success = false;
+ try {
+ splitNode = textNode.splitText(-69);
+ } catch (DOMException ex) {
+ success = (ex.code == DOMException.INDEX_SIZE_ERR);
+ }
+ assertTrue("throws_INDEX_SIZE_ERR", success);
+ }
+}
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/textindexsizeerrnegativeoffset";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(textindexsizeerrnegativeoffset.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level1/core/textindexsizeerroffsetoutofbounds.java b/dom/src/test/java/org/w3c/domts/level1/core/textindexsizeerroffsetoutofbounds.java
new file mode 100644
index 0000000..b91a537
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level1/core/textindexsizeerroffsetoutofbounds.java
@@ -0,0 +1,104 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+Copyright (c) 2001-2003 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+*/
+
+package org.w3c.domts.level1.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The "splitText(offset)" method raises an
+ * INDEX_SIZE_ERR DOMException if the specified offset is
+ * greater than the number of characters in the Text node.
+ *
+ * Retrieve the textual data from the second child of the
+ * third employee and invoke the "splitText(offset)" method.
+ * The desired exception should be raised since the offset
+ * is a greater than the number of characters in the Text
+ * node.
+* @author NIST
+* @author Mary Brady
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-258A00AF')/constant[@name='INDEX_SIZE_ERR'])">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-258A00AF')/constant[@name='INDEX_SIZE_ERR'])</a>
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-38853C1D">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-38853C1D</a>
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-38853C1D')/raises/exception[@name='DOMException']/descr/p[substring-before(.,':')='INDEX_SIZE_ERR'])">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-38853C1D')/raises/exception[@name='DOMException']/descr/p[substring-before(.,':')='INDEX_SIZE_ERR'])</a>
+* @see <a href="http://www.w3.org/Bugs/Public/show_bug.cgi?id=249">http://www.w3.org/Bugs/Public/show_bug.cgi?id=249</a>
+*/
+public final class textindexsizeerroffsetoutofbounds extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public textindexsizeerroffsetoutofbounds(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "staff", true);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ NodeList elementList;
+ Node nameNode;
+ Text textNode;
+ Text splitNode;
+ doc = (Document) load("staff", true);
+ elementList = doc.getElementsByTagName("name");
+ nameNode = elementList.item(2);
+ textNode = (Text) nameNode.getFirstChild();
+
+ {
+ boolean success = false;
+ try {
+ splitNode = textNode.splitText(300);
+ } catch (DOMException ex) {
+ success = (ex.code == DOMException.INDEX_SIZE_ERR);
+ }
+ assertTrue("throw_INDEX_SIZE_ERR", success);
+ }
+}
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/textindexsizeerroffsetoutofbounds";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(textindexsizeerroffsetoutofbounds.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level1/core/textparseintolistofelements.java b/dom/src/test/java/org/w3c/domts/level1/core/textparseintolistofelements.java
new file mode 100644
index 0000000..07b7838
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level1/core/textparseintolistofelements.java
@@ -0,0 +1,126 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+Copyright (c) 2001-2004 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+*/
+
+package org.w3c.domts.level1.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * Retrieve the textual data from the last child of the
+ * second employee. That node is composed of two
+ * EntityReference nodes and two Text nodes. After
+ * the content node is parsed, the "address" Element
+ * should contain four children with each one of the
+ * EntityReferences containing one child.
+* @author NIST
+* @author Mary Brady
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-1451460987">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-1451460987</a>
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-11C98490">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-11C98490</a>
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-745549614">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-745549614</a>
+*/
+public final class textparseintolistofelements extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public textparseintolistofelements(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "staff", false);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ NodeList elementList;
+ Node addressNode;
+ NodeList childList;
+ Node child;
+ int length;
+ String value;
+ Node grandChild;
+ java.util.List result = new java.util.ArrayList();
+
+ java.util.List expectedNormal = new java.util.ArrayList();
+ expectedNormal.add("1900 Dallas Road");
+ expectedNormal.add(" Dallas, ");
+ expectedNormal.add("Texas");
+ expectedNormal.add("\n 98554");
+
+ java.util.List expectedExpanded = new java.util.ArrayList();
+ expectedExpanded.add("1900 Dallas Road Dallas, Texas\n 98554");
+
+ doc = (Document) load("staff", false);
+ elementList = doc.getElementsByTagName("address");
+ addressNode = elementList.item(1);
+ childList = addressNode.getChildNodes();
+ length = (int) childList.getLength();
+ for (int indexN1007F = 0; indexN1007F < childList.getLength(); indexN1007F++) {
+ child = (Node) childList.item(indexN1007F);
+ value = child.getNodeValue();
+
+ if ((value == null)) {
+ grandChild = child.getFirstChild();
+ assertNotNull("grandChildNotNull", grandChild);
+ value = grandChild.getNodeValue();
+ result.add(value);
+ } else {
+ result.add(value);
+ }
+
+ }
+
+ if (equals(4, length)) {
+ assertEquals("assertEqNormal", expectedNormal, result);
+ } else {
+ assertEquals("assertEqCoalescing", expectedExpanded, result);
+ }
+
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/textparseintolistofelements";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(textparseintolistofelements.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level1/core/textsplittextfour.java b/dom/src/test/java/org/w3c/domts/level1/core/textsplittextfour.java
new file mode 100644
index 0000000..3e54d32
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level1/core/textsplittextfour.java
@@ -0,0 +1,95 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+Copyright (c) 2001 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+*/
+
+package org.w3c.domts.level1.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The "splitText(offset)" method returns the new Text node.
+ *
+ * Retrieve the textual data from the last child of the
+ * first employee and invoke the "splitText(offset)" method.
+ * The method should return the new Text node. The offset
+ * value used for this test is 30. The "getNodeValue()"
+ * method is called to check that the new node now contains
+ * the characters at and after position 30.
+ * (Starting count at 0)
+* @author NIST
+* @author Mary Brady
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-38853C1D">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-38853C1D</a>
+*/
+public final class textsplittextfour extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public textsplittextfour(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "staff", true);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ NodeList elementList;
+ Node addressNode;
+ Text textNode;
+ Text splitNode;
+ String value;
+ doc = (Document) load("staff", true);
+ elementList = doc.getElementsByTagName("address");
+ addressNode = elementList.item(0);
+ textNode = (Text) addressNode.getFirstChild();
+ splitNode = textNode.splitText(30);
+ value = splitNode.getNodeValue();
+ assertEquals("textSplitTextFourAssert", "98551", value);
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/textsplittextfour";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(textsplittextfour.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level1/core/textsplittextnomodificationallowederr.java b/dom/src/test/java/org/w3c/domts/level1/core/textsplittextnomodificationallowederr.java
new file mode 100644
index 0000000..9e33fde
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level1/core/textsplittextnomodificationallowederr.java
@@ -0,0 +1,117 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+Copyright (c) 2001-2004 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+*/
+
+package org.w3c.domts.level1.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The "splitText(offset)" method raises a
+ * NO_MODIFICATION_ALLOWED_ERR DOMException if the
+ * node is readonly.
+ *
+ * Obtain the children of the THIRD "gender" element. The elements
+ * content is an entity reference. Get the element content of the FIRST
+ * Text Node of the entity reference and execute the "splitText(offset)" method.
+ * This causes a NO_MODIFICATION_ALLOWED_ERR DOMException to be thrown.
+* @author NIST
+* @author Mary Brady
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-258A00AF')/constant[@name='NO_MODIFICATION_ALLOWED_ERR'])">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-258A00AF')/constant[@name='NO_MODIFICATION_ALLOWED_ERR'])</a>
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-38853C1D">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-38853C1D</a>
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-38853C1D')/raises/exception[@name='DOMException']/descr/p[substring-before(.,':')='NO_MODIFICATION_ALLOWED_ERR'])">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-38853C1D')/raises/exception[@name='DOMException']/descr/p[substring-before(.,':')='NO_MODIFICATION_ALLOWED_ERR'])</a>
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-38853C1D">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-38853C1D</a>
+*/
+public final class textsplittextnomodificationallowederr extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public textsplittextnomodificationallowederr(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "staff", true);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ NodeList genderList;
+ Node gender;
+ Node entRef;
+ Node entElement;
+ Node entElementText;
+ Text splitNode;
+ int nodeType;
+ doc = (Document) load("staff", true);
+ genderList = doc.getElementsByTagName("gender");
+ gender = genderList.item(2);
+ entRef = gender.getFirstChild();
+ assertNotNull("entRefNotNull", entRef);
+ nodeType = (int) entRef.getNodeType();
+
+ if (equals(1, nodeType)) {
+ entRef = doc.createEntityReference("ent4");
+ assertNotNull("createdEntRefNotNull", entRef);
+ }
+ entElement = entRef.getFirstChild();
+ assertNotNull("entElementNotNull", entElement);
+ entElementText = entElement.getFirstChild();
+ assertNotNull("entElementTextNotNull", entElementText);
+
+ {
+ boolean success = false;
+ try {
+ splitNode = ((Text) /*Node */entElementText).splitText(2);
+ } catch (DOMException ex) {
+ success = (ex.code == DOMException.NO_MODIFICATION_ALLOWED_ERR);
+ }
+ assertTrue("throw_NO_MODIFICATION_ALLOWED_ERR", success);
+ }
+}
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/textsplittextnomodificationallowederr";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(textsplittextnomodificationallowederr.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level1/core/textsplittextnomodificationallowederrEE.java b/dom/src/test/java/org/w3c/domts/level1/core/textsplittextnomodificationallowederrEE.java
new file mode 100644
index 0000000..1143f73
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level1/core/textsplittextnomodificationallowederrEE.java
@@ -0,0 +1,97 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+Copyright (c) 2001-2004 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+*/
+
+package org.w3c.domts.level1.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * Create an ent3 reference and execute the "splitText(offset)" method.
+ * This causes a NO_MODIFICATION_ALLOWED_ERR DOMException to be thrown.
+* @author Curt Arnold
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-258A00AF')/constant[@name='NO_MODIFICATION_ALLOWED_ERR'])">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-258A00AF')/constant[@name='NO_MODIFICATION_ALLOWED_ERR'])</a>
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-38853C1D">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-38853C1D</a>
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-38853C1D')/raises/exception[@name='DOMException']/descr/p[substring-before(.,':')='NO_MODIFICATION_ALLOWED_ERR'])">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-38853C1D')/raises/exception[@name='DOMException']/descr/p[substring-before(.,':')='NO_MODIFICATION_ALLOWED_ERR'])</a>
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-38853C1D">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-38853C1D</a>
+* @see <a href="http://www.w3.org/2001/DOM-Test-Suite/level1/core/textsplittextnomodificationallowederr.xml">http://www.w3.org/2001/DOM-Test-Suite/level1/core/textsplittextnomodificationallowederr.xml</a>
+*/
+public final class textsplittextnomodificationallowederrEE extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public textsplittextnomodificationallowederrEE(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "staff", true);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ Node entRef;
+ Node entText;
+ Text splitNode;
+ doc = (Document) load("staff", true);
+ entRef = doc.createEntityReference("ent3");
+ assertNotNull("createdEntRefNotNull", entRef);
+ entText = entRef.getFirstChild();
+ assertNotNull("entTextNotNull", entText);
+
+ {
+ boolean success = false;
+ try {
+ splitNode = ((Text) /*Node */entText).splitText(2);
+ } catch (DOMException ex) {
+ success = (ex.code == DOMException.NO_MODIFICATION_ALLOWED_ERR);
+ }
+ assertTrue("throw_NO_MODIFICATION_ALLOWED_ERR", success);
+ }
+}
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/textsplittextnomodificationallowederrEE";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(textsplittextnomodificationallowederrEE.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level1/core/textsplittextone.java b/dom/src/test/java/org/w3c/domts/level1/core/textsplittextone.java
new file mode 100644
index 0000000..c0bbbf4
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level1/core/textsplittextone.java
@@ -0,0 +1,98 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+Copyright (c) 2001 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+*/
+
+package org.w3c.domts.level1.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The "splitText(offset)" method breaks the Text node into
+ * two Text nodes at the specified offset keeping each node
+ * as siblings in the tree.
+ *
+ * Retrieve the textual data from the second child of the
+ * third employee and invoke the "splitText(offset)" method.
+ * The method splits the Text node into two new sibling
+ * Text nodes keeping both of them in the tree. This test
+ * checks the "nextSibling()" method of the original node
+ * to ensure that the two nodes are indeed siblings.
+* @author NIST
+* @author Mary Brady
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-38853C1D">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-38853C1D</a>
+*/
+public final class textsplittextone extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public textsplittextone(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "staff", true);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ NodeList elementList;
+ Node nameNode;
+ Text textNode;
+ Text splitNode;
+ Node secondPart;
+ String value;
+ doc = (Document) load("staff", true);
+ elementList = doc.getElementsByTagName("name");
+ nameNode = elementList.item(2);
+ textNode = (Text) nameNode.getFirstChild();
+ splitNode = textNode.splitText(7);
+ secondPart = textNode.getNextSibling();
+ value = secondPart.getNodeValue();
+ assertEquals("textSplitTextOneAssert", "Jones", value);
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/textsplittextone";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(textsplittextone.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level1/core/textsplittextthree.java b/dom/src/test/java/org/w3c/domts/level1/core/textsplittextthree.java
new file mode 100644
index 0000000..a2d3e13
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level1/core/textsplittextthree.java
@@ -0,0 +1,97 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+Copyright (c) 2001 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+*/
+
+package org.w3c.domts.level1.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * After the "splitText(offset)" method breaks the Text node
+ * into two Text nodes, the new Text node contains all the
+ * content at and after the offset point.
+ *
+ * Retrieve the textual data from the second child of the
+ * third employee and invoke the "splitText(offset)" method.
+ * The new Text node should contain all the content
+ * at and after the offset point. The "getNodeValue()"
+ * method is called to check that the new node now contains
+ * the characters at and after position seven.
+ * (Starting count at 0)
+* @author NIST
+* @author Mary Brady
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-38853C1D">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-38853C1D</a>
+*/
+public final class textsplittextthree extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public textsplittextthree(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "staff", true);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ NodeList elementList;
+ Node nameNode;
+ Text textNode;
+ Text splitNode;
+ String value;
+ doc = (Document) load("staff", true);
+ elementList = doc.getElementsByTagName("name");
+ nameNode = elementList.item(2);
+ textNode = (Text) nameNode.getFirstChild();
+ splitNode = textNode.splitText(6);
+ value = splitNode.getNodeValue();
+ assertEquals("textSplitTextThreeAssert", " Jones", value);
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/textsplittextthree";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(textsplittextthree.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level1/core/textsplittexttwo.java b/dom/src/test/java/org/w3c/domts/level1/core/textsplittexttwo.java
new file mode 100644
index 0000000..ac686f0
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level1/core/textsplittexttwo.java
@@ -0,0 +1,96 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+Copyright (c) 2001 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+*/
+
+package org.w3c.domts.level1.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * After the "splitText(offset)" method breaks the Text node
+ * into two Text nodes, the original node contains all the
+ * content up to the offset point.
+ *
+ * Retrieve the textual data from the second child of the
+ * third employee and invoke the "splitText(offset)" method.
+ * The original Text node should contain all the content
+ * up to the offset point. The "getNodeValue()" method
+ * is called to check that the original node now contains
+ * the first five characters.
+* @author NIST
+* @author Mary Brady
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-38853C1D">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-38853C1D</a>
+*/
+public final class textsplittexttwo extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public textsplittexttwo(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "staff", true);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ NodeList elementList;
+ Node nameNode;
+ Text textNode;
+ Text splitNode;
+ String value;
+ doc = (Document) load("staff", true);
+ elementList = doc.getElementsByTagName("name");
+ nameNode = elementList.item(2);
+ textNode = (Text) nameNode.getFirstChild();
+ splitNode = textNode.splitText(5);
+ value = textNode.getNodeValue();
+ assertEquals("textSplitTextTwoAssert", "Roger", value);
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/textsplittexttwo";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(textsplittexttwo.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level1/core/textwithnomarkup.java b/dom/src/test/java/org/w3c/domts/level1/core/textwithnomarkup.java
new file mode 100644
index 0000000..ab07460
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level1/core/textwithnomarkup.java
@@ -0,0 +1,95 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+Copyright (c) 2001-2004 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+*/
+
+package org.w3c.domts.level1.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * If there is not any markup inside an Element or Attr node
+ * content, then the text is contained in a single object
+ * implementing the Text interface that is the only child
+ * of the element.
+ *
+ * Retrieve the textual data from the second child of the
+ * third employee. That Text node contains a block of
+ * multiple text lines without markup, so they should be
+ * treated as a single Text node. The "getNodeValue()"
+ * method should contain the combination of the two lines.
+* @author NIST
+* @author Mary Brady
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-1312295772">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-1312295772</a>
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-F68D080">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-F68D080</a>
+*/
+public final class textwithnomarkup extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public textwithnomarkup(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "staff", false);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ NodeList elementList;
+ Node nameNode;
+ Node nodeV;
+ String value;
+ doc = (Document) load("staff", false);
+ elementList = doc.getElementsByTagName("name");
+ nameNode = elementList.item(2);
+ nodeV = nameNode.getFirstChild();
+ value = nodeV.getNodeValue();
+ assertEquals("textNodeValue", "Roger\n Jones", value);
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/textwithnomarkup";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(textwithnomarkup.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level1/html/TestDefaultLS.java b/dom/src/test/java/org/w3c/domts/level1/html/TestDefaultLS.java
new file mode 100644
index 0000000..0c7aaea
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level1/html/TestDefaultLS.java
@@ -0,0 +1,51 @@
+/*
+ * Copyright (c) 2001-2004 World Wide Web Consortium, (Massachusetts Institute
+ * of Technology, Institut National de Recherche en Informatique et en
+ * Automatique, Keio University). All Rights Reserved. This program is
+ * distributed under the W3C's Software Intellectual Property License. This
+ * program 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 W3C License
+ * http://www.w3.org/Consortium/Legal/ for more details.
+ */
+
+package org.w3c.domts.level1.html;
+
+import java.lang.reflect.Constructor;
+
+import junit.framework.TestSuite;
+
+
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+import org.w3c.domts.DOMTestSuite;
+import org.w3c.domts.LSDocumentBuilderFactory;
+import org.w3c.domts.JAXPDOMTestDocumentBuilderFactory;
+import org.w3c.domts.JUnitTestSuiteAdapter;
+
+/**
+ * Test suite that runs all DOM L1 HTML tests using the
+ * Default LS parser in default configuration.
+ *
+ * @author Curt Arnold
+ *
+ */
+public class TestDefaultLS extends TestSuite {
+
+ public static TestSuite suite() throws Exception {
+ Class testClass =
+ ClassLoader.getSystemClassLoader().loadClass(
+ "org.w3c.domts.level1.html.alltests");
+ Constructor testConstructor =
+ testClass.getConstructor(
+ new Class[] { DOMTestDocumentBuilderFactory.class });
+
+ DOMTestDocumentBuilderFactory factory =
+ new LSDocumentBuilderFactory(
+ JAXPDOMTestDocumentBuilderFactory.getConfiguration1());
+
+ Object test = testConstructor.newInstance(new Object[] { factory });
+
+ return new JUnitTestSuiteAdapter((DOMTestSuite) test);
+ }
+
+}
diff --git a/dom/src/test/java/org/w3c/domts/level1/html/TestDefaultLSAltConfig.java b/dom/src/test/java/org/w3c/domts/level1/html/TestDefaultLSAltConfig.java
new file mode 100644
index 0000000..4fb1c75
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level1/html/TestDefaultLSAltConfig.java
@@ -0,0 +1,51 @@
+/*
+ * Copyright (c) 2001-2004 World Wide Web Consortium, (Massachusetts Institute
+ * of Technology, Institut National de Recherche en Informatique et en
+ * Automatique, Keio University). All Rights Reserved. This program is
+ * distributed under the W3C's Software Intellectual Property License. This
+ * program 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 W3C License
+ * http://www.w3.org/Consortium/Legal/ for more details.
+ */
+
+package org.w3c.domts.level1.html;
+
+import java.lang.reflect.Constructor;
+
+import junit.framework.TestSuite;
+
+
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+import org.w3c.domts.DOMTestSuite;
+import org.w3c.domts.LSDocumentBuilderFactory;
+import org.w3c.domts.JAXPDOMTestDocumentBuilderFactory;
+import org.w3c.domts.JUnitTestSuiteAdapter;
+
+/**
+ * Test suite that runs all DOM L1 HTML tests using the
+ * Default LS parser in an alternate configuration.
+ *
+ * @author Curt Arnold
+ *
+ */
+public class TestDefaultLSAltConfig extends TestSuite {
+
+ public static TestSuite suite() throws Exception {
+ Class testClass =
+ ClassLoader.getSystemClassLoader().loadClass(
+ "org.w3c.domts.level1.html.alltests");
+ Constructor testConstructor =
+ testClass.getConstructor(
+ new Class[] { DOMTestDocumentBuilderFactory.class });
+
+ DOMTestDocumentBuilderFactory factory =
+ new LSDocumentBuilderFactory(
+ JAXPDOMTestDocumentBuilderFactory.getConfiguration2());
+
+ Object test = testConstructor.newInstance(new Object[] { factory });
+
+ return new JUnitTestSuiteAdapter((DOMTestSuite) test);
+ }
+
+}
diff --git a/dom/src/test/java/org/w3c/domts/level1/html/TestXercesHTML.java b/dom/src/test/java/org/w3c/domts/level1/html/TestXercesHTML.java
new file mode 100644
index 0000000..9e9c6dd
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level1/html/TestXercesHTML.java
@@ -0,0 +1,43 @@
+/*
+ * Copyright (c) 2001-2004 World Wide Web Consortium,
+ * (Massachusetts Institute of Technology, Institut National de
+ * Recherche en Informatique et en Automatique, Keio University). All
+ * Rights Reserved. This program is distributed under the W3C's Software
+ * Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+ */
+
+
+package org.w3c.domts.level1.html;
+
+import java.lang.reflect.Constructor;
+
+import junit.framework.TestSuite;
+
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+import org.w3c.domts.DOMTestSuite;
+import org.w3c.domts.JUnitTestSuiteAdapter;
+import org.w3c.domts.XercesHTMLDocumentBuilderFactory;
+
+public class TestXercesHTML extends TestSuite {
+
+ public static TestSuite suite() throws Exception
+ {
+ Class testClass = ClassLoader.getSystemClassLoader().loadClass("org.w3c.domts.level1.html.alltests");
+ Constructor testConstructor = testClass.getConstructor(new Class[] { DOMTestDocumentBuilderFactory.class });
+
+ DOMTestDocumentBuilderFactory factory =
+ new XercesHTMLDocumentBuilderFactory(
+ XercesHTMLDocumentBuilderFactory.getConfiguration1());
+
+ Object test = testConstructor.newInstance(new Object[] { factory });
+
+ return new JUnitTestSuiteAdapter((DOMTestSuite) test);
+ }
+
+
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level2/core/TestBatik.java b/dom/src/test/java/org/w3c/domts/level2/core/TestBatik.java
new file mode 100644
index 0000000..41dc17e
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level2/core/TestBatik.java
@@ -0,0 +1,43 @@
+/*
+ * Copyright (c) 2001-2004 World Wide Web Consortium,
+ * (Massachusetts Institute of Technology, Institut National de
+ * Recherche en Informatique et en Automatique, Keio University). All
+ * Rights Reserved. This program is distributed under the W3C's Software
+ * Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+ */
+
+
+package org.w3c.domts.level2.core;
+
+import java.lang.reflect.Constructor;
+
+import junit.framework.TestSuite;
+
+import org.w3c.domts.BatikTestDocumentBuilderFactory;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+import org.w3c.domts.DOMTestSuite;
+import org.w3c.domts.DocumentBuilderSetting;
+import org.w3c.domts.JUnitTestSuiteAdapter;
+
+public class TestBatik extends TestSuite {
+
+ public static TestSuite suite() throws Exception
+ {
+ Class testClass = ClassLoader.getSystemClassLoader().loadClass("org.w3c.domts.level2.core.alltests");
+ Constructor testConstructor = testClass.getConstructor(new Class[] { DOMTestDocumentBuilderFactory.class });
+
+ DOMTestDocumentBuilderFactory factory =
+ new BatikTestDocumentBuilderFactory(new DocumentBuilderSetting[0]);
+
+ Object test = testConstructor.newInstance(new Object[] { factory });
+
+ return new JUnitTestSuiteAdapter((DOMTestSuite) test);
+ }
+
+
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level2/core/TestCrimson.java b/dom/src/test/java/org/w3c/domts/level2/core/TestCrimson.java
new file mode 100644
index 0000000..ee8fd39
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level2/core/TestCrimson.java
@@ -0,0 +1,48 @@
+/*
+ * Copyright (c) 2001-2004 World Wide Web Consortium,
+ * (Massachusetts Institute of Technology, Institut National de
+ * Recherche en Informatique et en Automatique, Keio University). All
+ * Rights Reserved. This program is distributed under the W3C's Software
+ * Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+ */
+
+
+package org.w3c.domts.level2.core;
+
+import java.lang.reflect.Constructor;
+
+import javax.xml.parsers.DocumentBuilderFactory;
+
+import junit.framework.TestSuite;
+
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+import org.w3c.domts.DOMTestSuite;
+import org.w3c.domts.JAXPDOMTestDocumentBuilderFactory;
+import org.w3c.domts.JUnitTestSuiteAdapter;
+
+public class TestCrimson extends TestSuite {
+
+ public static TestSuite suite() throws Exception
+ {
+ Class testClass = ClassLoader.getSystemClassLoader().loadClass("org.w3c.domts.level2.core.alltests");
+ Constructor testConstructor = testClass.getConstructor(new Class[] { DOMTestDocumentBuilderFactory.class });
+
+ DocumentBuilderFactory crimsonFactory = (DocumentBuilderFactory)
+ ClassLoader.getSystemClassLoader().loadClass("org.apache.crimson.jaxp.DocumentBuilderFactoryImpl").newInstance();
+
+ DOMTestDocumentBuilderFactory factory =
+ new JAXPDOMTestDocumentBuilderFactory(crimsonFactory,
+ JAXPDOMTestDocumentBuilderFactory.getConfiguration1());
+
+ Object test = testConstructor.newInstance(new Object[] { factory });
+
+ return new JUnitTestSuiteAdapter((DOMTestSuite) test);
+ }
+
+
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level2/core/TestCrimsonAltConfig.java b/dom/src/test/java/org/w3c/domts/level2/core/TestCrimsonAltConfig.java
new file mode 100644
index 0000000..1ac4fc0
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level2/core/TestCrimsonAltConfig.java
@@ -0,0 +1,48 @@
+/*
+ * Copyright (c) 2001-2004 World Wide Web Consortium,
+ * (Massachusetts Institute of Technology, Institut National de
+ * Recherche en Informatique et en Automatique, Keio University). All
+ * Rights Reserved. This program is distributed under the W3C's Software
+ * Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+ */
+
+
+package org.w3c.domts.level2.core;
+
+import java.lang.reflect.Constructor;
+
+import javax.xml.parsers.DocumentBuilderFactory;
+
+import junit.framework.TestSuite;
+
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+import org.w3c.domts.DOMTestSuite;
+import org.w3c.domts.JAXPDOMTestDocumentBuilderFactory;
+import org.w3c.domts.JUnitTestSuiteAdapter;
+
+public class TestCrimsonAltConfig extends TestSuite {
+
+ public static TestSuite suite() throws Exception
+ {
+ Class testClass = ClassLoader.getSystemClassLoader().loadClass("org.w3c.domts.level2.core.alltests");
+ Constructor testConstructor = testClass.getConstructor(new Class[] { DOMTestDocumentBuilderFactory.class });
+
+ DocumentBuilderFactory crimsonFactory = (DocumentBuilderFactory)
+ ClassLoader.getSystemClassLoader().loadClass("org.apache.crimson.jaxp.DocumentBuilderFactoryImpl").newInstance();
+
+ DOMTestDocumentBuilderFactory factory =
+ new JAXPDOMTestDocumentBuilderFactory(crimsonFactory,
+ JAXPDOMTestDocumentBuilderFactory.getConfiguration2());
+
+ Object test = testConstructor.newInstance(new Object[] { factory });
+
+ return new JUnitTestSuiteAdapter((DOMTestSuite) test);
+ }
+
+
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level2/core/TestDOM4J.java b/dom/src/test/java/org/w3c/domts/level2/core/TestDOM4J.java
new file mode 100644
index 0000000..576842f
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level2/core/TestDOM4J.java
@@ -0,0 +1,43 @@
+/*
+ * Copyright (c) 2001-2004 World Wide Web Consortium,
+ * (Massachusetts Institute of Technology, Institut National de
+ * Recherche en Informatique et en Automatique, Keio University). All
+ * Rights Reserved. This program is distributed under the W3C's Software
+ * Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+ */
+
+
+package org.w3c.domts.level2.core;
+
+import java.lang.reflect.Constructor;
+
+import junit.framework.TestSuite;
+
+import org.w3c.domts.DOM4JTestDocumentBuilderFactory;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+import org.w3c.domts.DOMTestSuite;
+import org.w3c.domts.DocumentBuilderSetting;
+import org.w3c.domts.JUnitTestSuiteAdapter;
+
+public class TestDOM4J extends TestSuite {
+
+ public static TestSuite suite() throws Exception
+ {
+ Class testClass = ClassLoader.getSystemClassLoader().loadClass("org.w3c.domts.level2.core.alltests");
+ Constructor testConstructor = testClass.getConstructor(new Class[] { DOMTestDocumentBuilderFactory.class });
+
+ DOMTestDocumentBuilderFactory factory =
+ new DOM4JTestDocumentBuilderFactory(new DocumentBuilderSetting[0]);
+
+ Object test = testConstructor.newInstance(new Object[] { factory });
+
+ return new JUnitTestSuiteAdapter((DOMTestSuite) test);
+ }
+
+
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level2/core/TestDefaultLS.java b/dom/src/test/java/org/w3c/domts/level2/core/TestDefaultLS.java
new file mode 100644
index 0000000..ed86cd5
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level2/core/TestDefaultLS.java
@@ -0,0 +1,50 @@
+/*
+ * Copyright (c) 2001-2004 World Wide Web Consortium, (Massachusetts Institute
+ * of Technology, Institut National de Recherche en Informatique et en
+ * Automatique, Keio University). All Rights Reserved. This program is
+ * distributed under the W3C's Software Intellectual Property License. This
+ * program 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 W3C License
+ * http://www.w3.org/Consortium/Legal/ for more details.
+ */
+
+package org.w3c.domts.level2.core;
+
+import java.lang.reflect.Constructor;
+
+import junit.framework.TestSuite;
+
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+import org.w3c.domts.DOMTestSuite;
+import org.w3c.domts.JAXPDOMTestDocumentBuilderFactory;
+import org.w3c.domts.JUnitTestSuiteAdapter;
+import org.w3c.domts.LSDocumentBuilderFactory;
+
+/**
+ * Test suite that runs all DOM L2 Core tests using the
+ * Default LS parser in default configuration.
+ *
+ * @author Curt Arnold
+ *
+ */
+public class TestDefaultLS extends TestSuite {
+
+ public static TestSuite suite() throws Exception {
+ Class testClass =
+ ClassLoader.getSystemClassLoader().loadClass(
+ "org.w3c.domts.level2.core.alltests");
+ Constructor testConstructor =
+ testClass.getConstructor(
+ new Class[] { DOMTestDocumentBuilderFactory.class });
+
+ DOMTestDocumentBuilderFactory factory =
+ new LSDocumentBuilderFactory(
+ JAXPDOMTestDocumentBuilderFactory.getConfiguration1());
+
+ Object test = testConstructor.newInstance(new Object[] { factory });
+
+ return new JUnitTestSuiteAdapter((DOMTestSuite) test);
+ }
+
+}
diff --git a/dom/src/test/java/org/w3c/domts/level2/core/TestDefaultLSAltConfig.java b/dom/src/test/java/org/w3c/domts/level2/core/TestDefaultLSAltConfig.java
new file mode 100644
index 0000000..b253302
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level2/core/TestDefaultLSAltConfig.java
@@ -0,0 +1,51 @@
+/*
+ * Copyright (c) 2001-2004 World Wide Web Consortium, (Massachusetts Institute
+ * of Technology, Institut National de Recherche en Informatique et en
+ * Automatique, Keio University). All Rights Reserved. This program is
+ * distributed under the W3C's Software Intellectual Property License. This
+ * program 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 W3C License
+ * http://www.w3.org/Consortium/Legal/ for more details.
+ */
+
+package org.w3c.domts.level2.core;
+
+import java.lang.reflect.Constructor;
+
+import junit.framework.TestSuite;
+
+
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+import org.w3c.domts.DOMTestSuite;
+import org.w3c.domts.LSDocumentBuilderFactory;
+import org.w3c.domts.JAXPDOMTestDocumentBuilderFactory;
+import org.w3c.domts.JUnitTestSuiteAdapter;
+
+/**
+ * Test suite that runs all DOM L2 Core tests using the
+ * Default LS parser in an alternate configuration
+ *
+ * @author Curt Arnold
+ *
+ */
+public class TestDefaultLSAltConfig extends TestSuite {
+
+ public static TestSuite suite() throws Exception {
+ Class testClass =
+ ClassLoader.getSystemClassLoader().loadClass(
+ "org.w3c.domts.level2.core.alltests");
+ Constructor testConstructor =
+ testClass.getConstructor(
+ new Class[] { DOMTestDocumentBuilderFactory.class });
+
+ DOMTestDocumentBuilderFactory factory =
+ new LSDocumentBuilderFactory(
+ JAXPDOMTestDocumentBuilderFactory.getConfiguration2());
+
+ Object test = testConstructor.newInstance(new Object[] { factory });
+
+ return new JUnitTestSuiteAdapter((DOMTestSuite) test);
+ }
+
+}
diff --git a/dom/src/test/java/org/w3c/domts/level2/core/TestDefaultParser.java b/dom/src/test/java/org/w3c/domts/level2/core/TestDefaultParser.java
new file mode 100644
index 0000000..2a8b093
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level2/core/TestDefaultParser.java
@@ -0,0 +1,53 @@
+/*
+ * Copyright (c) 2001-2004 World Wide Web Consortium,
+ * (Massachusetts Institute of Technology, Institut National de
+ * Recherche en Informatique et en Automatique, Keio University). All
+ * Rights Reserved. This program is distributed under the W3C's Software
+ * Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+ */
+
+
+package org.w3c.domts.level2.core;
+
+import java.lang.reflect.Constructor;
+
+import junit.framework.TestSuite;
+
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+import org.w3c.domts.DOMTestSuite;
+import org.w3c.domts.JAXPDOMTestDocumentBuilderFactory;
+import org.w3c.domts.JUnitTestSuiteAdapter;
+
+/**
+ * Test suite using the default JAXP parser in the default configuration
+ *
+ *
+ */
+public class TestDefaultParser extends TestSuite {
+
+ /**
+ * Create a new instance of the test suite
+ * @return new test suite
+ * @exception Exception if tests or implementation can be created.
+ */
+ public static TestSuite suite() throws Exception
+ {
+ Class testClass = ClassLoader.getSystemClassLoader().loadClass("org.w3c.domts.level2.core.alltests");
+ Constructor testConstructor = testClass.getConstructor(new Class[] { DOMTestDocumentBuilderFactory.class });
+
+ DOMTestDocumentBuilderFactory factory =
+ new JAXPDOMTestDocumentBuilderFactory(null,
+ JAXPDOMTestDocumentBuilderFactory.getConfiguration1());
+
+ Object test = testConstructor.newInstance(new Object[] { factory });
+
+ return new JUnitTestSuiteAdapter((DOMTestSuite) test);
+ }
+
+
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level2/core/TestDefaultParserAltConfig.java b/dom/src/test/java/org/w3c/domts/level2/core/TestDefaultParserAltConfig.java
new file mode 100644
index 0000000..69ac3c6
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level2/core/TestDefaultParserAltConfig.java
@@ -0,0 +1,56 @@
+/*
+ * Copyright (c) 2001-2004 World Wide Web Consortium,
+ * (Massachusetts Institute of Technology, Institut National de
+ * Recherche en Informatique et en Automatique, Keio University). All
+ * Rights Reserved. This program is distributed under the W3C's Software
+ * Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+ */
+
+
+package org.w3c.domts.level2.core;
+
+import java.lang.reflect.Constructor;
+
+import junit.framework.TestSuite;
+
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+import org.w3c.domts.DOMTestSuite;
+import org.w3c.domts.JAXPDOMTestDocumentBuilderFactory;
+import org.w3c.domts.JUnitTestSuiteAdapter;
+
+
+
+/**
+ * Test suite using the default JAXP parser in the alternative configuration
+ *
+ *
+ */
+public class TestDefaultParserAltConfig extends TestSuite {
+
+ /**
+ * Create a new instance of the test suite
+ * @return new test suite
+ * @exception Exception if tests or implementation can be created.
+ */
+
+ public static TestSuite suite() throws Exception
+ {
+ Class testClass = ClassLoader.getSystemClassLoader().loadClass("org.w3c.domts.level2.core.alltests");
+ Constructor testConstructor = testClass.getConstructor(new Class[] { DOMTestDocumentBuilderFactory.class });
+
+ DOMTestDocumentBuilderFactory factory =
+ new JAXPDOMTestDocumentBuilderFactory(null,
+ JAXPDOMTestDocumentBuilderFactory.getConfiguration2());
+
+ Object test = testConstructor.newInstance(new Object[] { factory });
+
+ return new JUnitTestSuiteAdapter((DOMTestSuite) test);
+ }
+
+
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level2/core/TestGNUJAXP.java b/dom/src/test/java/org/w3c/domts/level2/core/TestGNUJAXP.java
new file mode 100644
index 0000000..c703b3c
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level2/core/TestGNUJAXP.java
@@ -0,0 +1,51 @@
+/*
+ * Copyright (c) 2001-2004 World Wide Web Consortium,
+ * (Massachusetts Institute of Technology, Institut National de
+ * Recherche en Informatique et en Automatique, Keio University). All
+ * Rights Reserved. This program is distributed under the W3C's Software
+ * Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+ */
+
+
+package org.w3c.domts.level2.core;
+
+import java.lang.reflect.Constructor;
+
+import javax.xml.parsers.DocumentBuilderFactory;
+
+import junit.framework.TestSuite;
+
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+import org.w3c.domts.DOMTestSuite;
+import org.w3c.domts.JAXPDOMTestDocumentBuilderFactory;
+import org.w3c.domts.JUnitTestSuiteAdapter;
+
+public class TestGNUJAXP extends TestSuite {
+
+ public static TestSuite suite() throws Exception
+ {
+ Class testClass = ClassLoader.getSystemClassLoader().loadClass("org.w3c.domts.level2.core.alltests");
+ Constructor testConstructor = testClass.getConstructor(new Class[] { DOMTestDocumentBuilderFactory.class });
+
+
+ DocumentBuilderFactory gnujaxpFactory = (DocumentBuilderFactory)
+ ClassLoader.getSystemClassLoader().
+ loadClass("gnu.xml.dom.JAXPFactory").newInstance();
+
+ DOMTestDocumentBuilderFactory factory =
+ new JAXPDOMTestDocumentBuilderFactory(gnujaxpFactory,
+ JAXPDOMTestDocumentBuilderFactory.getConfiguration1());
+
+
+ Object test = testConstructor.newInstance(new Object[] { factory });
+
+ return new JUnitTestSuiteAdapter((DOMTestSuite) test);
+ }
+
+
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level2/core/TestGNUJAXPAltConfig.java b/dom/src/test/java/org/w3c/domts/level2/core/TestGNUJAXPAltConfig.java
new file mode 100644
index 0000000..26a5b59
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level2/core/TestGNUJAXPAltConfig.java
@@ -0,0 +1,49 @@
+/*
+ * Copyright (c) 2001-2004 World Wide Web Consortium,
+ * (Massachusetts Institute of Technology, Institut National de
+ * Recherche en Informatique et en Automatique, Keio University). All
+ * Rights Reserved. This program is distributed under the W3C's Software
+ * Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+ */
+
+
+package org.w3c.domts.level2.core;
+
+import java.lang.reflect.Constructor;
+
+import javax.xml.parsers.DocumentBuilderFactory;
+
+import junit.framework.TestSuite;
+
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+import org.w3c.domts.DOMTestSuite;
+import org.w3c.domts.JAXPDOMTestDocumentBuilderFactory;
+import org.w3c.domts.JUnitTestSuiteAdapter;
+
+public class TestGNUJAXPAltConfig extends TestSuite {
+
+ public static TestSuite suite() throws Exception
+ {
+ Class testClass = ClassLoader.getSystemClassLoader().loadClass("org.w3c.domts.level2.core.alltests");
+ Constructor testConstructor = testClass.getConstructor(new Class[] { DOMTestDocumentBuilderFactory.class });
+
+ DocumentBuilderFactory gnujaxpFactory = (DocumentBuilderFactory)
+ ClassLoader.getSystemClassLoader().
+ loadClass("gnu.xml.dom.JAXPFactory").newInstance();
+
+ DOMTestDocumentBuilderFactory factory =
+ new JAXPDOMTestDocumentBuilderFactory(gnujaxpFactory,
+ JAXPDOMTestDocumentBuilderFactory.getConfiguration2());
+
+ Object test = testConstructor.newInstance(new Object[] { factory });
+
+ return new JUnitTestSuiteAdapter((DOMTestSuite) test);
+ }
+
+
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level2/core/TestJTidy.java b/dom/src/test/java/org/w3c/domts/level2/core/TestJTidy.java
new file mode 100644
index 0000000..77e240d
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level2/core/TestJTidy.java
@@ -0,0 +1,41 @@
+/*
+ * Copyright (c) 2001-2004 World Wide Web Consortium,
+ * (Massachusetts Institute of Technology, Institut National de
+ * Recherche en Informatique et en Automatique, Keio University). All
+ * Rights Reserved. This program is distributed under the W3C's Software
+ * Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+ */
+
+
+package org.w3c.domts.level2.core;
+
+import java.lang.reflect.Constructor;
+
+import junit.framework.TestSuite;
+
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+import org.w3c.domts.DOMTestSuite;
+import org.w3c.domts.DocumentBuilderSetting;
+import org.w3c.domts.JTidyDocumentBuilderFactory;
+import org.w3c.domts.JUnitTestSuiteAdapter;
+
+public class TestJTidy extends TestSuite {
+
+ public static TestSuite suite() throws Exception
+ {
+ Class testClass = ClassLoader.getSystemClassLoader().loadClass("org.w3c.domts.level2.core.alltests");
+ Constructor testConstructor = testClass.getConstructor(new Class[] { DOMTestDocumentBuilderFactory.class });
+
+ DOMTestDocumentBuilderFactory factory =
+ new JTidyDocumentBuilderFactory(new DocumentBuilderSetting[0]);
+
+ Object test = testConstructor.newInstance(new Object[] { factory });
+
+ return new JUnitTestSuiteAdapter((DOMTestSuite) test);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level2/core/TestOracle.java b/dom/src/test/java/org/w3c/domts/level2/core/TestOracle.java
new file mode 100644
index 0000000..cf1c9e9
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level2/core/TestOracle.java
@@ -0,0 +1,63 @@
+/*
+ * Copyright (c) 2001-2004 World Wide Web Consortium, (Massachusetts Institute of
+ * Technology, Institut National de Recherche en Informatique et en
+ * Automatique, Keio University). All Rights Reserved. This program is
+ * distributed under the W3C's Software Intellectual Property License. This
+ * program 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 W3C License
+ * http://www.w3.org/Consortium/Legal/ for more details.
+ */
+
+package org.w3c.domts.level2.core;
+
+import java.lang.reflect.Constructor;
+
+import javax.xml.parsers.DocumentBuilderFactory;
+
+import junit.framework.TestSuite;
+
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+import org.w3c.domts.DOMTestSuite;
+import org.w3c.domts.JAXPDOMTestDocumentBuilderFactory;
+import org.w3c.domts.JUnitTestSuiteAdapter;
+
+/**
+ * Test suite that runs all DOM L2 Core tests using the
+ * Oracle Parser for Java in default configuration.
+ *
+ * @author Curt Arnold
+ *
+ */
+public class TestOracle extends TestSuite {
+
+ /**
+ * Constructor
+ * @return test suite
+ * @throws Exception
+ */
+ public static TestSuite suite() throws Exception {
+ Class testClass =
+ ClassLoader.getSystemClassLoader().loadClass(
+ "org.w3c.domts.level2.core.alltests");
+ Constructor testConstructor =
+ testClass.getConstructor(
+ new Class[] { DOMTestDocumentBuilderFactory.class });
+
+ DocumentBuilderFactory oracleFactory =
+ (DocumentBuilderFactory) ClassLoader
+ .getSystemClassLoader()
+ .loadClass("oracle.xml.jaxp.JXDocumentBuilderFactory")
+ .newInstance();
+
+ DOMTestDocumentBuilderFactory factory =
+ new JAXPDOMTestDocumentBuilderFactory(
+ oracleFactory,
+ JAXPDOMTestDocumentBuilderFactory.getConfiguration1());
+
+ Object test = testConstructor.newInstance(new Object[] { factory });
+
+ return new JUnitTestSuiteAdapter((DOMTestSuite) test);
+ }
+
+}
diff --git a/dom/src/test/java/org/w3c/domts/level2/core/TestOracleAltConfig.java b/dom/src/test/java/org/w3c/domts/level2/core/TestOracleAltConfig.java
new file mode 100644
index 0000000..80d951e
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level2/core/TestOracleAltConfig.java
@@ -0,0 +1,62 @@
+/*
+ * Copyright (c) 2001-2004 World Wide Web Consortium, (Massachusetts Institute of
+ * Technology, Institut National de Recherche en Informatique et en
+ * Automatique, Keio University). All Rights Reserved. This program is
+ * distributed under the W3C's Software Intellectual Property License. This
+ * program 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 W3C License
+ * http://www.w3.org/Consortium/Legal/ for more details.
+ */
+
+package org.w3c.domts.level2.core;
+
+import java.lang.reflect.Constructor;
+
+import javax.xml.parsers.DocumentBuilderFactory;
+
+import junit.framework.TestSuite;
+
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+import org.w3c.domts.DOMTestSuite;
+import org.w3c.domts.JAXPDOMTestDocumentBuilderFactory;
+import org.w3c.domts.JUnitTestSuiteAdapter;
+
+/**
+ * Test suite that runs all DOM L2 Core tests using the
+ * Oracle Parser for Java in default configuration.
+ *
+ * @author Curt Arnold
+ *
+ */
+public class TestOracleAltConfig extends TestSuite {
+ /**
+ * Constructor
+ * @return test suite
+ * @throws Exception
+ */
+ public static TestSuite suite() throws Exception {
+ Class testClass =
+ ClassLoader.getSystemClassLoader().loadClass(
+ "org.w3c.domts.level2.core.alltests");
+ Constructor testConstructor =
+ testClass.getConstructor(
+ new Class[] { DOMTestDocumentBuilderFactory.class });
+
+ DocumentBuilderFactory oracleFactory =
+ (DocumentBuilderFactory) ClassLoader
+ .getSystemClassLoader()
+ .loadClass("oracle.xml.jaxp.JXDocumentBuilderFactory")
+ .newInstance();
+
+ DOMTestDocumentBuilderFactory factory =
+ new JAXPDOMTestDocumentBuilderFactory(
+ oracleFactory,
+ JAXPDOMTestDocumentBuilderFactory.getConfiguration2());
+
+ Object test = testConstructor.newInstance(new Object[] { factory });
+
+ return new JUnitTestSuiteAdapter((DOMTestSuite) test);
+ }
+
+}
diff --git a/dom/src/test/java/org/w3c/domts/level2/core/TestXerces.java b/dom/src/test/java/org/w3c/domts/level2/core/TestXerces.java
new file mode 100644
index 0000000..44c8678
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level2/core/TestXerces.java
@@ -0,0 +1,49 @@
+/*
+ * Copyright (c) 2001-2004 World Wide Web Consortium,
+ * (Massachusetts Institute of Technology, Institut National de
+ * Recherche en Informatique et en Automatique, Keio University). All
+ * Rights Reserved. This program is distributed under the W3C's Software
+ * Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+ */
+
+
+package org.w3c.domts.level2.core;
+
+import java.lang.reflect.Constructor;
+
+import javax.xml.parsers.DocumentBuilderFactory;
+
+import junit.framework.TestSuite;
+
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+import org.w3c.domts.DOMTestSuite;
+import org.w3c.domts.JAXPDOMTestDocumentBuilderFactory;
+import org.w3c.domts.JUnitTestSuiteAdapter;
+
+public class TestXerces extends TestSuite {
+
+ public static TestSuite suite() throws Exception
+ {
+ Class testClass = ClassLoader.getSystemClassLoader().loadClass("org.w3c.domts.level2.core.alltests");
+ Constructor testConstructor = testClass.getConstructor(new Class[] { DOMTestDocumentBuilderFactory.class });
+
+ DocumentBuilderFactory xercesFactory = (DocumentBuilderFactory)
+ ClassLoader.getSystemClassLoader().loadClass("org.apache.xerces.jaxp.DocumentBuilderFactoryImpl").newInstance();
+
+ DOMTestDocumentBuilderFactory factory =
+ new JAXPDOMTestDocumentBuilderFactory(xercesFactory,
+ JAXPDOMTestDocumentBuilderFactory.getConfiguration1());
+
+
+ Object test = testConstructor.newInstance(new Object[] { factory });
+
+ return new JUnitTestSuiteAdapter((DOMTestSuite) test);
+ }
+
+
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level2/core/TestXercesAltConfig.java b/dom/src/test/java/org/w3c/domts/level2/core/TestXercesAltConfig.java
new file mode 100644
index 0000000..17067bb
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level2/core/TestXercesAltConfig.java
@@ -0,0 +1,48 @@
+/*
+ * Copyright (c) 2001-2004 World Wide Web Consortium,
+ * (Massachusetts Institute of Technology, Institut National de
+ * Recherche en Informatique et en Automatique, Keio University). All
+ * Rights Reserved. This program is distributed under the W3C's Software
+ * Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+ */
+
+
+package org.w3c.domts.level2.core;
+
+import java.lang.reflect.Constructor;
+
+import javax.xml.parsers.DocumentBuilderFactory;
+
+import junit.framework.TestSuite;
+
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+import org.w3c.domts.DOMTestSuite;
+import org.w3c.domts.JAXPDOMTestDocumentBuilderFactory;
+import org.w3c.domts.JUnitTestSuiteAdapter;
+
+public class TestXercesAltConfig extends TestSuite {
+
+ public static TestSuite suite() throws Exception
+ {
+ Class testClass = ClassLoader.getSystemClassLoader().loadClass("org.w3c.domts.level2.core.alltests");
+ Constructor testConstructor = testClass.getConstructor(new Class[] { DOMTestDocumentBuilderFactory.class });
+
+ DocumentBuilderFactory xercesFactory = (DocumentBuilderFactory)
+ ClassLoader.getSystemClassLoader().loadClass("org.apache.xerces.jaxp.DocumentBuilderFactoryImpl").newInstance();
+
+ DOMTestDocumentBuilderFactory factory =
+ new JAXPDOMTestDocumentBuilderFactory(xercesFactory,
+ JAXPDOMTestDocumentBuilderFactory.getConfiguration2());
+
+ Object test = testConstructor.newInstance(new Object[] { factory });
+
+ return new JUnitTestSuiteAdapter((DOMTestSuite) test);
+ }
+
+
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level2/core/alltests.java b/dom/src/test/java/org/w3c/domts/level2/core/alltests.java
new file mode 100644
index 0000000..2eb9368
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level2/core/alltests.java
@@ -0,0 +1,350 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+Copyright (c) 2001-2004 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+*/
+
+package org.w3c.domts.level2.core;
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestSuite;
+import org.w3c.domts.DOMTestSink;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+/**
+ *
+* @author DOM Test Suite Project
+*/
+public class alltests extends DOMTestSuite {
+
+ /**
+ * Constructor
+ * @param factory document factory, may not be null
+ * @throws Exception Thrown if test is not compatible with settings
+ */
+ public alltests(DOMTestDocumentBuilderFactory factory) throws Exception {
+ super(factory);
+
+ setFactory(factory);
+ }
+
+ /**
+ * Build test suite by adding each test to the test sink
+ * @param sink test sink
+ */
+ public void build(DOMTestSink sink) {
+ sink.addTest(attrgetownerelement01.class);
+ sink.addTest(attrgetownerelement02.class);
+ sink.addTest(attrgetownerelement03.class);
+ sink.addTest(attrgetownerelement04.class);
+ sink.addTest(attrgetownerelement05.class);
+ sink.addTest(createAttributeNS01.class);
+ sink.addTest(createAttributeNS02.class);
+ sink.addTest(createAttributeNS03.class);
+ sink.addTest(createAttributeNS04.class);
+ sink.addTest(createAttributeNS05.class);
+// sink.addTest(createAttributeNS06.class);
+ sink.addTest(createDocument01.class);
+ sink.addTest(createDocument02.class);
+// sink.addTest(createDocument03.class);
+// sink.addTest(createDocument04.class);
+ sink.addTest(createDocument05.class);
+ sink.addTest(createDocument06.class);
+ sink.addTest(createDocument07.class);
+// sink.addTest(createDocument08.class);
+ sink.addTest(createDocumentType01.class);
+ sink.addTest(createDocumentType02.class);
+ sink.addTest(createDocumentType03.class);
+// sink.addTest(createDocumentType04.class);
+ sink.addTest(createElementNS01.class);
+ sink.addTest(createElementNS02.class);
+ sink.addTest(createElementNS03.class);
+ sink.addTest(createElementNS04.class);
+ sink.addTest(createElementNS05.class);
+ sink.addTest(documentcreateattributeNS01.class);
+ sink.addTest(documentcreateattributeNS02.class);
+ sink.addTest(documentcreateattributeNS03.class);
+ sink.addTest(documentcreateattributeNS04.class);
+ sink.addTest(documentcreateattributeNS05.class);
+ sink.addTest(documentcreateattributeNS06.class);
+ sink.addTest(documentcreateattributeNS07.class);
+ sink.addTest(documentcreateelementNS01.class);
+ sink.addTest(documentcreateelementNS02.class);
+ sink.addTest(documentcreateelementNS05.class);
+ sink.addTest(documentcreateelementNS06.class);
+ sink.addTest(documentgetelementbyid01.class);
+ sink.addTest(documentgetelementsbytagnameNS01.class);
+ sink.addTest(documentgetelementsbytagnameNS02.class);
+ sink.addTest(documentgetelementsbytagnameNS03.class);
+ sink.addTest(documentgetelementsbytagnameNS04.class);
+ sink.addTest(documentgetelementsbytagnameNS05.class);
+// sink.addTest(documentimportnode01.class);
+ sink.addTest(documentimportnode02.class);
+ sink.addTest(documentimportnode03.class);
+ sink.addTest(documentimportnode04.class);
+ sink.addTest(documentimportnode05.class);
+ sink.addTest(documentimportnode06.class);
+ sink.addTest(documentimportnode07.class);
+ sink.addTest(documentimportnode08.class);
+ sink.addTest(documentimportnode09.class);
+ sink.addTest(documentimportnode10.class);
+ sink.addTest(documentimportnode11.class);
+ sink.addTest(documentimportnode12.class);
+ sink.addTest(documentimportnode13.class);
+// sink.addTest(documentimportnode14.class);
+ sink.addTest(documentimportnode15.class);
+ sink.addTest(documentimportnode17.class);
+ sink.addTest(documentimportnode18.class);
+// sink.addTest(documentimportnode19.class);
+// sink.addTest(documentimportnode20.class);
+// sink.addTest(documentimportnode21.class);
+// sink.addTest(documentimportnode22.class);
+ sink.addTest(documenttypeinternalSubset01.class);
+ sink.addTest(documenttypepublicid01.class);
+ sink.addTest(documenttypesystemid01.class);
+ sink.addTest(domimplementationcreatedocument03.class);
+ sink.addTest(domimplementationcreatedocument04.class);
+ sink.addTest(domimplementationcreatedocument05.class);
+ sink.addTest(domimplementationcreatedocument07.class);
+ sink.addTest(domimplementationcreatedocumenttype01.class);
+ sink.addTest(domimplementationcreatedocumenttype02.class);
+ sink.addTest(domimplementationcreatedocumenttype04.class);
+ sink.addTest(domimplementationfeaturecore.class);
+ sink.addTest(domimplementationfeaturexmlversion2.class);
+ sink.addTest(domimplementationhasfeature01.class);
+ sink.addTest(domimplementationhasfeature02.class);
+ sink.addTest(elementgetattributenodens01.class);
+ sink.addTest(elementgetattributenodens02.class);
+ sink.addTest(elementgetattributenodens03.class);
+ sink.addTest(elementgetattributens02.class);
+ sink.addTest(elementgetelementsbytagnamens02.class);
+ sink.addTest(elementgetelementsbytagnamens04.class);
+ sink.addTest(elementgetelementsbytagnamens05.class);
+ sink.addTest(elementhasattribute01.class);
+ sink.addTest(elementhasattribute02.class);
+ sink.addTest(elementhasattribute03.class);
+ sink.addTest(elementhasattribute04.class);
+// sink.addTest(elementhasattributens01.class);
+ sink.addTest(elementhasattributens02.class);
+ sink.addTest(elementhasattributens03.class);
+ sink.addTest(elementremoveattributens01.class);
+ sink.addTest(elementsetattributenodens01.class);
+ sink.addTest(elementsetattributenodens02.class);
+ sink.addTest(elementsetattributenodens03.class);
+ sink.addTest(elementsetattributenodens04.class);
+ sink.addTest(elementsetattributenodens05.class);
+// sink.addTest(elementsetattributenodens06.class);
+ sink.addTest(elementsetattributens01.class);
+ sink.addTest(elementsetattributens02.class);
+ sink.addTest(elementsetattributens03.class);
+ sink.addTest(elementsetattributens04.class);
+ sink.addTest(elementsetattributens05.class);
+ sink.addTest(elementsetattributens08.class);
+ sink.addTest(elementsetattributensurinull.class);
+ sink.addTest(getAttributeNS01.class);
+ sink.addTest(getAttributeNS02.class);
+ sink.addTest(getAttributeNS03.class);
+ sink.addTest(getAttributeNS04.class);
+ sink.addTest(getAttributeNS05.class);
+ sink.addTest(getAttributeNodeNS01.class);
+ sink.addTest(getAttributeNodeNS02.class);
+ sink.addTest(getElementById01.class);
+ sink.addTest(getElementById02.class);
+// sink.addTest(getElementsByTagNameNS01.class);
+ sink.addTest(getElementsByTagNameNS02.class);
+ sink.addTest(getElementsByTagNameNS03.class);
+ sink.addTest(getElementsByTagNameNS04.class);
+ sink.addTest(getElementsByTagNameNS05.class);
+ sink.addTest(getElementsByTagNameNS06.class);
+ sink.addTest(getElementsByTagNameNS07.class);
+ sink.addTest(getElementsByTagNameNS08.class);
+ sink.addTest(getElementsByTagNameNS09.class);
+ sink.addTest(getElementsByTagNameNS10.class);
+ sink.addTest(getElementsByTagNameNS11.class);
+ sink.addTest(getElementsByTagNameNS12.class);
+ sink.addTest(getElementsByTagNameNS13.class);
+ sink.addTest(getElementsByTagNameNS14.class);
+ sink.addTest(getNamedItemNS01.class);
+ sink.addTest(getNamedItemNS02.class);
+// sink.addTest(getNamedItemNS03.class);
+// sink.addTest(getNamedItemNS04.class);
+ sink.addTest(hasAttribute01.class);
+ sink.addTest(hasAttribute02.class);
+ sink.addTest(hasAttribute03.class);
+ sink.addTest(hasAttribute04.class);
+ sink.addTest(hasAttributeNS01.class);
+ sink.addTest(hasAttributeNS02.class);
+ sink.addTest(hasAttributeNS03.class);
+ sink.addTest(hasAttributeNS04.class);
+ sink.addTest(hasAttributeNS05.class);
+ sink.addTest(hasAttributes01.class);
+ sink.addTest(hasAttributes02.class);
+// sink.addTest(hc_entitiesremovenameditemns1.class);
+// sink.addTest(hc_entitiessetnameditemns1.class);
+ sink.addTest(hc_namednodemapinvalidtype1.class);
+ sink.addTest(hc_nodedocumentfragmentnormalize1.class);
+ sink.addTest(hc_nodedocumentfragmentnormalize2.class);
+// sink.addTest(hc_notationsremovenameditemns1.class);
+// sink.addTest(hc_notationssetnameditemns1.class);
+// sink.addTest(importNode01.class);
+ sink.addTest(importNode02.class);
+ sink.addTest(importNode03.class);
+ sink.addTest(importNode04.class);
+// sink.addTest(importNode05.class);
+// sink.addTest(importNode06.class);
+ sink.addTest(importNode07.class);
+ sink.addTest(importNode08.class);
+// sink.addTest(importNode09.class);
+ sink.addTest(importNode10.class);
+// sink.addTest(importNode11.class);
+// sink.addTest(importNode12.class);
+// sink.addTest(importNode13.class);
+ sink.addTest(importNode14.class);
+ sink.addTest(importNode15.class);
+ sink.addTest(importNode16.class);
+ sink.addTest(importNode17.class);
+ sink.addTest(internalSubset01.class);
+ sink.addTest(isSupported01.class);
+ sink.addTest(isSupported02.class);
+ sink.addTest(isSupported04.class);
+ sink.addTest(isSupported05.class);
+ sink.addTest(isSupported06.class);
+ sink.addTest(isSupported07.class);
+ sink.addTest(isSupported09.class);
+ sink.addTest(isSupported10.class);
+ sink.addTest(isSupported11.class);
+ sink.addTest(isSupported12.class);
+ sink.addTest(isSupported13.class);
+ sink.addTest(isSupported14.class);
+ sink.addTest(localName01.class);
+ sink.addTest(localName02.class);
+ sink.addTest(localName03.class);
+ sink.addTest(localName04.class);
+// sink.addTest(namednodemapgetnameditemns01.class);
+ sink.addTest(namednodemapgetnameditemns02.class);
+ sink.addTest(namednodemapgetnameditemns03.class);
+ sink.addTest(namednodemapgetnameditemns04.class);
+ sink.addTest(namednodemapgetnameditemns05.class);
+ sink.addTest(namednodemapgetnameditemns06.class);
+ sink.addTest(namednodemapremovenameditemns01.class);
+ sink.addTest(namednodemapremovenameditemns02.class);
+ sink.addTest(namednodemapremovenameditemns03.class);
+// sink.addTest(namednodemapremovenameditemns04.class);
+// sink.addTest(namednodemapremovenameditemns05.class);
+ sink.addTest(namednodemapremovenameditemns06.class);
+ sink.addTest(namednodemapremovenameditemns07.class);
+ sink.addTest(namednodemapremovenameditemns08.class);
+ sink.addTest(namednodemapremovenameditemns09.class);
+ sink.addTest(namednodemapsetnameditemns01.class);
+ sink.addTest(namednodemapsetnameditemns02.class);
+ sink.addTest(namednodemapsetnameditemns03.class);
+ sink.addTest(namednodemapsetnameditemns04.class);
+// sink.addTest(namednodemapsetnameditemns05.class);
+ sink.addTest(namednodemapsetnameditemns06.class);
+ sink.addTest(namednodemapsetnameditemns07.class);
+ sink.addTest(namednodemapsetnameditemns08.class);
+// sink.addTest(namednodemapsetnameditemns09.class);
+// sink.addTest(namednodemapsetnameditemns10.class);
+// sink.addTest(namednodemapsetnameditemns11.class);
+ sink.addTest(namespaceURI01.class);
+ sink.addTest(namespaceURI02.class);
+ sink.addTest(namespaceURI03.class);
+ sink.addTest(namespaceURI04.class);
+ sink.addTest(nodegetlocalname03.class);
+ sink.addTest(nodegetnamespaceuri03.class);
+ sink.addTest(nodegetownerdocument01.class);
+ sink.addTest(nodegetownerdocument02.class);
+ sink.addTest(nodegetprefix03.class);
+ sink.addTest(nodehasattributes01.class);
+ sink.addTest(nodehasattributes02.class);
+ sink.addTest(nodehasattributes03.class);
+ sink.addTest(nodehasattributes04.class);
+ sink.addTest(nodeissupported01.class);
+ sink.addTest(nodeissupported02.class);
+ sink.addTest(nodeissupported03.class);
+ sink.addTest(nodeissupported04.class);
+ sink.addTest(nodeissupported05.class);
+ sink.addTest(nodenormalize01.class);
+ sink.addTest(nodesetprefix01.class);
+ sink.addTest(nodesetprefix02.class);
+ sink.addTest(nodesetprefix03.class);
+ sink.addTest(nodesetprefix04.class);
+ sink.addTest(nodesetprefix05.class);
+ sink.addTest(nodesetprefix06.class);
+ sink.addTest(nodesetprefix07.class);
+ sink.addTest(nodesetprefix08.class);
+// sink.addTest(nodesetprefix09.class);
+ sink.addTest(normalize01.class);
+ sink.addTest(ownerDocument01.class);
+ sink.addTest(ownerElement01.class);
+ sink.addTest(ownerElement02.class);
+ sink.addTest(prefix01.class);
+ sink.addTest(prefix02.class);
+ sink.addTest(prefix03.class);
+ sink.addTest(prefix04.class);
+ sink.addTest(prefix05.class);
+// sink.addTest(prefix06.class);
+ sink.addTest(prefix07.class);
+// sink.addTest(prefix08.class);
+// sink.addTest(prefix09.class);
+ sink.addTest(prefix10.class);
+ sink.addTest(prefix11.class);
+ sink.addTest(publicId01.class);
+// sink.addTest(removeAttributeNS01.class);
+ sink.addTest(removeAttributeNS02.class);
+ sink.addTest(removeNamedItemNS01.class);
+ sink.addTest(removeNamedItemNS02.class);
+// sink.addTest(removeNamedItemNS03.class);
+ sink.addTest(setAttributeNS01.class);
+ sink.addTest(setAttributeNS02.class);
+// sink.addTest(setAttributeNS03.class);
+ sink.addTest(setAttributeNS04.class);
+ sink.addTest(setAttributeNS05.class);
+ sink.addTest(setAttributeNS06.class);
+ sink.addTest(setAttributeNS07.class);
+ sink.addTest(setAttributeNS09.class);
+// sink.addTest(setAttributeNS10.class);
+ sink.addTest(setAttributeNodeNS01.class);
+// sink.addTest(setAttributeNodeNS02.class);
+ sink.addTest(setAttributeNodeNS03.class);
+ sink.addTest(setAttributeNodeNS04.class);
+ sink.addTest(setAttributeNodeNS05.class);
+ sink.addTest(setNamedItemNS01.class);
+ sink.addTest(setNamedItemNS02.class);
+ sink.addTest(setNamedItemNS03.class);
+// sink.addTest(setNamedItemNS04.class);
+// sink.addTest(setNamedItemNS05.class);
+ sink.addTest(systemId01.class);
+
+ }
+ /**
+ * Gets URI that identifies the test suite
+ * @return uri identifier of test suite
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level2/core/alltests";
+ }
+
+ /**
+ * Runs individual test
+ * @param args command line arguments
+ */
+ public static void main(String[] args) {
+ DOMTestCase.doMain(alltests.class, args);
+ }
+
+}
diff --git a/dom/src/test/java/org/w3c/domts/level2/core/attrgetownerelement01.java b/dom/src/test/java/org/w3c/domts/level2/core/attrgetownerelement01.java
new file mode 100644
index 0000000..ff22420
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level2/core/attrgetownerelement01.java
@@ -0,0 +1,106 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+
+Copyright (c) 2001-2004 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+
+*/
+
+package org.w3c.domts.level2.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The "getOwnerElement()" will return the Element node this attribute is attached to or
+ * null if this attribute is not in use.
+ *
+ * Retreive the default attribute defaultAttr and check its owner element. Verify if the name
+ * the nodeName of the returned ownerElement is emp:employee.
+* @author IBM
+* @author Neil Delima
+* @see <a href="http://www.w3.org/TR/DOM-Level-2-Core/core#Attr-ownerElement">http://www.w3.org/TR/DOM-Level-2-Core/core#Attr-ownerElement</a>
+* @see <a href="http://www.w3.org/Bugs/Public/show_bug.cgi?id=259">http://www.w3.org/Bugs/Public/show_bug.cgi?id=259</a>
+*/
+public final class attrgetownerelement01 extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public attrgetownerelement01(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+
+ org.w3c.domts.DocumentBuilderSetting[] settings =
+ new org.w3c.domts.DocumentBuilderSetting[] {
+org.w3c.domts.DocumentBuilderSetting.namespaceAware,
+org.w3c.domts.DocumentBuilderSetting.validating
+ };
+ DOMTestDocumentBuilderFactory testFactory = factory.newInstance(settings);
+ setFactory(testFactory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "staffNS", false);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ Attr attr;
+ Element element;
+ Element ownerElement;
+ String ownerElementName;
+ NodeList elementList;
+ NamedNodeMap attributes;
+ String nullNS = null;
+
+ doc = (Document) load("staffNS", false);
+ elementList = doc.getElementsByTagNameNS("http://www.nist.gov", "employee");
+ element = (Element) elementList.item(1);
+ attributes = element.getAttributes();
+ attr = (Attr) attributes.getNamedItemNS(nullNS, "defaultAttr");
+ ownerElement = attr.getOwnerElement();
+ ownerElementName = ownerElement.getNodeName();
+ assertEquals("attrgetownerelement01", "emp:employee", ownerElementName);
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level2/core/attrgetownerelement01";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(attrgetownerelement01.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level2/core/attrgetownerelement02.java b/dom/src/test/java/org/w3c/domts/level2/core/attrgetownerelement02.java
new file mode 100644
index 0000000..1c4f939
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level2/core/attrgetownerelement02.java
@@ -0,0 +1,100 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+
+Copyright (c) 2001 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+
+*/
+
+package org.w3c.domts.level2.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The "getOwnerElement()" will return the Element node this attribute
+ * is attached to or null if this attribute is not in use.
+ *
+ * Create a new element and attribute node, attach the attribute to the element.
+ * Check the value of owner element of the new attribute node
+* @author IBM
+* @author Neil Delima
+* @see <a href="http://www.w3.org/TR/DOM-Level-2-Core/core#Attr-ownerElement">http://www.w3.org/TR/DOM-Level-2-Core/core#Attr-ownerElement</a>
+*/
+public final class attrgetownerelement02 extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public attrgetownerelement02(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+
+ org.w3c.domts.DocumentBuilderSetting[] settings =
+ new org.w3c.domts.DocumentBuilderSetting[] {
+org.w3c.domts.DocumentBuilderSetting.namespaceAware
+ };
+ DOMTestDocumentBuilderFactory testFactory = factory.newInstance(settings);
+ setFactory(testFactory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "staffNS", false);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ Element element;
+ Element ownerElement;
+ String ownerElementName;
+ Attr attr;
+ Attr newAttr;
+ doc = (Document) load("staffNS", false);
+ element = doc.createElement("root");
+ attr = doc.createAttributeNS("http://www.w3.org/DOM/L1", "L1:att");
+ newAttr = element.setAttributeNodeNS(attr);
+ ownerElement = attr.getOwnerElement();
+ ownerElementName = ownerElement.getNodeName();
+ assertEqualsIgnoreCase("attrgetownerelement02", "root", ownerElementName);
+}
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level2/core/attrgetownerelement02";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(attrgetownerelement02.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level2/core/attrgetownerelement03.java b/dom/src/test/java/org/w3c/domts/level2/core/attrgetownerelement03.java
new file mode 100644
index 0000000..30378d8
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level2/core/attrgetownerelement03.java
@@ -0,0 +1,101 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+
+
+
+Copyright (c) 2001 World Wide Web Consortium,
+
+(Massachusetts Institute of Technology, Institut National de
+
+Recherche en Informatique et en Automatique, Keio University). All
+
+Rights Reserved. This program is distributed under the W3C's Software
+
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+
+
+
+*/
+
+package org.w3c.domts.level2.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The "getOwnerElement()" will return the Element node this attribute
+ * is attached to or null if this attribute is not in use.
+ *
+ * Create a new attribute node for this document node. Since the newly attribute is
+ * not it use its owner element should be null.
+* @author IBM
+* @author Neil Delima
+* @see <a href="http://www.w3.org/TR/DOM-Level-2-Core/core#Attr-ownerElement">http://www.w3.org/TR/DOM-Level-2-Core/core#Attr-ownerElement</a>
+*/
+public final class attrgetownerelement03 extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public attrgetownerelement03(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "staffNS", false);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ Node ownerElement;
+ Attr attr;
+ doc = (Document) load("staffNS", false);
+ attr = doc.createAttributeNS("http://www.w3.org/DOM", "dom:attr");
+ ownerElement = attr.getOwnerElement();
+ assertNull("attrgetownerelement03", ownerElement);
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level2/core/attrgetownerelement03";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(attrgetownerelement03.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level2/core/attrgetownerelement04.java b/dom/src/test/java/org/w3c/domts/level2/core/attrgetownerelement04.java
new file mode 100644
index 0000000..917a05a
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level2/core/attrgetownerelement04.java
@@ -0,0 +1,102 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+Copyright (c) 2001-2004 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+*/
+
+package org.w3c.domts.level2.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The "getOwnerElement()" will return the Element node this attribute is attached to or
+ * null if this attribute is not in use.
+ * Import an attribute node to another document. If an Attr node is imported, its
+ * ownerElement attribute should be set to null. Verify if the ownerElement has been set
+ * to null.
+* @author IBM
+* @author Neil Delima
+* @see <a href="http://www.w3.org/TR/DOM-Level-2-Core/core#Attr-ownerElement">http://www.w3.org/TR/DOM-Level-2-Core/core#Attr-ownerElement</a>
+*/
+public final class attrgetownerelement04 extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public attrgetownerelement04(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+
+ org.w3c.domts.DocumentBuilderSetting[] settings =
+ new org.w3c.domts.DocumentBuilderSetting[] {
+org.w3c.domts.DocumentBuilderSetting.namespaceAware
+ };
+ DOMTestDocumentBuilderFactory testFactory = factory.newInstance(settings);
+ setFactory(testFactory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "staffNS", false);
+ preload(contentType, "staff", false);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ Document docImp;
+ Node ownerElement;
+ Element element;
+ Attr attr;
+ Attr attrImp;
+ NodeList addresses;
+ doc = (Document) load("staffNS", false);
+ docImp = (Document) load("staff", false);
+ addresses = doc.getElementsByTagNameNS("http://www.nist.gov", "address");
+ element = (Element) addresses.item(1);
+ assertNotNull("empAddressNotNull", element);
+ attr = element.getAttributeNodeNS("http://www.nist.gov", "zone");
+ attrImp = (Attr) docImp.importNode(attr, true);
+ ownerElement = attrImp.getOwnerElement();
+ assertNull("attrgetownerelement04", ownerElement);
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level2/core/attrgetownerelement04";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(attrgetownerelement04.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level2/core/attrgetownerelement05.java b/dom/src/test/java/org/w3c/domts/level2/core/attrgetownerelement05.java
new file mode 100644
index 0000000..5e02786
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level2/core/attrgetownerelement05.java
@@ -0,0 +1,109 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+
+Copyright (c) 2001-2003 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+
+*/
+
+package org.w3c.domts.level2.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The "getOwnerElement()" will return the Element node this attribute is attached to
+ * or null if this attribute is not in use.
+ *
+ * Retreive an element and its attributes. Then remove the element and check the name of
+ * the ownerElement of attribute of the attribute "street".
+* @author IBM
+* @author Neil Delima
+* @see <a href="http://www.w3.org/TR/DOM-Level-2-Core/core#Attr-ownerElement">http://www.w3.org/TR/DOM-Level-2-Core/core#Attr-ownerElement</a>
+* @see <a href="http://www.w3.org/Bugs/Public/show_bug.cgi?id=259">http://www.w3.org/Bugs/Public/show_bug.cgi?id=259</a>
+*/
+public final class attrgetownerelement05 extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public attrgetownerelement05(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+
+ org.w3c.domts.DocumentBuilderSetting[] settings =
+ new org.w3c.domts.DocumentBuilderSetting[] {
+org.w3c.domts.DocumentBuilderSetting.namespaceAware
+ };
+ DOMTestDocumentBuilderFactory testFactory = factory.newInstance(settings);
+ setFactory(testFactory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "staffNS", true);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ Node element;
+ Element ownerElement;
+ Element parentElement;
+ NodeList elementList;
+ String ownerElementName;
+ Attr attr;
+ Node removedChild;
+ NamedNodeMap nodeMap;
+ String nullNS = null;
+
+ doc = (Document) load("staffNS", true);
+ elementList = doc.getElementsByTagNameNS("*", "address");
+ element = elementList.item(1);
+ parentElement = (Element) element.getParentNode();
+ nodeMap = element.getAttributes();
+ removedChild = parentElement.removeChild(element);
+ attr = (Attr) nodeMap.getNamedItemNS(nullNS, "street");
+ ownerElement = attr.getOwnerElement();
+ ownerElementName = ownerElement.getNodeName();
+ assertEquals("attrgetownerelement05", "address", ownerElementName);
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level2/core/attrgetownerelement05";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(attrgetownerelement05.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level2/core/createAttributeNS01.java b/dom/src/test/java/org/w3c/domts/level2/core/createAttributeNS01.java
new file mode 100644
index 0000000..fa2f3d5
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level2/core/createAttributeNS01.java
@@ -0,0 +1,101 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+
+Copyright (c) 2001 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+
+*/
+
+package org.w3c.domts.level2.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The "createAttributeNS(namespaceURI,qualifiedName)" method for a
+ * Document should raise NAMESPACE_ERR DOMException
+ * if qualifiedName is malformed.
+ *
+ * Invoke method createAttributeNS(namespaceURI,qualifiedName) on
+ * the XMLNS Document with namespaceURI being "http://www.ecommerce.org/",
+ * qualifiedName as "prefix::local". Method should raise
+ * NAMESPACE_ERR DOMException.
+* @author NIST
+* @author Mary Brady
+* @see <a href="http://www.w3.org/TR/DOM-Level-2-Core/core#xpointer(id('ID-258A00AF')/constant[@name='NAMESPACE_ERR'])">http://www.w3.org/TR/DOM-Level-2-Core/core#xpointer(id('ID-258A00AF')/constant[@name='NAMESPACE_ERR'])</a>
+* @see <a href="http://www.w3.org/TR/DOM-Level-2-Core/core#ID-DocCrAttrNS">http://www.w3.org/TR/DOM-Level-2-Core/core#ID-DocCrAttrNS</a>
+* @see <a href="http://www.w3.org/TR/DOM-Level-2-Core/core#xpointer(id('ID-DocCrAttrNS')/raises/exception[@name='DOMException']/descr/p[substring-before(.,':')='NAMESPACE_ERR'])">http://www.w3.org/TR/DOM-Level-2-Core/core#xpointer(id('ID-DocCrAttrNS')/raises/exception[@name='DOMException']/descr/p[substring-before(.,':')='NAMESPACE_ERR'])</a>
+*/
+public final class createAttributeNS01 extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public createAttributeNS01(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "staffNS", false);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ String namespaceURI = "http://www.ecommerce.org/";
+ String malformedName = "prefix::local";
+ Document doc;
+ Attr newAttr;
+ doc = (Document) load("staffNS", false);
+
+ {
+ boolean success = false;
+ try {
+ newAttr = doc.createAttributeNS(namespaceURI, malformedName);
+ } catch (DOMException ex) {
+ success = (ex.code == DOMException.NAMESPACE_ERR);
+ }
+ assertTrue("throw_NAMESPACE_ERR", success);
+ }
+}
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level2/core/createAttributeNS01";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(createAttributeNS01.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level2/core/createAttributeNS02.java b/dom/src/test/java/org/w3c/domts/level2/core/createAttributeNS02.java
new file mode 100644
index 0000000..444a401
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level2/core/createAttributeNS02.java
@@ -0,0 +1,101 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+
+Copyright (c) 2001 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+
+*/
+
+package org.w3c.domts.level2.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The "createAttributeNS(namespaceURI,qualifiedName)" method for a
+ * Document should raise NAMESPACE_ERR DOMException
+ * if qualifiedName has a prefix and namespaceURI is null.
+ *
+ * Invoke method createAttributeNS(namespaceURI,qualifiedName) on this document
+ * with namespaceURI being null and qualifiedName contains the prefix "person".
+ * Method should raise NAMESPACE_ERR DOMException.
+* @author NIST
+* @author Mary Brady
+* @see <a href="http://www.w3.org/TR/DOM-Level-2-Core/core#xpointer(id('ID-258A00AF')/constant[@name='NAMESPACE_ERR'])">http://www.w3.org/TR/DOM-Level-2-Core/core#xpointer(id('ID-258A00AF')/constant[@name='NAMESPACE_ERR'])</a>
+* @see <a href="http://www.w3.org/TR/DOM-Level-2-Core/core#ID-DocCrAttrNS">http://www.w3.org/TR/DOM-Level-2-Core/core#ID-DocCrAttrNS</a>
+* @see <a href="http://www.w3.org/TR/DOM-Level-2-Core/core#xpointer(id('ID-DocCrAttrNS')/raises/exception[@name='DOMException']/descr/p[substring-before(.,':')='NAMESPACE_ERR'])">http://www.w3.org/TR/DOM-Level-2-Core/core#xpointer(id('ID-DocCrAttrNS')/raises/exception[@name='DOMException']/descr/p[substring-before(.,':')='NAMESPACE_ERR'])</a>
+*/
+public final class createAttributeNS02 extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public createAttributeNS02(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "staffNS", false);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ String namespaceURI = null;
+
+ String qualifiedName = "prefix:local";
+ Document doc;
+ Attr newAttr;
+ doc = (Document) load("staffNS", false);
+
+ {
+ boolean success = false;
+ try {
+ newAttr = doc.createAttributeNS(namespaceURI, qualifiedName);
+ } catch (DOMException ex) {
+ success = (ex.code == DOMException.NAMESPACE_ERR);
+ }
+ assertTrue("throw_NAMESPACE_ERR", success);
+ }
+}
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level2/core/createAttributeNS02";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(createAttributeNS02.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level2/core/createAttributeNS03.java b/dom/src/test/java/org/w3c/domts/level2/core/createAttributeNS03.java
new file mode 100644
index 0000000..abce601
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level2/core/createAttributeNS03.java
@@ -0,0 +1,132 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+
+Copyright (c) 2001 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+
+*/
+
+package org.w3c.domts.level2.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The "createAttributeNS(namespaceURI,qualifiedName)" method for a
+ * Document should raise INVALID_CHARACTER_ERR DOMException
+ * if qualifiedName contains an illegal character.
+ *
+ * Invoke method createAttributeNS(namespaceURI,qualifiedName) on this document
+ * with qualifiedName containing an illegal character from illegalChars[].
+ * Method should raise INVALID_CHARACTER_ERR DOMException for all
+ * characters in illegalChars[].
+* @author NIST
+* @author Mary Brady
+* @see <a href="http://www.w3.org/TR/DOM-Level-2-Core/core#ID-DocCrAttrNS">http://www.w3.org/TR/DOM-Level-2-Core/core#ID-DocCrAttrNS</a>
+* @see <a href="http://www.w3.org/TR/DOM-Level-2-Core/core#xpointer(id('ID-DocCrAttrNS')/raises/exception[@name='DOMException']/descr/p[substring-before(.,':')='INVALID_CHARACTER_ERR'])">http://www.w3.org/TR/DOM-Level-2-Core/core#xpointer(id('ID-DocCrAttrNS')/raises/exception[@name='DOMException']/descr/p[substring-before(.,':')='INVALID_CHARACTER_ERR'])</a>
+*/
+public final class createAttributeNS03 extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public createAttributeNS03(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "staffNS", false);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ String namespaceURI = "http://www.wedding.com/";
+ String qualifiedName;
+ Document doc;
+ Attr newAttr;
+ java.util.List illegalQNames = new java.util.ArrayList();
+ illegalQNames.add("person:{");
+ illegalQNames.add("person:}");
+ illegalQNames.add("person:~");
+ illegalQNames.add("person:'");
+ illegalQNames.add("person:!");
+ illegalQNames.add("person:@");
+ illegalQNames.add("person:#");
+ illegalQNames.add("person:$");
+ illegalQNames.add("person:%");
+ illegalQNames.add("person:^");
+ illegalQNames.add("person:&");
+ illegalQNames.add("person:*");
+ illegalQNames.add("person:(");
+ illegalQNames.add("person:)");
+ illegalQNames.add("person:+");
+ illegalQNames.add("person:=");
+ illegalQNames.add("person:[");
+ illegalQNames.add("person:]");
+ illegalQNames.add("person:\\");
+ illegalQNames.add("person:/");
+ illegalQNames.add("person:;");
+ illegalQNames.add("person:`");
+ illegalQNames.add("person:<");
+ illegalQNames.add("person:>");
+ illegalQNames.add("person:,");
+ illegalQNames.add("person:a ");
+ illegalQNames.add("person:\"");
+
+ doc = (Document) load("staffNS", false);
+ for (int indexN10090 = 0; indexN10090 < illegalQNames.size(); indexN10090++) {
+ qualifiedName = (String) illegalQNames.get(indexN10090);
+
+ {
+ boolean success = false;
+ try {
+ newAttr = doc.createAttributeNS(namespaceURI, qualifiedName);
+ } catch (DOMException ex) {
+ success = (ex.code == DOMException.INVALID_CHARACTER_ERR);
+ }
+ assertTrue("throw_INVALID_CHARACTER_ERR", success);
+ }
+ }
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level2/core/createAttributeNS03";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(createAttributeNS03.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level2/core/createAttributeNS04.java b/dom/src/test/java/org/w3c/domts/level2/core/createAttributeNS04.java
new file mode 100644
index 0000000..2301989
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level2/core/createAttributeNS04.java
@@ -0,0 +1,103 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+
+Copyright (c) 2001 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+
+*/
+
+package org.w3c.domts.level2.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The "createAttributeNS(namespaceURI,qualifiedName)" method for a
+ * Document should raise NAMESPACE_ERR DOMException
+ * if qualifiedName has the "xml" prefix and namespaceURI is different
+ * from "http://www.w3.org/XML/1998/namespace".
+ *
+ * Invoke method createAttributeNS(namespaceURI,qualifiedName) on this document
+ * with qualifiedName being "xml:attr1 and namespaceURI equals
+ * the string "http://www.w3.org/XML/1998/namespaces" (which differs from the required
+ * string "http://www.w3.org/XML/1998/namespace").
+ * Method should raise NAMESPACE_ERR DOMException.
+* @author NIST
+* @author Mary Brady
+* @see <a href="http://www.w3.org/TR/DOM-Level-2-Core/core#xpointer(id('ID-258A00AF')/constant[@name='NAMESPACE_ERR'])">http://www.w3.org/TR/DOM-Level-2-Core/core#xpointer(id('ID-258A00AF')/constant[@name='NAMESPACE_ERR'])</a>
+* @see <a href="http://www.w3.org/TR/DOM-Level-2-Core/core#ID-DocCrAttrNS">http://www.w3.org/TR/DOM-Level-2-Core/core#ID-DocCrAttrNS</a>
+* @see <a href="http://www.w3.org/TR/DOM-Level-2-Core/core#xpointer(id('ID-DocCrAttrNS')/raises/exception[@name='DOMException']/descr/p[substring-before(.,':')='NAMESPACE_ERR'])">http://www.w3.org/TR/DOM-Level-2-Core/core#xpointer(id('ID-DocCrAttrNS')/raises/exception[@name='DOMException']/descr/p[substring-before(.,':')='NAMESPACE_ERR'])</a>
+*/
+public final class createAttributeNS04 extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public createAttributeNS04(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "staffNS", false);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ String namespaceURI = "http://www.w3.org/XML/1998/namespaces";
+ String qualifiedName = "xml:attr1";
+ Document doc;
+ Attr newAttr;
+ doc = (Document) load("staffNS", false);
+
+ {
+ boolean success = false;
+ try {
+ newAttr = doc.createAttributeNS(namespaceURI, qualifiedName);
+ } catch (DOMException ex) {
+ success = (ex.code == DOMException.NAMESPACE_ERR);
+ }
+ assertTrue("throw_NAMESPACE_ERR", success);
+ }
+}
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level2/core/createAttributeNS04";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(createAttributeNS04.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level2/core/createAttributeNS05.java b/dom/src/test/java/org/w3c/domts/level2/core/createAttributeNS05.java
new file mode 100644
index 0000000..e0bd5dd
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level2/core/createAttributeNS05.java
@@ -0,0 +1,92 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+
+Copyright (c) 2001 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+
+*/
+
+package org.w3c.domts.level2.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The "createAttributeNS(namespaceURI,qualifiedName)" method for a
+ * Document should return a new Attr object given that all parameters are
+ * valid and correctly formed.
+ *
+ * Invoke method createAttributeNS(namespaceURI,qualifiedName) on this document with
+ * parameters equal "http://www.ecommerce.org/" and "ecom:local"
+ * respectively. Method should return a new Attr object whose name is "ecom:local".
+* @author NIST
+* @author Mary Brady
+* @see <a href="http://www.w3.org/TR/DOM-Level-2-Core/core#ID-1112119403">http://www.w3.org/TR/DOM-Level-2-Core/core#ID-1112119403</a>
+*/
+public final class createAttributeNS05 extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public createAttributeNS05(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "staffNS", false);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ String namespaceURI = "http://www.ecommerce.org/";
+ String qualifiedName = "econm:local";
+ Document doc;
+ Attr newAttr;
+ String attrName;
+ doc = (Document) load("staffNS", false);
+ newAttr = doc.createAttributeNS(namespaceURI, qualifiedName);
+ attrName = newAttr.getName();
+ assertEquals("throw_Equals", qualifiedName, attrName);
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level2/core/createAttributeNS05";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(createAttributeNS05.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level2/core/createAttributeNS06.java b/dom/src/test/java/org/w3c/domts/level2/core/createAttributeNS06.java
new file mode 100644
index 0000000..f161370
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level2/core/createAttributeNS06.java
@@ -0,0 +1,93 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+
+Copyright (c) 2004 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+
+*/
+
+package org.w3c.domts.level2.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * Document.createAttributeNS with an empty qualified name should cause an INVALID_CHARACTER_ERR.
+* @author Curt Arnold
+* @see <a href="http://www.w3.org/TR/DOM-Level-2-Core/core#ID-DocCrAttrNS">http://www.w3.org/TR/DOM-Level-2-Core/core#ID-DocCrAttrNS</a>
+* @see <a href="http://www.w3.org/TR/DOM-Level-2-Core/core#xpointer(id('ID-DocCrAttrNS')/raises/exception[@name='DOMException']/descr/p[substring-before(.,':')='INVALID_CHARACTER_ERR'])">http://www.w3.org/TR/DOM-Level-2-Core/core#xpointer(id('ID-DocCrAttrNS')/raises/exception[@name='DOMException']/descr/p[substring-before(.,':')='INVALID_CHARACTER_ERR'])</a>
+* @see <a href="http://www.w3.org/Bugs/Public/show_bug.cgi?id=525">http://www.w3.org/Bugs/Public/show_bug.cgi?id=525</a>
+*/
+public final class createAttributeNS06 extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public createAttributeNS06(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "hc_staff", true);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ String namespaceURI = "http://www.example.com/";
+ String qualifiedName;
+ Document doc;
+ Attr newAttr;
+ doc = (Document) load("hc_staff", true);
+
+ {
+ boolean success = false;
+ try {
+ newAttr = doc.createAttributeNS(namespaceURI, "");
+ } catch (DOMException ex) {
+ success = (ex.code == DOMException.INVALID_CHARACTER_ERR);
+ }
+ assertTrue("throw_INVALID_CHARACTER_ERR", success);
+ }
+}
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level2/core/createAttributeNS06";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(createAttributeNS06.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level2/core/createDocument01.java b/dom/src/test/java/org/w3c/domts/level2/core/createDocument01.java
new file mode 100644
index 0000000..bf69541
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level2/core/createDocument01.java
@@ -0,0 +1,107 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+
+Copyright (c) 2001 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+
+*/
+
+package org.w3c.domts.level2.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The "createDocument(namespaceURI,qualifiedName,doctype)" method for a
+ * DOMImplementation should raise NAMESPACE_ERR DOMException
+ * if parameter qualifiedName is malformed.
+ *
+ * Retrieve the DOMImplementation on the XMLNS Document.
+ * Invoke method createDocument(namespaceURI,qualifiedName,doctype)
+ * on the retrieved DOMImplementation with namespaceURI being
+ * the literal string "http://www.ecommerce.org/", qualifiedName as
+ * "prefix::local", and doctype as null. Method should raise
+ * NAMESPACE_ERR DOMException.
+* @author NIST
+* @author Mary Brady
+* @see <a href="http://www.w3.org/TR/DOM-Level-2-Core/core#xpointer(id('ID-258A00AF')/constant[@name='NAMESPACE_ERR'])">http://www.w3.org/TR/DOM-Level-2-Core/core#xpointer(id('ID-258A00AF')/constant[@name='NAMESPACE_ERR'])</a>
+* @see <a href="http://www.w3.org/TR/DOM-Level-2-Core/core#Level-2-Core-DOM-createDocument">http://www.w3.org/TR/DOM-Level-2-Core/core#Level-2-Core-DOM-createDocument</a>
+* @see <a href="http://www.w3.org/TR/DOM-Level-2-Core/core#xpointer(id('Level-2-Core-DOM-createDocument')/raises/exception[@name='DOMException']/descr/p[substring-before(.,':')='NAMESPACE_ERR'])">http://www.w3.org/TR/DOM-Level-2-Core/core#xpointer(id('Level-2-Core-DOM-createDocument')/raises/exception[@name='DOMException']/descr/p[substring-before(.,':')='NAMESPACE_ERR'])</a>
+*/
+public final class createDocument01 extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public createDocument01(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "staffNS", false);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ String namespaceURI = "http://www.ecommerce.org/";
+ String malformedName = "prefix::local";
+ Document doc;
+ DocumentType docType = null;
+
+ DOMImplementation domImpl;
+ Document aNewDoc;
+ doc = (Document) load("staffNS", false);
+ domImpl = doc.getImplementation();
+
+ {
+ boolean success = false;
+ try {
+ aNewDoc = domImpl.createDocument(namespaceURI, malformedName, docType);
+ } catch (DOMException ex) {
+ success = (ex.code == DOMException.NAMESPACE_ERR);
+ }
+ assertTrue("throw_NAMESPACE_ERR", success);
+ }
+}
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level2/core/createDocument01";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(createDocument01.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level2/core/createDocument02.java b/dom/src/test/java/org/w3c/domts/level2/core/createDocument02.java
new file mode 100644
index 0000000..687773f
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level2/core/createDocument02.java
@@ -0,0 +1,105 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+
+Copyright (c) 2001 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+
+*/
+
+package org.w3c.domts.level2.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The "createDocument(namespaceURI,qualifiedName,doctype)" method for a
+ * DOMImplementation should raise NAMESPACE_ERR DOMException
+ * if qualifiedName has a prefix and namespaceURI is null.
+ *
+ * Invoke method createDocument(namespaceURI,qualifiedName,doctype) on
+ * this domimplementation with namespaceURI being null and qualifiedName
+ * equals "k:local". Method should raise NAMESPACE_ERR DOMException.
+* @author NIST
+* @author Mary Brady
+* @see <a href="http://www.w3.org/TR/DOM-Level-2-Core/core#xpointer(id('ID-258A00AF')/constant[@name='NAMESPACE_ERR'])">http://www.w3.org/TR/DOM-Level-2-Core/core#xpointer(id('ID-258A00AF')/constant[@name='NAMESPACE_ERR'])</a>
+* @see <a href="http://www.w3.org/TR/DOM-Level-2-Core/core#Level-2-Core-DOM-createDocument">http://www.w3.org/TR/DOM-Level-2-Core/core#Level-2-Core-DOM-createDocument</a>
+* @see <a href="http://www.w3.org/TR/DOM-Level-2-Core/core#xpointer(id('Level-2-Core-DOM-createDocument')/raises/exception[@name='DOMException']/descr/p[substring-before(.,':')='NAMESPACE_ERR'])">http://www.w3.org/TR/DOM-Level-2-Core/core#xpointer(id('Level-2-Core-DOM-createDocument')/raises/exception[@name='DOMException']/descr/p[substring-before(.,':')='NAMESPACE_ERR'])</a>
+*/
+public final class createDocument02 extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public createDocument02(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "staffNS", false);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ String namespaceURI = null;
+
+ String qualifiedName = "k:local";
+ Document doc;
+ DocumentType docType = null;
+
+ DOMImplementation domImpl;
+ Document aNewDoc;
+ doc = (Document) load("staffNS", false);
+ domImpl = doc.getImplementation();
+
+ {
+ boolean success = false;
+ try {
+ aNewDoc = domImpl.createDocument(namespaceURI, qualifiedName, docType);
+ } catch (DOMException ex) {
+ success = (ex.code == DOMException.NAMESPACE_ERR);
+ }
+ assertTrue("throw_NAMESPACE_ERR", success);
+ }
+}
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level2/core/createDocument02";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(createDocument02.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level2/core/createDocument03.java b/dom/src/test/java/org/w3c/domts/level2/core/createDocument03.java
new file mode 100644
index 0000000..c7faef9
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level2/core/createDocument03.java
@@ -0,0 +1,104 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+
+Copyright (c) 2001 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+
+*/
+
+package org.w3c.domts.level2.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The "createDocument(namespaceURI,qualifiedName,doctype)" method for a
+ * DOMImplementation should raise WRONG_DOCUMENT_ERR DOMException
+ * if parameter doctype has been used with a different document.
+ *
+ * Invoke method createDocument(namespaceURI,qualifiedName,doctype) on
+ * this domimplementation where doctype is the type of this document.
+ * Method should raise WRONG_DOCUMENT_ERR DOMException.
+* @author NIST
+* @author Mary Brady
+* @see <a href="http://www.w3.org/TR/DOM-Level-2-Core/core#xpointer(id('ID-258A00AF')/constant[@name='WRONG_DOCUMENT_ERR'])">http://www.w3.org/TR/DOM-Level-2-Core/core#xpointer(id('ID-258A00AF')/constant[@name='WRONG_DOCUMENT_ERR'])</a>
+* @see <a href="http://www.w3.org/TR/DOM-Level-2-Core/core#Level-2-Core-DOM-createDocument">http://www.w3.org/TR/DOM-Level-2-Core/core#Level-2-Core-DOM-createDocument</a>
+* @see <a href="http://www.w3.org/TR/DOM-Level-2-Core/core#xpointer(id('Level-2-Core-DOM-createDocument')/raises/exception[@name='DOMException']/descr/p[substring-before(.,':')='WRONG_DOCUMENT_ERR'])">http://www.w3.org/TR/DOM-Level-2-Core/core#xpointer(id('Level-2-Core-DOM-createDocument')/raises/exception[@name='DOMException']/descr/p[substring-before(.,':')='WRONG_DOCUMENT_ERR'])</a>
+*/
+public final class createDocument03 extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public createDocument03(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "staffNS", false);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ String namespaceURI = "http://www.ecommerce.org/schema";
+ String qualifiedName = "namespaceURI:x";
+ Document doc;
+ DocumentType docType;
+ DOMImplementation domImpl;
+ Document aNewDoc;
+ doc = (Document) load("staffNS", false);
+ docType = doc.getDoctype();
+ domImpl = doc.getImplementation();
+
+ {
+ boolean success = false;
+ try {
+ aNewDoc = domImpl.createDocument(namespaceURI, qualifiedName, docType);
+ } catch (DOMException ex) {
+ success = (ex.code == DOMException.WRONG_DOCUMENT_ERR);
+ }
+ assertTrue("throw_WRONG_DOCUMENT_ERR", success);
+ }
+}
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level2/core/createDocument03";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(createDocument03.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level2/core/createDocument04.java b/dom/src/test/java/org/w3c/domts/level2/core/createDocument04.java
new file mode 100644
index 0000000..652ece9
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level2/core/createDocument04.java
@@ -0,0 +1,107 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+
+Copyright (c) 2001 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+
+*/
+
+package org.w3c.domts.level2.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The "createDocument(namespaceURI,qualifiedName,doctype)" method for a
+ * DOMImplementation should raise WRONG_DOCUMENT_ERR DOMException
+ * if parameter doctype was created from a different implementation.
+ *
+ * Invoke method createDocument(namespaceURI,qualifiedName,doctype) on
+ * a domimplementation that is different from this domimplementation.
+ * Doctype is the type of this document.
+ * Method should raise WRONG_DOCUMENT_ERR DOMException.
+* @author NIST
+* @author Mary Brady
+* @see <a href="http://www.w3.org/TR/DOM-Level-2-Core/core#xpointer(id('ID-258A00AF')/constant[@name='WRONG_DOCUMENT_ERR'])">http://www.w3.org/TR/DOM-Level-2-Core/core#xpointer(id('ID-258A00AF')/constant[@name='WRONG_DOCUMENT_ERR'])</a>
+* @see <a href="http://www.w3.org/TR/DOM-Level-2-Core/core#Level-2-Core-DOM-createDocument">http://www.w3.org/TR/DOM-Level-2-Core/core#Level-2-Core-DOM-createDocument</a>
+* @see <a href="http://www.w3.org/TR/DOM-Level-2-Core/core#xpointer(id('Level-2-Core-DOM-createDocument')/raises/exception[@name='DOMException']/descr/p[substring-before(.,':')='WRONG_DOCUMENT_ERR'])">http://www.w3.org/TR/DOM-Level-2-Core/core#xpointer(id('Level-2-Core-DOM-createDocument')/raises/exception[@name='DOMException']/descr/p[substring-before(.,':')='WRONG_DOCUMENT_ERR'])</a>
+*/
+public final class createDocument04 extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public createDocument04(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "staffNS", false);
+ preload(contentType, "staffNS", false);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ String namespaceURI = "http://www.ecommerce.org/schema";
+ String qualifiedName = "namespaceURI:x";
+ Document doc;
+ DocumentType docType;
+ DOMImplementation domImpl;
+ Document aNewDoc;
+ doc = (Document) load("staffNS", false);
+ aNewDoc = (Document) load("staffNS", false);
+ docType = doc.getDoctype();
+ domImpl = aNewDoc.getImplementation();
+
+ {
+ boolean success = false;
+ try {
+ aNewDoc = domImpl.createDocument(namespaceURI, qualifiedName, docType);
+ } catch (DOMException ex) {
+ success = (ex.code == DOMException.WRONG_DOCUMENT_ERR);
+ }
+ assertTrue("throw_WRONG_DOCUMENT_ERR", success);
+ }
+}
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level2/core/createDocument04";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(createDocument04.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level2/core/createDocument05.java b/dom/src/test/java/org/w3c/domts/level2/core/createDocument05.java
new file mode 100644
index 0000000..16cf86d
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level2/core/createDocument05.java
@@ -0,0 +1,137 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+
+Copyright (c) 2001 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+
+*/
+
+package org.w3c.domts.level2.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The "createDocument(namespaceURI,qualifiedName,doctype)" method for a
+ * DOMImplementation should raise INVALID_CHARACTER_ERR DOMException
+ * if parameter qualifiedName contains an illegal character.
+ *
+ * Invoke method createDocument(namespaceURI,qualifiedName,doctype) on
+ * this domimplementation with namespaceURI equals "http://www.ecommerce.org/schema",
+ * doctype is null and qualifiedName contains an illegal character from
+ * illegalChars[]. Method should raise INVALID_CHARACTER_ERR DOMException
+ * for all characters in illegalChars[].
+* @author NIST
+* @author Mary Brady
+* @see <a href="http://www.w3.org/TR/DOM-Level-2-Core/core#">http://www.w3.org/TR/DOM-Level-2-Core/core#</a>
+*/
+public final class createDocument05 extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public createDocument05(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "staffNS", false);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ String namespaceURI = "http://www.ecommerce.org/schema";
+ String qualifiedName;
+ Document doc;
+ DocumentType docType = null;
+
+ DOMImplementation domImpl;
+ Document aNewDoc;
+ String charact;
+ java.util.List illegalQNames = new java.util.ArrayList();
+ illegalQNames.add("namespaceURI:{");
+ illegalQNames.add("namespaceURI:}");
+ illegalQNames.add("namespaceURI:~");
+ illegalQNames.add("namespaceURI:'");
+ illegalQNames.add("namespaceURI:!");
+ illegalQNames.add("namespaceURI:@");
+ illegalQNames.add("namespaceURI:#");
+ illegalQNames.add("namespaceURI:$");
+ illegalQNames.add("namespaceURI:%");
+ illegalQNames.add("namespaceURI:^");
+ illegalQNames.add("namespaceURI:&");
+ illegalQNames.add("namespaceURI:*");
+ illegalQNames.add("namespaceURI:(");
+ illegalQNames.add("namespaceURI:)");
+ illegalQNames.add("namespaceURI:+");
+ illegalQNames.add("namespaceURI:=");
+ illegalQNames.add("namespaceURI:[");
+ illegalQNames.add("namespaceURI:]");
+ illegalQNames.add("namespaceURI:\\");
+ illegalQNames.add("namespaceURI:/");
+ illegalQNames.add("namespaceURI:;");
+ illegalQNames.add("namespaceURI:`");
+ illegalQNames.add("namespaceURI:<");
+ illegalQNames.add("namespaceURI:>");
+ illegalQNames.add("namespaceURI:,");
+ illegalQNames.add("namespaceURI:a ");
+ illegalQNames.add("namespaceURI:\"");
+
+ doc = (Document) load("staffNS", false);
+ for (int indexN1009A = 0; indexN1009A < illegalQNames.size(); indexN1009A++) {
+ qualifiedName = (String) illegalQNames.get(indexN1009A);
+ domImpl = doc.getImplementation();
+
+ {
+ boolean success = false;
+ try {
+ aNewDoc = domImpl.createDocument(namespaceURI, qualifiedName, docType);
+ } catch (DOMException ex) {
+ success = (ex.code == DOMException.INVALID_CHARACTER_ERR);
+ }
+ assertTrue("throw_INVALID_CHARACTER_ERR", success);
+ }
+ }
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level2/core/createDocument05";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(createDocument05.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level2/core/createDocument06.java b/dom/src/test/java/org/w3c/domts/level2/core/createDocument06.java
new file mode 100644
index 0000000..7653d26
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level2/core/createDocument06.java
@@ -0,0 +1,108 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+
+Copyright (c) 2001 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+
+*/
+
+package org.w3c.domts.level2.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The "createDocument(namespaceURI,qualifiedName,doctype)" method for a
+ * DOMImplementation should raise NAMESPACE_ERR DOMException
+ * if qualifiedName has the "xml" prefix and namespaceURI different from
+ * "http://www.w3.org/XML/1998/namespace"
+ *
+ * Invoke method createDocument(namespaceURI,qualifiedName,doctype) on
+ * this domimplementation with qualifiedName "xml:local"
+ * and namespaceURI as the string
+ * "http://www.ecommerce.org/schema" (which is different from the required
+ * "http://www.w3.org/XML/1998/namespace"). Method should raise
+ * NAMESPACE_ERR DOMException.
+* @author NIST
+* @author Mary Brady
+* @see <a href="http://www.w3.org/TR/DOM-Level-2-Core/core#xpointer(id('ID-258A00AF')/constant[@name='NAMESPACE_ERR'])">http://www.w3.org/TR/DOM-Level-2-Core/core#xpointer(id('ID-258A00AF')/constant[@name='NAMESPACE_ERR'])</a>
+* @see <a href="http://www.w3.org/TR/DOM-Level-2-Core/core#Level-2-Core-DOM-createDocument">http://www.w3.org/TR/DOM-Level-2-Core/core#Level-2-Core-DOM-createDocument</a>
+* @see <a href="http://www.w3.org/TR/DOM-Level-2-Core/core#xpointer(id('Level-2-Core-DOM-createDocument')/raises/exception[@name='DOMException']/descr/p[substring-before(.,':')='NAMESPACE_ERR'])">http://www.w3.org/TR/DOM-Level-2-Core/core#xpointer(id('Level-2-Core-DOM-createDocument')/raises/exception[@name='DOMException']/descr/p[substring-before(.,':')='NAMESPACE_ERR'])</a>
+*/
+public final class createDocument06 extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public createDocument06(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "staffNS", false);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ String namespaceURI = "http://ecommerce.org/schema";
+ String qualifiedName = "xml:local";
+ Document doc;
+ DocumentType docType = null;
+
+ DOMImplementation domImpl;
+ Document aNewDoc;
+ doc = (Document) load("staffNS", false);
+ domImpl = doc.getImplementation();
+
+ {
+ boolean success = false;
+ try {
+ aNewDoc = domImpl.createDocument(namespaceURI, qualifiedName, docType);
+ } catch (DOMException ex) {
+ success = (ex.code == DOMException.NAMESPACE_ERR);
+ }
+ assertTrue("throw_NAMESPACE_ERR", success);
+ }
+}
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level2/core/createDocument06";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(createDocument06.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level2/core/createDocument07.java b/dom/src/test/java/org/w3c/domts/level2/core/createDocument07.java
new file mode 100644
index 0000000..9976ad3
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level2/core/createDocument07.java
@@ -0,0 +1,101 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+
+Copyright (c) 2001 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+
+*/
+
+package org.w3c.domts.level2.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The "createDocument(namespaceURI,qualifiedName,doctype)" method for a
+ * DOMImplementation should return a new xml Document object of the
+ * specified type with its document element given that all parameters are
+ * valid and correctly formed.
+ *
+ * Invoke method createDocument(namespaceURI,qualifiedName,doctype) on
+ * this domimplementation. namespaceURI is "http://www.ecommerce.org/schema"
+ * qualifiedName is "y:x" and doctype is null.
+ * Method should return a new xml Document as specified by the listed parameters.
+* @author NIST
+* @author Mary Brady
+* @see <a href="http://www.w3.org/TR/DOM-Level-2-Core/core#Level-2-Core-DOM-createDocument">http://www.w3.org/TR/DOM-Level-2-Core/core#Level-2-Core-DOM-createDocument</a>
+*/
+public final class createDocument07 extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public createDocument07(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "staffNS", false);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ String namespaceURI = "http://www.ecommerce.org/schema";
+ String qualifiedName = "y:x";
+ Document doc;
+ DocumentType docType = null;
+
+ DOMImplementation domImpl;
+ Document aNewDoc;
+ String nodeName;
+ String nodeValue;
+ doc = (Document) load("staffNS", false);
+ domImpl = doc.getImplementation();
+ aNewDoc = domImpl.createDocument(namespaceURI, qualifiedName, docType);
+ nodeName = aNewDoc.getNodeName();
+ nodeValue = aNewDoc.getNodeValue();
+ assertEquals("nodeName", "#document", nodeName);
+ assertNull("nodeValue", nodeValue);
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level2/core/createDocument07";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(createDocument07.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level2/core/createDocument08.java b/dom/src/test/java/org/w3c/domts/level2/core/createDocument08.java
new file mode 100644
index 0000000..5cb52bd
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level2/core/createDocument08.java
@@ -0,0 +1,92 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+
+Copyright (c) 2004 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+
+*/
+
+package org.w3c.domts.level2.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * DOMImplementation.createDocument with an empty qualified name should cause an INVALID_CHARACTER_ERR.
+* @author Curt Arnold
+* @see <a href="http://www.w3.org/TR/DOM-Level-2-Core/core#">http://www.w3.org/TR/DOM-Level-2-Core/core#</a>
+* @see <a href="http://www.w3.org/Bugs/Public/show_bug.cgi?id=525">http://www.w3.org/Bugs/Public/show_bug.cgi?id=525</a>
+*/
+public final class createDocument08 extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ */
+ public createDocument08(final DOMTestDocumentBuilderFactory factory) {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ String namespaceURI = "http://www.example.org/schema";
+ DocumentType docType = null;
+
+ DOMImplementation domImpl;
+ Document aNewDoc;
+ String charact;
+ domImpl = getImplementation();
+
+ {
+ boolean success = false;
+ try {
+ aNewDoc = domImpl.createDocument(namespaceURI, "", docType);
+ } catch (DOMException ex) {
+ success = (ex.code == DOMException.INVALID_CHARACTER_ERR);
+ }
+ assertTrue("throw_INVALID_CHARACTER_ERR", success);
+ }
+}
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level2/core/createDocument08";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(createDocument08.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level2/core/createDocumentType01.java b/dom/src/test/java/org/w3c/domts/level2/core/createDocumentType01.java
new file mode 100644
index 0000000..dc4b4a3
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level2/core/createDocumentType01.java
@@ -0,0 +1,105 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+
+Copyright (c) 2001 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+
+*/
+
+package org.w3c.domts.level2.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The "createDocumentType(qualifiedName,publicId,systemId)" method for a
+ * DOMImplementation should raise NAMESPACE_ERR DOMException if
+ * qualifiedName is malformed.
+ *
+ * Retrieve the DOMImplementation on the XMLNS Document.
+ * Invoke method createDocumentType(qualifiedName,publicId,systemId)
+ * on the retrieved DOMImplementation with qualifiedName being the literal
+ * string "prefix::local", publicId as "STAFF", and systemId as "staff".
+ * Method should raise NAMESPACE_ERR DOMException.
+* @author NIST
+* @author Mary Brady
+* @see <a href="http://www.w3.org/TR/DOM-Level-2-Core/core#xpointer(id('ID-258A00AF')/constant[@name='NAMESPACE_ERR'])">http://www.w3.org/TR/DOM-Level-2-Core/core#xpointer(id('ID-258A00AF')/constant[@name='NAMESPACE_ERR'])</a>
+* @see <a href="http://www.w3.org/TR/DOM-Level-2-Core/core#Level-2-Core-DOM-createDocType">http://www.w3.org/TR/DOM-Level-2-Core/core#Level-2-Core-DOM-createDocType</a>
+* @see <a href="http://www.w3.org/TR/DOM-Level-2-Core/core#xpointer(id('Level-2-Core-DOM-createDocType')/raises/exception[@name='DOMException']/descr/p[substring-before(.,':')='NAMESPACE_ERR'])">http://www.w3.org/TR/DOM-Level-2-Core/core#xpointer(id('Level-2-Core-DOM-createDocType')/raises/exception[@name='DOMException']/descr/p[substring-before(.,':')='NAMESPACE_ERR'])</a>
+*/
+public final class createDocumentType01 extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public createDocumentType01(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "staffNS", false);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ String publicId = "STAFF";
+ String systemId = "staff.xml";
+ String malformedName = "prefix::local";
+ Document doc;
+ DOMImplementation domImpl;
+ DocumentType newType;
+ doc = (Document) load("staffNS", false);
+ domImpl = doc.getImplementation();
+
+ {
+ boolean success = false;
+ try {
+ newType = domImpl.createDocumentType(malformedName, publicId, systemId);
+ } catch (DOMException ex) {
+ success = (ex.code == DOMException.NAMESPACE_ERR);
+ }
+ assertTrue("throw_NAMESPACE_ERR", success);
+ }
+}
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level2/core/createDocumentType01";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(createDocumentType01.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level2/core/createDocumentType02.java b/dom/src/test/java/org/w3c/domts/level2/core/createDocumentType02.java
new file mode 100644
index 0000000..39317ae
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level2/core/createDocumentType02.java
@@ -0,0 +1,136 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+
+Copyright (c) 2001 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+
+*/
+
+package org.w3c.domts.level2.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The "createDocumentType(qualifiedName,publicId,systemId)" method for a
+ * DOMImplementation should raise INVALID_CHARACTER_ERR DOMException if
+ * qualifiedName contains an illegal character.
+ *
+ * Invoke method createDocumentType(qualifiedName,publicId,systemId) on
+ * this domimplementation with qualifiedName containing an illegal character
+ * from illegalChars[]. Method should raise INVALID_CHARACTER_ERR
+ * DOMException for all characters in illegalChars[].
+* @author NIST
+* @author Mary Brady
+* @see <a href="http://www.w3.org/TR/DOM-Level-2-Core/core#Level-2-Core-DOM-createDocType">http://www.w3.org/TR/DOM-Level-2-Core/core#Level-2-Core-DOM-createDocType</a>
+* @see <a href="http://www.w3.org/TR/DOM-Level-2-Core/core#xpointer(id('Level-2-Core-DOM-createDocType')/raises/exception[@name='DOMException']/descr/p[substring-before(.,':')='INVALID_CHARACTER_ERR'])">http://www.w3.org/TR/DOM-Level-2-Core/core#xpointer(id('Level-2-Core-DOM-createDocType')/raises/exception[@name='DOMException']/descr/p[substring-before(.,':')='INVALID_CHARACTER_ERR'])</a>
+*/
+public final class createDocumentType02 extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public createDocumentType02(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "staffNS", false);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ String publicId = "http://www.localhost.com/";
+ String systemId = "myDoc.dtd";
+ String qualifiedName;
+ Document doc;
+ DocumentType docType = null;
+
+ DOMImplementation domImpl;
+ java.util.List illegalQNames = new java.util.ArrayList();
+ illegalQNames.add("edi:{");
+ illegalQNames.add("edi:}");
+ illegalQNames.add("edi:~");
+ illegalQNames.add("edi:'");
+ illegalQNames.add("edi:!");
+ illegalQNames.add("edi:@");
+ illegalQNames.add("edi:#");
+ illegalQNames.add("edi:$");
+ illegalQNames.add("edi:%");
+ illegalQNames.add("edi:^");
+ illegalQNames.add("edi:&");
+ illegalQNames.add("edi:*");
+ illegalQNames.add("edi:(");
+ illegalQNames.add("edi:)");
+ illegalQNames.add("edi:+");
+ illegalQNames.add("edi:=");
+ illegalQNames.add("edi:[");
+ illegalQNames.add("edi:]");
+ illegalQNames.add("edi:\\");
+ illegalQNames.add("edi:/");
+ illegalQNames.add("edi:;");
+ illegalQNames.add("edi:`");
+ illegalQNames.add("edi:<");
+ illegalQNames.add("edi:>");
+ illegalQNames.add("edi:,");
+ illegalQNames.add("edi:a ");
+ illegalQNames.add("edi:\"");
+
+ doc = (Document) load("staffNS", false);
+ for (int indexN1009A = 0; indexN1009A < illegalQNames.size(); indexN1009A++) {
+ qualifiedName = (String) illegalQNames.get(indexN1009A);
+ domImpl = doc.getImplementation();
+
+ {
+ boolean success = false;
+ try {
+ docType = domImpl.createDocumentType(qualifiedName, publicId, systemId);
+ } catch (DOMException ex) {
+ success = (ex.code == DOMException.INVALID_CHARACTER_ERR);
+ }
+ assertTrue("throw_INVALID_CHARACTER_ERR", success);
+ }
+ }
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level2/core/createDocumentType02";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(createDocumentType02.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level2/core/createDocumentType03.java b/dom/src/test/java/org/w3c/domts/level2/core/createDocumentType03.java
new file mode 100644
index 0000000..2777331
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level2/core/createDocumentType03.java
@@ -0,0 +1,100 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+
+Copyright (c) 2001 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+
+*/
+
+package org.w3c.domts.level2.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The "createDocumentType(qualifiedName,publicId,systemId)" method for a
+ * DOMImplementation should return a new DocumentType node
+ * given that qualifiedName is valid and correctly formed.
+ *
+ * Invoke method createDocumentType(qualifiedName,publicId,systemId) on
+ * this domimplementation with qualifiedName "prefix:myDoc".
+ * Method should return a new DocumentType node.
+* @author NIST
+* @author Mary Brady
+* @see <a href="http://www.w3.org/TR/DOM-Level-2-Core/core#Level-2-Core-DOM-createDocType">http://www.w3.org/TR/DOM-Level-2-Core/core#Level-2-Core-DOM-createDocType</a>
+*/
+public final class createDocumentType03 extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public createDocumentType03(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "staffNS", false);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ String namespaceURI = "http://ecommerce.org/schema";
+ String qualifiedName = "prefix:myDoc";
+ String publicId = "http://www.localhost.com";
+ String systemId = "myDoc.dtd";
+ Document doc;
+ DOMImplementation domImpl;
+ DocumentType newType = null;
+
+ String nodeName;
+ String nodeValue;
+ doc = (Document) load("staffNS", false);
+ domImpl = doc.getImplementation();
+ newType = domImpl.createDocumentType(qualifiedName, publicId, systemId);
+ nodeName = newType.getNodeName();
+ assertEquals("nodeName", "prefix:myDoc", nodeName);
+ nodeValue = newType.getNodeValue();
+ assertNull("nodeValue", nodeValue);
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level2/core/createDocumentType03";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(createDocumentType03.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level2/core/createDocumentType04.java b/dom/src/test/java/org/w3c/domts/level2/core/createDocumentType04.java
new file mode 100644
index 0000000..c69a08b
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level2/core/createDocumentType04.java
@@ -0,0 +1,93 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+
+Copyright (c) 2004 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+
+*/
+
+package org.w3c.domts.level2.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * DOMImplementation.createDocumentType with an empty name should cause an INVALID_CHARACTER_ERR.
+* @author Curt Arnold
+* @see <a href="http://www.w3.org/TR/DOM-Level-2-Core/core#Level-2-Core-DOM-createDocType">http://www.w3.org/TR/DOM-Level-2-Core/core#Level-2-Core-DOM-createDocType</a>
+* @see <a href="http://www.w3.org/TR/DOM-Level-2-Core/core#xpointer(id('Level-2-Core-DOM-createDocType')/raises/exception[@name='DOMException']/descr/p[substring-before(.,':')='INVALID_CHARACTER_ERR'])">http://www.w3.org/TR/DOM-Level-2-Core/core#xpointer(id('Level-2-Core-DOM-createDocType')/raises/exception[@name='DOMException']/descr/p[substring-before(.,':')='INVALID_CHARACTER_ERR'])</a>
+* @see <a href="http://www.w3.org/Bugs/Public/show_bug.cgi?id=525">http://www.w3.org/Bugs/Public/show_bug.cgi?id=525</a>
+*/
+public final class createDocumentType04 extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ */
+ public createDocumentType04(final DOMTestDocumentBuilderFactory factory) {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ String publicId = "http://www.example.com/";
+ String systemId = "myDoc.dtd";
+ String qualifiedName;
+ DocumentType docType = null;
+
+ DOMImplementation domImpl;
+ domImpl = getImplementation();
+
+ {
+ boolean success = false;
+ try {
+ docType = domImpl.createDocumentType("", publicId, systemId);
+ } catch (DOMException ex) {
+ success = (ex.code == DOMException.INVALID_CHARACTER_ERR);
+ }
+ assertTrue("throw_INVALID_CHARACTER_ERR", success);
+ }
+}
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level2/core/createDocumentType04";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(createDocumentType04.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level2/core/createElementNS01.java b/dom/src/test/java/org/w3c/domts/level2/core/createElementNS01.java
new file mode 100644
index 0000000..6b59b44
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level2/core/createElementNS01.java
@@ -0,0 +1,101 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+
+Copyright (c) 2001 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+
+*/
+
+package org.w3c.domts.level2.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The "createElementNS(namespaceURI,qualifiedName)" method for a
+ * Document should raise NAMESPACE_ERR DOMException if
+ * qualifiedName is malformed.
+ *
+ * Invoke method createElementNS(namespaceURI,qualifiedName) on
+ * the XMLNS Document with namespaceURI being the literal string
+ * "http://www.ecommerce.org/", and qualifiedName as "prefix::local".
+ * Method should raise NAMESPACE_ERR DOMException.
+* @author NIST
+* @author Mary Brady
+* @see <a href="http://www.w3.org/TR/DOM-Level-2-Core/core#xpointer(id('ID-258A00AF')/constant[@name='NAMESPACE_ERR'])">http://www.w3.org/TR/DOM-Level-2-Core/core#xpointer(id('ID-258A00AF')/constant[@name='NAMESPACE_ERR'])</a>
+* @see <a href="http://www.w3.org/TR/DOM-Level-2-Core/core#ID-DocCrElNS">http://www.w3.org/TR/DOM-Level-2-Core/core#ID-DocCrElNS</a>
+* @see <a href="http://www.w3.org/TR/DOM-Level-2-Core/core#xpointer(id('ID-DocCrElNS')/raises/exception[@name='DOMException']/descr/p[substring-before(.,':')='NAMESPACE_ERR'])">http://www.w3.org/TR/DOM-Level-2-Core/core#xpointer(id('ID-DocCrElNS')/raises/exception[@name='DOMException']/descr/p[substring-before(.,':')='NAMESPACE_ERR'])</a>
+*/
+public final class createElementNS01 extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public createElementNS01(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "staffNS", false);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ String namespaceURI = "http://www.ecommerce.org/";
+ String malformedName = "prefix::local";
+ Document doc;
+ Element newElement;
+ doc = (Document) load("staffNS", false);
+
+ {
+ boolean success = false;
+ try {
+ newElement = doc.createElementNS(namespaceURI, malformedName);
+ } catch (DOMException ex) {
+ success = (ex.code == DOMException.NAMESPACE_ERR);
+ }
+ assertTrue("throw_NAMESPACE_ERR", success);
+ }
+}
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level2/core/createElementNS01";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(createElementNS01.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level2/core/createElementNS02.java b/dom/src/test/java/org/w3c/domts/level2/core/createElementNS02.java
new file mode 100644
index 0000000..a2c26a7
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level2/core/createElementNS02.java
@@ -0,0 +1,101 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+
+Copyright (c) 2001 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+
+*/
+
+package org.w3c.domts.level2.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The "createElementNS(namespaceURI,qualifiedName)" method for a
+ * Document should raise NAMESPACE_ERR DOMException if
+ * qualifiedName has a prefix and namespaceURI is null.
+ *
+ * Invoke method createElementNS(namespaceURI,qualifiedName) on this document
+ * with namespaceURI being null and qualifiedName being "elem:attr1".
+ * Method should raise NAMESPACE_ERR DOMException.
+* @author NIST
+* @author Mary Brady
+* @see <a href="http://www.w3.org/TR/DOM-Level-2-Core/core#xpointer(id('ID-258A00AF')/constant[@name='NAMESPACE_ERR'])">http://www.w3.org/TR/DOM-Level-2-Core/core#xpointer(id('ID-258A00AF')/constant[@name='NAMESPACE_ERR'])</a>
+* @see <a href="http://www.w3.org/TR/DOM-Level-2-Core/core#ID-DocCrElNS">http://www.w3.org/TR/DOM-Level-2-Core/core#ID-DocCrElNS</a>
+* @see <a href="http://www.w3.org/TR/DOM-Level-2-Core/core#xpointer(id('ID-DocCrElNS')/raises/exception[@name='DOMException']/descr/p[substring-before(.,':')='NAMESPACE_ERR'])">http://www.w3.org/TR/DOM-Level-2-Core/core#xpointer(id('ID-DocCrElNS')/raises/exception[@name='DOMException']/descr/p[substring-before(.,':')='NAMESPACE_ERR'])</a>
+*/
+public final class createElementNS02 extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public createElementNS02(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "staffNS", false);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ String namespaceURI = null;
+
+ String qualifiedName = "prefix:local";
+ Document doc;
+ Element newElement;
+ doc = (Document) load("staffNS", false);
+
+ {
+ boolean success = false;
+ try {
+ newElement = doc.createElementNS(namespaceURI, qualifiedName);
+ } catch (DOMException ex) {
+ success = (ex.code == DOMException.NAMESPACE_ERR);
+ }
+ assertTrue("throw_NAMESPACE_ERR", success);
+ }
+}
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level2/core/createElementNS02";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(createElementNS02.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level2/core/createElementNS03.java b/dom/src/test/java/org/w3c/domts/level2/core/createElementNS03.java
new file mode 100644
index 0000000..fe503b3
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level2/core/createElementNS03.java
@@ -0,0 +1,134 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+
+Copyright (c) 2001 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+
+*/
+
+package org.w3c.domts.level2.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The "createElementNS(namespaceURI,qualifiedName)" method for a
+ * Document should raise INVALID_CHARACTER_ERR DOMException if
+ * qualifiedName contains an illegal character.
+ *
+ * Invoke method createElementNS(namespaceURI,qualifiedName) on this document
+ * with qualifiedName containing an illegal character from illegalChars[].
+ * Method should raise INVALID_CHARACTER_ERR DOMException for all characters
+ * in illegalChars[].
+* @author NIST
+* @author Mary Brady
+* @see <a href="http://www.w3.org/TR/DOM-Level-2-Core/core#ID-DocCrElNS">http://www.w3.org/TR/DOM-Level-2-Core/core#ID-DocCrElNS</a>
+* @see <a href="http://www.w3.org/TR/DOM-Level-2-Core/core#xpointer(id('ID-DocCrElNS')/raises/exception[@name='DOMException']/descr/p[substring-before(.,':')='INVALID_CHARACTER_ERR'])">http://www.w3.org/TR/DOM-Level-2-Core/core#xpointer(id('ID-DocCrElNS')/raises/exception[@name='DOMException']/descr/p[substring-before(.,':')='INVALID_CHARACTER_ERR'])</a>
+*/
+public final class createElementNS03 extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public createElementNS03(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "staffNS", false);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ String namespaceURI = "http://www.wedding.com/";
+ String qualifiedName;
+ Document doc;
+ boolean done;
+ Element newElement;
+ String charact;
+ java.util.List illegalQNames = new java.util.ArrayList();
+ illegalQNames.add("person:{");
+ illegalQNames.add("person:}");
+ illegalQNames.add("person:~");
+ illegalQNames.add("person:'");
+ illegalQNames.add("person:!");
+ illegalQNames.add("person:@");
+ illegalQNames.add("person:#");
+ illegalQNames.add("person:$");
+ illegalQNames.add("person:%");
+ illegalQNames.add("person:^");
+ illegalQNames.add("person:&");
+ illegalQNames.add("person:*");
+ illegalQNames.add("person:(");
+ illegalQNames.add("person:)");
+ illegalQNames.add("person:+");
+ illegalQNames.add("person:=");
+ illegalQNames.add("person:[");
+ illegalQNames.add("person:]");
+ illegalQNames.add("person:\\");
+ illegalQNames.add("person:/");
+ illegalQNames.add("person:;");
+ illegalQNames.add("person:`");
+ illegalQNames.add("person:<");
+ illegalQNames.add("person:>");
+ illegalQNames.add("person:,");
+ illegalQNames.add("person:a ");
+ illegalQNames.add("person:\"");
+
+ doc = (Document) load("staffNS", false);
+ for (int indexN10098 = 0; indexN10098 < illegalQNames.size(); indexN10098++) {
+ qualifiedName = (String) illegalQNames.get(indexN10098);
+
+ {
+ boolean success = false;
+ try {
+ newElement = doc.createElementNS(namespaceURI, qualifiedName);
+ } catch (DOMException ex) {
+ success = (ex.code == DOMException.INVALID_CHARACTER_ERR);
+ }
+ assertTrue("throw_INVALID_CHARACTER_ERR", success);
+ }
+ }
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level2/core/createElementNS03";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(createElementNS03.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level2/core/createElementNS04.java b/dom/src/test/java/org/w3c/domts/level2/core/createElementNS04.java
new file mode 100644
index 0000000..b54d182
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level2/core/createElementNS04.java
@@ -0,0 +1,103 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+
+Copyright (c) 2001 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+
+*/
+
+package org.w3c.domts.level2.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The "createElementNS(namespaceURI,qualifiedName") method for
+ * a Document should raise NAMESPACE_ERR DOMException if the
+ * qualifiedName has an "xml" prefix and the namespaceURI is different
+ * from http://www.w3.org/XML/1998/namespace".
+ *
+ * Invoke method createElementNS(namespaceURI,qualifiedName) on this document
+ * with qualifiedName being "xml:element1" and namespaceURI equals the string
+ * "http://www.w3.org/XML/1997/namespace" (which differs from the required
+ * string "http://www.w3.org/XML/1998/namespace").
+ * Method should raise NAMESPACE_ERR DOMException.
+* @author NIST
+* @author Mary Brady
+* @see <a href="http://www.w3.org/TR/DOM-Level-2-Core/core#xpointer(id('ID-258A00AF')/constant[@name='NAMESPACE_ERR'])">http://www.w3.org/TR/DOM-Level-2-Core/core#xpointer(id('ID-258A00AF')/constant[@name='NAMESPACE_ERR'])</a>
+* @see <a href="http://www.w3.org/TR/DOM-Level-2-Core/core#ID-DocCrElNS">http://www.w3.org/TR/DOM-Level-2-Core/core#ID-DocCrElNS</a>
+* @see <a href="http://www.w3.org/TR/DOM-Level-2-Core/core#xpointer(id('ID-DocCrElNS')/raises/exception[@name='DOMException']/descr/p[substring-before(.,':')='NAMESPACE_ERR'])">http://www.w3.org/TR/DOM-Level-2-Core/core#xpointer(id('ID-DocCrElNS')/raises/exception[@name='DOMException']/descr/p[substring-before(.,':')='NAMESPACE_ERR'])</a>
+*/
+public final class createElementNS04 extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public createElementNS04(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "staffNS", false);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ String namespaceURI = "http://www.w3.org/XML/1998/namespaces";
+ String qualifiedName = "xml:element1";
+ Document doc;
+ Element newElement;
+ doc = (Document) load("staffNS", false);
+
+ {
+ boolean success = false;
+ try {
+ newElement = doc.createElementNS(namespaceURI, qualifiedName);
+ } catch (DOMException ex) {
+ success = (ex.code == DOMException.NAMESPACE_ERR);
+ }
+ assertTrue("throw_NAMESPACE_ERR", success);
+ }
+}
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level2/core/createElementNS04";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(createElementNS04.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level2/core/createElementNS05.java b/dom/src/test/java/org/w3c/domts/level2/core/createElementNS05.java
new file mode 100644
index 0000000..33ff00c
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level2/core/createElementNS05.java
@@ -0,0 +1,92 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+
+Copyright (c) 2001 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+
+*/
+
+package org.w3c.domts.level2.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The "createElementNS(namespaceURI,qualifiedName)" method for a
+ * Document should return a new Element object given that all parameters
+ * are valid and correctly formed.
+ *
+ * Invoke method createElementNS(namespaceURI,qualifiedName on this document
+ * with namespaceURI as "http://www.nist.gov" and qualifiedName as "gov:faculty".
+ * Method should return a new Element object whose name is "gov:faculty".
+* @author NIST
+* @author Mary Brady
+* @see <a href="http://www.w3.org/TR/DOM-Level-2-Core/core#ID-104682815">http://www.w3.org/TR/DOM-Level-2-Core/core#ID-104682815</a>
+*/
+public final class createElementNS05 extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public createElementNS05(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "staffNS", false);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ String namespaceURI = "http://www.nist.gov";
+ String qualifiedName = "gov:faculty";
+ Document doc;
+ Element newElement;
+ String elementName;
+ doc = (Document) load("staffNS", false);
+ newElement = doc.createElementNS(namespaceURI, qualifiedName);
+ elementName = newElement.getTagName();
+ assertEquals("throw_Equals", qualifiedName, elementName);
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level2/core/createElementNS05";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(createElementNS05.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level2/core/createElementNS06.java b/dom/src/test/java/org/w3c/domts/level2/core/createElementNS06.java
new file mode 100644
index 0000000..e4744f3
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level2/core/createElementNS06.java
@@ -0,0 +1,95 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+
+Copyright (c) 2004 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+
+*/
+
+package org.w3c.domts.level2.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * Document.createElementNS with an empty qualified name should cause an INVALID_CHARACTER_ERR.
+* @author Curt Arnold
+* @see <a href="http://www.w3.org/TR/DOM-Level-2-Core/core#ID-DocCrElNS">http://www.w3.org/TR/DOM-Level-2-Core/core#ID-DocCrElNS</a>
+* @see <a href="http://www.w3.org/TR/DOM-Level-2-Core/core#xpointer(id('ID-DocCrElNS')/raises/exception[@name='DOMException']/descr/p[substring-before(.,':')='INVALID_CHARACTER_ERR'])">http://www.w3.org/TR/DOM-Level-2-Core/core#xpointer(id('ID-DocCrElNS')/raises/exception[@name='DOMException']/descr/p[substring-before(.,':')='INVALID_CHARACTER_ERR'])</a>
+* @see <a href="http://www.w3.org/Bugs/Public/show_bug.cgi?id=525">http://www.w3.org/Bugs/Public/show_bug.cgi?id=525</a>
+*/
+public final class createElementNS06 extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public createElementNS06(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "hc_staff", true);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ String namespaceURI = "http://www.example.com/";
+ String qualifiedName;
+ Document doc;
+ boolean done;
+ Element newElement;
+ String charact;
+ doc = (Document) load("hc_staff", true);
+
+ {
+ boolean success = false;
+ try {
+ newElement = doc.createElementNS(namespaceURI, "");
+ } catch (DOMException ex) {
+ success = (ex.code == DOMException.INVALID_CHARACTER_ERR);
+ }
+ assertTrue("throw_INVALID_CHARACTER_ERR", success);
+ }
+}
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level2/core/createElementNS06";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(createElementNS06.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level2/core/documentcreateattributeNS01.java b/dom/src/test/java/org/w3c/domts/level2/core/documentcreateattributeNS01.java
new file mode 100644
index 0000000..1bb6da1
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level2/core/documentcreateattributeNS01.java
@@ -0,0 +1,95 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+
+Copyright (c) 2001 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+
+*/
+
+package org.w3c.domts.level2.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The method createAttributeNS creates an attribute of the given qualified name and namespace URI
+ *
+ * Invoke the createAttributeNS method on this Document object with a null
+ * namespaceURI, and a qualifiedName without a prefix. This should return a valid Attr
+ * node object.
+* @author IBM
+* @author Neil Delima
+* @see <a href="http://www.w3.org/TR/DOM-Level-2-Core/core">http://www.w3.org/TR/DOM-Level-2-Core/core</a>
+* @see <a href="http://www.w3.org/TR/DOM-Level-2-Core/core#ID-DocCrAttrNS">http://www.w3.org/TR/DOM-Level-2-Core/core#ID-DocCrAttrNS</a>
+*/
+public final class documentcreateattributeNS01 extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public documentcreateattributeNS01(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "staffNS", false);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ Attr attribute;
+ String namespaceURI = null;
+
+ String qualifiedName = "test";
+ String name;
+ String nodeName;
+ String nodeValue;
+ doc = (Document) load("staffNS", false);
+ attribute = doc.createAttributeNS(namespaceURI, qualifiedName);
+ nodeName = attribute.getNodeName();
+ nodeValue = attribute.getNodeValue();
+ assertEquals("documentcreateattributeNS01", "test", nodeName);
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level2/core/documentcreateattributeNS01";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(documentcreateattributeNS01.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level2/core/documentcreateattributeNS02.java b/dom/src/test/java/org/w3c/domts/level2/core/documentcreateattributeNS02.java
new file mode 100644
index 0000000..8582ff3
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level2/core/documentcreateattributeNS02.java
@@ -0,0 +1,111 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+
+Copyright (c) 2001 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+
+*/
+
+package org.w3c.domts.level2.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The method createAttributeNS creates an attribute of the given qualified name and namespace URI
+ *
+ * Invoke the createAttributeNS method on this Document object with a valid values for
+ * namespaceURI, and a qualifiedName as below. This should return a valid Attr node.
+* @author IBM
+* @author Neil Delima
+* @see <a href="http://www.w3.org/TR/DOM-Level-2-Core/core">http://www.w3.org/TR/DOM-Level-2-Core/core</a>
+* @see <a href="http://www.w3.org/TR/DOM-Level-2-Core/core#ID-DocCrAttrNS">http://www.w3.org/TR/DOM-Level-2-Core/core#ID-DocCrAttrNS</a>
+*/
+public final class documentcreateattributeNS02 extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public documentcreateattributeNS02(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "staffNS", false);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ Attr attribute1;
+ Attr attribute2;
+ String name;
+ String nodeName;
+ String nodeValue;
+ String prefix;
+ String namespaceURI;
+ doc = (Document) load("staffNS", false);
+ attribute1 = doc.createAttributeNS("http://www.w3.org/XML/1998/namespace", "xml:xml");
+ name = attribute1.getName();
+ nodeName = attribute1.getNodeName();
+ nodeValue = attribute1.getNodeValue();
+ prefix = attribute1.getPrefix();
+ namespaceURI = attribute1.getNamespaceURI();
+ assertEquals("documentcreateattributeNS02_att1_name", "xml:xml", name);
+ assertEquals("documentcreateattributeNS02_att1_nodeName", "xml:xml", nodeName);
+ assertEquals("documentcreateattributeNS02_att1_nodeValue", "", nodeValue);
+ assertEquals("documentcreateattributeNS02_att1_prefix", "xml", prefix);
+ assertEquals("documentcreateattributeNS02_att1_namespaceURI", "http://www.w3.org/XML/1998/namespace", namespaceURI);
+ attribute2 = doc.createAttributeNS("http://www.w3.org/2000/xmlns/", "xmlns");
+ name = attribute2.getName();
+ nodeName = attribute2.getNodeName();
+ nodeValue = attribute2.getNodeValue();
+ prefix = attribute2.getPrefix();
+ namespaceURI = attribute2.getNamespaceURI();
+ assertEquals("documentcreateattributeNS02_att2_name", "xmlns", name);
+ assertEquals("documentcreateattributeNS02_att2_nodeName", "xmlns", nodeName);
+ assertEquals("documentcreateattributeNS02_att2_nodeValue", "", nodeValue);
+ assertEquals("documentcreateattributeNS02_att2_namespaceURI", "http://www.w3.org/2000/xmlns/", namespaceURI);
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level2/core/documentcreateattributeNS02";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(documentcreateattributeNS02.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level2/core/documentcreateattributeNS03.java b/dom/src/test/java/org/w3c/domts/level2/core/documentcreateattributeNS03.java
new file mode 100644
index 0000000..8f457b0
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level2/core/documentcreateattributeNS03.java
@@ -0,0 +1,125 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+
+
+
+Copyright (c) 2001 World Wide Web Consortium,
+
+(Massachusetts Institute of Technology, Institut National de
+
+Recherche en Informatique et en Automatique, Keio University). All
+
+Rights Reserved. This program is distributed under the W3C's Software
+
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+
+
+
+*/
+
+package org.w3c.domts.level2.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The method createAttributeNS raises an INVALID_CHARACTER_ERR if the specified
+ * qualified name contains an illegal character
+ *
+ * Invoke the createAttributeNS method on this Document object with a valid value for
+ * namespaceURI, and qualifiedNames that contain illegal characters. Check if the an
+ * INVALID_CHARACTER_ERR was thrown.
+* @author IBM
+* @author Neil Delima
+* @see <a href="http://www.w3.org/TR/DOM-Level-2-Core/core">http://www.w3.org/TR/DOM-Level-2-Core/core</a>
+* @see <a href="http://www.w3.org/TR/DOM-Level-2-Core/core#ID-DocCrAttrNS">http://www.w3.org/TR/DOM-Level-2-Core/core#ID-DocCrAttrNS</a>
+*/
+public final class documentcreateattributeNS03 extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public documentcreateattributeNS03(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "staffNS", false);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ Attr attribute;
+ String namespaceURI = "http://www.w3.org/DOM/Test/Level2";
+ String qualifiedName;
+ java.util.List qualifiedNames = new java.util.ArrayList();
+ qualifiedNames.add("/");
+ qualifiedNames.add("//");
+ qualifiedNames.add("\\");
+ qualifiedNames.add(";");
+ qualifiedNames.add("&");
+ qualifiedNames.add("*");
+ qualifiedNames.add("]]");
+ qualifiedNames.add(">");
+ qualifiedNames.add("<");
+
+ doc = (Document) load("staffNS", false);
+ for (int indexN1005A = 0; indexN1005A < qualifiedNames.size(); indexN1005A++) {
+ qualifiedName = (String) qualifiedNames.get(indexN1005A);
+
+ {
+ boolean success = false;
+ try {
+ attribute = doc.createAttributeNS(namespaceURI, qualifiedName);
+ } catch (DOMException ex) {
+ success = (ex.code == DOMException.INVALID_CHARACTER_ERR);
+ }
+ assertTrue("documentcreateattributeNS03", success);
+ }
+ }
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level2/core/documentcreateattributeNS03";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(documentcreateattributeNS03.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level2/core/documentcreateattributeNS04.java b/dom/src/test/java/org/w3c/domts/level2/core/documentcreateattributeNS04.java
new file mode 100644
index 0000000..bc7b323
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level2/core/documentcreateattributeNS04.java
@@ -0,0 +1,120 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+
+
+
+Copyright (c) 2001 World Wide Web Consortium,
+
+(Massachusetts Institute of Technology, Institut National de
+
+Recherche en Informatique et en Automatique, Keio University). All
+
+Rights Reserved. This program is distributed under the W3C's Software
+
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+
+
+
+*/
+
+package org.w3c.domts.level2.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The method createAttributeNS raises a NAMESPACE_ERR if the specified qualified name
+ * is malformed.
+ *
+ * Invoke the createAttributeNS method on this Document object with a valid value for
+ * namespaceURI, and malformed qualifiedNames. Check if the a NAMESPACE_ERR was thrown.
+* @author IBM
+* @author Neil Delima
+* @see <a href="http://www.w3.org/TR/DOM-Level-2-Core/core">http://www.w3.org/TR/DOM-Level-2-Core/core</a>
+* @see <a href="http://www.w3.org/TR/DOM-Level-2-Core/core#ID-DocCrAttrNS">http://www.w3.org/TR/DOM-Level-2-Core/core#ID-DocCrAttrNS</a>
+*/
+public final class documentcreateattributeNS04 extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public documentcreateattributeNS04(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "staffNS", false);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ Attr attribute;
+ String namespaceURI = "http://www.w3.org/DOM/Test/Level2";
+ String qualifiedName;
+ java.util.List qualifiedNames = new java.util.ArrayList();
+ qualifiedNames.add("_:");
+ qualifiedNames.add(":0a");
+ qualifiedNames.add(":");
+ qualifiedNames.add("a:b:c");
+ qualifiedNames.add("_::a");
+
+ doc = (Document) load("staffNS", false);
+ for (int indexN1004E = 0; indexN1004E < qualifiedNames.size(); indexN1004E++) {
+ qualifiedName = (String) qualifiedNames.get(indexN1004E);
+
+ {
+ boolean success = false;
+ try {
+ attribute = doc.createAttributeNS(namespaceURI, qualifiedName);
+ } catch (DOMException ex) {
+ success = (ex.code == DOMException.NAMESPACE_ERR);
+ }
+ assertTrue("documentcreateattributeNS04", success);
+ }
+ }
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level2/core/documentcreateattributeNS04";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(documentcreateattributeNS04.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level2/core/documentcreateattributeNS05.java b/dom/src/test/java/org/w3c/domts/level2/core/documentcreateattributeNS05.java
new file mode 100644
index 0000000..7eecea3
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level2/core/documentcreateattributeNS05.java
@@ -0,0 +1,104 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+
+Copyright (c) 2001 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+
+*/
+
+package org.w3c.domts.level2.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The method createAttributeNS raises a NAMESPACE_ERR if the qualifiedName has a prefix and
+ * the namespaceURI is null.
+ *
+ * Invoke the createAttributeNS method on a new Document object with a null value for
+ * namespaceURI, and a valid qualifiedName. Check if a NAMESPACE_ERR is thrown.
+* @author IBM
+* @author Neil Delima
+* @see <a href="http://www.w3.org/TR/DOM-Level-2-Core/core">http://www.w3.org/TR/DOM-Level-2-Core/core</a>
+* @see <a href="http://www.w3.org/TR/DOM-Level-2-Core/core#ID-DocCrAttrNS">http://www.w3.org/TR/DOM-Level-2-Core/core#ID-DocCrAttrNS</a>
+*/
+public final class documentcreateattributeNS05 extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public documentcreateattributeNS05(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "staffNS", false);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ Document newDoc;
+ DocumentType docType = null;
+
+ DOMImplementation domImpl;
+ Attr attribute;
+ String namespaceURI = null;
+
+ String qualifiedName = "abc:def";
+ doc = (Document) load("staffNS", false);
+ domImpl = doc.getImplementation();
+ newDoc = domImpl.createDocument("http://www.w3.org/DOM/Test", "dom:doc", docType);
+
+ {
+ boolean success = false;
+ try {
+ attribute = newDoc.createAttributeNS(namespaceURI, qualifiedName);
+ } catch (DOMException ex) {
+ success = (ex.code == DOMException.NAMESPACE_ERR);
+ }
+ assertTrue("documentcreateattributeNS05", success);
+ }
+}
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level2/core/documentcreateattributeNS05";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(documentcreateattributeNS05.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level2/core/documentcreateattributeNS06.java b/dom/src/test/java/org/w3c/domts/level2/core/documentcreateattributeNS06.java
new file mode 100644
index 0000000..8f47801
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level2/core/documentcreateattributeNS06.java
@@ -0,0 +1,104 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+
+Copyright (c) 2001 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+
+*/
+
+package org.w3c.domts.level2.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The method createAttributeNS raises a NAMESPACE_ERR if the qualifiedName has a prefix that
+ * is "xml" and the namespaceURI is different from "http://www.w3.org/XML/1998/namespace".
+ *
+ * Invoke the createAttributeNS method on a new DOMImplementation object with the qualifiedName
+ * as xml:root and namespaceURI as http://www.w3.org/XML/1998 /namespace.
+ * Check if the NAMESPACE_ERR exception is thrown.
+* @author IBM
+* @author Neil Delima
+* @see <a href="http://www.w3.org/TR/DOM-Level-2-Core/core">http://www.w3.org/TR/DOM-Level-2-Core/core</a>
+* @see <a href="http://www.w3.org/TR/DOM-Level-2-Core/core#ID-DocCrAttrNS">http://www.w3.org/TR/DOM-Level-2-Core/core#ID-DocCrAttrNS</a>
+*/
+public final class documentcreateattributeNS06 extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public documentcreateattributeNS06(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "staffNS", false);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ Document newDoc;
+ DocumentType docType = null;
+
+ DOMImplementation domImpl;
+ Attr attribute;
+ String namespaceURI = "http://www.w3.org/XML/1998 /namespace";
+ String qualifiedName = "xml:root";
+ doc = (Document) load("staffNS", false);
+ domImpl = doc.getImplementation();
+ newDoc = domImpl.createDocument("http://www.w3.org/DOM/Test", "dom:doc", docType);
+
+ {
+ boolean success = false;
+ try {
+ attribute = newDoc.createAttributeNS(namespaceURI, qualifiedName);
+ } catch (DOMException ex) {
+ success = (ex.code == DOMException.NAMESPACE_ERR);
+ }
+ assertTrue("documentcreateattributeNS06", success);
+ }
+}
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level2/core/documentcreateattributeNS06";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(documentcreateattributeNS06.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level2/core/documentcreateattributeNS07.java b/dom/src/test/java/org/w3c/domts/level2/core/documentcreateattributeNS07.java
new file mode 100644
index 0000000..3994797
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level2/core/documentcreateattributeNS07.java
@@ -0,0 +1,111 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+
+
+
+Copyright (c) 2001 World Wide Web Consortium,
+
+(Massachusetts Institute of Technology, Institut National de
+
+Recherche en Informatique et en Automatique, Keio University). All
+
+Rights Reserved. This program is distributed under the W3C's Software
+
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+
+
+
+*/
+
+package org.w3c.domts.level2.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The method createAttributeNS raises a NAMESPACE_ERR if the qualifiedName is xmlns and
+ * the namespaceURI is different from http://www.w3.org/2000/xmlns
+ *
+ * Invoke the createAttributeNS method on this DOMImplementation object with
+ * the qualifiedName as xmlns and namespaceURI as http://www.W3.org/2000/xmlns.
+ * Check if the NAMESPACE_ERR exception is thrown.
+* @author IBM
+* @author Neil Delima
+* @see <a href="http://www.w3.org/TR/DOM-Level-2-Core/core">http://www.w3.org/TR/DOM-Level-2-Core/core</a>
+* @see <a href="http://www.w3.org/TR/DOM-Level-2-Core/core#ID-DocCrAttrNS">http://www.w3.org/TR/DOM-Level-2-Core/core#ID-DocCrAttrNS</a>
+*/
+public final class documentcreateattributeNS07 extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public documentcreateattributeNS07(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "staffNS", false);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ Attr attribute;
+ String namespaceURI = "http://www.W3.org/2000/xmlns";
+ String qualifiedName = "xmlns";
+ doc = (Document) load("staffNS", false);
+
+ {
+ boolean success = false;
+ try {
+ attribute = doc.createAttributeNS(namespaceURI, qualifiedName);
+ } catch (DOMException ex) {
+ success = (ex.code == DOMException.NAMESPACE_ERR);
+ }
+ assertTrue("documentcreateattributeNS07", success);
+ }
+}
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level2/core/documentcreateattributeNS07";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(documentcreateattributeNS07.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level2/core/documentcreateelementNS01.java b/dom/src/test/java/org/w3c/domts/level2/core/documentcreateelementNS01.java
new file mode 100644
index 0000000..e031941
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level2/core/documentcreateelementNS01.java
@@ -0,0 +1,115 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+
+
+
+Copyright (c) 2001 World Wide Web Consortium,
+
+(Massachusetts Institute of Technology, Institut National de
+
+Recherche en Informatique et en Automatique, Keio University). All
+
+Rights Reserved. This program is distributed under the W3C's Software
+
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+
+
+
+*/
+
+package org.w3c.domts.level2.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The method createElementNS creates an element of the given valid qualifiedName and NamespaceURI.
+ *
+ * Invoke the createElementNS method on this Document object with a valid namespaceURI
+ * and qualifiedName. Check if a valid Element object is returned with the same node attributes.
+* @author IBM
+* @author Neil Delima
+* @see <a href="http://www.w3.org/TR/DOM-Level-2-Core/core">http://www.w3.org/TR/DOM-Level-2-Core/core</a>
+* @see <a href="http://www.w3.org/TR/DOM-Level-2-Core/core#ID-DocCrElNS">http://www.w3.org/TR/DOM-Level-2-Core/core#ID-DocCrElNS</a>
+*/
+public final class documentcreateelementNS01 extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public documentcreateelementNS01(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "staffNS", false);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ Element element;
+ String namespaceURI = "http://www.w3.org/DOM/Test/level2";
+ String qualifiedName = "XML:XML";
+ String nodeName;
+ String nsURI;
+ String localName;
+ String prefix;
+ String tagName;
+ doc = (Document) load("staffNS", false);
+ element = doc.createElementNS(namespaceURI, qualifiedName);
+ nodeName = element.getNodeName();
+ nsURI = element.getNamespaceURI();
+ localName = element.getLocalName();
+ prefix = element.getPrefix();
+ tagName = element.getTagName();
+ assertEquals("documentcreateelementNS01_nodeName", "XML:XML", nodeName);
+ assertEquals("documentcreateelementNS01_namespaceURI", "http://www.w3.org/DOM/Test/level2", nsURI);
+ assertEquals("documentcreateelementNS01_localName", "XML", localName);
+ assertEquals("documentcreateelementNS01_prefix", "XML", prefix);
+ assertEquals("documentcreateelementNS01_tagName", "XML:XML", tagName);
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level2/core/documentcreateelementNS01";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(documentcreateelementNS01.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level2/core/documentcreateelementNS02.java b/dom/src/test/java/org/w3c/domts/level2/core/documentcreateelementNS02.java
new file mode 100644
index 0000000..b6cedb2
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level2/core/documentcreateelementNS02.java
@@ -0,0 +1,110 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+
+
+
+Copyright (c) 2001 World Wide Web Consortium,
+
+(Massachusetts Institute of Technology, Institut National de
+
+Recherche en Informatique et en Automatique, Keio University). All
+
+Rights Reserved. This program is distributed under the W3C's Software
+
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+
+
+
+*/
+
+package org.w3c.domts.level2.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The method createElementNS creates an element of the given valid qualifiedName and NamespaceURI.
+ *
+ * Invoke the createElementNS method on this Document object with null values for namespaceURI,
+ * and a qualifiedName with an invalid character and check if an INVALID_CHARACTER_ERR is thrown.
+* @author IBM
+* @author Neil Delima
+* @see <a href="http://www.w3.org/TR/DOM-Level-2-Core/core">http://www.w3.org/TR/DOM-Level-2-Core/core</a>
+* @see <a href="http://www.w3.org/TR/DOM-Level-2-Core/core#ID-DocCrElNS">http://www.w3.org/TR/DOM-Level-2-Core/core#ID-DocCrElNS</a>
+*/
+public final class documentcreateelementNS02 extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public documentcreateelementNS02(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "staffNS", false);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ Element element;
+ String namespaceURI = null;
+
+ String qualifiedName = "^^";
+ doc = (Document) load("staffNS", false);
+
+ {
+ boolean success = false;
+ try {
+ element = doc.createElementNS(namespaceURI, qualifiedName);
+ } catch (DOMException ex) {
+ success = (ex.code == DOMException.INVALID_CHARACTER_ERR);
+ }
+ assertTrue("documentcreateelementNS02", success);
+ }
+}
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level2/core/documentcreateelementNS02";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(documentcreateelementNS02.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level2/core/documentcreateelementNS05.java b/dom/src/test/java/org/w3c/domts/level2/core/documentcreateelementNS05.java
new file mode 100644
index 0000000..f01150f
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level2/core/documentcreateelementNS05.java
@@ -0,0 +1,111 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+
+
+
+Copyright (c) 2001 World Wide Web Consortium,
+
+(Massachusetts Institute of Technology, Institut National de
+
+Recherche en Informatique et en Automatique, Keio University). All
+
+Rights Reserved. This program is distributed under the W3C's Software
+
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+
+
+
+*/
+
+package org.w3c.domts.level2.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The method createElementNS raises a NAMESPACE_ERR if the qualifiedName has a prefix and
+ * the namespaceURI is null.
+ *
+ * Invoke the createElementNS method on a new Document object with a null value for
+ * namespaceURI, and a valid qualifiedName. Check if a NAMESPACE_ERR is thrown.
+* @author IBM
+* @author Neil Delima
+* @see <a href="http://www.w3.org/TR/DOM-Level-2-Core/core">http://www.w3.org/TR/DOM-Level-2-Core/core</a>
+* @see <a href="http://www.w3.org/TR/DOM-Level-2-Core/core#ID-DocCrElNS">http://www.w3.org/TR/DOM-Level-2-Core/core#ID-DocCrElNS</a>
+*/
+public final class documentcreateelementNS05 extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public documentcreateelementNS05(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "staffNS", false);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ Element element;
+ String namespaceURI = null;
+
+ String qualifiedName = "null:xml";
+ doc = (Document) load("staffNS", false);
+
+ {
+ boolean success = false;
+ try {
+ element = doc.createElementNS(namespaceURI, qualifiedName);
+ } catch (DOMException ex) {
+ success = (ex.code == DOMException.NAMESPACE_ERR);
+ }
+ assertTrue("documentcreateelementNS05", success);
+ }
+}
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level2/core/documentcreateelementNS05";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(documentcreateelementNS05.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level2/core/documentcreateelementNS06.java b/dom/src/test/java/org/w3c/domts/level2/core/documentcreateelementNS06.java
new file mode 100644
index 0000000..42e3935
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level2/core/documentcreateelementNS06.java
@@ -0,0 +1,105 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+
+Copyright (c) 2001 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+
+*/
+
+package org.w3c.domts.level2.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The method createElementNS raises a NAMESPACE_ERR if the qualifiedName
+ * has a prefix that is "xml" and the namespaceURI is different
+ * from http://www.w3.org/XML/1998/namespace
+ *
+ * Invoke the createElementNS method on this DOMImplementation object with
+ * the qualifiedName as xml:root and namespaceURI as http://www.w3.org/xml/1998/namespace
+ * Check if the NAMESPACE_ERR exception is thrown.
+* @author IBM
+* @author Neil Delima
+* @see <a href="http://www.w3.org/TR/DOM-Level-2-Core/core">http://www.w3.org/TR/DOM-Level-2-Core/core</a>
+* @see <a href="http://www.w3.org/TR/DOM-Level-2-Core/core#ID-DocCrElNS">http://www.w3.org/TR/DOM-Level-2-Core/core#ID-DocCrElNS</a>
+*/
+public final class documentcreateelementNS06 extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public documentcreateelementNS06(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "staffNS", false);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ Document newDoc;
+ DocumentType docType = null;
+
+ DOMImplementation domImpl;
+ Element element;
+ String namespaceURI = "http://www.w3.org/xml/1998/namespace ";
+ String qualifiedName = "xml:root";
+ doc = (Document) load("staffNS", false);
+ domImpl = doc.getImplementation();
+ newDoc = domImpl.createDocument("http://www.w3.org/DOM/Test", "dom:doc", docType);
+
+ {
+ boolean success = false;
+ try {
+ element = newDoc.createElementNS(namespaceURI, qualifiedName);
+ } catch (DOMException ex) {
+ success = (ex.code == DOMException.NAMESPACE_ERR);
+ }
+ assertTrue("documentcreateelementNS06", success);
+ }
+}
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level2/core/documentcreateelementNS06";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(documentcreateelementNS06.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level2/core/documentgetelementbyid01.java b/dom/src/test/java/org/w3c/domts/level2/core/documentgetelementbyid01.java
new file mode 100644
index 0000000..472fa47
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level2/core/documentgetelementbyid01.java
@@ -0,0 +1,101 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+
+
+
+Copyright (c) 2001 World Wide Web Consortium,
+
+(Massachusetts Institute of Technology, Institut National de
+
+Recherche en Informatique et en Automatique, Keio University). All
+
+Rights Reserved. This program is distributed under the W3C's Software
+
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+
+
+
+*/
+
+package org.w3c.domts.level2.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The method getElementById returns the element whose ID is given by elementId.
+ * If not such element exists, returns null.
+ *
+ * Invoke the getElementById method on this Document object with an invalid elementId.
+ * This should return a null element.
+* @author IBM
+* @author Neil Delima
+* @see <a href="http://www.w3.org/TR/DOM-Level-2-Core/core">http://www.w3.org/TR/DOM-Level-2-Core/core</a>
+* @see <a href="http://www.w3.org/TR/DOM-Level-2-Core/core#ID-getElBId">http://www.w3.org/TR/DOM-Level-2-Core/core#ID-getElBId</a>
+*/
+public final class documentgetelementbyid01 extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public documentgetelementbyid01(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "staffNS", false);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ Element element;
+ String elementId = "---";
+ doc = (Document) load("staffNS", false);
+ element = doc.getElementById(elementId);
+ assertNull("documentgetelementbyid01", element);
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level2/core/documentgetelementbyid01";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(documentgetelementbyid01.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level2/core/documentgetelementsbytagnameNS01.java b/dom/src/test/java/org/w3c/domts/level2/core/documentgetelementsbytagnameNS01.java
new file mode 100644
index 0000000..88320dc
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level2/core/documentgetelementsbytagnameNS01.java
@@ -0,0 +1,97 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+
+Copyright (c) 2001-2003 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+
+*/
+
+package org.w3c.domts.level2.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The method getElementsByTagNameNS returns a NodeList of all the Elements with
+ * a given local name and namespace URI in the order in which they are encountered
+ * in a preorder traversal of the Document tree.
+ *
+ * Invoke the getElementsByTagNameNS method on a new Document object with the values of
+ * namespaceURI=* and localName=*. This should return a nodeList of 1 item.
+* @author IBM
+* @author Neil Delima
+* @see <a href="http://www.w3.org/TR/DOM-Level-2-Core/core">http://www.w3.org/TR/DOM-Level-2-Core/core</a>
+* @see <a href="http://www.w3.org/TR/DOM-Level-2-Core/core#ID-getElBTNNS">http://www.w3.org/TR/DOM-Level-2-Core/core#ID-getElBTNNS</a>
+* @see <a href="http://www.w3.org/Bugs/Public/show_bug.cgi?id=259">http://www.w3.org/Bugs/Public/show_bug.cgi?id=259</a>
+*/
+public final class documentgetelementsbytagnameNS01 extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public documentgetelementsbytagnameNS01(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "staffNS", false);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ Document newDoc;
+ DocumentType docType = null;
+
+ DOMImplementation domImpl;
+ NodeList childList;
+ String nullNS = null;
+
+ doc = (Document) load("staffNS", false);
+ domImpl = doc.getImplementation();
+ newDoc = domImpl.createDocument(nullNS, "root", docType);
+ childList = newDoc.getElementsByTagNameNS("*", "*");
+ assertSize("documentgetelementsbytagnameNS01", 1, childList);
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level2/core/documentgetelementsbytagnameNS01";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(documentgetelementsbytagnameNS01.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level2/core/documentgetelementsbytagnameNS02.java b/dom/src/test/java/org/w3c/domts/level2/core/documentgetelementsbytagnameNS02.java
new file mode 100644
index 0000000..10b7288
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level2/core/documentgetelementsbytagnameNS02.java
@@ -0,0 +1,103 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+
+Copyright (c) 2001 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+
+*/
+
+package org.w3c.domts.level2.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The method getElementsByTagNameNS returns a NodeList of all the Elements with
+ * a given local name and namespace URI in the order in which they are encountered
+ * in a preorder traversal of the Document tree.
+ *
+ *
+ * Create a new element having a local name="employeeId" belonging to the namespace "test"
+ * and append it to this document. Invoke the getElementsByTagNameNS method on a this
+ * Document object with the values of namespaceURI=* and localName="elementId". This
+ * should return a nodeList of 6 item. Check the length of the nodeList returned.
+* @author IBM
+* @author Neil Delima
+* @see <a href="http://www.w3.org/TR/DOM-Level-2-Core/core">http://www.w3.org/TR/DOM-Level-2-Core/core</a>
+* @see <a href="http://www.w3.org/TR/DOM-Level-2-Core/core#ID-getElBTNNS">http://www.w3.org/TR/DOM-Level-2-Core/core#ID-getElBTNNS</a>
+*/
+public final class documentgetelementsbytagnameNS02 extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public documentgetelementsbytagnameNS02(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+
+ org.w3c.domts.DocumentBuilderSetting[] settings =
+ new org.w3c.domts.DocumentBuilderSetting[] {
+org.w3c.domts.DocumentBuilderSetting.namespaceAware
+ };
+ DOMTestDocumentBuilderFactory testFactory = factory.newInstance(settings);
+ setFactory(testFactory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "staffNS", true);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ Element docElem;
+ Element element;
+ NodeList childList;
+ Node appendedChild;
+ doc = (Document) load("staffNS", true);
+ docElem = doc.getDocumentElement();
+ element = doc.createElementNS("test", "employeeId");
+ appendedChild = docElem.appendChild(element);
+ childList = doc.getElementsByTagNameNS("*", "employeeId");
+ assertSize("documentgetelementsbytagnameNS02", 6, childList);
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level2/core/documentgetelementsbytagnameNS02";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(documentgetelementsbytagnameNS02.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level2/core/documentgetelementsbytagnameNS03.java b/dom/src/test/java/org/w3c/domts/level2/core/documentgetelementsbytagnameNS03.java
new file mode 100644
index 0000000..27fc7f4
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level2/core/documentgetelementsbytagnameNS03.java
@@ -0,0 +1,88 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+
+Copyright (c) 2001 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+
+*/
+
+package org.w3c.domts.level2.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The method getElementsByTagNameNS returns a NodeList of all the Elements with
+ * a given local name and namespace URI in the order in which they are encountered
+ * in a preorder traversal of the Document tree.
+ *
+ * Invoke the getElementsByTagNameNS method on a new Document object with the values of
+ * namespaceURI=** and localName=**. This should return a nodeList of 0 items.
+* @author IBM
+* @author Neil Delima
+* @see <a href="http://www.w3.org/TR/DOM-Level-2-Core/core">http://www.w3.org/TR/DOM-Level-2-Core/core</a>
+* @see <a href="http://www.w3.org/TR/DOM-Level-2-Core/core#ID-getElBTNNS">http://www.w3.org/TR/DOM-Level-2-Core/core#ID-getElBTNNS</a>
+*/
+public final class documentgetelementsbytagnameNS03 extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public documentgetelementsbytagnameNS03(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "staffNS", false);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ NodeList childList;
+ doc = (Document) load("staffNS", false);
+ childList = doc.getElementsByTagNameNS("**", "*");
+ assertSize("documentgetelementsbytagnameNS03", 0, childList);
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level2/core/documentgetelementsbytagnameNS03";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(documentgetelementsbytagnameNS03.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level2/core/documentgetelementsbytagnameNS04.java b/dom/src/test/java/org/w3c/domts/level2/core/documentgetelementsbytagnameNS04.java
new file mode 100644
index 0000000..1349037
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level2/core/documentgetelementsbytagnameNS04.java
@@ -0,0 +1,97 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+
+Copyright (c) 2001-2003 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+
+*/
+
+package org.w3c.domts.level2.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The method getElementsByTagNameNS returns a NodeList of all the Elements with
+ * a given local name and namespace URI in the order in which they are encountered
+ * in a preorder traversal of the Document tree.
+ *
+ * Invoke the getElementsByTagNameNS method on a new Document object with the values of
+ * namespaceURI="null" and localName="0". This should return a nodeList of 0 items.
+* @author IBM
+* @author Neil Delima
+* @see <a href="http://www.w3.org/TR/DOM-Level-2-Core/core">http://www.w3.org/TR/DOM-Level-2-Core/core</a>
+* @see <a href="http://www.w3.org/TR/DOM-Level-2-Core/core#ID-getElBTNNS">http://www.w3.org/TR/DOM-Level-2-Core/core#ID-getElBTNNS</a>
+* @see <a href="http://www.w3.org/Bugs/Public/show_bug.cgi?id=259">http://www.w3.org/Bugs/Public/show_bug.cgi?id=259</a>
+*/
+public final class documentgetelementsbytagnameNS04 extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public documentgetelementsbytagnameNS04(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+
+ org.w3c.domts.DocumentBuilderSetting[] settings =
+ new org.w3c.domts.DocumentBuilderSetting[] {
+org.w3c.domts.DocumentBuilderSetting.namespaceAware
+ };
+ DOMTestDocumentBuilderFactory testFactory = factory.newInstance(settings);
+ setFactory(testFactory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "staffNS", false);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ NodeList childList;
+ String nullNS = null;
+
+ doc = (Document) load("staffNS", false);
+ childList = doc.getElementsByTagNameNS(nullNS, "0");
+ assertSize("documentgetelementsbytagnameNS04", 0, childList);
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level2/core/documentgetelementsbytagnameNS04";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(documentgetelementsbytagnameNS04.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level2/core/documentgetelementsbytagnameNS05.java b/dom/src/test/java/org/w3c/domts/level2/core/documentgetelementsbytagnameNS05.java
new file mode 100644
index 0000000..1adadd4
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level2/core/documentgetelementsbytagnameNS05.java
@@ -0,0 +1,90 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+
+Copyright (c) 2001 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+
+*/
+
+package org.w3c.domts.level2.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The method getElementsByTagNameNS returns a NodeList of all the Elements with
+ * a given local name and namespace URI in the order in which they are encountered
+ * in a preorder traversal of the Document tree.
+ *
+ *
+ * Invoke the getElementsByTagNameNS method on a this Document object with the
+ * values of namespaceURI=null and localName="elementId". This
+ * should return a nodeList of 0 item. Check the length of the nodeList returned.
+* @author IBM
+* @author Neil Delima
+* @see <a href="http://www.w3.org/TR/DOM-Level-2-Core/core">http://www.w3.org/TR/DOM-Level-2-Core/core</a>
+* @see <a href="http://www.w3.org/TR/DOM-Level-2-Core/core#ID-getElBTNNS">http://www.w3.org/TR/DOM-Level-2-Core/core#ID-getElBTNNS</a>
+*/
+public final class documentgetelementsbytagnameNS05 extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public documentgetelementsbytagnameNS05(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "staffNS", false);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ NodeList childList;
+ doc = (Document) load("staffNS", false);
+ childList = doc.getElementsByTagNameNS("null", "elementId");
+ assertSize("documentgetelementsbytagnameNS05", 0, childList);
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level2/core/documentgetelementsbytagnameNS05";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(documentgetelementsbytagnameNS05.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level2/core/documentimportnode01.java b/dom/src/test/java/org/w3c/domts/level2/core/documentimportnode01.java
new file mode 100644
index 0000000..63e4929
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level2/core/documentimportnode01.java
@@ -0,0 +1,111 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+
+Copyright (c) 2001 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+
+*/
+
+package org.w3c.domts.level2.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The importNode method imports a node from another document to this document.
+ * The returned node has no parent; (parentNode is null). The source node is not
+ * altered or removed from the original document but a new copy of the source node
+ * is created.
+ *
+ * Using the method importNode with deep=true, import the attribute, "street" of the second
+ * element node, from a list of nodes whose local names are "address" and namespaceURI
+ * "http://www.nist.gov" into the same document. Check the parentNode, nodeName,
+ * nodeType and nodeValue of the imported node to verify if it has been imported correctly.
+* @author IBM
+* @author Neil Delima
+* @see <a href="http://www.w3.org/TR/DOM-Level-2-Core/core">http://www.w3.org/TR/DOM-Level-2-Core/core</a>
+* @see <a href="http://www.w3.org/TR/DOM-Level-2-Core/core#Core-Document-importNode">http://www.w3.org/TR/DOM-Level-2-Core/core#Core-Document-importNode</a>
+*/
+public final class documentimportnode01 extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public documentimportnode01(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+
+ org.w3c.domts.DocumentBuilderSetting[] settings =
+ new org.w3c.domts.DocumentBuilderSetting[] {
+org.w3c.domts.DocumentBuilderSetting.namespaceAware
+ };
+ DOMTestDocumentBuilderFactory testFactory = factory.newInstance(settings);
+ setFactory(testFactory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "staffNS", true);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ Element element;
+ Attr attr;
+ NodeList childList;
+ Node importedAttr;
+ String nodeName;
+ int nodeType;
+ String nodeValue;
+ doc = (Document) load("staffNS", true);
+ childList = doc.getElementsByTagNameNS("http://www.nist.gov", "address");
+ element = (Element) childList.item(1);
+ attr = element.getAttributeNode("street");
+ importedAttr = doc.importNode(attr, false);
+ nodeName = importedAttr.getNodeName();
+ nodeValue = importedAttr.getNodeValue();
+ nodeType = (int) importedAttr.getNodeType();
+ assertEquals("documentimportnode01_nodeName", "street", nodeName);
+ assertEquals("documentimportnode01_nodeType", 2, nodeType);
+ assertEquals("documentimportnode01_nodeValue", "Yes", nodeValue);
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level2/core/documentimportnode01";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(documentimportnode01.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level2/core/documentimportnode02.java b/dom/src/test/java/org/w3c/domts/level2/core/documentimportnode02.java
new file mode 100644
index 0000000..693d725
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level2/core/documentimportnode02.java
@@ -0,0 +1,117 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+
+Copyright (c) 2001-2004 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+
+*/
+
+package org.w3c.domts.level2.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The importNode method imports a node from another document to this document.
+ * The returned node has no parent; (parentNode is null). The source node is not
+ * altered or removed from the original document but a new copy of the source node
+ * is created.
+ *
+ * Using the method importNode with deep=false, import the attribute, "emp:zone" of the
+ * element node which is retreived by its elementId="CANADA", into the another document.
+ * Check the parentNode, nodeName, nodeType and nodeValue of the imported node to
+ * verify if it has been imported correctly.
+* @author IBM
+* @author Neil Delima
+* @see <a href="http://www.w3.org/TR/DOM-Level-2-Core/core">http://www.w3.org/TR/DOM-Level-2-Core/core</a>
+* @see <a href="http://www.w3.org/TR/DOM-Level-2-Core/core#Core-Document-importNode">http://www.w3.org/TR/DOM-Level-2-Core/core#Core-Document-importNode</a>
+*/
+public final class documentimportnode02 extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public documentimportnode02(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+
+ org.w3c.domts.DocumentBuilderSetting[] settings =
+ new org.w3c.domts.DocumentBuilderSetting[] {
+org.w3c.domts.DocumentBuilderSetting.namespaceAware
+ };
+ DOMTestDocumentBuilderFactory testFactory = factory.newInstance(settings);
+ setFactory(testFactory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "staffNS", true);
+ preload(contentType, "staff", true);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ Document docImported;
+ Element element;
+ Attr attr;
+ Node importedAttr;
+ String nodeName;
+ int nodeType;
+ String nodeValue;
+ NodeList addresses;
+ Node attrsParent;
+ doc = (Document) load("staffNS", true);
+ docImported = (Document) load("staff", true);
+ addresses = doc.getElementsByTagNameNS("http://www.nist.gov", "address");
+ element = (Element) addresses.item(1);
+ attr = element.getAttributeNodeNS("http://www.nist.gov", "zone");
+ importedAttr = docImported.importNode(attr, false);
+ nodeName = importedAttr.getNodeName();
+ nodeType = (int) importedAttr.getNodeType();
+ nodeValue = importedAttr.getNodeValue();
+ attrsParent = importedAttr.getParentNode();
+ assertNull("documentimportnode02_parentNull", attrsParent);
+ assertEquals("documentimportnode02_nodeName", "emp:zone", nodeName);
+ assertEquals("documentimportnode02_nodeType", 2, nodeType);
+ assertEquals("documentimportnode02_nodeValue", "CANADA", nodeValue);
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level2/core/documentimportnode02";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(documentimportnode02.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level2/core/documentimportnode03.java b/dom/src/test/java/org/w3c/domts/level2/core/documentimportnode03.java
new file mode 100644
index 0000000..6cdb98d
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level2/core/documentimportnode03.java
@@ -0,0 +1,113 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+
+Copyright (c) 2001-2004 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+
+*/
+
+package org.w3c.domts.level2.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The importNode method imports a node from another document to this document.
+ * The returned node has no parent; (parentNode is null). The source node is not
+ * altered or removed from the original document but a new copy of the source node
+ * is created.
+ *
+ * Using the method importNode with deep=false, import the default Attribute attribute,
+ * "defaultAttr" of the second element node whose namespaceURI="http://www.nist.gov" and
+ * localName="defaultAttr", into the same document.
+ * Check the parentNode, nodeName, nodeType and nodeValue of the imported node to
+ * verify if it has been imported correctly.
+* @author IBM
+* @author Neil Delima
+* @see <a href="http://www.w3.org/TR/DOM-Level-2-Core/core">http://www.w3.org/TR/DOM-Level-2-Core/core</a>
+* @see <a href="http://www.w3.org/TR/DOM-Level-2-Core/core#Core-Document-importNode">http://www.w3.org/TR/DOM-Level-2-Core/core#Core-Document-importNode</a>
+*/
+public final class documentimportnode03 extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public documentimportnode03(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+
+ org.w3c.domts.DocumentBuilderSetting[] settings =
+ new org.w3c.domts.DocumentBuilderSetting[] {
+org.w3c.domts.DocumentBuilderSetting.namespaceAware,
+org.w3c.domts.DocumentBuilderSetting.validating
+ };
+ DOMTestDocumentBuilderFactory testFactory = factory.newInstance(settings);
+ setFactory(testFactory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "staffNS", true);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ Element element;
+ Attr attr;
+ NodeList childList;
+ Node importedAttr;
+ String nodeName;
+ int nodeType;
+ String nodeValue;
+ doc = (Document) load("staffNS", true);
+ childList = doc.getElementsByTagNameNS("http://www.nist.gov", "employee");
+ element = (Element) childList.item(1);
+ attr = element.getAttributeNode("defaultAttr");
+ importedAttr = doc.importNode(attr, false);
+ nodeName = importedAttr.getNodeName();
+ nodeValue = importedAttr.getNodeValue();
+ nodeType = (int) importedAttr.getNodeType();
+ assertEquals("documentimportnode03_nodeName", "defaultAttr", nodeName);
+ assertEquals("documentimportnode03_nodeType", 2, nodeType);
+ assertEquals("documentimportnode03_nodeValue", "defaultVal", nodeValue);
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level2/core/documentimportnode03";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(documentimportnode03.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level2/core/documentimportnode04.java b/dom/src/test/java/org/w3c/domts/level2/core/documentimportnode04.java
new file mode 100644
index 0000000..a74cfc1
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level2/core/documentimportnode04.java
@@ -0,0 +1,119 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+
+Copyright (c) 2001-2004 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+
+*/
+
+package org.w3c.domts.level2.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The importNode method imports a node from another document to this document.
+ * The returned node has no parent; (parentNode is null). The source node is not
+ * altered or removed from the original document but a new copy of the source node
+ * is created.
+ *
+ * Using the method importNode with deep=true, import the default Attribute attribute,
+ * "defaultAttr" of the second element node whose namespaceURI="http://www.nist.gov" and
+ * localName="defaultAttr", into a new document.
+ * Check the parentNode, nodeName, nodeType and nodeValue of the imported node to
+ * verify if it has been imported correctly.
+* @author IBM
+* @author Neil Delima
+* @see <a href="http://www.w3.org/TR/DOM-Level-2-Core/core">http://www.w3.org/TR/DOM-Level-2-Core/core</a>
+* @see <a href="http://www.w3.org/TR/DOM-Level-2-Core/core#Core-Document-importNode">http://www.w3.org/TR/DOM-Level-2-Core/core#Core-Document-importNode</a>
+*/
+public final class documentimportnode04 extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public documentimportnode04(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+
+ org.w3c.domts.DocumentBuilderSetting[] settings =
+ new org.w3c.domts.DocumentBuilderSetting[] {
+org.w3c.domts.DocumentBuilderSetting.namespaceAware,
+org.w3c.domts.DocumentBuilderSetting.validating
+ };
+ DOMTestDocumentBuilderFactory testFactory = factory.newInstance(settings);
+ setFactory(testFactory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "staffNS", true);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ Document newDoc;
+ DocumentType docType = null;
+
+ DOMImplementation domImpl;
+ Element element;
+ Attr attr;
+ NodeList childList;
+ Node importedAttr;
+ String nodeName;
+ int nodeType;
+ String nodeValue;
+ doc = (Document) load("staffNS", true);
+ domImpl = doc.getImplementation();
+ newDoc = domImpl.createDocument("http://www.w3.org/DOM/Test", "l2:root", docType);
+ childList = doc.getElementsByTagNameNS("http://www.nist.gov", "employee");
+ element = (Element) childList.item(1);
+ attr = element.getAttributeNode("defaultAttr");
+ importedAttr = newDoc.importNode(attr, true);
+ nodeName = importedAttr.getNodeName();
+ nodeValue = importedAttr.getNodeValue();
+ nodeType = (int) importedAttr.getNodeType();
+ assertEquals("documentimportnode04_nodeName", "defaultAttr", nodeName);
+ assertEquals("documentimportnode04_nodeType", 2, nodeType);
+ assertEquals("documentimportnode04_nodeValue", "defaultVal", nodeValue);
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level2/core/documentimportnode04";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(documentimportnode04.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level2/core/documentimportnode05.java b/dom/src/test/java/org/w3c/domts/level2/core/documentimportnode05.java
new file mode 100644
index 0000000..ba2e9e1
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level2/core/documentimportnode05.java
@@ -0,0 +1,113 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+
+Copyright (c) 2001 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+
+*/
+
+package org.w3c.domts.level2.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The importNode method imports a node from another document to this document.
+ * The returned node has no parent; (parentNode is null). The source node is not
+ * altered or removed from the original document but a new copy of the source node
+ * is created.
+ *
+ * Using the method importNode with deep=false, import a newly created attribute node,
+ * into the another document.
+ * Check the nodeName, nodeType and nodeValue namespaceURI of the imported node to
+ * verify if it has been imported correctly.
+* @author IBM
+* @author Neil Delima
+* @see <a href="http://www.w3.org/TR/DOM-Level-2-Core/core">http://www.w3.org/TR/DOM-Level-2-Core/core</a>
+* @see <a href="http://www.w3.org/TR/DOM-Level-2-Core/core#Core-Document-importNode">http://www.w3.org/TR/DOM-Level-2-Core/core#Core-Document-importNode</a>
+*/
+public final class documentimportnode05 extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public documentimportnode05(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+
+ org.w3c.domts.DocumentBuilderSetting[] settings =
+ new org.w3c.domts.DocumentBuilderSetting[] {
+org.w3c.domts.DocumentBuilderSetting.namespaceAware
+ };
+ DOMTestDocumentBuilderFactory testFactory = factory.newInstance(settings);
+ setFactory(testFactory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "staffNS", true);
+ preload(contentType, "staff", true);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ Document docImported;
+ Attr attr;
+ Node importedAttr;
+ String nodeName;
+ int nodeType;
+ String nodeValue;
+ String namespaceURI;
+ doc = (Document) load("staffNS", true);
+ docImported = (Document) load("staff", true);
+ attr = doc.createAttributeNS("http://www.w3.org/DOM/Test", "a_:b0");
+ importedAttr = docImported.importNode(attr, false);
+ nodeName = importedAttr.getNodeName();
+ nodeValue = importedAttr.getNodeValue();
+ nodeType = (int) importedAttr.getNodeType();
+ namespaceURI = importedAttr.getNamespaceURI();
+ assertEquals("documentimportnode05_nodeName", "a_:b0", nodeName);
+ assertEquals("documentimportnode05_nodeType", 2, nodeType);
+ assertEquals("documentimportnode05_nodeValue", "", nodeValue);
+ assertEquals("documentimportnode05_namespaceURI", "http://www.w3.org/DOM/Test", namespaceURI);
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level2/core/documentimportnode05";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(documentimportnode05.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level2/core/documentimportnode06.java b/dom/src/test/java/org/w3c/domts/level2/core/documentimportnode06.java
new file mode 100644
index 0000000..3e7e228
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level2/core/documentimportnode06.java
@@ -0,0 +1,102 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+
+Copyright (c) 2001-2004 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+
+*/
+
+package org.w3c.domts.level2.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The importNode method imports a node from another document to this document.
+ * A NOT_SUPPORTED_ERR is raised if the type of node being imported is
+ * not supported
+ *
+ * Using the method importNode with deep=false, try to import this document object to itself.
+ * Since Document nodes cannot be imported, a NOT_SUPPORTED_ERR should be raised.
+* @author IBM
+* @author Neil Delima
+* @see <a href="http://www.w3.org/TR/DOM-Level-2-Core/core">http://www.w3.org/TR/DOM-Level-2-Core/core</a>
+* @see <a href="http://www.w3.org/TR/DOM-Level-2-Core/core#Core-Document-importNode">http://www.w3.org/TR/DOM-Level-2-Core/core#Core-Document-importNode</a>
+*/
+public final class documentimportnode06 extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public documentimportnode06(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+
+ org.w3c.domts.DocumentBuilderSetting[] settings =
+ new org.w3c.domts.DocumentBuilderSetting[] {
+org.w3c.domts.DocumentBuilderSetting.namespaceAware
+ };
+ DOMTestDocumentBuilderFactory testFactory = factory.newInstance(settings);
+ setFactory(testFactory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "staffNS", true);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ Document docImported;
+ doc = (Document) load("staffNS", true);
+
+ {
+ boolean success = false;
+ try {
+ docImported = (Document) doc.importNode(doc, false);
+ } catch (DOMException ex) {
+ success = (ex.code == DOMException.NOT_SUPPORTED_ERR);
+ }
+ assertTrue("throw_NOT_SUPPORTED_ERR", success);
+ }
+}
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level2/core/documentimportnode06";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(documentimportnode06.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level2/core/documentimportnode07.java b/dom/src/test/java/org/w3c/domts/level2/core/documentimportnode07.java
new file mode 100644
index 0000000..01ffd60
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level2/core/documentimportnode07.java
@@ -0,0 +1,105 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+
+Copyright (c) 2001-2004 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+
+*/
+
+package org.w3c.domts.level2.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The importNode method imports a node from another document to this document.
+ * A NOT_SUPPORTED_ERR is raised if the type of node being imported is
+ * not supported
+ *
+ * Using the method importNode with deep=true, try to import this Document's
+ * DocumentType object. Since DocumentType nodes cannot be imported, a
+ * NOT_SUPPORTED_ERR should be raised.
+* @author IBM
+* @author Neil Delima
+* @see <a href="http://www.w3.org/TR/DOM-Level-2-Core/core">http://www.w3.org/TR/DOM-Level-2-Core/core</a>
+* @see <a href="http://www.w3.org/TR/DOM-Level-2-Core/core#Core-Document-importNode">http://www.w3.org/TR/DOM-Level-2-Core/core#Core-Document-importNode</a>
+*/
+public final class documentimportnode07 extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public documentimportnode07(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+
+ org.w3c.domts.DocumentBuilderSetting[] settings =
+ new org.w3c.domts.DocumentBuilderSetting[] {
+org.w3c.domts.DocumentBuilderSetting.namespaceAware
+ };
+ DOMTestDocumentBuilderFactory testFactory = factory.newInstance(settings);
+ setFactory(testFactory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "staffNS", true);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ Node imported;
+ DocumentType docType;
+ doc = (Document) load("staffNS", true);
+ docType = doc.getDoctype();
+
+ {
+ boolean success = false;
+ try {
+ imported = doc.importNode(docType, true);
+ } catch (DOMException ex) {
+ success = (ex.code == DOMException.NOT_SUPPORTED_ERR);
+ }
+ assertTrue("throw_NOT_SUPPORTED_ERR", success);
+ }
+}
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level2/core/documentimportnode07";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(documentimportnode07.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level2/core/documentimportnode08.java b/dom/src/test/java/org/w3c/domts/level2/core/documentimportnode08.java
new file mode 100644
index 0000000..15c7d1f
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level2/core/documentimportnode08.java
@@ -0,0 +1,109 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+
+Copyright (c) 2001-2004 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+
+*/
+
+package org.w3c.domts.level2.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The importNode method imports a node from another document to this document.
+ * A NOT_SUPPORTED_ERR is raised if the type of node being imported is
+ * not supported
+ *
+ * Using the method importNode with deep=true, try to import a newly created DOcumentType
+ * node. Since DocumentType nodes cannot be imported, a NOT_SUPPORTED_ERR should be raised.
+* @author IBM
+* @author Neil Delima
+* @see <a href="http://www.w3.org/TR/DOM-Level-2-Core/core">http://www.w3.org/TR/DOM-Level-2-Core/core</a>
+* @see <a href="http://www.w3.org/TR/DOM-Level-2-Core/core#Core-Document-importNode">http://www.w3.org/TR/DOM-Level-2-Core/core#Core-Document-importNode</a>
+* @see <a href="http://www.w3.org/Bugs/Public/show_bug.cgi?id=259">http://www.w3.org/Bugs/Public/show_bug.cgi?id=259</a>
+*/
+public final class documentimportnode08 extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public documentimportnode08(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+
+ org.w3c.domts.DocumentBuilderSetting[] settings =
+ new org.w3c.domts.DocumentBuilderSetting[] {
+org.w3c.domts.DocumentBuilderSetting.namespaceAware
+ };
+ DOMTestDocumentBuilderFactory testFactory = factory.newInstance(settings);
+ setFactory(testFactory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "staffNS", true);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ Node imported;
+ DocumentType docType;
+ DOMImplementation domImpl;
+ String nullNS = null;
+
+ doc = (Document) load("staffNS", true);
+ domImpl = doc.getImplementation();
+ docType = domImpl.createDocumentType("test:root", nullNS, nullNS);
+
+ {
+ boolean success = false;
+ try {
+ imported = doc.importNode(docType, true);
+ } catch (DOMException ex) {
+ success = (ex.code == DOMException.NOT_SUPPORTED_ERR);
+ }
+ assertTrue("throw_NOT_SUPPORTED_ERR", success);
+ }
+}
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level2/core/documentimportnode08";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(documentimportnode08.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level2/core/documentimportnode09.java b/dom/src/test/java/org/w3c/domts/level2/core/documentimportnode09.java
new file mode 100644
index 0000000..fefe8ad
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level2/core/documentimportnode09.java
@@ -0,0 +1,106 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+
+Copyright (c) 2001 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+
+*/
+
+package org.w3c.domts.level2.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The importNode method imports a node from another document to this document.
+ * The returned node has no parent; (parentNode is null). The source node is not
+ * altered or removed from the original document but a new copy of the source node
+ * is created.
+ *
+ * Using the method importNode with deep=false, import a newly created DocumentFragment node
+ * with the first address element from this Document appended to it into this document.
+ * Since deep=false, an empty DocumentFragment should be returned
+* @author IBM
+* @author Neil Delima
+* @see <a href="http://www.w3.org/TR/DOM-Level-2-Core/core">http://www.w3.org/TR/DOM-Level-2-Core/core</a>
+* @see <a href="http://www.w3.org/TR/DOM-Level-2-Core/core#Core-Document-importNode">http://www.w3.org/TR/DOM-Level-2-Core/core#Core-Document-importNode</a>
+*/
+public final class documentimportnode09 extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public documentimportnode09(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+
+ org.w3c.domts.DocumentBuilderSetting[] settings =
+ new org.w3c.domts.DocumentBuilderSetting[] {
+org.w3c.domts.DocumentBuilderSetting.namespaceAware
+ };
+ DOMTestDocumentBuilderFactory testFactory = factory.newInstance(settings);
+ setFactory(testFactory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "staffNS", true);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ DocumentFragment docFragment;
+ NodeList childList;
+ boolean success;
+ Node addressNode;
+ Node appendedChild;
+ Node importedDocFrag;
+ doc = (Document) load("staffNS", true);
+ docFragment = doc.createDocumentFragment();
+ childList = doc.getElementsByTagNameNS("*", "address");
+ addressNode = childList.item(0);
+ appendedChild = docFragment.appendChild(addressNode);
+ importedDocFrag = doc.importNode(docFragment, false);
+ success = importedDocFrag.hasChildNodes();
+ assertFalse("documentimportnode09", success);
+}
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level2/core/documentimportnode09";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(documentimportnode09.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level2/core/documentimportnode10.java b/dom/src/test/java/org/w3c/domts/level2/core/documentimportnode10.java
new file mode 100644
index 0000000..c9c5202
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level2/core/documentimportnode10.java
@@ -0,0 +1,106 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+
+Copyright (c) 2001 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+
+*/
+
+package org.w3c.domts.level2.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The importNode method imports a node from another document to this document.
+ * The returned node has no parent; (parentNode is null). The source node is not
+ * altered or removed from the original document but a new copy of the source node
+ * is created.
+ *
+ * Using the method importNode with deep=false, import a newly created DocumentFragment node
+ * with the first address element from this Document appended to it into this document.
+ * Since deep=true, a DocumentFragment with its child should be returned
+* @author IBM
+* @author Neil Delima
+* @see <a href="http://www.w3.org/TR/DOM-Level-2-Core/core">http://www.w3.org/TR/DOM-Level-2-Core/core</a>
+* @see <a href="http://www.w3.org/TR/DOM-Level-2-Core/core#Core-Document-importNode">http://www.w3.org/TR/DOM-Level-2-Core/core#Core-Document-importNode</a>
+*/
+public final class documentimportnode10 extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public documentimportnode10(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+
+ org.w3c.domts.DocumentBuilderSetting[] settings =
+ new org.w3c.domts.DocumentBuilderSetting[] {
+org.w3c.domts.DocumentBuilderSetting.namespaceAware
+ };
+ DOMTestDocumentBuilderFactory testFactory = factory.newInstance(settings);
+ setFactory(testFactory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "staffNS", true);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ DocumentFragment docFragment;
+ NodeList childList;
+ boolean success;
+ Node addressNode;
+ Node appendedChild;
+ Node importedDocFrag;
+ doc = (Document) load("staffNS", true);
+ docFragment = doc.createDocumentFragment();
+ childList = doc.getElementsByTagNameNS("*", "address");
+ addressNode = childList.item(0);
+ appendedChild = docFragment.appendChild(addressNode);
+ importedDocFrag = doc.importNode(docFragment, true);
+ success = importedDocFrag.hasChildNodes();
+ assertTrue("documentimportnode10", success);
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level2/core/documentimportnode10";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(documentimportnode10.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level2/core/documentimportnode11.java b/dom/src/test/java/org/w3c/domts/level2/core/documentimportnode11.java
new file mode 100644
index 0000000..d3c9146
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level2/core/documentimportnode11.java
@@ -0,0 +1,105 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+
+Copyright (c) 2001 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+
+*/
+
+package org.w3c.domts.level2.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The importNode method imports a node from another document to this document.
+ * The returned node has no parent; (parentNode is null). The source node is not
+ * altered or removed from the original document but a new copy of the source node
+ * is created.
+ *
+ * Using the method importNode with deep=false, import this Document's documentElement
+ * node. Verify if the node has been imported correctly by its nodeName atttribute and
+ * if the original document is not altered by checking if hasChildNodes returns false.
+* @author IBM
+* @author Neil Delima
+* @see <a href="http://www.w3.org/TR/DOM-Level-2-Core/core">http://www.w3.org/TR/DOM-Level-2-Core/core</a>
+* @see <a href="http://www.w3.org/TR/DOM-Level-2-Core/core#Core-Document-importNode">http://www.w3.org/TR/DOM-Level-2-Core/core#Core-Document-importNode</a>
+*/
+public final class documentimportnode11 extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public documentimportnode11(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+
+ org.w3c.domts.DocumentBuilderSetting[] settings =
+ new org.w3c.domts.DocumentBuilderSetting[] {
+org.w3c.domts.DocumentBuilderSetting.namespaceAware
+ };
+ DOMTestDocumentBuilderFactory testFactory = factory.newInstance(settings);
+ setFactory(testFactory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "staffNS", true);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ Element docElement;
+ Node imported;
+ boolean success;
+ String nodeNameOrig;
+ String nodeNameImported;
+ doc = (Document) load("staffNS", true);
+ docElement = doc.getDocumentElement();
+ imported = doc.importNode(docElement, false);
+ success = imported.hasChildNodes();
+ assertFalse("documentimportnode11", success);
+nodeNameImported = imported.getNodeName();
+ nodeNameOrig = docElement.getNodeName();
+ assertEquals("documentimportnode11_NodeName", nodeNameImported, nodeNameOrig);
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level2/core/documentimportnode11";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(documentimportnode11.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level2/core/documentimportnode12.java b/dom/src/test/java/org/w3c/domts/level2/core/documentimportnode12.java
new file mode 100644
index 0000000..f698b0d
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level2/core/documentimportnode12.java
@@ -0,0 +1,108 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+
+Copyright (c) 2001 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+
+*/
+
+package org.w3c.domts.level2.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The importNode method imports a node from another document to this document.
+ * The returned node has no parent; (parentNode is null). The source node is not
+ * altered or removed from the original document but a new copy of the source node
+ * is created.
+ *
+ * Using the method importNode with deep=true, import the first address element node of this
+ * Document. Verify if the node has been imported correctly by checking the length of the
+ * this elements childNode list before and after the import.
+* @author IBM
+* @author Neil Delima
+* @see <a href="http://www.w3.org/TR/DOM-Level-2-Core/core">http://www.w3.org/TR/DOM-Level-2-Core/core</a>
+* @see <a href="http://www.w3.org/TR/DOM-Level-2-Core/core#Core-Document-importNode">http://www.w3.org/TR/DOM-Level-2-Core/core#Core-Document-importNode</a>
+*/
+public final class documentimportnode12 extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public documentimportnode12(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+
+ org.w3c.domts.DocumentBuilderSetting[] settings =
+ new org.w3c.domts.DocumentBuilderSetting[] {
+org.w3c.domts.DocumentBuilderSetting.namespaceAware
+ };
+ DOMTestDocumentBuilderFactory testFactory = factory.newInstance(settings);
+ setFactory(testFactory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "staffNS", true);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ NodeList childList;
+ Node imported;
+ Node addressElem;
+ NodeList addressElemChildren;
+ NodeList importedChildren;
+ int addressElemLen;
+ int importedLen;
+ doc = (Document) load("staffNS", true);
+ childList = doc.getElementsByTagNameNS("*", "address");
+ addressElem = childList.item(0);
+ imported = doc.importNode(addressElem, true);
+ addressElemChildren = addressElem.getChildNodes();
+ importedChildren = imported.getChildNodes();
+ addressElemLen = (int) addressElemChildren.getLength();
+ importedLen = (int) importedChildren.getLength();
+ assertEquals("documentimportnode12", importedLen, addressElemLen);
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level2/core/documentimportnode12";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(documentimportnode12.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level2/core/documentimportnode13.java b/dom/src/test/java/org/w3c/domts/level2/core/documentimportnode13.java
new file mode 100644
index 0000000..1e534df
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level2/core/documentimportnode13.java
@@ -0,0 +1,104 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+
+Copyright (c) 2001 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+
+*/
+
+package org.w3c.domts.level2.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The importNode method imports a node from another document to this document.
+ * The returned node has no parent; (parentNode is null). The source node is not
+ * altered or removed from the original document but a new copy of the source node
+ * is created.
+ *
+ * Using the method importNode with deep=false, import the first employee element node of this
+ * Document. Verify if the node has been imported correctly by checking the length of the
+ * this elements childNode list before and after the import.
+* @author IBM
+* @author Neil Delima
+* @see <a href="http://www.w3.org/TR/DOM-Level-2-Core/core">http://www.w3.org/TR/DOM-Level-2-Core/core</a>
+* @see <a href="http://www.w3.org/TR/DOM-Level-2-Core/core#Core-Document-importNode">http://www.w3.org/TR/DOM-Level-2-Core/core#Core-Document-importNode</a>
+*/
+public final class documentimportnode13 extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public documentimportnode13(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+
+ org.w3c.domts.DocumentBuilderSetting[] settings =
+ new org.w3c.domts.DocumentBuilderSetting[] {
+org.w3c.domts.DocumentBuilderSetting.namespaceAware
+ };
+ DOMTestDocumentBuilderFactory testFactory = factory.newInstance(settings);
+ setFactory(testFactory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "staffNS", true);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ NodeList childList;
+ Node imported;
+ NodeList importedList;
+ Node employeeElem;
+ int importedLen;
+ doc = (Document) load("staffNS", true);
+ childList = doc.getElementsByTagNameNS("*", "employee");
+ employeeElem = childList.item(0);
+ imported = doc.importNode(employeeElem, false);
+ importedList = imported.getChildNodes();
+ importedLen = (int) importedList.getLength();
+ assertEquals("documentimportnode13", 0, importedLen);
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level2/core/documentimportnode13";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(documentimportnode13.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level2/core/documentimportnode14.java b/dom/src/test/java/org/w3c/domts/level2/core/documentimportnode14.java
new file mode 100644
index 0000000..0ab0a44
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level2/core/documentimportnode14.java
@@ -0,0 +1,111 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+
+Copyright (c) 2001-2003 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+
+*/
+
+package org.w3c.domts.level2.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * Using the method importNode with deep=true, import the fourth employee element node of this
+ * Document. Verify if the node has been imported correctly by checking
+ * if the default attribute present on this node has not been imported
+ * and an explicit attribute has been imported.
+* @author IBM
+* @author Neil Delima
+* @see <a href="http://www.w3.org/TR/DOM-Level-2-Core/core">http://www.w3.org/TR/DOM-Level-2-Core/core</a>
+* @see <a href="http://www.w3.org/TR/DOM-Level-2-Core/core#Core-Document-importNode">http://www.w3.org/TR/DOM-Level-2-Core/core#Core-Document-importNode</a>
+* @see <a href="http://www.w3.org/Bugs/Public/show_bug.cgi?id=259">http://www.w3.org/Bugs/Public/show_bug.cgi?id=259</a>
+* @see <a href="http://www.w3.org/Bugs/Public/show_bug.cgi?id=402">http://www.w3.org/Bugs/Public/show_bug.cgi?id=402</a>
+*/
+public final class documentimportnode14 extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public documentimportnode14(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+
+ org.w3c.domts.DocumentBuilderSetting[] settings =
+ new org.w3c.domts.DocumentBuilderSetting[] {
+org.w3c.domts.DocumentBuilderSetting.namespaceAware
+ };
+ DOMTestDocumentBuilderFactory testFactory = factory.newInstance(settings);
+ setFactory(testFactory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "staffNS", true);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ Document newDoc;
+ DOMImplementation domImpl;
+ DocumentType nullDocType = null;
+
+ NodeList childList;
+ Node imported;
+ Node employeeElem;
+ Attr attrNode;
+ String attrValue;
+ String nullNS = null;
+
+ doc = (Document) load("staffNS", true);
+ childList = doc.getElementsByTagNameNS("*", "employee");
+ employeeElem = childList.item(3);
+ domImpl = getImplementation();
+ newDoc = domImpl.createDocument(nullNS, "staff", nullDocType);
+ imported = newDoc.importNode(employeeElem, true);
+ attrNode = ((Element) /*Node */imported).getAttributeNodeNS(nullNS, "defaultAttr");
+ assertNull("defaultAttrNotImported", attrNode);
+ attrValue = ((Element) /*Node */imported).getAttributeNS("http://www.w3.org/2000/xmlns/", "emp");
+ assertEquals("explicitAttrImported", "http://www.nist.gov", attrValue);
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level2/core/documentimportnode14";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(documentimportnode14.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level2/core/documentimportnode15.java b/dom/src/test/java/org/w3c/domts/level2/core/documentimportnode15.java
new file mode 100644
index 0000000..9d26804
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level2/core/documentimportnode15.java
@@ -0,0 +1,103 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+
+Copyright (c) 2001 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+
+*/
+
+package org.w3c.domts.level2.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The importNode method imports a node from another document to this document.
+ * The returned node has no parent; (parentNode is null). The source node is not
+ * altered or removed from the original document but a new copy of the source node
+ * is created.
+ *
+ * Using the method importNode with deep=true, import a newly created Text node for this
+ * Document. Verify if the node has been imported correctly by checking the value of the
+ * imported text node.
+* @author IBM
+* @author Neil Delima
+* @see <a href="http://www.w3.org/TR/DOM-Level-2-Core/core">http://www.w3.org/TR/DOM-Level-2-Core/core</a>
+* @see <a href="http://www.w3.org/TR/DOM-Level-2-Core/core#Core-Document-importNode">http://www.w3.org/TR/DOM-Level-2-Core/core#Core-Document-importNode</a>
+*/
+public final class documentimportnode15 extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public documentimportnode15(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+
+ org.w3c.domts.DocumentBuilderSetting[] settings =
+ new org.w3c.domts.DocumentBuilderSetting[] {
+org.w3c.domts.DocumentBuilderSetting.namespaceAware
+ };
+ DOMTestDocumentBuilderFactory testFactory = factory.newInstance(settings);
+ setFactory(testFactory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "staffNS", true);
+ preload(contentType, "staffNS", true);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ Document docImp;
+ Node textImport;
+ Node textToImport;
+ String nodeValue;
+ doc = (Document) load("staffNS", true);
+ docImp = (Document) load("staffNS", true);
+ textToImport = doc.createTextNode("Document.importNode test for a TEXT_NODE");
+ textImport = doc.importNode(textToImport, true);
+ nodeValue = textImport.getNodeValue();
+ assertEquals("documentimportnode15", "Document.importNode test for a TEXT_NODE", nodeValue);
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level2/core/documentimportnode15";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(documentimportnode15.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level2/core/documentimportnode17.java b/dom/src/test/java/org/w3c/domts/level2/core/documentimportnode17.java
new file mode 100644
index 0000000..ae57411
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level2/core/documentimportnode17.java
@@ -0,0 +1,103 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+
+Copyright (c) 2001 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+
+*/
+
+package org.w3c.domts.level2.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The importNode method imports a node from another document to this document.
+ * The returned node has no parent; (parentNode is null). The source node is not
+ * altered or removed from the original document but a new copy of the source node
+ * is created.
+ *
+ * Using the method importNode with deep=true, import a newly created Comment node for this
+ * Document. Verify if the node has been imported correctly by checking the value of the
+ * imported Comment node.
+* @author IBM
+* @author Neil Delima
+* @see <a href="http://www.w3.org/TR/DOM-Level-2-Core/core">http://www.w3.org/TR/DOM-Level-2-Core/core</a>
+* @see <a href="http://www.w3.org/TR/DOM-Level-2-Core/core#Core-Document-importNode">http://www.w3.org/TR/DOM-Level-2-Core/core#Core-Document-importNode</a>
+*/
+public final class documentimportnode17 extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public documentimportnode17(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+
+ org.w3c.domts.DocumentBuilderSetting[] settings =
+ new org.w3c.domts.DocumentBuilderSetting[] {
+org.w3c.domts.DocumentBuilderSetting.namespaceAware
+ };
+ DOMTestDocumentBuilderFactory testFactory = factory.newInstance(settings);
+ setFactory(testFactory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "staffNS", true);
+ preload(contentType, "staffNS", true);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ Document docImp;
+ Node commentImport;
+ Node commentToImport;
+ String nodeValue;
+ doc = (Document) load("staffNS", true);
+ docImp = (Document) load("staffNS", true);
+ commentToImport = doc.createComment("Document.importNode test for a COMMENT_NODE");
+ commentImport = doc.importNode(commentToImport, true);
+ nodeValue = commentImport.getNodeValue();
+ assertEquals("documentimportnode17", "Document.importNode test for a COMMENT_NODE", nodeValue);
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level2/core/documentimportnode17";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(documentimportnode17.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level2/core/documentimportnode18.java b/dom/src/test/java/org/w3c/domts/level2/core/documentimportnode18.java
new file mode 100644
index 0000000..dcb9c09
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level2/core/documentimportnode18.java
@@ -0,0 +1,106 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+
+Copyright (c) 2001-2004 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+
+*/
+
+package org.w3c.domts.level2.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The importNode method imports a node from another document to this document.
+ * The returned node has no parent; (parentNode is null). The source node is not
+ * altered or removed from the original document but a new copy of the source node
+ * is created.
+ *
+ * Using the method importNode with deep=true, import a newly created PI node for this
+ * Document. Verify if the node has been imported correctly by checking the PITarget and
+ * PIData values of the imported PI node.
+* @author IBM
+* @author Neil Delima
+* @see <a href="http://www.w3.org/TR/DOM-Level-2-Core/core">http://www.w3.org/TR/DOM-Level-2-Core/core</a>
+* @see <a href="http://www.w3.org/TR/DOM-Level-2-Core/core#Core-Document-importNode">http://www.w3.org/TR/DOM-Level-2-Core/core#Core-Document-importNode</a>
+*/
+public final class documentimportnode18 extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public documentimportnode18(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+
+ org.w3c.domts.DocumentBuilderSetting[] settings =
+ new org.w3c.domts.DocumentBuilderSetting[] {
+org.w3c.domts.DocumentBuilderSetting.namespaceAware
+ };
+ DOMTestDocumentBuilderFactory testFactory = factory.newInstance(settings);
+ setFactory(testFactory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "staffNS", true);
+ preload(contentType, "staffNS", true);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ Document docImp;
+ ProcessingInstruction piImport;
+ ProcessingInstruction piToImport;
+ String piData;
+ String piTarget;
+ doc = (Document) load("staffNS", true);
+ docImp = (Document) load("staffNS", true);
+ piToImport = doc.createProcessingInstruction("Target", "Data");
+ piImport = (ProcessingInstruction) doc.importNode(piToImport, false);
+ piTarget = piImport.getTarget();
+ piData = piImport.getData();
+ assertEquals("documentimportnode18_Target", "Target", piTarget);
+ assertEquals("documentimportnode18_Data", "Data", piData);
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level2/core/documentimportnode18";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(documentimportnode18.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level2/core/documentimportnode19.java b/dom/src/test/java/org/w3c/domts/level2/core/documentimportnode19.java
new file mode 100644
index 0000000..3be355b
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level2/core/documentimportnode19.java
@@ -0,0 +1,136 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+
+Copyright (c) 2001-2004 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+
+*/
+
+package org.w3c.domts.level2.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The importNode method imports a node from another document to this document.
+ * The returned node has no parent; (parentNode is null). The source node is not
+ * altered or removed from the original document but a new copy of the source node
+ * is created.
+ *
+ * Using the method importNode with deep=true/false, import a entity nodes ent2 and ent6
+ * from this document to a new document object. Verify if the nodes have been
+ * imported correctly by checking the nodeNames of the imported nodes and public and system ids.
+* @author IBM
+* @author Neil Delima
+* @see <a href="http://www.w3.org/TR/DOM-Level-2-Core/core">http://www.w3.org/TR/DOM-Level-2-Core/core</a>
+* @see <a href="http://www.w3.org/TR/DOM-Level-2-Core/core#Core-Document-importNode">http://www.w3.org/TR/DOM-Level-2-Core/core#Core-Document-importNode</a>
+*/
+public final class documentimportnode19 extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public documentimportnode19(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+
+ org.w3c.domts.DocumentBuilderSetting[] settings =
+ new org.w3c.domts.DocumentBuilderSetting[] {
+org.w3c.domts.DocumentBuilderSetting.namespaceAware
+ };
+ DOMTestDocumentBuilderFactory testFactory = factory.newInstance(settings);
+ setFactory(testFactory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "staffNS", true);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ DocumentType docTypeNull = null;
+
+ Document docImp;
+ DOMImplementation domImpl;
+ DocumentType docType;
+ NamedNodeMap nodeMap;
+ Entity entity2;
+ Entity entity6;
+ Entity entityImp2;
+ Entity entityImp6;
+ String nodeName;
+ String systemId;
+ String notationName;
+ String nodeNameImp;
+ String systemIdImp;
+ String notationNameImp;
+ doc = (Document) load("staffNS", true);
+ domImpl = doc.getImplementation();
+ docType = doc.getDoctype();
+ docImp = domImpl.createDocument("http://www.w3.org/DOM/Test", "a:b", docTypeNull);
+ nodeMap = docType.getEntities();
+ assertNotNull("entitiesNotNull", nodeMap);
+ entity2 = (Entity) nodeMap.getNamedItem("ent2");
+ entity6 = (Entity) nodeMap.getNamedItem("ent6");
+ entityImp2 = (Entity) docImp.importNode(entity2, false);
+ entityImp6 = (Entity) docImp.importNode(entity6, true);
+ nodeName = entity2.getNodeName();
+ nodeNameImp = entityImp2.getNodeName();
+ assertEquals("documentimportnode19_Ent2NodeName", nodeName, nodeNameImp);
+ nodeName = entity6.getNodeName();
+ nodeNameImp = entityImp6.getNodeName();
+ assertEquals("documentimportnode19_Ent6NodeName", nodeName, nodeNameImp);
+ systemId = entity2.getSystemId();
+ systemIdImp = entityImp2.getSystemId();
+ assertEquals("documentimportnode19_Ent2SystemId", systemId, systemIdImp);
+ systemId = entity6.getSystemId();
+ systemIdImp = entityImp6.getSystemId();
+ assertEquals("documentimportnode19_Ent6SystemId", systemId, systemIdImp);
+ notationName = entity2.getNotationName();
+ notationNameImp = entityImp2.getNotationName();
+ assertEquals("documentimportnode19_Ent2NotationName", notationName, notationNameImp);
+ notationName = entity6.getNotationName();
+ notationNameImp = entityImp6.getNotationName();
+ assertEquals("documentimportnode19_Ent6NotationName", notationName, notationNameImp);
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level2/core/documentimportnode19";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(documentimportnode19.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level2/core/documentimportnode20.java b/dom/src/test/java/org/w3c/domts/level2/core/documentimportnode20.java
new file mode 100644
index 0000000..bb77713
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level2/core/documentimportnode20.java
@@ -0,0 +1,134 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+
+Copyright (c) 2001 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+
+*/
+
+package org.w3c.domts.level2.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The importNode method imports a node from another document to this document.
+ * The returned node has no parent; (parentNode is null). The source node is not
+ * altered or removed from the original document but a new copy of the source node
+ * is created.
+ *
+ * Using the method importNode with deep=true, import a entity node ent4
+ * from this document to a new document object. The replacement text of this entity is an element
+ * node, a cdata node and a pi. Verify if the nodes have been
+ * imported correctly by checking the nodeNames of the imported element node, the data for the
+ * cdata nodes and the PItarget and PIData for the pi nodes.
+* @author IBM
+* @author Neil Delima
+* @see <a href="http://www.w3.org/TR/DOM-Level-2-Core/core">http://www.w3.org/TR/DOM-Level-2-Core/core</a>
+* @see <a href="http://www.w3.org/TR/DOM-Level-2-Core/core#Core-Document-importNode">http://www.w3.org/TR/DOM-Level-2-Core/core#Core-Document-importNode</a>
+*/
+public final class documentimportnode20 extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public documentimportnode20(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+
+ org.w3c.domts.DocumentBuilderSetting[] settings =
+ new org.w3c.domts.DocumentBuilderSetting[] {
+org.w3c.domts.DocumentBuilderSetting.namespaceAware,
+org.w3c.domts.DocumentBuilderSetting.notExpandEntityReferences
+ };
+ DOMTestDocumentBuilderFactory testFactory = factory.newInstance(settings);
+ setFactory(testFactory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "staffNS", true);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ Document docImp;
+ DOMImplementation domImpl;
+ DocumentType docType;
+ DocumentType docTypeNull = null;
+
+ NamedNodeMap nodeMap;
+ Entity entity4;
+ Entity entityImp4;
+ Element element;
+ CharacterData cdata;
+ ProcessingInstruction pi;
+ NodeList childList;
+ NodeList elemchildList;
+ String ent4Name;
+ String ent4ImpName;
+ String cdataVal;
+ String piTargetVal;
+ String piDataVal;
+ doc = (Document) load("staffNS", true);
+ domImpl = doc.getImplementation();
+ docType = doc.getDoctype();
+ docImp = domImpl.createDocument("http://www.w3.org/DOM/Test", "a:b", docTypeNull);
+ nodeMap = docType.getEntities();
+ entity4 = (Entity) nodeMap.getNamedItem("ent4");
+ entityImp4 = (Entity) docImp.importNode(entity4, true);
+ childList = entityImp4.getChildNodes();
+ element = (Element) childList.item(0);
+ elemchildList = element.getChildNodes();
+ cdata = (CharacterData) elemchildList.item(0);
+ pi = (ProcessingInstruction) childList.item(1);
+ ent4Name = entity4.getNodeName();
+ ent4ImpName = entityImp4.getNodeName();
+ cdataVal = cdata.getData();
+ piTargetVal = pi.getTarget();
+ piDataVal = pi.getData();
+ assertEquals("documentimportnode20_Ent4NodeName", ent4Name, ent4ImpName);
+ assertEquals("documentimportnode20_Cdata", "Element data", cdataVal);
+ assertEquals("documentimportnode20_PITarget", "PItarget", piTargetVal);
+ assertEquals("documentimportnode20_PIData", "PIdata", piDataVal);
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level2/core/documentimportnode20";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(documentimportnode20.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level2/core/documentimportnode21.java b/dom/src/test/java/org/w3c/domts/level2/core/documentimportnode21.java
new file mode 100644
index 0000000..9aeccf3
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level2/core/documentimportnode21.java
@@ -0,0 +1,144 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+
+Copyright (c) 2001 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+
+*/
+
+package org.w3c.domts.level2.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The importNode method imports a node from another document to this document.
+ * The returned node has no parent; (parentNode is null). The source node is not
+ * altered or removed from the original document but a new copy of the source node
+ * is created.
+ *
+ * Using the method importNode with deep=true, retreive the entity refs present in the
+ * second element node whose tagName is address and import these nodes into another document.
+ * Verify if the nodes have been imported correctly by checking the nodeNames of the
+ * imported nodes, since they are imported into a new document which doesnot have thes defined,
+ * the imported nodes should not have any children.
+ * Now import the entityRef nodes into the same document and verify if the nodes have been
+ * imported correctly by checking the nodeNames of the imported nodes, and by checking the
+ * value of the replacement text of the imported nodes.
+* @author IBM
+* @author Neil Delima
+* @see <a href="http://www.w3.org/TR/DOM-Level-2-Core/core">http://www.w3.org/TR/DOM-Level-2-Core/core</a>
+* @see <a href="http://www.w3.org/TR/DOM-Level-2-Core/core#Core-Document-importNode">http://www.w3.org/TR/DOM-Level-2-Core/core#Core-Document-importNode</a>
+*/
+public final class documentimportnode21 extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public documentimportnode21(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+
+ org.w3c.domts.DocumentBuilderSetting[] settings =
+ new org.w3c.domts.DocumentBuilderSetting[] {
+org.w3c.domts.DocumentBuilderSetting.namespaceAware,
+org.w3c.domts.DocumentBuilderSetting.notExpandEntityReferences
+ };
+ DOMTestDocumentBuilderFactory testFactory = factory.newInstance(settings);
+ setFactory(testFactory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "staffNS", true);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ DocumentType docTypeNull = null;
+
+ Document docImp;
+ DOMImplementation domImpl;
+ NodeList addressList;
+ NodeList addressChildList;
+ Element element;
+ EntityReference entRef2;
+ EntityReference entRefImp2;
+ EntityReference entRef3;
+ EntityReference entRefImp3;
+ String nodeName2;
+ String nodeName3;
+ String nodeNameImp2;
+ String nodeNameImp3;
+ NodeList nodes;
+ Node nodeImp3;
+ Node nodeImp2;
+ String nodeValueImp2;
+ String nodeValueImp3;
+ doc = (Document) load("staffNS", true);
+ domImpl = doc.getImplementation();
+ docImp = domImpl.createDocument("http://www.w3.org/DOM/Test", "a:b", docTypeNull);
+ addressList = doc.getElementsByTagName("address");
+ element = (Element) addressList.item(1);
+ addressChildList = element.getChildNodes();
+ entRef2 = (EntityReference) addressChildList.item(0);
+ entRef3 = (EntityReference) addressChildList.item(2);
+ entRefImp2 = (EntityReference) docImp.importNode(entRef2, true);
+ entRefImp3 = (EntityReference) docImp.importNode(entRef3, false);
+ nodeName2 = entRef2.getNodeName();
+ nodeName3 = entRef3.getNodeName();
+ nodeNameImp2 = entRefImp2.getNodeName();
+ nodeNameImp3 = entRefImp3.getNodeName();
+ assertEquals("documentimportnode21_Ent2NodeName", nodeName2, nodeNameImp2);
+ assertEquals("documentimportnode21_Ent3NodeName", nodeName3, nodeNameImp3);
+ entRefImp2 = (EntityReference) doc.importNode(entRef2, true);
+ entRefImp3 = (EntityReference) doc.importNode(entRef3, false);
+ nodes = entRefImp2.getChildNodes();
+ nodeImp2 = nodes.item(0);
+ nodeValueImp2 = nodeImp2.getNodeValue();
+ nodes = entRefImp3.getChildNodes();
+ nodeImp3 = nodes.item(0);
+ nodeValueImp3 = nodeImp3.getNodeValue();
+ assertEquals("documentimportnode21_Ent2NodeValue", "1900 Dallas Road", nodeValueImp2);
+ assertEquals("documentimportnode21_Ent3Nodevalue", "Texas", nodeValueImp3);
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level2/core/documentimportnode21";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(documentimportnode21.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level2/core/documentimportnode22.java b/dom/src/test/java/org/w3c/domts/level2/core/documentimportnode22.java
new file mode 100644
index 0000000..0ce8977
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level2/core/documentimportnode22.java
@@ -0,0 +1,144 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+
+Copyright (c) 2001-2004 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+
+*/
+
+package org.w3c.domts.level2.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The importNode method imports a node from another document to this document.
+ * The returned node has no parent; (parentNode is null). The source node is not
+ * altered or removed from the original document but a new copy of the source node
+ * is created.
+ *
+ * Using the method importNode with deep=true/false, import two notaiton nodes into the
+ * same and different documnet objects. In each case check if valid public and systemids
+ * are returned if any and if none, check if a null value was returned.
+* @author IBM
+* @author Neil Delima
+* @see <a href="http://www.w3.org/TR/DOM-Level-2-Core/core">http://www.w3.org/TR/DOM-Level-2-Core/core</a>
+* @see <a href="http://www.w3.org/TR/DOM-Level-2-Core/core#Core-Document-importNode">http://www.w3.org/TR/DOM-Level-2-Core/core#Core-Document-importNode</a>
+*/
+public final class documentimportnode22 extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public documentimportnode22(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+
+ org.w3c.domts.DocumentBuilderSetting[] settings =
+ new org.w3c.domts.DocumentBuilderSetting[] {
+org.w3c.domts.DocumentBuilderSetting.namespaceAware
+ };
+ DOMTestDocumentBuilderFactory testFactory = factory.newInstance(settings);
+ setFactory(testFactory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "staffNS", true);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ DocumentType docTypeNull = null;
+
+ Document docImp;
+ DOMImplementation domImpl;
+ DocumentType docType;
+ NamedNodeMap nodeMap;
+ Notation notation1;
+ Notation notation2;
+ Notation notationImp1;
+ Notation notationImp2;
+ Notation notationImpNew1;
+ Notation notationImpNew2;
+ String publicId1;
+ String publicId1Imp;
+ String publicId1NewImp;
+ String publicId2Imp;
+ String publicId2NewImp;
+ String systemId1Imp;
+ String systemId1NewImp;
+ String systemId2;
+ String systemId2Imp;
+ String systemId2NewImp;
+ doc = (Document) load("staffNS", true);
+ domImpl = doc.getImplementation();
+ docType = doc.getDoctype();
+ docImp = domImpl.createDocument("http://www.w3.org/DOM/Test", "a:b", docTypeNull);
+ nodeMap = docType.getNotations();
+ assertNotNull("notationsNotNull", nodeMap);
+ notation1 = (Notation) nodeMap.getNamedItem("notation1");
+ notation2 = (Notation) nodeMap.getNamedItem("notation2");
+ notationImp1 = (Notation) doc.importNode(notation1, true);
+ notationImp2 = (Notation) doc.importNode(notation2, false);
+ notationImpNew1 = (Notation) docImp.importNode(notation1, false);
+ notationImpNew2 = (Notation) docImp.importNode(notation2, true);
+ publicId1 = notation1.getPublicId();
+ publicId1Imp = notation1.getPublicId();
+ publicId1NewImp = notation1.getPublicId();
+ systemId1Imp = notation1.getSystemId();
+ systemId1NewImp = notation1.getSystemId();
+ publicId2Imp = notation2.getPublicId();
+ publicId2NewImp = notation2.getPublicId();
+ systemId2 = notation2.getSystemId();
+ systemId2Imp = notation2.getSystemId();
+ systemId2NewImp = notation2.getSystemId();
+ assertEquals("documentimportnode22_N1PID", publicId1, publicId1Imp);
+ assertEquals("documentimportnode22_N1NPID", publicId1, publicId1NewImp);
+ assertNull("documentimportnode22_N1SID", systemId1Imp);
+ assertNull("documentimportnode22_N1NSID", systemId1NewImp);
+ assertEquals("documentimportnode22_N2SID", systemId2, systemId2Imp);
+ assertEquals("documentimportnode22_N2NSID", systemId2, systemId2NewImp);
+ assertNull("documentimportnode22_N2PID", publicId2Imp);
+ assertNull("documentimportnode22_N2NPID", publicId2Imp);
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level2/core/documentimportnode22";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(documentimportnode22.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level2/core/documenttypeinternalSubset01.java b/dom/src/test/java/org/w3c/domts/level2/core/documenttypeinternalSubset01.java
new file mode 100644
index 0000000..0432411
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level2/core/documenttypeinternalSubset01.java
@@ -0,0 +1,92 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+
+Copyright (c) 2001-2004 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+
+*/
+
+package org.w3c.domts.level2.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The method getInternalSubset() returns the internal subset as a string.
+ *
+ * Create a new DocumentType node with null values for publicId and systemId.
+ * Verify that its internal subset is null.
+* @author IBM
+* @author Neil Delima
+* @see <a href="http://www.w3.org/TR/DOM-Level-2-Core/core#ID-Core-DocType-internalSubset">http://www.w3.org/TR/DOM-Level-2-Core/core#ID-Core-DocType-internalSubset</a>
+* @see <a href="http://www.w3.org/Bugs/Public/show_bug.cgi?id=259">http://www.w3.org/Bugs/Public/show_bug.cgi?id=259</a>
+*/
+public final class documenttypeinternalSubset01 extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public documenttypeinternalSubset01(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "staffNS", false);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ DocumentType docType;
+ DOMImplementation domImpl;
+ String internal;
+ String nullNS = null;
+
+ doc = (Document) load("staffNS", false);
+ domImpl = doc.getImplementation();
+ docType = domImpl.createDocumentType("l2:root", nullNS, nullNS);
+ internal = docType.getInternalSubset();
+ assertNull("internalSubsetNull", internal);
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level2/core/documenttypeinternalSubset01";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(documenttypeinternalSubset01.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level2/core/documenttypepublicid01.java b/dom/src/test/java/org/w3c/domts/level2/core/documenttypepublicid01.java
new file mode 100644
index 0000000..47834cd
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level2/core/documenttypepublicid01.java
@@ -0,0 +1,92 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+
+Copyright (c) 2001-2003 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+
+*/
+
+package org.w3c.domts.level2.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The method getInternalSubset() returns the public identifier of the external subset.
+ *
+ * Create a new DocumentType node with the value "PUB" for its publicId.
+ * Check the value of the publicId attribute using getPublicId().
+* @author IBM
+* @author Neil Delima
+* @see <a href="http://www.w3.org/TR/DOM-Level-2-Core/core#ID-Core-DocType-publicId">http://www.w3.org/TR/DOM-Level-2-Core/core#ID-Core-DocType-publicId</a>
+* @see <a href="http://www.w3.org/Bugs/Public/show_bug.cgi?id=259">http://www.w3.org/Bugs/Public/show_bug.cgi?id=259</a>
+*/
+public final class documenttypepublicid01 extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public documenttypepublicid01(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "staffNS", false);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ DocumentType docType;
+ DOMImplementation domImpl;
+ String publicId;
+ String nullNS = null;
+
+ doc = (Document) load("staffNS", false);
+ domImpl = doc.getImplementation();
+ docType = domImpl.createDocumentType("l2:root", "PUB", nullNS);
+ publicId = docType.getPublicId();
+ assertEquals("documenttypepublicid01", "PUB", publicId);
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level2/core/documenttypepublicid01";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(documenttypepublicid01.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level2/core/documenttypesystemid01.java b/dom/src/test/java/org/w3c/domts/level2/core/documenttypesystemid01.java
new file mode 100644
index 0000000..f266bf5
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level2/core/documenttypesystemid01.java
@@ -0,0 +1,92 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+
+Copyright (c) 2001 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+
+*/
+
+package org.w3c.domts.level2.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The method getInternalSubset() returns the public identifier of the external subset.
+ *
+ * Create a new DocumentType node with the value "SYS" for its systemId and PUB for
+ * its publicId. Check the value of the systemId and pbulicId attributes.
+* @author IBM
+* @author Neil Delima
+* @see <a href="http://www.w3.org/TR/DOM-Level-2-Core/core#ID-Core-DocType-systemId">http://www.w3.org/TR/DOM-Level-2-Core/core#ID-Core-DocType-systemId</a>
+*/
+public final class documenttypesystemid01 extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public documenttypesystemid01(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "staffNS", false);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ DocumentType docType;
+ DOMImplementation domImpl;
+ String publicId;
+ String systemId;
+ doc = (Document) load("staffNS", false);
+ domImpl = doc.getImplementation();
+ docType = domImpl.createDocumentType("l2:root", "PUB", "SYS");
+ publicId = docType.getPublicId();
+ systemId = docType.getSystemId();
+ assertEquals("documenttypepublicid01", "PUB", publicId);
+ assertEquals("documenttypesystemid01", "SYS", systemId);
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level2/core/documenttypesystemid01";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(documenttypesystemid01.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level2/core/domimplementationcreatedocument03.java b/dom/src/test/java/org/w3c/domts/level2/core/domimplementationcreatedocument03.java
new file mode 100644
index 0000000..740e9a8
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level2/core/domimplementationcreatedocument03.java
@@ -0,0 +1,127 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+
+
+
+Copyright (c) 2001 World Wide Web Consortium,
+
+(Massachusetts Institute of Technology, Institut National de
+
+Recherche en Informatique et en Automatique, Keio University). All
+
+Rights Reserved. This program is distributed under the W3C's Software
+
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+
+
+
+*/
+
+package org.w3c.domts.level2.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The createDocument method with valid arguments, should create a DOM Document of
+ * the specified type.
+ *
+ * Call the createDocument on this DOMImplementation with
+ * createDocument ("http://www.w3.org/DOMTest/L2",see the array below for valid QNames,null).
+ * Check if the returned Document object is is empty with no Document Element.
+* @author IBM
+* @author Neil Delima
+* @see <a href="http://www.w3.org/TR/DOM-Level-2-Core/core#Level-2-Core-DOM-createDocument">http://www.w3.org/TR/DOM-Level-2-Core/core#Level-2-Core-DOM-createDocument</a>
+*/
+public final class domimplementationcreatedocument03 extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public domimplementationcreatedocument03(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+
+ org.w3c.domts.DocumentBuilderSetting[] settings =
+ new org.w3c.domts.DocumentBuilderSetting[] {
+org.w3c.domts.DocumentBuilderSetting.namespaceAware
+ };
+ DOMTestDocumentBuilderFactory testFactory = factory.newInstance(settings);
+ setFactory(testFactory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "staffNS", false);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ DOMImplementation domImpl;
+ Document newDoc;
+ DocumentType docType = null;
+
+ String namespaceURI = "http://www.w3.org/DOMTest/L2";
+ String qualifiedName;
+ java.util.List qualifiedNames = new java.util.ArrayList();
+ qualifiedNames.add("_:_");
+ qualifiedNames.add("_:h0");
+ qualifiedNames.add("_:test");
+ qualifiedNames.add("l_:_");
+ qualifiedNames.add("ns:_0");
+ qualifiedNames.add("ns:a0");
+ qualifiedNames.add("ns0:test");
+ qualifiedNames.add("a.b:c");
+ qualifiedNames.add("a-b:c");
+ qualifiedNames.add("a-b:c");
+
+ doc = (Document) load("staffNS", false);
+ domImpl = doc.getImplementation();
+ for (int indexN1006B = 0; indexN1006B < qualifiedNames.size(); indexN1006B++) {
+ qualifiedName = (String) qualifiedNames.get(indexN1006B);
+ newDoc = domImpl.createDocument(namespaceURI, qualifiedName, docType);
+ assertNotNull("domimplementationcreatedocument03", newDoc);
+ }
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level2/core/domimplementationcreatedocument03";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(domimplementationcreatedocument03.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level2/core/domimplementationcreatedocument04.java b/dom/src/test/java/org/w3c/domts/level2/core/domimplementationcreatedocument04.java
new file mode 100644
index 0000000..de24aef
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level2/core/domimplementationcreatedocument04.java
@@ -0,0 +1,116 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+
+
+
+Copyright (c) 2001 World Wide Web Consortium,
+
+(Massachusetts Institute of Technology, Institut National de
+
+Recherche en Informatique et en Automatique, Keio University). All
+
+Rights Reserved. This program is distributed under the W3C's Software
+
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+
+
+
+*/
+
+package org.w3c.domts.level2.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The createDocument method should throw a NAMESPACE_ERR if the qualifiedName has
+ * a prefix and the namespaceURI is null.
+ *
+ * Call the createDocument on this DOMImplementation with null namespaceURI and a
+ * qualifiedName that has a namespace prefix using this DOMImplementation.
+ * Check if the NAMESPACE_ERR is thrown.
+* @author IBM
+* @author Neil Delima
+* @see <a href="http://www.w3.org/TR/DOM-Level-2-Core/core#Level-2-Core-DOM-createDocument">http://www.w3.org/TR/DOM-Level-2-Core/core#Level-2-Core-DOM-createDocument</a>
+* @see <a href="http://www.w3.org/TR/DOM-Level-2-Core/core#Level-2-Core-DOM-createDocument">http://www.w3.org/TR/DOM-Level-2-Core/core#Level-2-Core-DOM-createDocument</a>
+*/
+public final class domimplementationcreatedocument04 extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public domimplementationcreatedocument04(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "staffNS", false);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ DOMImplementation domImpl;
+ Document newDoc;
+ String namespaceURI = null;
+
+ String qualifiedName = "dom:root";
+ DocumentType docType = null;
+
+ doc = (Document) load("staffNS", false);
+ domImpl = doc.getImplementation();
+
+ {
+ boolean success = false;
+ try {
+ newDoc = domImpl.createDocument(namespaceURI, qualifiedName, docType);
+ } catch (DOMException ex) {
+ success = (ex.code == DOMException.NAMESPACE_ERR);
+ }
+ assertTrue("domimplementationcreatedocument04", success);
+ }
+}
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level2/core/domimplementationcreatedocument04";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(domimplementationcreatedocument04.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level2/core/domimplementationcreatedocument05.java b/dom/src/test/java/org/w3c/domts/level2/core/domimplementationcreatedocument05.java
new file mode 100644
index 0000000..0efee48
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level2/core/domimplementationcreatedocument05.java
@@ -0,0 +1,115 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+
+
+
+Copyright (c) 2001 World Wide Web Consortium,
+
+(Massachusetts Institute of Technology, Institut National de
+
+Recherche en Informatique et en Automatique, Keio University). All
+
+Rights Reserved. This program is distributed under the W3C's Software
+
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+
+
+
+*/
+
+package org.w3c.domts.level2.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The createDocument method should throw a NAMESPACE_ERR if the qualifiedName has
+ * a prefix that is xml and the namespaceURI is different from
+ * http://www..w3.org/XML/1998/namespace.
+ *
+ * Call the createDocument on this DOMImplementation with namespaceURI that is
+ * http://www.w3.org/xml/1998/namespace and a qualifiedName that has the prefix xml
+ * Check if the NAMESPACE_ERR is thrown.
+* @author IBM
+* @author Neil Delima
+* @see <a href="http://www.w3.org/TR/DOM-Level-2-Core/core#Level-2-Core-DOM-createDocument">http://www.w3.org/TR/DOM-Level-2-Core/core#Level-2-Core-DOM-createDocument</a>
+*/
+public final class domimplementationcreatedocument05 extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public domimplementationcreatedocument05(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "staffNS", false);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ DOMImplementation domImpl;
+ Document newDoc;
+ String namespaceURI = "http://www.w3.org/xml/1998/namespace";
+ String qualifiedName = "xml:root";
+ DocumentType docType = null;
+
+ doc = (Document) load("staffNS", false);
+ domImpl = doc.getImplementation();
+
+ {
+ boolean success = false;
+ try {
+ newDoc = domImpl.createDocument(namespaceURI, qualifiedName, docType);
+ } catch (DOMException ex) {
+ success = (ex.code == DOMException.NAMESPACE_ERR);
+ }
+ assertTrue("domimplementationcreatedocument05", success);
+ }
+}
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level2/core/domimplementationcreatedocument05";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(domimplementationcreatedocument05.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level2/core/domimplementationcreatedocument07.java b/dom/src/test/java/org/w3c/domts/level2/core/domimplementationcreatedocument07.java
new file mode 100644
index 0000000..46a47cd
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level2/core/domimplementationcreatedocument07.java
@@ -0,0 +1,112 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+
+
+
+Copyright (c) 2001 World Wide Web Consortium,
+
+(Massachusetts Institute of Technology, Institut National de
+
+Recherche en Informatique et en Automatique, Keio University). All
+
+Rights Reserved. This program is distributed under the W3C's Software
+
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+
+
+
+*/
+
+package org.w3c.domts.level2.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The createDocument method should raise a NAMESPACE_ERR if the qualifiedName is malformed
+ *
+ * Invoke the createDocument method on this DOMImplementation object with null values
+ * for namespaceURI and docType and a malformed qualifiedName.
+ * The NAMESPACE_ERR should be raised.
+* @author IBM
+* @author Neil Delima
+* @see <a href="http://www.w3.org/TR/DOM-Level-2-Core/core#Level-2-Core-DOM-createDocument">http://www.w3.org/TR/DOM-Level-2-Core/core#Level-2-Core-DOM-createDocument</a>
+*/
+public final class domimplementationcreatedocument07 extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public domimplementationcreatedocument07(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "staffNS", false);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ DOMImplementation domImpl;
+ Document newDoc;
+ String namespaceURI = "http://www.w3.org/DOMTest/level2";
+ DocumentType docType = null;
+
+ doc = (Document) load("staffNS", false);
+ domImpl = doc.getImplementation();
+
+ {
+ boolean success = false;
+ try {
+ newDoc = domImpl.createDocument(namespaceURI, ":", docType);
+ } catch (DOMException ex) {
+ success = (ex.code == DOMException.NAMESPACE_ERR);
+ }
+ assertTrue("domimplementationcreatedocument07", success);
+ }
+}
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level2/core/domimplementationcreatedocument07";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(domimplementationcreatedocument07.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level2/core/domimplementationcreatedocumenttype01.java b/dom/src/test/java/org/w3c/domts/level2/core/domimplementationcreatedocumenttype01.java
new file mode 100644
index 0000000..99f1a63
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level2/core/domimplementationcreatedocumenttype01.java
@@ -0,0 +1,109 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+
+Copyright (c) 2001 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+
+*/
+
+package org.w3c.domts.level2.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The method createDocumentType with valid values for qualifiedName, publicId and
+ * systemId should create an empty DocumentType node.
+ *
+ * Invoke createDocument on this DOMImplementation with a valid qualifiedName and different
+ * publicIds and systemIds. Check if the the DocumentType node was created with its
+ * ownerDocument attribute set to null.
+* @author IBM
+* @author Neil Delima
+* @see <a href="http://www.w3.org/TR/DOM-Level-2-Core/core#Level-2-Core-DOM-createDocument">http://www.w3.org/TR/DOM-Level-2-Core/core#Level-2-Core-DOM-createDocument</a>
+*/
+public final class domimplementationcreatedocumenttype01 extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public domimplementationcreatedocumenttype01(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "staffNS", false);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ DOMImplementation domImpl;
+ DocumentType newDocType;
+ Document ownerDocument;
+ String qualifiedName = "test:root";
+ String publicId;
+ String systemId;
+ java.util.List publicIds = new java.util.ArrayList();
+ publicIds.add("1234");
+ publicIds.add("test");
+
+ java.util.List systemIds = new java.util.ArrayList();
+ systemIds.add("");
+ systemIds.add("test");
+
+ doc = (Document) load("staffNS", false);
+ domImpl = doc.getImplementation();
+ for (int indexN1005D = 0; indexN1005D < publicIds.size(); indexN1005D++) {
+ publicId = (String) publicIds.get(indexN1005D);
+ for (int indexN10061 = 0; indexN10061 < systemIds.size(); indexN10061++) {
+ systemId = (String) systemIds.get(indexN10061);
+ newDocType = domImpl.createDocumentType(qualifiedName, publicId, systemId);
+ assertNotNull("domimplementationcreatedocumenttype01_newDocType", newDocType);
+ ownerDocument = newDocType.getOwnerDocument();
+ assertNull("domimplementationcreatedocumenttype01_ownerDocument", ownerDocument);
+ }
+ }
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level2/core/domimplementationcreatedocumenttype01";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(domimplementationcreatedocumenttype01.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level2/core/domimplementationcreatedocumenttype02.java b/dom/src/test/java/org/w3c/domts/level2/core/domimplementationcreatedocumenttype02.java
new file mode 100644
index 0000000..5962bfa
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level2/core/domimplementationcreatedocumenttype02.java
@@ -0,0 +1,127 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+
+
+
+Copyright (c) 2001 World Wide Web Consortium,
+
+(Massachusetts Institute of Technology, Institut National de
+
+Recherche en Informatique et en Automatique, Keio University). All
+
+Rights Reserved. This program is distributed under the W3C's Software
+
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+
+
+
+*/
+
+package org.w3c.domts.level2.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The method createDocumentType with valid values for qualifiedName, publicId and
+ * systemId should create an empty DocumentType node.
+ *
+ * Invoke createDocument on this DOMImplementation with a different valid qualifiedNames
+ * and a valid publicId and systemId. Check if the the DocumentType node was created
+ * with its ownerDocument attribute set to null.
+* @author IBM
+* @author Neil Delima
+* @see <a href="http://www.w3.org/TR/DOM-Level-2-Core/core#Level-2-Core-DOM-createDocType">http://www.w3.org/TR/DOM-Level-2-Core/core#Level-2-Core-DOM-createDocType</a>
+*/
+public final class domimplementationcreatedocumenttype02 extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public domimplementationcreatedocumenttype02(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "staffNS", false);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ DOMImplementation domImpl;
+ DocumentType newDocType;
+ Document ownerDocument;
+ String publicId = "http://www.w3.org/DOM/Test/dom2.dtd";
+ String systemId = "dom2.dtd";
+ String qualifiedName;
+ java.util.List qualifiedNames = new java.util.ArrayList();
+ qualifiedNames.add("_:_");
+ qualifiedNames.add("_:h0");
+ qualifiedNames.add("_:test");
+ qualifiedNames.add("_:_.");
+ qualifiedNames.add("_:a-");
+ qualifiedNames.add("l_:_");
+ qualifiedNames.add("ns:_0");
+ qualifiedNames.add("ns:a0");
+ qualifiedNames.add("ns0:test");
+ qualifiedNames.add("ns:EEE.");
+ qualifiedNames.add("ns:_-");
+ qualifiedNames.add("a.b:c");
+ qualifiedNames.add("a-b:c.j");
+ qualifiedNames.add("a-b:c");
+
+ doc = (Document) load("staffNS", false);
+ domImpl = doc.getImplementation();
+ for (int indexN10077 = 0; indexN10077 < qualifiedNames.size(); indexN10077++) {
+ qualifiedName = (String) qualifiedNames.get(indexN10077);
+ newDocType = domImpl.createDocumentType(qualifiedName, publicId, systemId);
+ assertNotNull("domimplementationcreatedocumenttype02_newDocType", newDocType);
+ ownerDocument = newDocType.getOwnerDocument();
+ assertNull("domimplementationcreatedocumenttype02_ownerDocument", ownerDocument);
+ }
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level2/core/domimplementationcreatedocumenttype02";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(domimplementationcreatedocumenttype02.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level2/core/domimplementationcreatedocumenttype04.java b/dom/src/test/java/org/w3c/domts/level2/core/domimplementationcreatedocumenttype04.java
new file mode 100644
index 0000000..ae0084c
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level2/core/domimplementationcreatedocumenttype04.java
@@ -0,0 +1,131 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+
+
+
+Copyright (c) 2001 World Wide Web Consortium,
+
+(Massachusetts Institute of Technology, Institut National de
+
+Recherche en Informatique et en Automatique, Keio University). All
+
+Rights Reserved. This program is distributed under the W3C's Software
+
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+
+
+
+*/
+
+package org.w3c.domts.level2.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The method createDocumentType should raise a INVALID_CHARACTER_ERR if the qualifiedName
+ * contains an illegal characters.
+ *
+ * Invoke createDocument on this DOMImplementation with qualifiedNames having illegal characters.
+ * Check if an INVALID_CHARACTER_ERR is raised in each case.
+* @author IBM
+* @author Neil Delima
+* @see <a href="http://www.w3.org/TR/DOM-Level-2-Core/core#Level-2-Core-DOM-createDocType">http://www.w3.org/TR/DOM-Level-2-Core/core#Level-2-Core-DOM-createDocType</a>
+*/
+public final class domimplementationcreatedocumenttype04 extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public domimplementationcreatedocumenttype04(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "staffNS", false);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ DOMImplementation domImpl;
+ DocumentType newDocType;
+ String publicId = "http://www.w3.org/DOM/Test/dom2.dtd";
+ String systemId = "dom2.dtd";
+ String qualifiedName;
+ java.util.List qualifiedNames = new java.util.ArrayList();
+ qualifiedNames.add("{");
+ qualifiedNames.add("}");
+ qualifiedNames.add("'");
+ qualifiedNames.add("~");
+ qualifiedNames.add("`");
+ qualifiedNames.add("@");
+ qualifiedNames.add("#");
+ qualifiedNames.add("$");
+ qualifiedNames.add("%");
+ qualifiedNames.add("^");
+ qualifiedNames.add("&");
+ qualifiedNames.add("*");
+ qualifiedNames.add("(");
+ qualifiedNames.add(")");
+
+ doc = (Document) load("staffNS", false);
+ domImpl = doc.getImplementation();
+ for (int indexN10073 = 0; indexN10073 < qualifiedNames.size(); indexN10073++) {
+ qualifiedName = (String) qualifiedNames.get(indexN10073);
+
+ {
+ boolean success = false;
+ try {
+ newDocType = domImpl.createDocumentType(qualifiedName, publicId, systemId);
+ } catch (DOMException ex) {
+ success = (ex.code == DOMException.INVALID_CHARACTER_ERR);
+ }
+ assertTrue("domimplementationcreatedocumenttype04", success);
+ }
+ }
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level2/core/domimplementationcreatedocumenttype04";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(domimplementationcreatedocumenttype04.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level2/core/domimplementationfeaturecore.java b/dom/src/test/java/org/w3c/domts/level2/core/domimplementationfeaturecore.java
new file mode 100644
index 0000000..6a299f0
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level2/core/domimplementationfeaturecore.java
@@ -0,0 +1,106 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+
+
+
+Copyright (c) 2001 World Wide Web Consortium,
+
+(Massachusetts Institute of Technology, Institut National de
+
+Recherche en Informatique et en Automatique, Keio University). All
+
+Rights Reserved. This program is distributed under the W3C's Software
+
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+
+
+
+*/
+
+package org.w3c.domts.level2.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The "feature" parameter in the
+ * "hasFeature(feature,version)" method is the package name
+ * of the feature. Legal values are XML and HTML and CORE.
+ * (Test for feature core, lower case)
+ *
+ * Retrieve the entire DOM document and invoke its
+ * "getImplementation()" method. This should create a
+ * DOMImplementation object whose "hasFeature(feature,
+ * version)" method is invoked with feature equal to "core".
+ * The method should return a boolean "true".
+* @author NIST
+* @author Mary Brady
+* @see <a href="http://www.w3.org/TR/DOM-Level-2-Core/core#ID-5CED94D7">http://www.w3.org/TR/DOM-Level-2-Core/core#ID-5CED94D7</a>
+*/
+public final class domimplementationfeaturecore extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public domimplementationfeaturecore(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "staff", false);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ DOMImplementation domImpl;
+ boolean state;
+ doc = (Document) load("staff", false);
+ domImpl = doc.getImplementation();
+ state = domImpl.hasFeature("core", "2.0");
+assertTrue("domimplementationFeaturecoreAssert", state);
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level2/core/domimplementationfeaturecore";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(domimplementationfeaturecore.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level2/core/domimplementationfeaturexmlversion2.java b/dom/src/test/java/org/w3c/domts/level2/core/domimplementationfeaturexmlversion2.java
new file mode 100644
index 0000000..47302cf
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level2/core/domimplementationfeaturexmlversion2.java
@@ -0,0 +1,106 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+
+
+
+Copyright (c) 2001 World Wide Web Consortium,
+
+(Massachusetts Institute of Technology, Institut National de
+
+Recherche en Informatique et en Automatique, Keio University). All
+
+Rights Reserved. This program is distributed under the W3C's Software
+
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+
+
+
+*/
+
+package org.w3c.domts.level2.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The "feature" parameter in the
+ * "hasFeature(feature,version)" method is the package name
+ * of the feature. Legal values are XML and HTML.
+ * (Test for feature "xml" and version "2.0")
+ *
+ * Retrieve the entire DOM document and invoke its
+ * "getImplementation()" method. This should create a
+ * DOMImplementation object whose "hasFeature(feature,
+ * version)" method is invoked with "feature" equal to "xml".
+ * The method should return a boolean "true".
+* @author NIST
+* @author Mary Brady
+* @see <a href="http://www.w3.org/TR/DOM-Level-2-Core/core#ID-5CED94D7">http://www.w3.org/TR/DOM-Level-2-Core/core#ID-5CED94D7</a>
+*/
+public final class domimplementationfeaturexmlversion2 extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public domimplementationfeaturexmlversion2(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "staff", false);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ DOMImplementation domImpl;
+ boolean state;
+ doc = (Document) load("staff", false);
+ domImpl = doc.getImplementation();
+ state = domImpl.hasFeature("xml", "2.0");
+assertTrue("domimplementationFeaturexmlVersion2Assert", state);
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level2/core/domimplementationfeaturexmlversion2";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(domimplementationfeaturexmlversion2.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level2/core/domimplementationhasfeature01.java b/dom/src/test/java/org/w3c/domts/level2/core/domimplementationhasfeature01.java
new file mode 100644
index 0000000..2174f1b
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level2/core/domimplementationhasfeature01.java
@@ -0,0 +1,116 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+
+Copyright (c) 2001 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+
+*/
+
+package org.w3c.domts.level2.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The method "hasFeature(feature,version)" tests if the DOMImplementation implements
+ * a specific feature and if so returns true.
+ *
+ * Call the hasFeature method on this DOMImplementation with a combination of features
+ * versions as below. Valid feature names are case insensitive and versions "2.0",
+ * "1.0" and if the version is not specified, supporting any version of the feature
+ * should return true. Check if the value returned value was true.
+* @author IBM
+* @author Neil Delima
+* @see <a href="http://www.w3.org/TR/DOM-Level-2-Core/core#ID-5CED94D7">http://www.w3.org/TR/DOM-Level-2-Core/core#ID-5CED94D7</a>
+*/
+public final class domimplementationhasfeature01 extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public domimplementationhasfeature01(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "staffNS", false);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ DOMImplementation domImpl;
+ String version = "";
+ String version1 = "1.0";
+ String version2 = "2.0";
+ String featureCore;
+ String featureXML;
+ boolean success;
+ java.util.List featuresXML = new java.util.ArrayList();
+ featuresXML.add("XML");
+ featuresXML.add("xmL");
+
+ java.util.List featuresCore = new java.util.ArrayList();
+ featuresCore.add("Core");
+ featuresCore.add("CORE");
+
+ doc = (Document) load("staffNS", false);
+ domImpl = doc.getImplementation();
+ for (int indexN10063 = 0; indexN10063 < featuresXML.size(); indexN10063++) {
+ featureXML = (String) featuresXML.get(indexN10063);
+ success = domImpl.hasFeature(featureXML, version);
+assertTrue("domimplementationhasfeature01_XML_1", success);
+ success = domImpl.hasFeature(featureXML, version1);
+assertTrue("domimplementationhasfeature01_XML_2", success);
+ }
+ for (int indexN1007C = 0; indexN1007C < featuresCore.size(); indexN1007C++) {
+ featureCore = (String) featuresCore.get(indexN1007C);
+ success = domImpl.hasFeature(featureCore, version);
+assertTrue("domimplementationhasfeature01_Core_1", success);
+ success = domImpl.hasFeature(featureCore, version1);
+success = domImpl.hasFeature(featureCore, version2);
+assertTrue("domimplementationhasfeature01_Core_3", success);
+ }
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level2/core/domimplementationhasfeature01";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(domimplementationhasfeature01.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level2/core/domimplementationhasfeature02.java b/dom/src/test/java/org/w3c/domts/level2/core/domimplementationhasfeature02.java
new file mode 100644
index 0000000..0753299
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level2/core/domimplementationhasfeature02.java
@@ -0,0 +1,88 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+
+Copyright (c) 2001-2003 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+
+*/
+
+package org.w3c.domts.level2.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The method "hasFeature(feature,version)" tests if the DOMImplementation implements
+ * a specific feature and if not returns false.
+ *
+ * Call the hasFeature method on this DOMImplementation with a unfimiliar values for
+ * feature and version. Check if the value returned was false.
+* @author IBM
+* @author Neil Delima
+* @see <a href="http://www.w3.org/TR/DOM-Level-2-Core/core#ID-5CED94D7">http://www.w3.org/TR/DOM-Level-2-Core/core#ID-5CED94D7</a>
+*/
+public final class domimplementationhasfeature02 extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public domimplementationhasfeature02(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "staffNS", false);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ DOMImplementation domImpl;
+ boolean success;
+ doc = (Document) load("staffNS", false);
+ domImpl = doc.getImplementation();
+ success = domImpl.hasFeature("Blah Blah", "");
+assertFalse("domimplementationhasfeature02", success);
+}
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level2/core/domimplementationhasfeature02";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(domimplementationhasfeature02.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level2/core/elementgetattributenodens01.java b/dom/src/test/java/org/w3c/domts/level2/core/elementgetattributenodens01.java
new file mode 100644
index 0000000..286e07d
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level2/core/elementgetattributenodens01.java
@@ -0,0 +1,115 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+Copyright (c) 2001 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+*/
+
+package org.w3c.domts.level2.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The method getAttributeNodeNS retrieves an Attr node by local name and namespace URI.
+ * Create a new element node and add 2 new attribute nodes to it that have the same
+ * local name but different namespaceURIs and prefixes.
+ * Retrieve an attribute using namespace and localname and check its value, name and
+ * namespaceURI.
+ *
+* @author IBM
+* @author Neil Delima
+* @see <a href="http://www.w3.org/TR/DOM-Level-2-Core/core#ID-ElGetAtNodeNS">http://www.w3.org/TR/DOM-Level-2-Core/core#ID-ElGetAtNodeNS</a>
+*/
+public final class elementgetattributenodens01 extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public elementgetattributenodens01(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+
+ org.w3c.domts.DocumentBuilderSetting[] settings =
+ new org.w3c.domts.DocumentBuilderSetting[] {
+org.w3c.domts.DocumentBuilderSetting.namespaceAware
+ };
+ DOMTestDocumentBuilderFactory testFactory = factory.newInstance(settings);
+ setFactory(testFactory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "staffNS", false);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ Element element;
+ Attr attribute1;
+ Attr attribute2;
+ Attr newAttribute1;
+ Attr newAttribute2;
+ Attr attribute;
+ String attrValue;
+ String attrName;
+ String attNodeName;
+ String attrLocalName;
+ String attrNS;
+ doc = (Document) load("staffNS", false);
+ element = doc.createElementNS("namespaceURI", "root");
+ attribute1 = doc.createAttributeNS("http://www.w3.org/DOM/Level2", "l2:att");
+ newAttribute1 = element.setAttributeNodeNS(attribute1);
+ attribute2 = doc.createAttributeNS("http://www.w3.org/DOM/Level1", "att");
+ newAttribute2 = element.setAttributeNodeNS(attribute2);
+ attribute = element.getAttributeNodeNS("http://www.w3.org/DOM/Level2", "att");
+ attrValue = attribute.getNodeValue();
+ attrName = attribute.getName();
+ attNodeName = attribute.getNodeName();
+ attrLocalName = attribute.getLocalName();
+ attrNS = attribute.getNamespaceURI();
+ assertEquals("elementgetattributenodens01_attrValue", "", attrValue);
+ assertEquals("elementgetattributenodens01_attrName", "l2:att", attrName);
+ assertEquals("elementgetattributenodens01_attrNodeName", "l2:att", attNodeName);
+ assertEquals("elementgetattributenodens01_attrLocalName", "att", attrLocalName);
+ assertEquals("elementgetattributenodens01_attrNs", "http://www.w3.org/DOM/Level2", attrNS);
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level2/core/elementgetattributenodens01";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(elementgetattributenodens01.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level2/core/elementgetattributenodens02.java b/dom/src/test/java/org/w3c/domts/level2/core/elementgetattributenodens02.java
new file mode 100644
index 0000000..0ea6b58
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level2/core/elementgetattributenodens02.java
@@ -0,0 +1,98 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+
+Copyright (c) 2001 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+
+*/
+
+package org.w3c.domts.level2.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The method getAttributeNodeNS retrieves an Attr node by local name and namespace URI.
+ * Create a new element node and add a new attribute node to it. Using the getAttributeNodeNS,
+ * retrieve the newly added attribute node and check its value.
+ *
+* @author IBM
+* @author Neil Delima
+* @see <a href="http://www.w3.org/TR/DOM-Level-2-Core/core#ID-ElGetAtNodeNS">http://www.w3.org/TR/DOM-Level-2-Core/core#ID-ElGetAtNodeNS</a>
+*/
+public final class elementgetattributenodens02 extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public elementgetattributenodens02(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+
+ org.w3c.domts.DocumentBuilderSetting[] settings =
+ new org.w3c.domts.DocumentBuilderSetting[] {
+org.w3c.domts.DocumentBuilderSetting.namespaceAware
+ };
+ DOMTestDocumentBuilderFactory testFactory = factory.newInstance(settings);
+ setFactory(testFactory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "staffNS", false);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ Element element;
+ Attr attribute;
+ Attr newAttribute1;
+ String attrValue;
+ doc = (Document) load("staffNS", false);
+ element = doc.createElementNS("namespaceURI", "root");
+ attribute = doc.createAttributeNS("http://www.w3.org/DOM/Level2", "l2:att");
+ newAttribute1 = element.setAttributeNodeNS(attribute);
+ attribute = element.getAttributeNodeNS("http://www.w3.org/DOM/Level2", "att");
+ attrValue = attribute.getNodeValue();
+ assertEquals("elementgetattributenodens02", "", attrValue);
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level2/core/elementgetattributenodens02";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(elementgetattributenodens02.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level2/core/elementgetattributenodens03.java b/dom/src/test/java/org/w3c/domts/level2/core/elementgetattributenodens03.java
new file mode 100644
index 0000000..00a5093
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level2/core/elementgetattributenodens03.java
@@ -0,0 +1,101 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+
+Copyright (c) 2001-2003 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+
+*/
+
+package org.w3c.domts.level2.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The method getAttributeNodeNS retrieves an Attr node by local name and namespace URI.
+ * Using the getAttributeNodeNS, retrieve and verify the value of the default
+ * attribute node.
+ *
+* @author IBM
+* @author Neil Delima
+* @see <a href="http://www.w3.org/TR/DOM-Level-2-Core/core#ID-ElGetAtNodeNS">http://www.w3.org/TR/DOM-Level-2-Core/core#ID-ElGetAtNodeNS</a>
+* @see <a href="http://www.w3.org/Bugs/Public/show_bug.cgi?id=259">http://www.w3.org/Bugs/Public/show_bug.cgi?id=259</a>
+*/
+public final class elementgetattributenodens03 extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public elementgetattributenodens03(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+
+ org.w3c.domts.DocumentBuilderSetting[] settings =
+ new org.w3c.domts.DocumentBuilderSetting[] {
+org.w3c.domts.DocumentBuilderSetting.namespaceAware,
+org.w3c.domts.DocumentBuilderSetting.validating
+ };
+ DOMTestDocumentBuilderFactory testFactory = factory.newInstance(settings);
+ setFactory(testFactory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "staffNS", false);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ Element element;
+ Attr attribute;
+ String attrValue;
+ NodeList childList;
+ String nullNS = null;
+
+ doc = (Document) load("staffNS", false);
+ childList = doc.getElementsByTagNameNS("http://www.nist.gov", "employee");
+ element = (Element) childList.item(1);
+ attribute = element.getAttributeNodeNS(nullNS, "defaultAttr");
+ attrValue = attribute.getNodeValue();
+ assertEquals("elementgetattributenodens03", "defaultVal", attrValue);
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level2/core/elementgetattributenodens03";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(elementgetattributenodens03.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level2/core/elementgetattributens02.java b/dom/src/test/java/org/w3c/domts/level2/core/elementgetattributens02.java
new file mode 100644
index 0000000..5da3367
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level2/core/elementgetattributens02.java
@@ -0,0 +1,99 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+
+Copyright (c) 2001-2004 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+
+*/
+
+package org.w3c.domts.level2.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The method getAttributeNS retrieves an attribute value by local name and namespace URI.
+ * Using the getAttributeNodeNS, retreive and verify the value of the default
+ * attribute node.
+ *
+* @author IBM
+* @author Neil Delima
+* @see <a href="http://www.w3.org/TR/DOM-Level-2-Core/core#ID-ElGetAttrNS">http://www.w3.org/TR/DOM-Level-2-Core/core#ID-ElGetAttrNS</a>
+* @see <a href="http://www.w3.org/Bugs/Public/show_bug.cgi?id=259">http://www.w3.org/Bugs/Public/show_bug.cgi?id=259</a>
+*/
+public final class elementgetattributens02 extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public elementgetattributens02(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+
+ org.w3c.domts.DocumentBuilderSetting[] settings =
+ new org.w3c.domts.DocumentBuilderSetting[] {
+org.w3c.domts.DocumentBuilderSetting.namespaceAware,
+org.w3c.domts.DocumentBuilderSetting.validating
+ };
+ DOMTestDocumentBuilderFactory testFactory = factory.newInstance(settings);
+ setFactory(testFactory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "staffNS", false);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ Element element;
+ String attrValue;
+ NodeList childList;
+ String nullNS = null;
+
+ doc = (Document) load("staffNS", false);
+ childList = doc.getElementsByTagNameNS("http://www.nist.gov", "employee");
+ element = (Element) childList.item(1);
+ attrValue = element.getAttributeNS(nullNS, "defaultAttr");
+ assertEquals("elementgetattributens02", "defaultVal", attrValue);
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level2/core/elementgetattributens02";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(elementgetattributens02.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level2/core/elementgetelementsbytagnamens02.java b/dom/src/test/java/org/w3c/domts/level2/core/elementgetelementsbytagnamens02.java
new file mode 100644
index 0000000..07e16d8
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level2/core/elementgetelementsbytagnamens02.java
@@ -0,0 +1,108 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+
+
+
+Copyright (c) 2001 World Wide Web Consortium,
+
+(Massachusetts Institute of Technology, Institut National de
+
+Recherche en Informatique et en Automatique, Keio University). All
+
+Rights Reserved. This program is distributed under the W3C's Software
+
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+
+
+
+*/
+
+package org.w3c.domts.level2.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The method getElementsByTagNameNS returns a NodeList of all the Elements with a given local
+ * name and namespace URI in the order in which they are encountered in a preorder traversal
+ * of the Document tree.
+ * Invoke getElementsByTagNameNS on the documentElement with values for namespaceURI '*' and
+ * localName '*'. Verify if this returns a nodeList of 0 elements.
+ *
+* @author IBM
+* @author Neil Delima
+* @see <a href="http://www.w3.org/TR/DOM-Level-2-Core/core#ID-getElBTNNS">http://www.w3.org/TR/DOM-Level-2-Core/core#ID-getElBTNNS</a>
+*/
+public final class elementgetelementsbytagnamens02 extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public elementgetelementsbytagnamens02(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+
+ org.w3c.domts.DocumentBuilderSetting[] settings =
+ new org.w3c.domts.DocumentBuilderSetting[] {
+org.w3c.domts.DocumentBuilderSetting.namespaceAware
+ };
+ DOMTestDocumentBuilderFactory testFactory = factory.newInstance(settings);
+ setFactory(testFactory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "staffNS", false);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ Element element;
+ NodeList elementList;
+ doc = (Document) load("staffNS", false);
+ element = doc.getDocumentElement();
+ elementList = element.getElementsByTagNameNS("**", "*");
+ assertSize("elementgetelementsbytagnamens02", 0, elementList);
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level2/core/elementgetelementsbytagnamens02";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(elementgetelementsbytagnamens02.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level2/core/elementgetelementsbytagnamens04.java b/dom/src/test/java/org/w3c/domts/level2/core/elementgetelementsbytagnamens04.java
new file mode 100644
index 0000000..41a69e1
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level2/core/elementgetelementsbytagnamens04.java
@@ -0,0 +1,112 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+
+Copyright (c) 2001-2003 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+
+*/
+
+package org.w3c.domts.level2.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * Returns a NodeList of all the Elements with a given local name and namespace URI in the
+ * order in which they are encountered in a preorder traversal of the Document tree.
+ * Create a new element node ('root') and append three newly created child nodes (all have
+ * local name 'child' and defined in different namespaces).
+ * Test 1: invoke getElementsByTagNameNS to retrieve one of the children.
+ * Test 2: invoke getElementsByTagNameNS with the value of namespace equals to '*', and
+ * verify that the node list has length of 3.
+ *
+* @author IBM
+* @author Neil Delima
+* @see <a href="http://www.w3.org/TR/DOM-Level-2-Core/core#ID-getElBTNNS">http://www.w3.org/TR/DOM-Level-2-Core/core#ID-getElBTNNS</a>
+* @see <a href="http://www.w3.org/Bugs/Public/show_bug.cgi?id=259">http://www.w3.org/Bugs/Public/show_bug.cgi?id=259</a>
+*/
+public final class elementgetelementsbytagnamens04 extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public elementgetelementsbytagnamens04(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+
+ org.w3c.domts.DocumentBuilderSetting[] settings =
+ new org.w3c.domts.DocumentBuilderSetting[] {
+org.w3c.domts.DocumentBuilderSetting.namespaceAware
+ };
+ DOMTestDocumentBuilderFactory testFactory = factory.newInstance(settings);
+ setFactory(testFactory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "staffNS", false);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ Element element;
+ Element child1;
+ Element child2;
+ Element child3;
+ Node appendedChild;
+ NodeList elementList;
+ String nullNS = null;
+
+ doc = (Document) load("staffNS", false);
+ element = doc.createElementNS("http://www.w3.org/DOM", "root");
+ child1 = doc.createElementNS("http://www.w3.org/DOM/Level1", "dom:child");
+ child2 = doc.createElementNS(nullNS, "child");
+ child3 = doc.createElementNS("http://www.w3.org/DOM/Level2", "dom:child");
+ appendedChild = element.appendChild(child1);
+ appendedChild = element.appendChild(child2);
+ appendedChild = element.appendChild(child3);
+ elementList = element.getElementsByTagNameNS(nullNS, "child");
+ assertSize("elementgetelementsbytagnamens04_1", 1, elementList);
+ elementList = element.getElementsByTagNameNS("*", "child");
+ assertSize("elementgetelementsbytagnamens04_2", 3, elementList);
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level2/core/elementgetelementsbytagnamens04";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(elementgetelementsbytagnamens04.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level2/core/elementgetelementsbytagnamens05.java b/dom/src/test/java/org/w3c/domts/level2/core/elementgetelementsbytagnamens05.java
new file mode 100644
index 0000000..d205f5a
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level2/core/elementgetelementsbytagnamens05.java
@@ -0,0 +1,109 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+
+
+
+Copyright (c) 2001 World Wide Web Consortium,
+
+(Massachusetts Institute of Technology, Institut National de
+
+Recherche en Informatique et en Automatique, Keio University). All
+
+Rights Reserved. This program is distributed under the W3C's Software
+
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+
+
+
+*/
+
+package org.w3c.domts.level2.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * Returns a NodeList of all the Elements with a given local name and namespace URI in the
+ * order in which they are encountered in a preorder traversal of the Document tree.
+ * Invoke getElementsByTagNameNS on the documentElement with the following values:
+ * namespaceURI: 'http://www.altavista.com'
+ * localName: '*'.
+ * Verify if this returns a nodeList of 1 elements.
+ *
+* @author IBM
+* @author Neil Delima
+* @see <a href="http://www.w3.org/TR/DOM-Level-2-Core/core#ID-getElBTNNS">http://www.w3.org/TR/DOM-Level-2-Core/core#ID-getElBTNNS</a>
+*/
+public final class elementgetelementsbytagnamens05 extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public elementgetelementsbytagnamens05(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+
+ org.w3c.domts.DocumentBuilderSetting[] settings =
+ new org.w3c.domts.DocumentBuilderSetting[] {
+org.w3c.domts.DocumentBuilderSetting.namespaceAware
+ };
+ DOMTestDocumentBuilderFactory testFactory = factory.newInstance(settings);
+ setFactory(testFactory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "staffNS", false);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ Element element;
+ NodeList elementList;
+ doc = (Document) load("staffNS", false);
+ element = doc.getDocumentElement();
+ elementList = element.getElementsByTagNameNS("http://www.altavista.com", "*");
+ assertSize("elementgetelementsbytagnamens05", 1, elementList);
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level2/core/elementgetelementsbytagnamens05";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(elementgetelementsbytagnamens05.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level2/core/elementhasattribute01.java b/dom/src/test/java/org/w3c/domts/level2/core/elementhasattribute01.java
new file mode 100644
index 0000000..167fb3a
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level2/core/elementhasattribute01.java
@@ -0,0 +1,106 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+
+
+
+Copyright (c) 2001 World Wide Web Consortium,
+
+(Massachusetts Institute of Technology, Institut National de
+
+Recherche en Informatique et en Automatique, Keio University). All
+
+Rights Reserved. This program is distributed under the W3C's Software
+
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+
+
+
+*/
+
+package org.w3c.domts.level2.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The method hasAttribute returns true when an attribute with a given name is specified
+ * on this element or has a default value, false otherwise
+ * Invoke the hasAttribute method to check if the documentElement has attributres.
+ *
+* @author IBM
+* @author Neil Delima
+* @see <a href="http://www.w3.org/TR/DOM-Level-2-Core/core#ID-NodeHasAttrs">http://www.w3.org/TR/DOM-Level-2-Core/core#ID-NodeHasAttrs</a>
+*/
+public final class elementhasattribute01 extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public elementhasattribute01(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+
+ org.w3c.domts.DocumentBuilderSetting[] settings =
+ new org.w3c.domts.DocumentBuilderSetting[] {
+org.w3c.domts.DocumentBuilderSetting.notNamespaceAware
+ };
+ DOMTestDocumentBuilderFactory testFactory = factory.newInstance(settings);
+ setFactory(testFactory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "staff", false);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ Element element;
+ boolean state;
+ doc = (Document) load("staff", false);
+ element = doc.getDocumentElement();
+ state = element.hasAttribute("");
+ assertFalse("elementhasattribute01", state);
+}
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level2/core/elementhasattribute01";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(elementhasattribute01.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level2/core/elementhasattribute02.java b/dom/src/test/java/org/w3c/domts/level2/core/elementhasattribute02.java
new file mode 100644
index 0000000..762e4de
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level2/core/elementhasattribute02.java
@@ -0,0 +1,97 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+
+Copyright (c) 2001-2004 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+
+*/
+
+package org.w3c.domts.level2.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The method hasAttribute returns true when an attribute with a given name is specified
+ * on this element or has a default value, false otherwise
+ * Invoke the hasAttribute method to on an element with default attributes and verify if it
+ * returns true.
+ *
+* @author IBM
+* @author Neil Delima
+* @see <a href="http://www.w3.org/TR/DOM-Level-2-Core/core#ID-NodeHasAttrs">http://www.w3.org/TR/DOM-Level-2-Core/core#ID-NodeHasAttrs</a>
+*/
+public final class elementhasattribute02 extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public elementhasattribute02(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+
+ org.w3c.domts.DocumentBuilderSetting[] settings =
+ new org.w3c.domts.DocumentBuilderSetting[] {
+org.w3c.domts.DocumentBuilderSetting.validating
+ };
+ DOMTestDocumentBuilderFactory testFactory = factory.newInstance(settings);
+ setFactory(testFactory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "staffNS", false);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ Element element;
+ boolean state;
+ NodeList elementList;
+ doc = (Document) load("staffNS", false);
+ elementList = doc.getElementsByTagName("emp:employee");
+ element = (Element) elementList.item(0);
+ assertNotNull("empEmployeeNotNull", element);
+ state = element.hasAttribute("defaultAttr");
+ assertTrue("elementhasattribute02", state);
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level2/core/elementhasattribute02";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(elementhasattribute02.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level2/core/elementhasattribute03.java b/dom/src/test/java/org/w3c/domts/level2/core/elementhasattribute03.java
new file mode 100644
index 0000000..8877007
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level2/core/elementhasattribute03.java
@@ -0,0 +1,95 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+
+Copyright (c) 2001-2003 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+
+*/
+
+package org.w3c.domts.level2.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The method hasAttribute returns true when an attribute with a given name is specified
+ * on this element or has a default value, false otherwise.
+ * Create an element Node and an attribute Node. Invoke hasAttribute method
+ * to verify that there is no attribute. Append the attribute node to the element node.
+ * Invoke the hasAttribute method on the element and verify if it returns true.
+ *
+* @author IBM
+* @author Neil Delima
+* @see <a href="http://www.w3.org/TR/DOM-Level-2-Core/core#ID-NodeHasAttrs">http://www.w3.org/TR/DOM-Level-2-Core/core#ID-NodeHasAttrs</a>
+*/
+public final class elementhasattribute03 extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public elementhasattribute03(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "staff", false);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ Element element;
+ boolean state;
+ Attr attribute;
+ Attr newAttribute;
+ doc = (Document) load("staff", false);
+ element = doc.createElement("address");
+ attribute = doc.createAttribute("domestic");
+ state = element.hasAttribute("domestic");
+ assertFalse("elementhasattribute03_False", state);
+newAttribute = element.setAttributeNode(attribute);
+ state = element.hasAttribute("domestic");
+ assertTrue("elementhasattribute03_True", state);
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level2/core/elementhasattribute03";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(elementhasattribute03.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level2/core/elementhasattribute04.java b/dom/src/test/java/org/w3c/domts/level2/core/elementhasattribute04.java
new file mode 100644
index 0000000..9d67590
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level2/core/elementhasattribute04.java
@@ -0,0 +1,92 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+
+Copyright (c) 2001 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+
+*/
+
+package org.w3c.domts.level2.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The method hasAttribute returns true when an attribute with a given name is specified
+ * on this element or has a default value, false otherwise.
+ * Create an element Node and an attribute Node and add the attribute node to the element.
+ * Invoke the hasAttribute method on the element and verify if the method returns true.
+ *
+* @author IBM
+* @author Neil Delima
+* @see <a href="http://www.w3.org/TR/DOM-Level-2-Core/core#ID-NodeHasAttrs">http://www.w3.org/TR/DOM-Level-2-Core/core#ID-NodeHasAttrs</a>
+*/
+public final class elementhasattribute04 extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public elementhasattribute04(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "staff", false);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ Element element;
+ boolean state;
+ Attr attribute;
+ Attr newAttribute;
+ doc = (Document) load("staff", false);
+ element = doc.createElement("address");
+ attribute = doc.createAttribute("domestic");
+ newAttribute = element.setAttributeNode(attribute);
+ state = element.hasAttribute("domestic");
+ assertTrue("elementhasattribute04", state);
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level2/core/elementhasattribute04";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(elementhasattribute04.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level2/core/elementhasattributens01.java b/dom/src/test/java/org/w3c/domts/level2/core/elementhasattributens01.java
new file mode 100644
index 0000000..9bfbc50
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level2/core/elementhasattributens01.java
@@ -0,0 +1,98 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+
+Copyright (c) 2001 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+
+*/
+
+package org.w3c.domts.level2.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The method hasAttributeNS returns true when an attribute with a given local name
+ * and namespace
+ * URI is specified on this element or has a default value, false otherwise.
+ *
+ * Retreive the first employee element node. Invoke the hasAttributeNS method to check if it
+ * has the xmlns attribute that belongs to the namespace http://www.w3.org/2000/xmlns/.
+ *
+* @author IBM
+* @author Neil Delima
+* @see <a href="http://www.w3.org/TR/DOM-Level-2-Core/core#ID-ElHasAttrNS">http://www.w3.org/TR/DOM-Level-2-Core/core#ID-ElHasAttrNS</a>
+*/
+public final class elementhasattributens01 extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public elementhasattributens01(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+
+ org.w3c.domts.DocumentBuilderSetting[] settings =
+ new org.w3c.domts.DocumentBuilderSetting[] {
+org.w3c.domts.DocumentBuilderSetting.namespaceAware
+ };
+ DOMTestDocumentBuilderFactory testFactory = factory.newInstance(settings);
+ setFactory(testFactory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "staffNS", false);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ Element element;
+ boolean state;
+ NodeList elementList;
+ doc = (Document) load("staffNS", false);
+ elementList = doc.getElementsByTagNameNS("*", "employee");
+ element = (Element) elementList.item(0);
+ state = element.hasAttributeNS("http://www.w3.org/2000/xmlns/", "xmlns");
+ assertTrue("elementhasattributens01", state);
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level2/core/elementhasattributens01";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(elementhasattributens01.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level2/core/elementhasattributens02.java b/dom/src/test/java/org/w3c/domts/level2/core/elementhasattributens02.java
new file mode 100644
index 0000000..e1a06c2
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level2/core/elementhasattributens02.java
@@ -0,0 +1,101 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+
+Copyright (c) 2001-2004 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+
+*/
+
+package org.w3c.domts.level2.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The method hasAttributeNS returns true when an attribute with a given local
+ * name and namespace URI is specified on this element or has a default value,
+ * false otherwise.
+ * Create a new element and attribute node that belong to the same namespace.
+ * Add the attribute node to the element node. Check if the newly created element
+ * node has an attribute by invoking the hasAttributeNS method with appropriate
+ * values for the namespaceURI and localName parameters.
+ *
+* @author IBM
+* @author Neil Delima
+* @see <a href="http://www.w3.org/TR/DOM-Level-2-Core/core#ID-ElHasAttrNS">http://www.w3.org/TR/DOM-Level-2-Core/core#ID-ElHasAttrNS</a>
+*/
+public final class elementhasattributens02 extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public elementhasattributens02(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+
+ org.w3c.domts.DocumentBuilderSetting[] settings =
+ new org.w3c.domts.DocumentBuilderSetting[] {
+org.w3c.domts.DocumentBuilderSetting.namespaceAware
+ };
+ DOMTestDocumentBuilderFactory testFactory = factory.newInstance(settings);
+ setFactory(testFactory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "staff", false);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ Element element;
+ boolean state;
+ Attr attribute;
+ Attr newAttribute;
+ doc = (Document) load("staff", false);
+ element = doc.createElementNS("http://www.w3.org/DOM", "address");
+ attribute = doc.createAttributeNS("http://www.w3.org/DOM", "domestic");
+ newAttribute = element.setAttributeNode(attribute);
+ state = element.hasAttributeNS("http://www.w3.org/DOM", "domestic");
+ assertTrue("hasDomesticAttr", state);
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level2/core/elementhasattributens02";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(elementhasattributens02.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level2/core/elementhasattributens03.java b/dom/src/test/java/org/w3c/domts/level2/core/elementhasattributens03.java
new file mode 100644
index 0000000..b15bd96
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level2/core/elementhasattributens03.java
@@ -0,0 +1,106 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+
+Copyright (c) 2001-2003 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+
+*/
+
+package org.w3c.domts.level2.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The method hasAttributeNS returns true when an attribute with a given local name
+ * and namespace URI is specified on this element or has a default value,
+ * false otherwise.
+ *
+ * Create a new element and an attribute node that has an empty namespace.
+ * Add the attribute node to the element node. Check if the newly created element
+ * node has an attribute by invoking the hasAttributeNS method with appropriate
+ * values for the namespaceURI and localName parameters.
+ *
+* @author IBM
+* @author Neil Delima
+* @see <a href="http://www.w3.org/TR/DOM-Level-2-Core/core#ID-ElHasAttrNS">http://www.w3.org/TR/DOM-Level-2-Core/core#ID-ElHasAttrNS</a>
+* @see <a href="http://www.w3.org/Bugs/Public/show_bug.cgi?id=259">http://www.w3.org/Bugs/Public/show_bug.cgi?id=259</a>
+*/
+public final class elementhasattributens03 extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public elementhasattributens03(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+
+ org.w3c.domts.DocumentBuilderSetting[] settings =
+ new org.w3c.domts.DocumentBuilderSetting[] {
+org.w3c.domts.DocumentBuilderSetting.namespaceAware
+ };
+ DOMTestDocumentBuilderFactory testFactory = factory.newInstance(settings);
+ setFactory(testFactory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "staff", false);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ Element element;
+ boolean state;
+ Attr attribute;
+ Attr newAttribute;
+ String nullNS = null;
+
+ doc = (Document) load("staff", false);
+ element = doc.createElementNS("http://www.w3.org/DOM", "address");
+ assertNotNull("createElementNotNull", element);
+ attribute = doc.createAttributeNS(nullNS, "domestic");
+ newAttribute = element.setAttributeNode(attribute);
+ state = element.hasAttributeNS(nullNS, "domestic");
+ assertTrue("elementhasattributens03", state);
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level2/core/elementhasattributens03";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(elementhasattributens03.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level2/core/elementremoveattributens01.java b/dom/src/test/java/org/w3c/domts/level2/core/elementremoveattributens01.java
new file mode 100644
index 0000000..b6ec27a
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level2/core/elementremoveattributens01.java
@@ -0,0 +1,100 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+
+Copyright (c) 2001 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+
+*/
+
+package org.w3c.domts.level2.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The method removeAttributeNS removes an attribute by local name and namespace URI.
+ * Create a new element and add a new attribute node to it.
+ * Remove the attribute node using the removeAttributeNodeNS method.
+ * Check if the attribute was remove by invoking the hasAttributeNS
+ * method on the element and check if it returns false.
+ *
+* @author IBM
+* @author Neil Delima
+* @see <a href="http://www.w3.org/TR/DOM-Level-2-Core/core#ID-ElRemAtNS">http://www.w3.org/TR/DOM-Level-2-Core/core#ID-ElRemAtNS</a>
+*/
+public final class elementremoveattributens01 extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public elementremoveattributens01(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+
+ org.w3c.domts.DocumentBuilderSetting[] settings =
+ new org.w3c.domts.DocumentBuilderSetting[] {
+org.w3c.domts.DocumentBuilderSetting.namespaceAware
+ };
+ DOMTestDocumentBuilderFactory testFactory = factory.newInstance(settings);
+ setFactory(testFactory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "staff", false);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ Element element;
+ boolean state;
+ Attr attribute;
+ Attr newAttribute;
+ doc = (Document) load("staff", false);
+ element = doc.createElementNS("http://www.w3.org/DOM", "elem");
+ attribute = doc.createAttributeNS("http://www.w3.org/DOM/Test/createAttributeNS", "attr");
+ newAttribute = element.setAttributeNodeNS(attribute);
+ element.removeAttributeNS("http://www.w3.org/DOM/Test/createAttributeNS", "attr");
+ state = element.hasAttributeNS("http://www.w3.org/DOM/Test/createAttributeNS", "attr");
+ assertFalse("elementremoveattributens01", state);
+}
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level2/core/elementremoveattributens01";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(elementremoveattributens01.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level2/core/elementsetattributenodens01.java b/dom/src/test/java/org/w3c/domts/level2/core/elementsetattributenodens01.java
new file mode 100644
index 0000000..3fc2ee7
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level2/core/elementsetattributenodens01.java
@@ -0,0 +1,117 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+
+Copyright (c) 2001 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+
+*/
+
+package org.w3c.domts.level2.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * Testing Element.setAttributeNodeNS: If an attribute with that local name
+ * and that namespace URI is already present in the element, it is replaced
+ * by the new one.
+ * Create a new element and two new attribute nodes (in the same namespace
+ * and same localNames).
+ * Add the two new attribute nodes to the element node using the
+ * setAttributeNodeNS method. Check that only one attribute is added, check
+ * the value of this attribute.
+ *
+* @author IBM
+* @author Neil Delima
+* @see <a href="http://www.w3.org/TR/DOM-Level-2-Core/core#ID-ElSetAtNodeNS">http://www.w3.org/TR/DOM-Level-2-Core/core#ID-ElSetAtNodeNS</a>
+*/
+public final class elementsetattributenodens01 extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public elementsetattributenodens01(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+
+ org.w3c.domts.DocumentBuilderSetting[] settings =
+ new org.w3c.domts.DocumentBuilderSetting[] {
+org.w3c.domts.DocumentBuilderSetting.namespaceAware
+ };
+ DOMTestDocumentBuilderFactory testFactory = factory.newInstance(settings);
+ setFactory(testFactory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "staff", true);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ Element element;
+ Attr attribute1;
+ Attr attribute2;
+ Attr attrNode;
+ String attrName;
+ String attrNS;
+ String attrValue;
+ NamedNodeMap attributes;
+ Attr newAttribute;
+ int length;
+ doc = (Document) load("staff", true);
+ element = doc.createElementNS("http://www.w3.org/DOM/Test/Level2", "new:element");
+ attribute1 = doc.createAttributeNS("http://www.w3.org/DOM/Test/att1", "p1:att");
+ attribute2 = doc.createAttributeNS("http://www.w3.org/DOM/Test/att1", "p2:att");
+ attribute2.setValue("value2");
+ newAttribute = element.setAttributeNodeNS(attribute1);
+ newAttribute = element.setAttributeNodeNS(attribute2);
+ attrNode = element.getAttributeNodeNS("http://www.w3.org/DOM/Test/att1", "att");
+ attrName = attrNode.getNodeName();
+ attrNS = attrNode.getNamespaceURI();
+ assertEquals("elementsetattributenodens01_attrName", "p2:att", attrName);
+ assertEquals("elementsetattributenodens01_attrNS", "http://www.w3.org/DOM/Test/att1", attrNS);
+ attributes = element.getAttributes();
+ length = (int) attributes.getLength();
+ assertEquals("length", 1, length);
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level2/core/elementsetattributenodens01";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(elementsetattributenodens01.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level2/core/elementsetattributenodens02.java b/dom/src/test/java/org/w3c/domts/level2/core/elementsetattributenodens02.java
new file mode 100644
index 0000000..f5eed4b
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level2/core/elementsetattributenodens02.java
@@ -0,0 +1,110 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+
+Copyright (c) 2001-2003 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+
+*/
+
+package org.w3c.domts.level2.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * Test the setAttributeNodeNS method.
+ * Retreive the street attribute from the second address element node.
+ * Clone it and add it to the first address node. The INUSE_ATTRIBUTE_ERR exception
+ * should not be thrown. Check the name and value of the newly added node.
+ *
+* @author IBM
+* @author Neil Delima
+* @see <a href="http://www.w3.org/TR/DOM-Level-2-Core/core#ID-ElSetAtNodeNS">http://www.w3.org/TR/DOM-Level-2-Core/core#ID-ElSetAtNodeNS</a>
+* @see <a href="http://www.w3.org/Bugs/Public/show_bug.cgi?id=259">http://www.w3.org/Bugs/Public/show_bug.cgi?id=259</a>
+*/
+public final class elementsetattributenodens02 extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public elementsetattributenodens02(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+
+ org.w3c.domts.DocumentBuilderSetting[] settings =
+ new org.w3c.domts.DocumentBuilderSetting[] {
+org.w3c.domts.DocumentBuilderSetting.namespaceAware
+ };
+ DOMTestDocumentBuilderFactory testFactory = factory.newInstance(settings);
+ setFactory(testFactory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "staffNS", true);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ Element element;
+ Element element2;
+ Attr attribute;
+ Attr attributeCloned;
+ Attr newAttr;
+ NodeList elementList;
+ String attrName;
+ String attrValue;
+ String nullNS = null;
+
+ doc = (Document) load("staffNS", true);
+ elementList = doc.getElementsByTagNameNS("http://www.nist.gov", "address");
+ element = (Element) elementList.item(1);
+ attribute = element.getAttributeNodeNS(nullNS, "street");
+ attributeCloned = (Attr) attribute.cloneNode(true);
+ element2 = (Element) elementList.item(2);
+ newAttr = element2.setAttributeNodeNS(attributeCloned);
+ attrName = newAttr.getNodeName();
+ attrValue = newAttr.getNodeValue();
+ assertEquals("elementsetattributenodens02_attrName", "street", attrName);
+ assertEquals("elementsetattributenodens02_attrValue", "Yes", attrValue);
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level2/core/elementsetattributenodens02";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(elementsetattributenodens02.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level2/core/elementsetattributenodens03.java b/dom/src/test/java/org/w3c/domts/level2/core/elementsetattributenodens03.java
new file mode 100644
index 0000000..c51ec2e
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level2/core/elementsetattributenodens03.java
@@ -0,0 +1,113 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+
+Copyright (c) 2001-2003 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+
+*/
+
+package org.w3c.domts.level2.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The method setAttributeNodeNS adds a new attribute and raises the
+ * INUSE_ATTRIBUTE_ERR exception if the newAttr is already an attribute of
+ * another Element object.
+ *
+ * Retreive an attribute node of an existing element node. Attempt to add it to an another
+ * element node. Check if the INUSE_ATTRIBUTE_ERR exception is thrown.
+ *
+* @author IBM
+* @author Neil Delima
+* @see <a href="http://www.w3.org/TR/DOM-Level-2-Core/core#ID-ElSetAtNodeNS">http://www.w3.org/TR/DOM-Level-2-Core/core#ID-ElSetAtNodeNS</a>
+*/
+public final class elementsetattributenodens03 extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public elementsetattributenodens03(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+
+ org.w3c.domts.DocumentBuilderSetting[] settings =
+ new org.w3c.domts.DocumentBuilderSetting[] {
+org.w3c.domts.DocumentBuilderSetting.namespaceAware,
+org.w3c.domts.DocumentBuilderSetting.namespaceAware
+ };
+ DOMTestDocumentBuilderFactory testFactory = factory.newInstance(settings);
+ setFactory(testFactory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "staffNS", true);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ Element element1;
+ Element element2;
+ Attr attribute;
+ Attr newAttribute;
+ NodeList elementList;
+ String nullNS = null;
+
+ doc = (Document) load("staffNS", true);
+ elementList = doc.getElementsByTagNameNS("http://www.nist.gov", "address");
+ element1 = (Element) elementList.item(1);
+ attribute = element1.getAttributeNodeNS(nullNS, "street");
+ element2 = (Element) elementList.item(2);
+
+ {
+ boolean success = false;
+ try {
+ newAttribute = element2.setAttributeNodeNS(attribute);
+ } catch (DOMException ex) {
+ success = (ex.code == DOMException.INUSE_ATTRIBUTE_ERR);
+ }
+ assertTrue("elementsetattributenodens03", success);
+ }
+}
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level2/core/elementsetattributenodens03";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(elementsetattributenodens03.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level2/core/elementsetattributenodens04.java b/dom/src/test/java/org/w3c/domts/level2/core/elementsetattributenodens04.java
new file mode 100644
index 0000000..28b142b
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level2/core/elementsetattributenodens04.java
@@ -0,0 +1,109 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+
+Copyright (c) 2001 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+
+*/
+
+package org.w3c.domts.level2.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The method setAttributeNodeNS Adds a new attribute and raises an INUSE_ATTRIBUTE_ERR
+ * if newAttr is already an attribute of another Element object.
+ *
+ * Create two new element nodes and a new attribute node. Attempt to add the same attribute
+ * node to the same two element nodes.
+ * Check if an INUSE_ATTRIBUTE_ERR is thrown.
+ *
+* @author IBM
+* @author Neil Delima
+* @see <a href="http://www.w3.org/TR/DOM-Level-2-Core/core#ID-ElSetAtNodeNS">http://www.w3.org/TR/DOM-Level-2-Core/core#ID-ElSetAtNodeNS</a>
+*/
+public final class elementsetattributenodens04 extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public elementsetattributenodens04(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+
+ org.w3c.domts.DocumentBuilderSetting[] settings =
+ new org.w3c.domts.DocumentBuilderSetting[] {
+org.w3c.domts.DocumentBuilderSetting.namespaceAware
+ };
+ DOMTestDocumentBuilderFactory testFactory = factory.newInstance(settings);
+ setFactory(testFactory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "staffNS", true);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ Element element1;
+ Element element2;
+ Attr attribute;
+ Attr newAttribute;
+ doc = (Document) load("staffNS", true);
+ element1 = doc.createElementNS("http://www.w3.org/DOM/Test", "elem1");
+ element2 = doc.createElementNS("http://www.w3.org/DOM/Test", "elem2");
+ attribute = doc.createAttributeNS("http://www.w3.org/DOM/Test", "attr");
+ newAttribute = element1.setAttributeNodeNS(attribute);
+
+ {
+ boolean success = false;
+ try {
+ newAttribute = element2.setAttributeNodeNS(attribute);
+ } catch (DOMException ex) {
+ success = (ex.code == DOMException.INUSE_ATTRIBUTE_ERR);
+ }
+ assertTrue("elementsetattributenodens04", success);
+ }
+}
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level2/core/elementsetattributenodens04";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(elementsetattributenodens04.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level2/core/elementsetattributenodens05.java b/dom/src/test/java/org/w3c/domts/level2/core/elementsetattributenodens05.java
new file mode 100644
index 0000000..be1ebba
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level2/core/elementsetattributenodens05.java
@@ -0,0 +1,109 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+
+Copyright (c) 2001-2004 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+
+*/
+
+package org.w3c.domts.level2.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The method setAttributeNodeNS Adds a new attribute and raises
+ * an WRONG_DOCUMENT_ERR if newAttr was created from a different document
+ * than the one that created the element.
+ * Create new element and attribute nodes in different documents.
+ * Attempt to add the attribute node to the element node.
+ * Check if an WRONG_DOCUMENT_ERR is thrown.
+ *
+* @author IBM
+* @author Neil Delima
+* @see <a href="http://www.w3.org/TR/DOM-Level-2-Core/core#ID-ElSetAtNodeNS">http://www.w3.org/TR/DOM-Level-2-Core/core#ID-ElSetAtNodeNS</a>
+*/
+public final class elementsetattributenodens05 extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public elementsetattributenodens05(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+
+ org.w3c.domts.DocumentBuilderSetting[] settings =
+ new org.w3c.domts.DocumentBuilderSetting[] {
+org.w3c.domts.DocumentBuilderSetting.namespaceAware
+ };
+ DOMTestDocumentBuilderFactory testFactory = factory.newInstance(settings);
+ setFactory(testFactory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "staffNS", true);
+ preload(contentType, "staffNS", true);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ Document docAlt;
+ Element element;
+ Attr attribute;
+ Attr newAttribute;
+ doc = (Document) load("staffNS", true);
+ docAlt = (Document) load("staffNS", true);
+ element = doc.createElementNS("http://www.w3.org/DOM/Test", "elem1");
+ attribute = docAlt.createAttributeNS("http://www.w3.org/DOM/Test", "attr");
+
+ {
+ boolean success = false;
+ try {
+ newAttribute = element.setAttributeNodeNS(attribute);
+ } catch (DOMException ex) {
+ success = (ex.code == DOMException.WRONG_DOCUMENT_ERR);
+ }
+ assertTrue("throw_WRONG_DOCUMENT_ERR", success);
+ }
+}
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level2/core/elementsetattributenodens05";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(elementsetattributenodens05.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level2/core/elementsetattributenodens06.java b/dom/src/test/java/org/w3c/domts/level2/core/elementsetattributenodens06.java
new file mode 100644
index 0000000..e5d3691
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level2/core/elementsetattributenodens06.java
@@ -0,0 +1,114 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+
+Copyright (c) 2001 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+
+*/
+
+package org.w3c.domts.level2.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The method setAttributeNodeNS Adds a new attribute and raises an WRONG_DOCUMENT_ERR if this node
+ * is readonly.
+ * Attempt to add an attribute node to an element node which is part of the replacement text of
+ * a read-only EntityReference node.
+ * Check if a NO_MODIFICATION_ALLOWED_ERR is thrown.
+* @author IBM
+* @author Neil Delima
+* @see <a href="http://www.w3.org/TR/DOM-Level-2-Core/core#ID-ElSetAtNodeNS">http://www.w3.org/TR/DOM-Level-2-Core/core#ID-ElSetAtNodeNS</a>
+*/
+public final class elementsetattributenodens06 extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public elementsetattributenodens06(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+
+ org.w3c.domts.DocumentBuilderSetting[] settings =
+ new org.w3c.domts.DocumentBuilderSetting[] {
+org.w3c.domts.DocumentBuilderSetting.notExpandEntityReferences
+ };
+ DOMTestDocumentBuilderFactory testFactory = factory.newInstance(settings);
+ setFactory(testFactory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "staffNS", true);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ Element element;
+ Attr attribute;
+ Attr attribute2;
+ EntityReference entRef;
+ NodeList elementList;
+ Node newAttribute;
+ Node newChild;
+ doc = (Document) load("staffNS", true);
+ element = doc.createElementNS("http://www.w3.org/DOM/Test", "elem1");
+ attribute = doc.createAttributeNS("http://www.w3.org/DOM/Test", "attr");
+ entRef = doc.createEntityReference("ent4");
+ newChild = attribute.appendChild(entRef);
+ newAttribute = element.setAttributeNodeNS(attribute);
+ elementList = entRef.getChildNodes();
+ element = (Element) elementList.item(0);
+ attribute2 = doc.createAttributeNS("http://www.w3.org/DOM/Test", "attr2");
+
+ {
+ boolean success = false;
+ try {
+ newAttribute = element.setAttributeNodeNS(attribute2);
+ } catch (DOMException ex) {
+ success = (ex.code == DOMException.NO_MODIFICATION_ALLOWED_ERR);
+ }
+ assertTrue("elementsetattributenodens06", success);
+ }
+}
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level2/core/elementsetattributenodens06";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(elementsetattributenodens06.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level2/core/elementsetattributens01.java b/dom/src/test/java/org/w3c/domts/level2/core/elementsetattributens01.java
new file mode 100644
index 0000000..639454d
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level2/core/elementsetattributens01.java
@@ -0,0 +1,100 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+
+Copyright (c) 2001 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+
+*/
+
+package org.w3c.domts.level2.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The method setAttributeNS adds a new attribute.
+ * Create a new element and add a new attribute node to it using the setAttributeNS method.
+ * Check if the attribute was correctly set by invoking the getAttributeNodeNS method
+ * and checking the nodeName and nodeValue of the returned nodes.
+ *
+* @author IBM
+* @author Neil Delima
+* @see <a href="http://www.w3.org/TR/DOM-Level-2-Core/core#ID-ElSetAttrNS">http://www.w3.org/TR/DOM-Level-2-Core/core#ID-ElSetAttrNS</a>
+*/
+public final class elementsetattributens01 extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public elementsetattributens01(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+
+ org.w3c.domts.DocumentBuilderSetting[] settings =
+ new org.w3c.domts.DocumentBuilderSetting[] {
+org.w3c.domts.DocumentBuilderSetting.namespaceAware
+ };
+ DOMTestDocumentBuilderFactory testFactory = factory.newInstance(settings);
+ setFactory(testFactory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "staff", true);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ Element element;
+ Attr attribute;
+ String attrName;
+ String attrValue;
+ doc = (Document) load("staff", true);
+ element = doc.createElementNS("http://www.w3.org/DOM", "dom:elem");
+ element.setAttributeNS("http://www.w3.org/DOM/Test/setAttributeNS", "attr", "value");
+ attribute = element.getAttributeNodeNS("http://www.w3.org/DOM/Test/setAttributeNS", "attr");
+ attrName = attribute.getNodeName();
+ attrValue = attribute.getNodeValue();
+ assertEquals("elementsetattributens01_attrName", "attr", attrName);
+ assertEquals("elementsetattributens01_attrValue", "value", attrValue);
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level2/core/elementsetattributens01";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(elementsetattributens01.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level2/core/elementsetattributens02.java b/dom/src/test/java/org/w3c/domts/level2/core/elementsetattributens02.java
new file mode 100644
index 0000000..030f81b
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level2/core/elementsetattributens02.java
@@ -0,0 +1,103 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+
+Copyright (c) 2001 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+
+*/
+
+package org.w3c.domts.level2.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The method setAttributeNS adds a new attribute.
+ *
+ * Retrieve an existing element node with attributes and add a new attribute node to it using
+ * the setAttributeNS method. Check if the attribute was correctly set by invoking the
+ * getAttributeNodeNS method and checking the nodeName and nodeValue of the returned nodes.
+ *
+* @author IBM
+* @author Neil Delima
+* @see <a href="http://www.w3.org/TR/DOM-Level-2-Core/core#ID-ElSetAttrNS">http://www.w3.org/TR/DOM-Level-2-Core/core#ID-ElSetAttrNS</a>
+*/
+public final class elementsetattributens02 extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public elementsetattributens02(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+
+ org.w3c.domts.DocumentBuilderSetting[] settings =
+ new org.w3c.domts.DocumentBuilderSetting[] {
+org.w3c.domts.DocumentBuilderSetting.namespaceAware
+ };
+ DOMTestDocumentBuilderFactory testFactory = factory.newInstance(settings);
+ setFactory(testFactory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "staff", true);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ Element element;
+ Attr attribute;
+ NodeList elementList;
+ String attrName;
+ String attrValue;
+ doc = (Document) load("staff", true);
+ elementList = doc.getElementsByTagNameNS("*", "address");
+ element = (Element) elementList.item(0);
+ element.setAttributeNS("http://www.w3.org/DOM/Test/setAttributeNS", "this:street", "Silver Street");
+ attribute = element.getAttributeNodeNS("http://www.w3.org/DOM/Test/setAttributeNS", "street");
+ attrName = attribute.getNodeName();
+ attrValue = attribute.getNodeValue();
+ assertEquals("elementsetattributens02_attrName", "this:street", attrName);
+ assertEquals("elementsetattributens02_attrValue", "Silver Street", attrValue);
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level2/core/elementsetattributens02";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(elementsetattributens02.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level2/core/elementsetattributens03.java b/dom/src/test/java/org/w3c/domts/level2/core/elementsetattributens03.java
new file mode 100644
index 0000000..051ac3e
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level2/core/elementsetattributens03.java
@@ -0,0 +1,106 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+
+Copyright (c) 2001-2004 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+
+*/
+
+package org.w3c.domts.level2.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The method setAttributeNS adds a new attribute.
+ * Retreive an existing element node with a default attribute node and
+ * add two new attribute nodes that have the same local name as the
+ * default attribute but different namespaceURI to it using the setAttributeNS method.
+ * Check if the attribute was correctly set by invoking the getAttributeNodeNS method
+ * and checking the nodeName and nodeValue of the returned nodes.
+ *
+* @author IBM
+* @author Neil Delima
+* @see <a href="http://www.w3.org/TR/DOM-Level-2-Core/core#ID-ElSetAttrNS">http://www.w3.org/TR/DOM-Level-2-Core/core#ID-ElSetAttrNS</a>
+*/
+public final class elementsetattributens03 extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public elementsetattributens03(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+
+ org.w3c.domts.DocumentBuilderSetting[] settings =
+ new org.w3c.domts.DocumentBuilderSetting[] {
+org.w3c.domts.DocumentBuilderSetting.namespaceAware
+ };
+ DOMTestDocumentBuilderFactory testFactory = factory.newInstance(settings);
+ setFactory(testFactory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "staffNS", true);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ Element element;
+ Attr attribute;
+ NodeList elementList;
+ String attrName;
+ String attrValue;
+ doc = (Document) load("staffNS", true);
+ elementList = doc.getElementsByTagName("emp:employee");
+ element = (Element) elementList.item(0);
+ assertNotNull("empEmployeeNotNull", element);
+ element.setAttributeNS("http://www.w3.org/DOM/Test/1", "defaultAttr", "default1");
+ element.setAttributeNS("http://www.w3.org/DOM/Test/2", "defaultAttr", "default2");
+ attribute = element.getAttributeNodeNS("http://www.w3.org/DOM/Test/1", "defaultAttr");
+ attrName = attribute.getNodeName();
+ attrValue = attribute.getNodeValue();
+ assertEquals("elementsetattributens03_attrName", "defaultAttr", attrName);
+ assertEquals("elementsetattributens03_attrValue", "default1", attrValue);
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level2/core/elementsetattributens03";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(elementsetattributens03.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level2/core/elementsetattributens04.java b/dom/src/test/java/org/w3c/domts/level2/core/elementsetattributens04.java
new file mode 100644
index 0000000..37bbda0
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level2/core/elementsetattributens04.java
@@ -0,0 +1,111 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+
+Copyright (c) 2001 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+
+*/
+
+package org.w3c.domts.level2.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The method setAttributeNS adds a new attribute and raises a INVALID_CHARACTER_ERR if
+ * the specified qualified name contains an illegal character.
+ * Invoke the setAttributeNS method on this Element object with a valid value for
+ * namespaceURI, and qualifiedNames that contain illegal characters. Check if the an
+ * INVALID_CHARACTER_ERR was thrown.
+ *
+* @author IBM
+* @author Neil Delima
+* @see <a href="http://www.w3.org/TR/DOM-Level-2-Core/core#ID-ElSetAttrNS">http://www.w3.org/TR/DOM-Level-2-Core/core#ID-ElSetAttrNS</a>
+*/
+public final class elementsetattributens04 extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public elementsetattributens04(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "staffNS", true);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ Element element;
+ String qualifiedName;
+ java.util.List qualifiedNames = new java.util.ArrayList();
+ qualifiedNames.add("/");
+ qualifiedNames.add("//");
+ qualifiedNames.add("\\");
+ qualifiedNames.add(";");
+ qualifiedNames.add("&");
+ qualifiedNames.add("*");
+ qualifiedNames.add("]]");
+ qualifiedNames.add(">");
+ qualifiedNames.add("<");
+
+ doc = (Document) load("staffNS", true);
+ element = doc.createElementNS("http://www.w3.org/DOM/Test/L2", "dom:elem");
+ for (int indexN10058 = 0; indexN10058 < qualifiedNames.size(); indexN10058++) {
+ qualifiedName = (String) qualifiedNames.get(indexN10058);
+
+ {
+ boolean success = false;
+ try {
+ element.setAttributeNS("http://www.w3.org/DOM/Test/L2", qualifiedName, "test");
+ } catch (DOMException ex) {
+ success = (ex.code == DOMException.INVALID_CHARACTER_ERR);
+ }
+ assertTrue("elementsetattributens04", success);
+ }
+ }
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level2/core/elementsetattributens04";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(elementsetattributens04.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level2/core/elementsetattributens05.java b/dom/src/test/java/org/w3c/domts/level2/core/elementsetattributens05.java
new file mode 100644
index 0000000..778529b
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level2/core/elementsetattributens05.java
@@ -0,0 +1,98 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+
+Copyright (c) 2001-2003 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+
+*/
+
+package org.w3c.domts.level2.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The method setAttributeNS adds a new attribute and raises a NAMESPACE_ERR if the
+ * qualifiedName has a prefix and the namespaceURI is null.
+ * Invoke the setAttributeNS method on a new Element object with null namespaceURI and a
+ * qualifiedName that has a namespace prefix. Check if the NAMESPACE_ERR was thrown.
+ *
+* @author IBM
+* @author Neil Delima
+* @see <a href="http://www.w3.org/TR/DOM-Level-2-Core/core#ID-ElSetAttrNS">http://www.w3.org/TR/DOM-Level-2-Core/core#ID-ElSetAttrNS</a>
+* @see <a href="http://www.w3.org/Bugs/Public/show_bug.cgi?id=259">http://www.w3.org/Bugs/Public/show_bug.cgi?id=259</a>
+*/
+public final class elementsetattributens05 extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public elementsetattributens05(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "staffNS", true);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ Element element;
+ String nullNS = null;
+
+ doc = (Document) load("staffNS", true);
+ element = doc.createElementNS("http://www.w3.org/DOM/Test/L2", "dom:elem");
+
+ {
+ boolean success = false;
+ try {
+ element.setAttributeNS(nullNS, "dom:root", "test");
+ } catch (DOMException ex) {
+ success = (ex.code == DOMException.NAMESPACE_ERR);
+ }
+ assertTrue("elementsetattributens05", success);
+ }
+}
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level2/core/elementsetattributens05";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(elementsetattributens05.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level2/core/elementsetattributens08.java b/dom/src/test/java/org/w3c/domts/level2/core/elementsetattributens08.java
new file mode 100644
index 0000000..53a4b76
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level2/core/elementsetattributens08.java
@@ -0,0 +1,109 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+
+Copyright (c) 2001 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+
+*/
+
+package org.w3c.domts.level2.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The method setAttributeNS adds a new attribute and raises a NAMESPACE_ERR
+ * if the qualifiedName, or its prefix, is "xmlns" and the namespaceURI is
+ * different from "http://www.w3.org/2000/xmlns/".
+ *
+ * Invoke the setAttributeNS method on a new Element object with namespaceURI that is
+ * http://www.w3.org/DOMTest/level2 and a qualifiedName that has the prefix xmlns and once
+ * again with a qualifiedName that is xmlns.
+ * Check if the NAMESPACE_ERR was thrown.
+ *
+* @author IBM
+* @author Neil Delima
+* @see <a href="http://www.w3.org/TR/DOM-Level-2-Core/core#ID-ElSetAttrNS">http://www.w3.org/TR/DOM-Level-2-Core/core#ID-ElSetAttrNS</a>
+*/
+public final class elementsetattributens08 extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public elementsetattributens08(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "staffNS", true);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ Element element;
+ doc = (Document) load("staffNS", true);
+ element = doc.createElementNS("http://www.w3.org/DOMTest/level2", "dom:elem");
+
+ {
+ boolean success = false;
+ try {
+ element.setAttributeNS("http://www.w3.org/DOMTest/level2", "xmlns", "test");
+ } catch (DOMException ex) {
+ success = (ex.code == DOMException.NAMESPACE_ERR);
+ }
+ assertTrue("elementsetattributens08_Err1", success);
+ }
+
+ {
+ boolean success = false;
+ try {
+ element.setAttributeNS("http://www.w3.org/DOMTest/level2", "xmlns:root", "test");
+ } catch (DOMException ex) {
+ success = (ex.code == DOMException.NAMESPACE_ERR);
+ }
+ assertTrue("elementsetattributens08_Err2", success);
+ }
+}
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level2/core/elementsetattributens08";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(elementsetattributens08.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level2/core/elementsetattributensurinull.java b/dom/src/test/java/org/w3c/domts/level2/core/elementsetattributensurinull.java
new file mode 100644
index 0000000..829d9f7
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level2/core/elementsetattributensurinull.java
@@ -0,0 +1,116 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+
+
+
+Copyright (c) 2001 World Wide Web Consortium,
+
+(Massachusetts Institute of Technology, Institut National de
+
+Recherche en Informatique et en Automatique, Keio University). All
+
+Rights Reserved. This program is distributed under the W3C's Software
+
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+
+
+
+*/
+
+package org.w3c.domts.level2.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The "setAttributeNS(namespaceURI,qualifiedName,value)" method raises a
+ * NAMESPACE_ERR DOMException if the specified
+ * qualifiedName has a prefix and the namespaceURI is null.
+ *
+ * Attempt to add a new attribute on the first employee node.
+ * An exception should be raised since the "qualifiedName" has a
+ * prefix and the namespaceURI is null.
+* @author NIST
+* @author Mary Brady
+* @see <a href="http://www.w3.org/TR/DOM-Level-2-Core/core#ID-ElSetAttrNS">http://www.w3.org/TR/DOM-Level-2-Core/core#ID-ElSetAttrNS</a>
+* @see <a href="http://www.w3.org/TR/DOM-Level-2-Core/core#xpointer(id('ID-ElSetAttrNS')/raises/exception[@name='DOMException']/descr/p[substring-before(.,':')='NAMESPACE_ERR'])">http://www.w3.org/TR/DOM-Level-2-Core/core#xpointer(id('ID-ElSetAttrNS')/raises/exception[@name='DOMException']/descr/p[substring-before(.,':')='NAMESPACE_ERR'])</a>
+*/
+public final class elementsetattributensurinull extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public elementsetattributensurinull(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "staff", true);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ String namespaceURI = null;
+
+ String qualifiedName = "emp:qualifiedName";
+ Document doc;
+ NodeList elementList;
+ Node testAddr;
+ doc = (Document) load("staff", true);
+ elementList = doc.getElementsByTagName("employee");
+ testAddr = elementList.item(0);
+
+ {
+ boolean success = false;
+ try {
+ ((Element) /*Node */testAddr).setAttributeNS(namespaceURI, qualifiedName, "newValue");
+ } catch (DOMException ex) {
+ success = (ex.code == DOMException.NAMESPACE_ERR);
+ }
+ assertTrue("throw_NAMESPACE_ERR", success);
+ }
+}
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level2/core/elementsetattributensurinull";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(elementsetattributensurinull.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level2/core/getAttributeNS01.java b/dom/src/test/java/org/w3c/domts/level2/core/getAttributeNS01.java
new file mode 100644
index 0000000..ba4c0e5
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level2/core/getAttributeNS01.java
@@ -0,0 +1,102 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+
+Copyright (c) 2001-2003 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+
+*/
+
+package org.w3c.domts.level2.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The "getAttributeNS(namespaceURI,localName)" method retrieves an
+ * attribute value by local name and NamespaceURI.
+ *
+ * Retrieve the first "emp:address" element.
+ * The value returned by the "getAttributeNS()" method should be the
+ * value "DISTRICT" since the attribute has a default value.
+* @author NIST
+* @author Mary Brady
+* @see <a href="http://www.w3.org/TR/DOM-Level-2-Core/core#ID-ElGetAttrNS">http://www.w3.org/TR/DOM-Level-2-Core/core#ID-ElGetAttrNS</a>
+* @see <a href="http://www.w3.org/Bugs/Public/show_bug.cgi?id=238">http://www.w3.org/Bugs/Public/show_bug.cgi?id=238</a>
+*/
+public final class getAttributeNS01 extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public getAttributeNS01(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+
+ org.w3c.domts.DocumentBuilderSetting[] settings =
+ new org.w3c.domts.DocumentBuilderSetting[] {
+org.w3c.domts.DocumentBuilderSetting.namespaceAware,
+org.w3c.domts.DocumentBuilderSetting.validating
+ };
+ DOMTestDocumentBuilderFactory testFactory = factory.newInstance(settings);
+ setFactory(testFactory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "staffNS", false);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ String namespaceURI = "http://www.nist.gov";
+ String localName = "district";
+ String qualifiedName = "emp:district";
+ Document doc;
+ NodeList elementList;
+ Element testAddr;
+ String attrValue;
+ doc = (Document) load("staffNS", false);
+ elementList = doc.getElementsByTagName("emp:address");
+ testAddr = (Element) elementList.item(0);
+ attrValue = testAddr.getAttributeNS(namespaceURI, localName);
+ assertEquals("attrValue", "DISTRICT", attrValue);
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level2/core/getAttributeNS01";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(getAttributeNS01.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level2/core/getAttributeNS02.java b/dom/src/test/java/org/w3c/domts/level2/core/getAttributeNS02.java
new file mode 100644
index 0000000..0c8d718
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level2/core/getAttributeNS02.java
@@ -0,0 +1,103 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+
+Copyright (c) 2001-2004 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+
+*/
+
+package org.w3c.domts.level2.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The "getAttributeNS(namespaceURI,localName)" method retrieves an
+ * attribute value by local name and NamespaceURI.
+ *
+ * Retrieve the first "emp:address" element.
+ * Create a new attribute with the "createAttributeNS()" method.
+ * Add the new attribute with the "setAttributeNS()" method.
+ * The value returned by the "getAttributeNS()" method should be the
+ * empty string since the attribute does not have a default value.
+* @author NIST
+* @author Mary Brady
+* @see <a href="http://www.w3.org/TR/DOM-Level-2-Core/core#ID-ElGetAttrNS">http://www.w3.org/TR/DOM-Level-2-Core/core#ID-ElGetAttrNS</a>
+*/
+public final class getAttributeNS02 extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public getAttributeNS02(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "staffNS", true);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ String namespaceURI = "http://www.nist.gov";
+ String localName = "district";
+ String qualifiedName = "emp:district";
+ Document doc;
+ Attr newAttribute;
+ NodeList elementList;
+ Element testAddr;
+ Attr districtAttr;
+ String attrValue;
+ doc = (Document) load("staffNS", true);
+ newAttribute = doc.createAttributeNS(namespaceURI, qualifiedName);
+ elementList = doc.getElementsByTagName("emp:address");
+ testAddr = (Element) elementList.item(0);
+ assertNotNull("empAddrNotNull", testAddr);
+ districtAttr = testAddr.setAttributeNodeNS(newAttribute);
+ elementList = doc.getElementsByTagName("emp:address");
+ testAddr = (Element) elementList.item(0);
+ attrValue = testAddr.getAttributeNS(namespaceURI, localName);
+ assertEquals("throw_Equals", "", attrValue);
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level2/core/getAttributeNS02";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(getAttributeNS02.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level2/core/getAttributeNS03.java b/dom/src/test/java/org/w3c/domts/level2/core/getAttributeNS03.java
new file mode 100644
index 0000000..dbbaeb5
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level2/core/getAttributeNS03.java
@@ -0,0 +1,96 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+
+Copyright (c) 2001-2004 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+
+*/
+
+package org.w3c.domts.level2.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The "getAttributeNS(namespaceURI,localName)" method retrieves an
+ * attribute value by local name and NamespaceURI.
+ *
+ * Retrieve the first "emp:address" element.
+ * The value returned by the "getAttributeNS()" method for the emp:domestic attribute
+ * should be the empty string since the attribute does not have a specified value
+ * because it was removed by the "removeAttributeNS()" method.
+* @author NIST
+* @author Mary Brady
+* @see <a href="http://www.w3.org/TR/DOM-Level-2-Core/core#ID-ElGetAttrNS">http://www.w3.org/TR/DOM-Level-2-Core/core#ID-ElGetAttrNS</a>
+*/
+public final class getAttributeNS03 extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public getAttributeNS03(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "staffNS", true);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ String namespaceURI = "http://www.nist.gov";
+ String localName = "domestic";
+ Document doc;
+ NodeList elementList;
+ Element testAddr;
+ String attrValue;
+ doc = (Document) load("staffNS", true);
+ elementList = doc.getElementsByTagName("emp:address");
+ testAddr = (Element) elementList.item(0);
+ assertNotNull("empAddrNotNull", testAddr);
+ testAddr.removeAttributeNS(namespaceURI, localName);
+ attrValue = testAddr.getAttributeNS(namespaceURI, localName);
+ assertEquals("throw_Equals", "", attrValue);
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level2/core/getAttributeNS03";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(getAttributeNS03.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level2/core/getAttributeNS04.java b/dom/src/test/java/org/w3c/domts/level2/core/getAttributeNS04.java
new file mode 100644
index 0000000..4c9fa06
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level2/core/getAttributeNS04.java
@@ -0,0 +1,101 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+
+Copyright (c) 2001-2004 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+
+*/
+
+package org.w3c.domts.level2.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The "getAttributeNS(namespaceURI,localName)" method retrieves an
+ * attribute value by local name and NamespaceURI.
+ *
+ * Retrieve the first "emp:address" element.
+ * Create a new attribute with the "createAttributeNS()" method.
+ * Add the new attribute and value with the "setAttributeNS()" method.
+ * The value returned by the "getAttributeNS()" method should be
+ * the string "NewValue" since the attribute had a specified value.
+* @author NIST
+* @author Mary Brady
+* @see <a href="http://www.w3.org/TR/DOM-Level-2-Core/core#ID-ElGetAttrNS">http://www.w3.org/TR/DOM-Level-2-Core/core#ID-ElGetAttrNS</a>
+*/
+public final class getAttributeNS04 extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public getAttributeNS04(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "staffNS", true);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ String namespaceURI = "http://www.nist.gov";
+ String localName = "blank";
+ String qualifiedName = "emp:blank";
+ Document doc;
+ Attr newAttribute;
+ NodeList elementList;
+ Element testAddr;
+ Attr districtAttr;
+ String attrValue;
+ doc = (Document) load("staffNS", true);
+ newAttribute = doc.createAttributeNS(namespaceURI, qualifiedName);
+ elementList = doc.getElementsByTagName("emp:address");
+ testAddr = (Element) elementList.item(0);
+ assertNotNull("empAddrNotNull", testAddr);
+ testAddr.setAttributeNS(namespaceURI, qualifiedName, "NewValue");
+ attrValue = testAddr.getAttributeNS(namespaceURI, localName);
+ assertEquals("throw_Equals", "NewValue", attrValue);
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level2/core/getAttributeNS04";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(getAttributeNS04.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level2/core/getAttributeNS05.java b/dom/src/test/java/org/w3c/domts/level2/core/getAttributeNS05.java
new file mode 100644
index 0000000..e424d6b
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level2/core/getAttributeNS05.java
@@ -0,0 +1,99 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+
+Copyright (c) 2001-2004 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+
+*/
+
+package org.w3c.domts.level2.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The "getAttributeNS(namespaceURI,localName)" method retrieves an
+ * attribute value by local name and NamespaceURI.
+ *
+ * Retrieve the first emp:address element node
+ * and retrieve the emp:domestic attribute. The method returns an
+ * Attr value as a string, the "value" can be examined to ensure the
+ * proper attribute value was retrieved.
+* @author NIST
+* @author Mary Brady
+* @see <a href="http://www.w3.org/TR/DOM-Level-2-Core/core#ID-ElGetAttrNS">http://www.w3.org/TR/DOM-Level-2-Core/core#ID-ElGetAttrNS</a>
+*/
+public final class getAttributeNS05 extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public getAttributeNS05(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+
+ org.w3c.domts.DocumentBuilderSetting[] settings =
+ new org.w3c.domts.DocumentBuilderSetting[] {
+org.w3c.domts.DocumentBuilderSetting.namespaceAware
+ };
+ DOMTestDocumentBuilderFactory testFactory = factory.newInstance(settings);
+ setFactory(testFactory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "staffNS", false);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ NodeList elementList;
+ Element testAddr;
+ String attrValue;
+ doc = (Document) load("staffNS", false);
+ elementList = doc.getElementsByTagName("emp:address");
+ testAddr = (Element) elementList.item(0);
+ assertNotNull("empAddrNotNull", testAddr);
+ attrValue = testAddr.getAttributeNS("http://www.nist.gov", "domestic");
+ assertEquals("attrValue", "Yes", attrValue);
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level2/core/getAttributeNS05";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(getAttributeNS05.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level2/core/getAttributeNodeNS01.java b/dom/src/test/java/org/w3c/domts/level2/core/getAttributeNodeNS01.java
new file mode 100644
index 0000000..39bb06c
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level2/core/getAttributeNodeNS01.java
@@ -0,0 +1,96 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+
+Copyright (c) 2001-2004 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+
+*/
+
+package org.w3c.domts.level2.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The "getAttributeNodeNS(namespaceURI,localName)" method retrieves an
+ * attribute node by local name and NamespaceURI.
+ *
+ * Retrieve the first emp:address element node.
+ * The getAttributeNodeNS method returns an
+ * Attr node, the "value" can be examined to ensure the
+ * proper attribute node was retrieved. This attribute
+ * value should be null since there is no such attribute.
+* @author NIST
+* @author Mary Brady
+* @see <a href="http://www.w3.org/TR/DOM-Level-2-Core/core#ID-ElGetAtNodeNS">http://www.w3.org/TR/DOM-Level-2-Core/core#ID-ElGetAtNodeNS</a>
+*/
+public final class getAttributeNodeNS01 extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public getAttributeNodeNS01(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "staffNS", false);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ String namespaceURI = "http://www.nist.gov";
+ String localName = "invalidlocalname";
+ Document doc;
+ NodeList elementList;
+ Element testAddr;
+ Attr attribute;
+ doc = (Document) load("staffNS", false);
+ elementList = doc.getElementsByTagName("emp:address");
+ testAddr = (Element) elementList.item(0);
+ assertNotNull("empAddrNotNull", testAddr);
+ attribute = testAddr.getAttributeNodeNS(namespaceURI, localName);
+ assertNull("throw_Null", attribute);
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level2/core/getAttributeNodeNS01";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(getAttributeNodeNS01.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level2/core/getAttributeNodeNS02.java b/dom/src/test/java/org/w3c/domts/level2/core/getAttributeNodeNS02.java
new file mode 100644
index 0000000..6b2325e
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level2/core/getAttributeNodeNS02.java
@@ -0,0 +1,101 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+
+Copyright (c) 2001-2004 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+
+*/
+
+package org.w3c.domts.level2.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The "getAttributeNodeNS(namespaceURI,localName)" method retrieves an
+ * attribute node by local name and NamespaceURI.
+ *
+ * Retrieve the first emp:address element node.
+ * The getAttributeNodeNS method returns an
+ * Attr node, the "value" can be examined to ensure the
+ * proper attribute node was retrieved.
+* @author NIST
+* @author Mary Brady
+* @see <a href="http://www.w3.org/TR/DOM-Level-2-Core/core#ID-F68D095">http://www.w3.org/TR/DOM-Level-2-Core/core#ID-F68D095</a>
+*/
+public final class getAttributeNodeNS02 extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public getAttributeNodeNS02(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+
+ org.w3c.domts.DocumentBuilderSetting[] settings =
+ new org.w3c.domts.DocumentBuilderSetting[] {
+org.w3c.domts.DocumentBuilderSetting.namespaceAware
+ };
+ DOMTestDocumentBuilderFactory testFactory = factory.newInstance(settings);
+ setFactory(testFactory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "staffNS", false);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ NodeList elementList;
+ Element testAddr;
+ Attr attribute;
+ String attrName;
+ doc = (Document) load("staffNS", false);
+ elementList = doc.getElementsByTagName("emp:address");
+ testAddr = (Element) elementList.item(0);
+ assertNotNull("empAddrNotNull", testAddr);
+ attribute = testAddr.getAttributeNodeNS("http://www.nist.gov", "domestic");
+ attrName = attribute.getNodeName();
+ assertEquals("attrName", "emp:domestic", attrName);
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level2/core/getAttributeNodeNS02";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(getAttributeNodeNS02.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level2/core/getElementById01.java b/dom/src/test/java/org/w3c/domts/level2/core/getElementById01.java
new file mode 100644
index 0000000..dec140c
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level2/core/getElementById01.java
@@ -0,0 +1,96 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+
+Copyright (c) 2001-2003 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+
+*/
+
+package org.w3c.domts.level2.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The "getElementById(elementId)" method for a
+ * Document should return an element whose ID matches elementId.
+ *
+ * Invoke method getElementById(elementId) on this document
+ * with elementId equals "CANADA". Method should return an element
+ * whose tag name is "emp:address".
+* @author NIST
+* @author Mary Brady
+* @see <a href="http://www.w3.org/TR/DOM-Level-2-Core/core#ID-104682815">http://www.w3.org/TR/DOM-Level-2-Core/core#ID-104682815</a>
+* @see <a href="http://www.w3.org/Bugs/Public/show_bug.cgi?id=383">http://www.w3.org/Bugs/Public/show_bug.cgi?id=383</a>
+*/
+public final class getElementById01 extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public getElementById01(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+
+ org.w3c.domts.DocumentBuilderSetting[] settings =
+ new org.w3c.domts.DocumentBuilderSetting[] {
+org.w3c.domts.DocumentBuilderSetting.validating
+ };
+ DOMTestDocumentBuilderFactory testFactory = factory.newInstance(settings);
+ setFactory(testFactory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "staffNS", false);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ Element element;
+ String tagname;
+ doc = (Document) load("staffNS", false);
+ element = doc.getElementById("CANADA");
+ tagname = element.getTagName();
+ assertEquals("throw_Equals", "emp:address", tagname);
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level2/core/getElementById01";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(getElementById01.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level2/core/getElementById02.java b/dom/src/test/java/org/w3c/domts/level2/core/getElementById02.java
new file mode 100644
index 0000000..c683fac
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level2/core/getElementById02.java
@@ -0,0 +1,88 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+
+Copyright (c) 2001 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+
+*/
+
+package org.w3c.domts.level2.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ *
+ * The "getElementById(elementId)" method for a
+ * Document should return null if elementId does not identify any
+ * elements in this document.
+ *
+ * Invoke method getElementById(elementId) on this document
+ * with elementId equals "Cancun". Method should return null.
+* @author NIST
+* @author Mary Brady
+* @see <a href="http://www.w3.org/TR/DOM-Level-2-Core/core#ID-getElBId">http://www.w3.org/TR/DOM-Level-2-Core/core#ID-getElBId</a>
+*/
+public final class getElementById02 extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public getElementById02(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "staffNS", false);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ Element element;
+ doc = (Document) load("staffNS", false);
+ element = doc.getElementById("Cancun");
+ assertNull("throw_Null", element);
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level2/core/getElementById02";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(getElementById02.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level2/core/getElementsByTagNameNS01.java b/dom/src/test/java/org/w3c/domts/level2/core/getElementsByTagNameNS01.java
new file mode 100644
index 0000000..5c751fc
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level2/core/getElementsByTagNameNS01.java
@@ -0,0 +1,90 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+
+Copyright (c) 2001 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+
+*/
+
+package org.w3c.domts.level2.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The "getElementsByTagNameNS(namespaceURI,localName)" method for a
+ * Document should return a new NodeList of all Elements that have a namespace
+ * when local name is specified as ' '.
+ *
+ * Invoke method getElementsByTagNameNS(namespaceURI,localName) on this document
+ * with namespaceURI and localName as " ".
+ * Method should return a new NodeList of 37 elements.
+* @author NIST
+* @author Mary Brady
+* @see <a href="http://www.w3.org/TR/DOM-Level-2-Core/core#ID-getElBTNNS">http://www.w3.org/TR/DOM-Level-2-Core/core#ID-getElBTNNS</a>
+*/
+public final class getElementsByTagNameNS01 extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public getElementsByTagNameNS01(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "staffNS", false);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ String namespaceURI = "*";
+ String localName = "*";
+ Document doc;
+ NodeList newList;
+ doc = (Document) load("staffNS", false);
+ newList = doc.getElementsByTagNameNS(namespaceURI, localName);
+ assertSize("throw_Size", 37, newList);
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level2/core/getElementsByTagNameNS01";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(getElementsByTagNameNS01.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level2/core/getElementsByTagNameNS02.java b/dom/src/test/java/org/w3c/domts/level2/core/getElementsByTagNameNS02.java
new file mode 100644
index 0000000..706de39
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level2/core/getElementsByTagNameNS02.java
@@ -0,0 +1,104 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+
+Copyright (c) 2001 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+
+*/
+
+package org.w3c.domts.level2.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The "getElementsByTagNameNS(namespaceURI,localName)" method for a
+ * Document should return a new NodeList of all Elements with a given
+ * localName and namespaceURI in the order they were encountered in a preorder
+ * traversal of the document tree.
+ *
+ * Invoke method getElementsByTagNameNS(namespaceURI,localName) on this document
+ * with namespaceURI being " " and localName is "employee".
+ * Method should return a new NodeList containing five Elements.
+ * Retrieve the FOURTH element whose name should be "emp:employee".
+* @author NIST
+* @author Mary Brady
+* @see <a href="http://www.w3.org/TR/DOM-Level-2-Core/core#ID-getElBTNNS">http://www.w3.org/TR/DOM-Level-2-Core/core#ID-getElBTNNS</a>
+*/
+public final class getElementsByTagNameNS02 extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public getElementsByTagNameNS02(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+
+ org.w3c.domts.DocumentBuilderSetting[] settings =
+ new org.w3c.domts.DocumentBuilderSetting[] {
+org.w3c.domts.DocumentBuilderSetting.namespaceAware
+ };
+ DOMTestDocumentBuilderFactory testFactory = factory.newInstance(settings);
+ setFactory(testFactory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "staffNS", false);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ NodeList newList;
+ Element newElement;
+ String prefix;
+ String lname;
+ doc = (Document) load("staffNS", false);
+ newList = doc.getElementsByTagNameNS("*", "employee");
+ assertSize("employeeCount", 5, newList);
+ newElement = (Element) newList.item(3);
+ prefix = newElement.getPrefix();
+ assertEquals("prefix", "emp", prefix);
+ lname = newElement.getLocalName();
+ assertEquals("lname", "employee", lname);
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level2/core/getElementsByTagNameNS02";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(getElementsByTagNameNS02.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level2/core/getElementsByTagNameNS03.java b/dom/src/test/java/org/w3c/domts/level2/core/getElementsByTagNameNS03.java
new file mode 100644
index 0000000..eec09e4
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level2/core/getElementsByTagNameNS03.java
@@ -0,0 +1,121 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+
+Copyright (c) 2001 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+
+*/
+
+package org.w3c.domts.level2.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The "getElementsByTagNameNS(namespaceURI,localName)" method returns a NodeList
+ * of all descendant Elements with a given local name and namespace URI in the
+ * order in which they are encountered in a preorder traversal of this Element tree.
+ *
+ * Create a NodeList of all the descendant elements
+ * using the "http://www.nist.gov" as the namespaceURI and the special value " " as the
+ * localName.
+ * The method should return a NodeList of elements that have "http://www.nist.gov
+ * as a namespace URI.
+* @author NIST
+* @author Mary Brady
+* @see <a href="http://www.w3.org/TR/DOM-Level-2-Core/core#ID-getElBTNNS">http://www.w3.org/TR/DOM-Level-2-Core/core#ID-getElBTNNS</a>
+*/
+public final class getElementsByTagNameNS03 extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public getElementsByTagNameNS03(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+
+ org.w3c.domts.DocumentBuilderSetting[] settings =
+ new org.w3c.domts.DocumentBuilderSetting[] {
+org.w3c.domts.DocumentBuilderSetting.namespaceAware
+ };
+ DOMTestDocumentBuilderFactory testFactory = factory.newInstance(settings);
+ setFactory(testFactory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "staffNS", false);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ NodeList elementList;
+ Node child;
+ String childName;
+ java.util.List result = new java.util.ArrayList();
+
+ java.util.List expectedResult = new java.util.ArrayList();
+ expectedResult.add("employee");
+ expectedResult.add("employeeId");
+ expectedResult.add("name");
+ expectedResult.add("position");
+ expectedResult.add("salary");
+ expectedResult.add("gender");
+ expectedResult.add("address");
+ expectedResult.add("emp:employee");
+ expectedResult.add("emp:employeeId");
+ expectedResult.add("emp:position");
+ expectedResult.add("emp:salary");
+ expectedResult.add("emp:gender");
+ expectedResult.add("emp:address");
+ expectedResult.add("address");
+
+ doc = (Document) load("staffNS", false);
+ elementList = doc.getElementsByTagNameNS("http://www.nist.gov", "*");
+ for (int indexN10076 = 0; indexN10076 < elementList.getLength(); indexN10076++) {
+ child = (Node) elementList.item(indexN10076);
+ childName = child.getNodeName();
+ result.add(childName);
+ }
+ assertEquals("nodeNames", expectedResult, result);
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level2/core/getElementsByTagNameNS03";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(getElementsByTagNameNS03.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level2/core/getElementsByTagNameNS04.java b/dom/src/test/java/org/w3c/domts/level2/core/getElementsByTagNameNS04.java
new file mode 100644
index 0000000..5600408
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level2/core/getElementsByTagNameNS04.java
@@ -0,0 +1,112 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+
+Copyright (c) 2001 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+
+*/
+
+package org.w3c.domts.level2.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The "getElementsByTagNameNS(namespaceURI,localName)" method returns a NodeList
+ * of all descendant Elements with a given local name and namespace URI in the
+ * order in which they are encountered in a preorder traversal of this Element tree.
+ *
+ * Create a NodeList of all the descendant elements
+ * using the special value " " as the namespaceURI and "address" as the
+ * localName.
+ * The method should return a NodeList of Elements that have
+ * "address" as the local name.
+* @author NIST
+* @author Mary Brady
+* @see <a href="http://www.w3.org/TR/DOM-Level-2-Core/core#ID-getElBTNNS">http://www.w3.org/TR/DOM-Level-2-Core/core#ID-getElBTNNS</a>
+*/
+public final class getElementsByTagNameNS04 extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public getElementsByTagNameNS04(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+
+ org.w3c.domts.DocumentBuilderSetting[] settings =
+ new org.w3c.domts.DocumentBuilderSetting[] {
+org.w3c.domts.DocumentBuilderSetting.namespaceAware
+ };
+ DOMTestDocumentBuilderFactory testFactory = factory.newInstance(settings);
+ setFactory(testFactory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "staffNS", false);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ NodeList elementList;
+ Node child;
+ String childName;
+ java.util.List result = new java.util.ArrayList();
+
+ java.util.List expectedResult = new java.util.ArrayList();
+ expectedResult.add("address");
+ expectedResult.add("address");
+ expectedResult.add("address");
+ expectedResult.add("emp:address");
+ expectedResult.add("address");
+
+ doc = (Document) load("staffNS", false);
+ elementList = doc.getElementsByTagNameNS("*", "address");
+ for (int indexN10059 = 0; indexN10059 < elementList.getLength(); indexN10059++) {
+ child = (Node) elementList.item(indexN10059);
+ childName = child.getNodeName();
+ result.add(childName);
+ }
+ assertEquals("nodeNames", expectedResult, result);
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level2/core/getElementsByTagNameNS04";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(getElementsByTagNameNS04.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level2/core/getElementsByTagNameNS05.java b/dom/src/test/java/org/w3c/domts/level2/core/getElementsByTagNameNS05.java
new file mode 100644
index 0000000..543fb70
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level2/core/getElementsByTagNameNS05.java
@@ -0,0 +1,92 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+
+Copyright (c) 2001 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+
+*/
+
+package org.w3c.domts.level2.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The "getElementsByTagNameNS(namespaceURI,localName)" method returns a NodeList
+ * of all descendant Elements with a given local name and namespace URI in the
+ * order in which they are encountered in a preorder traversal of this Element tree.
+ *
+ * Create a NodeList of all the descendant elements
+ * using the "http://www.nist.gov" as the namespaceURI and "nomatch" as the
+ * localName.
+ * The method should return a NodeList whose length is
+ * "0".
+* @author NIST
+* @author Mary Brady
+* @see <a href="http://www.w3.org/TR/DOM-Level-2-Core/core#ID-getElBTNNS">http://www.w3.org/TR/DOM-Level-2-Core/core#ID-getElBTNNS</a>
+*/
+public final class getElementsByTagNameNS05 extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public getElementsByTagNameNS05(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "staffNS", false);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ String namespaceURI = "http://www.nist.gov";
+ String localName = "nomatch";
+ Document doc;
+ NodeList elementList;
+ doc = (Document) load("staffNS", false);
+ elementList = doc.getElementsByTagNameNS(namespaceURI, localName);
+ assertSize("throw_Size", 0, elementList);
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level2/core/getElementsByTagNameNS05";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(getElementsByTagNameNS05.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level2/core/getElementsByTagNameNS06.java b/dom/src/test/java/org/w3c/domts/level2/core/getElementsByTagNameNS06.java
new file mode 100644
index 0000000..c355f71
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level2/core/getElementsByTagNameNS06.java
@@ -0,0 +1,96 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+
+Copyright (c) 2001 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+
+*/
+
+package org.w3c.domts.level2.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The "getElementsByTagNameNS(namespaceURI,localName)" method returns a NodeList
+ * of all descendant Elements with a given local name and namespace URI in the
+ * order in which they are encountered in a preorder traversal of this Element tree.
+ *
+ * Create a NodeList of all the descendant elements
+ * using the "http://www.nomatch.com" as the namespaceURI and "address" as the
+ * localName.
+ * The method should return a NodeList whose length is
+ * "0".
+* @author NIST
+* @author Mary Brady
+* @see <a href="http://www.w3.org/TR/DOM-Level-2-Core/core#ID-getElBTNNS">http://www.w3.org/TR/DOM-Level-2-Core/core#ID-getElBTNNS</a>
+*/
+public final class getElementsByTagNameNS06 extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public getElementsByTagNameNS06(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+
+ org.w3c.domts.DocumentBuilderSetting[] settings =
+ new org.w3c.domts.DocumentBuilderSetting[] {
+org.w3c.domts.DocumentBuilderSetting.namespaceAware
+ };
+ DOMTestDocumentBuilderFactory testFactory = factory.newInstance(settings);
+ setFactory(testFactory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "staffNS", false);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ NodeList elementList;
+ doc = (Document) load("staffNS", false);
+ elementList = doc.getElementsByTagNameNS("http://www.nomatch.com", "address");
+ assertSize("matchSize", 0, elementList);
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level2/core/getElementsByTagNameNS06";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(getElementsByTagNameNS06.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level2/core/getElementsByTagNameNS07.java b/dom/src/test/java/org/w3c/domts/level2/core/getElementsByTagNameNS07.java
new file mode 100644
index 0000000..0663da1
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level2/core/getElementsByTagNameNS07.java
@@ -0,0 +1,96 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+
+Copyright (c) 2001 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+
+*/
+
+package org.w3c.domts.level2.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The "getElementsByTagNameNS(namespaceURI,localName)" method returns a NodeList
+ * of all descendant Elements with a given local name and namespace URI in the
+ * order in which they are encountered in a preorder traversal of this Element tree.
+ *
+ * Create a NodeList of all the descendant elements
+ * using the string "http://www.nist.gov" as the namespaceURI and "address" as the
+ * localName.
+ * The method should return a NodeList whose length is
+ * "3".
+* @author NIST
+* @author Mary Brady
+* @see <a href="http://www.w3.org/TR/DOM-Level-2-Core/core#ID-getElBTNNS">http://www.w3.org/TR/DOM-Level-2-Core/core#ID-getElBTNNS</a>
+*/
+public final class getElementsByTagNameNS07 extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public getElementsByTagNameNS07(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+
+ org.w3c.domts.DocumentBuilderSetting[] settings =
+ new org.w3c.domts.DocumentBuilderSetting[] {
+org.w3c.domts.DocumentBuilderSetting.namespaceAware
+ };
+ DOMTestDocumentBuilderFactory testFactory = factory.newInstance(settings);
+ setFactory(testFactory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "staffNS", false);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ NodeList elementList;
+ doc = (Document) load("staffNS", false);
+ elementList = doc.getElementsByTagNameNS("http://www.nist.gov", "address");
+ assertSize("addresses", 3, elementList);
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level2/core/getElementsByTagNameNS07";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(getElementsByTagNameNS07.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level2/core/getElementsByTagNameNS08.java b/dom/src/test/java/org/w3c/domts/level2/core/getElementsByTagNameNS08.java
new file mode 100644
index 0000000..4afe927
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level2/core/getElementsByTagNameNS08.java
@@ -0,0 +1,88 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+
+Copyright (c) 2001 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+
+*/
+
+package org.w3c.domts.level2.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * Element.getElementsByTagNameNS('*','*') should return all child
+ * elements. There is some contention on whether this should match
+ * unqualified elements, this test reflects the interpretation that
+ * '*' should match elements in all namespaces and unqualified elements.
+ * Derived from getElementsByTagNameNS01 which tests similar functionality
+ * on the Document interface.
+* @author Curt Arnold
+* @see <a href="http://www.w3.org/TR/DOM-Level-2-Core/core#ID-1938918D">http://www.w3.org/TR/DOM-Level-2-Core/core#ID-1938918D</a>
+*/
+public final class getElementsByTagNameNS08 extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public getElementsByTagNameNS08(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "staffNS", false);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ Element docElem;
+ NodeList newList;
+ doc = (Document) load("staffNS", false);
+ docElem = doc.getDocumentElement();
+ newList = docElem.getElementsByTagNameNS("*", "*");
+ assertSize("listSize", 36, newList);
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level2/core/getElementsByTagNameNS08";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(getElementsByTagNameNS08.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level2/core/getElementsByTagNameNS09.java b/dom/src/test/java/org/w3c/domts/level2/core/getElementsByTagNameNS09.java
new file mode 100644
index 0000000..db6529c
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level2/core/getElementsByTagNameNS09.java
@@ -0,0 +1,108 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+
+Copyright (c) 2001 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+
+*/
+
+package org.w3c.domts.level2.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The "getElementsByTagNameNS(namespaceURI,localName)" method for a
+ * Element should return a new NodeList of all descendant Elements with a given
+ * localName and namespaceURI in the order they were encountered in a preorder
+ * traversal of the document tree.
+ *
+ * Invoke method getElementsByTagNameNS(namespaceURI,localName) on the document
+ * element with namespaceURI being "*" and localName is "employee".
+ * Method should return a new NodeList containing five Elements.
+ * Retrieve the FOURTH element whose name should be "emp:employee".
+ * Derived from getElementsByTagNameNS02 and reflects its interpretation
+ * that namespace="*" matches namespace unqualified tagnames.
+* @author Curt Arnold
+* @author Curt Arnold
+* @see <a href="http://www.w3.org/TR/DOM-Level-2-Core/core#ID-1938918D">http://www.w3.org/TR/DOM-Level-2-Core/core#ID-1938918D</a>
+*/
+public final class getElementsByTagNameNS09 extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public getElementsByTagNameNS09(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+
+ org.w3c.domts.DocumentBuilderSetting[] settings =
+ new org.w3c.domts.DocumentBuilderSetting[] {
+org.w3c.domts.DocumentBuilderSetting.namespaceAware
+ };
+ DOMTestDocumentBuilderFactory testFactory = factory.newInstance(settings);
+ setFactory(testFactory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "staffNS", false);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ NodeList newList;
+ Element newElement;
+ String prefix;
+ String lname;
+ Element docElem;
+ doc = (Document) load("staffNS", false);
+ docElem = doc.getDocumentElement();
+ newList = docElem.getElementsByTagNameNS("*", "employee");
+ assertSize("employeeCount", 5, newList);
+ newElement = (Element) newList.item(3);
+ prefix = newElement.getPrefix();
+ assertEquals("prefix", "emp", prefix);
+ lname = newElement.getLocalName();
+ assertEquals("lname", "employee", lname);
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level2/core/getElementsByTagNameNS09";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(getElementsByTagNameNS09.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level2/core/getElementsByTagNameNS10.java b/dom/src/test/java/org/w3c/domts/level2/core/getElementsByTagNameNS10.java
new file mode 100644
index 0000000..491c51c
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level2/core/getElementsByTagNameNS10.java
@@ -0,0 +1,124 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+
+Copyright (c) 2001 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+
+*/
+
+package org.w3c.domts.level2.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The "getElementsByTagNameNS(namespaceURI,localName)" method returns a NodeList
+ * of all descendant Elements with a given local name and namespace URI in the
+ * order in which they are encountered in a preorder traversal of this Element tree.
+ *
+ * Create a NodeList of all the descendant elements of the document element
+ * using the "http://www.nist.gov" as the namespaceURI and the special value "*" as the
+ * localName.
+ * The method should return a NodeList of elements that have "http://www.nist.gov
+ * as a namespace URI.
+ * Derived from getElementsByTagNameNS03
+* @author Curt Arnold
+* @author Curt Arnold
+* @see <a href="http://www.w3.org/TR/DOM-Level-2-Core/core#ID-1938918D">http://www.w3.org/TR/DOM-Level-2-Core/core#ID-1938918D</a>
+*/
+public final class getElementsByTagNameNS10 extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public getElementsByTagNameNS10(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+
+ org.w3c.domts.DocumentBuilderSetting[] settings =
+ new org.w3c.domts.DocumentBuilderSetting[] {
+org.w3c.domts.DocumentBuilderSetting.namespaceAware
+ };
+ DOMTestDocumentBuilderFactory testFactory = factory.newInstance(settings);
+ setFactory(testFactory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "staffNS", false);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ Element docElem;
+ NodeList elementList;
+ Node child;
+ String childName;
+ java.util.List result = new java.util.ArrayList();
+
+ java.util.List expectedResult = new java.util.ArrayList();
+ expectedResult.add("employee");
+ expectedResult.add("employeeId");
+ expectedResult.add("name");
+ expectedResult.add("position");
+ expectedResult.add("salary");
+ expectedResult.add("gender");
+ expectedResult.add("address");
+ expectedResult.add("emp:employee");
+ expectedResult.add("emp:employeeId");
+ expectedResult.add("emp:position");
+ expectedResult.add("emp:salary");
+ expectedResult.add("emp:gender");
+ expectedResult.add("emp:address");
+ expectedResult.add("address");
+
+ doc = (Document) load("staffNS", false);
+ docElem = doc.getDocumentElement();
+ elementList = docElem.getElementsByTagNameNS("http://www.nist.gov", "*");
+ for (int indexN1007E = 0; indexN1007E < elementList.getLength(); indexN1007E++) {
+ child = (Node) elementList.item(indexN1007E);
+ childName = child.getNodeName();
+ result.add(childName);
+ }
+ assertEquals("nodeNames", expectedResult, result);
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level2/core/getElementsByTagNameNS10";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(getElementsByTagNameNS10.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level2/core/getElementsByTagNameNS11.java b/dom/src/test/java/org/w3c/domts/level2/core/getElementsByTagNameNS11.java
new file mode 100644
index 0000000..197acbc
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level2/core/getElementsByTagNameNS11.java
@@ -0,0 +1,114 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+
+Copyright (c) 2001 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+
+*/
+
+package org.w3c.domts.level2.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The "getElementsByTagNameNS(namespaceURI,localName)" method returns a NodeList
+ * of all descendant Elements with a given local name and namespace URI in the
+ * order in which they are encountered in a preorder traversal of this Element tree.
+ *
+ * Create a NodeList of all the descendant elements
+ * using the special value "*" as the namespaceURI and "address" as the
+ * localName.
+ * The method should return a NodeList of Elements that have
+ * "address" as the local name.
+ * This test is derived from getElementsByTagNameNS04
+* @author Curt Arnold
+* @see <a href="http://www.w3.org/TR/DOM-Level-2-Core/core#ID-1938918D">http://www.w3.org/TR/DOM-Level-2-Core/core#ID-1938918D</a>
+*/
+public final class getElementsByTagNameNS11 extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public getElementsByTagNameNS11(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+
+ org.w3c.domts.DocumentBuilderSetting[] settings =
+ new org.w3c.domts.DocumentBuilderSetting[] {
+org.w3c.domts.DocumentBuilderSetting.namespaceAware
+ };
+ DOMTestDocumentBuilderFactory testFactory = factory.newInstance(settings);
+ setFactory(testFactory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "staffNS", false);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ Element docElem;
+ NodeList elementList;
+ Node child;
+ String childName;
+ java.util.List result = new java.util.ArrayList();
+
+ java.util.List expectedResult = new java.util.ArrayList();
+ expectedResult.add("address");
+ expectedResult.add("address");
+ expectedResult.add("address");
+ expectedResult.add("emp:address");
+ expectedResult.add("address");
+
+ doc = (Document) load("staffNS", false);
+ docElem = doc.getDocumentElement();
+ elementList = docElem.getElementsByTagNameNS("*", "address");
+ for (int indexN1005E = 0; indexN1005E < elementList.getLength(); indexN1005E++) {
+ child = (Node) elementList.item(indexN1005E);
+ childName = child.getNodeName();
+ result.add(childName);
+ }
+ assertEquals("nodeNames", expectedResult, result);
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level2/core/getElementsByTagNameNS11";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(getElementsByTagNameNS11.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level2/core/getElementsByTagNameNS12.java b/dom/src/test/java/org/w3c/domts/level2/core/getElementsByTagNameNS12.java
new file mode 100644
index 0000000..41cb437
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level2/core/getElementsByTagNameNS12.java
@@ -0,0 +1,91 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+
+Copyright (c) 2001 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+
+*/
+
+package org.w3c.domts.level2.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The "getElementsByTagNameNS(namespaceURI,localName)" method returns a NodeList
+ * of all descendant Elements with a given local name and namespace URI in the
+ * order in which they are encountered in a preorder traversal of this Element tree.
+ *
+ * Create a NodeList of all the descendant elements
+ * using the "http://www.nist.gov" as the namespaceURI and "nomatch" as the
+ * localName.
+ * The method should return a NodeList whose length is "0".
+ * This test is a modification of getElementsByTagName05
+* @author Curt Arnold
+* @see <a href="http://www.w3.org/TR/DOM-Level-2-Core/core#ID-1938918D">http://www.w3.org/TR/DOM-Level-2-Core/core#ID-1938918D</a>
+*/
+public final class getElementsByTagNameNS12 extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public getElementsByTagNameNS12(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "staffNS", false);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ Element docElem;
+ NodeList elementList;
+ doc = (Document) load("staffNS", false);
+ docElem = doc.getDocumentElement();
+ elementList = docElem.getElementsByTagNameNS("http://www.nist.gov", "nomatch");
+ assertSize("size", 0, elementList);
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level2/core/getElementsByTagNameNS12";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(getElementsByTagNameNS12.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level2/core/getElementsByTagNameNS13.java b/dom/src/test/java/org/w3c/domts/level2/core/getElementsByTagNameNS13.java
new file mode 100644
index 0000000..8e2d7a6
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level2/core/getElementsByTagNameNS13.java
@@ -0,0 +1,97 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+
+Copyright (c) 2001 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+
+*/
+
+package org.w3c.domts.level2.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The "getElementsByTagNameNS(namespaceURI,localName)" method returns a NodeList
+ * of all descendant Elements with a given local name and namespace URI in the
+ * order in which they are encountered in a preorder traversal of this Element tree.
+ *
+ * Create a NodeList of all the descendant elements
+ * using the "http://www.nomatch.com" as the namespaceURI and "address" as the
+ * localName.
+ * The method should return a NodeList whose length is
+ * "0".
+* @author Curt Arnold
+* @see <a href="http://www.w3.org/TR/DOM-Level-2-Core/core#ID-1938918D">http://www.w3.org/TR/DOM-Level-2-Core/core#ID-1938918D</a>
+*/
+public final class getElementsByTagNameNS13 extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public getElementsByTagNameNS13(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+
+ org.w3c.domts.DocumentBuilderSetting[] settings =
+ new org.w3c.domts.DocumentBuilderSetting[] {
+org.w3c.domts.DocumentBuilderSetting.namespaceAware
+ };
+ DOMTestDocumentBuilderFactory testFactory = factory.newInstance(settings);
+ setFactory(testFactory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "staffNS", false);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ Element docElem;
+ NodeList elementList;
+ doc = (Document) load("staffNS", false);
+ docElem = doc.getDocumentElement();
+ elementList = docElem.getElementsByTagNameNS("http://www.nomatch.com", "address");
+ assertSize("matchSize", 0, elementList);
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level2/core/getElementsByTagNameNS13";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(getElementsByTagNameNS13.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level2/core/getElementsByTagNameNS14.java b/dom/src/test/java/org/w3c/domts/level2/core/getElementsByTagNameNS14.java
new file mode 100644
index 0000000..2334f27
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level2/core/getElementsByTagNameNS14.java
@@ -0,0 +1,97 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+
+Copyright (c) 2001 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+
+*/
+
+package org.w3c.domts.level2.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The "getElementsByTagNameNS(namespaceURI,localName)" method returns a NodeList
+ * of all descendant Elements with a given local name and namespace URI in the
+ * order in which they are encountered in a preorder traversal of this Element tree.
+ *
+ * Create a NodeList of all the descendant elements
+ * using the string "http://www.nist.gov" as the namespaceURI and "address" as the
+ * localName.
+ * The method should return a NodeList whose length is
+ * "3".
+* @author Curt Arnold
+* @see <a href="http://www.w3.org/TR/DOM-Level-2-Core/core#ID-1938918D">http://www.w3.org/TR/DOM-Level-2-Core/core#ID-1938918D</a>
+*/
+public final class getElementsByTagNameNS14 extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public getElementsByTagNameNS14(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+
+ org.w3c.domts.DocumentBuilderSetting[] settings =
+ new org.w3c.domts.DocumentBuilderSetting[] {
+org.w3c.domts.DocumentBuilderSetting.namespaceAware
+ };
+ DOMTestDocumentBuilderFactory testFactory = factory.newInstance(settings);
+ setFactory(testFactory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "staffNS", false);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ Element docElem;
+ NodeList elementList;
+ doc = (Document) load("staffNS", false);
+ docElem = doc.getDocumentElement();
+ elementList = docElem.getElementsByTagNameNS("http://www.nist.gov", "address");
+ assertSize("addresses", 3, elementList);
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level2/core/getElementsByTagNameNS14";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(getElementsByTagNameNS14.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level2/core/getNamedItemNS01.java b/dom/src/test/java/org/w3c/domts/level2/core/getNamedItemNS01.java
new file mode 100644
index 0000000..859a582
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level2/core/getNamedItemNS01.java
@@ -0,0 +1,103 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+
+Copyright (c) 2001 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+
+*/
+
+package org.w3c.domts.level2.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The "getNamedItemNS(namespaceURI,localName)" method for a
+ * NamedNodeMap should return a node specified by localName and namespaceURI
+ *
+ * Retrieve a list of elements with tag name "address".
+ * Access the second element from the list and get its attributes.
+ * Try to retrieve the attribute node with local name "domestic"
+ * and namespace uri "http://www.usa.com" with
+ * method getNamedItemNS(namespaceURI,localName).
+* @author NIST
+* @author Mary Brady
+* @see <a href="http://www.w3.org/TR/DOM-Level-2-Core/core#ID-F68D095">http://www.w3.org/TR/DOM-Level-2-Core/core#ID-F68D095</a>
+*/
+public final class getNamedItemNS01 extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public getNamedItemNS01(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+
+ org.w3c.domts.DocumentBuilderSetting[] settings =
+ new org.w3c.domts.DocumentBuilderSetting[] {
+org.w3c.domts.DocumentBuilderSetting.namespaceAware
+ };
+ DOMTestDocumentBuilderFactory testFactory = factory.newInstance(settings);
+ setFactory(testFactory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "staffNS", false);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ NodeList elementList;
+ Node testEmployee;
+ NamedNodeMap attributes;
+ Attr domesticAttr;
+ String attrName;
+ doc = (Document) load("staffNS", false);
+ elementList = doc.getElementsByTagName("address");
+ testEmployee = elementList.item(1);
+ attributes = testEmployee.getAttributes();
+ domesticAttr = (Attr) attributes.getNamedItemNS("http://www.usa.com", "domestic");
+ attrName = domesticAttr.getNodeName();
+ assertEquals("attrName", "dmstc:domestic", attrName);
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level2/core/getNamedItemNS01";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(getNamedItemNS01.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level2/core/getNamedItemNS02.java b/dom/src/test/java/org/w3c/domts/level2/core/getNamedItemNS02.java
new file mode 100644
index 0000000..087b9e0
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level2/core/getNamedItemNS02.java
@@ -0,0 +1,99 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+
+Copyright (c) 2001 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+
+*/
+
+package org.w3c.domts.level2.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The "getNamedItemNS(namespaceURI,localName)" method for a
+ * NamedNodeMap should return null
+ * if parameters do not identify any node in this map.
+ *
+ * Retrieve a list of elements with tag name "address".
+ * Access the second element from the list and get its attributes.
+ * Try to retrieve an attribute node with local name "domest"
+ * and namespace uri "http://www.usa.com" with
+ * method getNamedItemNS(namespaceURI,localName).
+ * This should return null because "domest" does not match any local names in this map.
+* @author NIST
+* @author Mary Brady
+* @see <a href="http://www.w3.org/TR/DOM-Level-2-Core/core#ID-getNamedItemNS">http://www.w3.org/TR/DOM-Level-2-Core/core#ID-getNamedItemNS</a>
+*/
+public final class getNamedItemNS02 extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public getNamedItemNS02(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "staffNS", false);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ String namespaceURI = "http://www.usa.com";
+ String localName = "domest";
+ Document doc;
+ NodeList elementList;
+ Node testEmployee;
+ NamedNodeMap attributes;
+ Attr newAttr;
+ doc = (Document) load("staffNS", false);
+ elementList = doc.getElementsByTagName("address");
+ testEmployee = elementList.item(1);
+ attributes = testEmployee.getAttributes();
+ newAttr = (Attr) attributes.getNamedItemNS(namespaceURI, localName);
+ assertNull("throw_Null", newAttr);
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level2/core/getNamedItemNS02";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(getNamedItemNS02.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level2/core/getNamedItemNS03.java b/dom/src/test/java/org/w3c/domts/level2/core/getNamedItemNS03.java
new file mode 100644
index 0000000..235352f
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level2/core/getNamedItemNS03.java
@@ -0,0 +1,91 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+
+Copyright (c) 2003 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+
+*/
+
+package org.w3c.domts.level2.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * Entity nodes are not namespaced and should not be retrievable using
+ * getNamedItemNS.
+* @author Curt Arnold
+* @author Curt Arnold
+* @see <a href="http://www.w3.org/TR/DOM-Level-2-Core/core#ID-getNamedItemNS">http://www.w3.org/TR/DOM-Level-2-Core/core#ID-getNamedItemNS</a>
+* @see <a href="http://www.w3.org/Bugs/Public/show_bug.cgi?id=259">http://www.w3.org/Bugs/Public/show_bug.cgi?id=259</a>
+*/
+public final class getNamedItemNS03 extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public getNamedItemNS03(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "staffNS", false);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ DocumentType docType;
+ NamedNodeMap entities;
+ Entity entity;
+ String nullNS = null;
+
+ doc = (Document) load("staffNS", false);
+ docType = doc.getDoctype();
+ entities = docType.getEntities();
+ assertNotNull("entitiesNotNull", entities);
+ entity = (Entity) entities.getNamedItemNS(nullNS, "ent1");
+ assertNull("entityNull", entity);
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level2/core/getNamedItemNS03";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(getNamedItemNS03.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level2/core/getNamedItemNS04.java b/dom/src/test/java/org/w3c/domts/level2/core/getNamedItemNS04.java
new file mode 100644
index 0000000..f22f963
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level2/core/getNamedItemNS04.java
@@ -0,0 +1,91 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+
+Copyright (c) 2003 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+
+*/
+
+package org.w3c.domts.level2.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * Notation nodes are not namespaced and should not be retrievable using
+ * getNamedItemNS.
+* @author Curt Arnold
+* @author Curt Arnold
+* @see <a href="http://www.w3.org/TR/DOM-Level-2-Core/core#ID-getNamedItemNS">http://www.w3.org/TR/DOM-Level-2-Core/core#ID-getNamedItemNS</a>
+* @see <a href="http://www.w3.org/Bugs/Public/show_bug.cgi?id=259">http://www.w3.org/Bugs/Public/show_bug.cgi?id=259</a>
+*/
+public final class getNamedItemNS04 extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public getNamedItemNS04(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "staffNS", false);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ DocumentType docType;
+ NamedNodeMap notations;
+ Notation notation;
+ String nullNS = null;
+
+ doc = (Document) load("staffNS", false);
+ docType = doc.getDoctype();
+ notations = docType.getNotations();
+ assertNotNull("notationsNotNull", notations);
+ notation = (Notation) notations.getNamedItemNS(nullNS, "notation1");
+ assertNull("notationNull", notation);
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level2/core/getNamedItemNS04";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(getNamedItemNS04.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level2/core/hasAttribute01.java b/dom/src/test/java/org/w3c/domts/level2/core/hasAttribute01.java
new file mode 100644
index 0000000..b9e2d7a
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level2/core/hasAttribute01.java
@@ -0,0 +1,89 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+
+Copyright (c) 2001 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+
+*/
+
+package org.w3c.domts.level2.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The "hasAttribute()" method for an Element should
+ * return true if the element has an attribute with the given name.
+ * Retrieve the first "address" element and the "hasAttribute()" method
+ * should return false since the element does not have a default value.
+* @author NIST
+* @author Mary Brady
+* @see <a href="http://www.w3.org/TR/DOM-Level-2-Core/core#ID-ElHasAttr">http://www.w3.org/TR/DOM-Level-2-Core/core#ID-ElHasAttr</a>
+*/
+public final class hasAttribute01 extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public hasAttribute01(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "staff", false);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ NodeList elementList;
+ Element testNode;
+ boolean state;
+ doc = (Document) load("staff", false);
+ elementList = doc.getElementsByTagName("address");
+ testNode = (Element) elementList.item(4);
+ state = testNode.hasAttribute("domestic");
+ assertFalse("throw_False", state);
+}
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level2/core/hasAttribute01";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(hasAttribute01.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level2/core/hasAttribute02.java b/dom/src/test/java/org/w3c/domts/level2/core/hasAttribute02.java
new file mode 100644
index 0000000..23ef84c
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level2/core/hasAttribute02.java
@@ -0,0 +1,96 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+
+Copyright (c) 2001-2003 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+
+*/
+
+package org.w3c.domts.level2.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The "hasAttribute()" method for an Element should
+ * return true if the element has an attribute with the given name.
+ * Retrieve the first "address" element and the "hasAttribute()" method
+ * should return true since the attribute "street" has a default value.
+* @author NIST
+* @author Mary Brady
+* @see <a href="http://www.w3.org/TR/DOM-Level-2-Core/core#ID-ElHasAttr">http://www.w3.org/TR/DOM-Level-2-Core/core#ID-ElHasAttr</a>
+* @see <a href="http://www.w3.org/Bugs/Public/show_bug.cgi?id=238">http://www.w3.org/Bugs/Public/show_bug.cgi?id=238</a>
+*/
+public final class hasAttribute02 extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public hasAttribute02(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+
+ org.w3c.domts.DocumentBuilderSetting[] settings =
+ new org.w3c.domts.DocumentBuilderSetting[] {
+org.w3c.domts.DocumentBuilderSetting.validating
+ };
+ DOMTestDocumentBuilderFactory testFactory = factory.newInstance(settings);
+ setFactory(testFactory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "staff", false);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ NodeList elementList;
+ Element testNode;
+ boolean state;
+ doc = (Document) load("staff", false);
+ elementList = doc.getElementsByTagName("address");
+ testNode = (Element) elementList.item(0);
+ state = testNode.hasAttribute("street");
+ assertTrue("throw_True", state);
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level2/core/hasAttribute02";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(hasAttribute02.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level2/core/hasAttribute03.java b/dom/src/test/java/org/w3c/domts/level2/core/hasAttribute03.java
new file mode 100644
index 0000000..adc23e4
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level2/core/hasAttribute03.java
@@ -0,0 +1,89 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+
+Copyright (c) 2001 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+
+*/
+
+package org.w3c.domts.level2.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The "hasAttribute()" method for an Element should
+ * return false if the element does not have an attribute with the given name.
+ * Retrieve the first "address" element and the "hasAttribute()" method
+ * should return false since the element does not have "nomatch" as an attribute.
+* @author NIST
+* @author Mary Brady
+* @see <a href="http://www.w3.org/TR/DOM-Level-2-Core/core#ID-ElHasAttr">http://www.w3.org/TR/DOM-Level-2-Core/core#ID-ElHasAttr</a>
+*/
+public final class hasAttribute03 extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public hasAttribute03(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "staff", false);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ NodeList elementList;
+ Element testNode;
+ boolean state;
+ doc = (Document) load("staff", false);
+ elementList = doc.getElementsByTagName("address");
+ testNode = (Element) elementList.item(0);
+ state = testNode.hasAttribute("nomatch");
+ assertFalse("throw_False", state);
+}
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level2/core/hasAttribute03";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(hasAttribute03.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level2/core/hasAttribute04.java b/dom/src/test/java/org/w3c/domts/level2/core/hasAttribute04.java
new file mode 100644
index 0000000..98a9f24
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level2/core/hasAttribute04.java
@@ -0,0 +1,96 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+
+Copyright (c) 2001-2003 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+
+*/
+
+package org.w3c.domts.level2.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The "hasAttribute()" method for an Element should
+ * return true if the element has an attribute with the given name.
+ * Retrieve the first "address" element and the "hasAttribute()" method
+ * should return true since the element has "domestic" as an attribute.
+* @author NIST
+* @author Mary Brady
+* @see <a href="http://www.w3.org/TR/DOM-Level-2-Core/core#ID-ElHasAttr">http://www.w3.org/TR/DOM-Level-2-Core/core#ID-ElHasAttr</a>
+* @see <a href="http://www.w3.org/Bugs/Public/show_bug.cgi?id=238">http://www.w3.org/Bugs/Public/show_bug.cgi?id=238</a>
+*/
+public final class hasAttribute04 extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public hasAttribute04(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+
+ org.w3c.domts.DocumentBuilderSetting[] settings =
+ new org.w3c.domts.DocumentBuilderSetting[] {
+org.w3c.domts.DocumentBuilderSetting.validating
+ };
+ DOMTestDocumentBuilderFactory testFactory = factory.newInstance(settings);
+ setFactory(testFactory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "staffNS", false);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ NodeList elementList;
+ Element testNode;
+ boolean state;
+ doc = (Document) load("staffNS", false);
+ elementList = doc.getElementsByTagName("address");
+ testNode = (Element) elementList.item(0);
+ state = testNode.hasAttribute("dmstc:domestic");
+ assertTrue("hasDomesticAttr", state);
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level2/core/hasAttribute04";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(hasAttribute04.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level2/core/hasAttributeNS01.java b/dom/src/test/java/org/w3c/domts/level2/core/hasAttributeNS01.java
new file mode 100644
index 0000000..da6c532
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level2/core/hasAttributeNS01.java
@@ -0,0 +1,94 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+
+Copyright (c) 2001 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+
+*/
+
+package org.w3c.domts.level2.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ *
+ * The "hasAttributeNS()" method for an Element should
+ * return false if the element does not have an attribute with the given local name
+ * and/or a namespace URI specified on this element or does not have a default value.
+ * Retrieve the first "address" element and the "hasAttributeNS()" method
+ * should return false since the element has "nomatch" as the local name
+ * and "http://www.usa.com" as the namespace URI.
+* @author NIST
+* @author Mary Brady
+* @see <a href="http://www.w3.org/TR/DOM-Level-2-Core/core#ID-ElHasAttrNS">http://www.w3.org/TR/DOM-Level-2-Core/core#ID-ElHasAttrNS</a>
+*/
+public final class hasAttributeNS01 extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public hasAttributeNS01(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "staffNS", false);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ String localName = "nomatch";
+ String namespaceURI = "http://www.usa.com";
+ Document doc;
+ NodeList elementList;
+ Element testNode;
+ boolean state;
+ doc = (Document) load("staffNS", false);
+ elementList = doc.getElementsByTagName("address");
+ testNode = (Element) elementList.item(0);
+ state = testNode.hasAttributeNS(namespaceURI, localName);
+ assertFalse("throw_False", state);
+}
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level2/core/hasAttributeNS01";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(hasAttributeNS01.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level2/core/hasAttributeNS02.java b/dom/src/test/java/org/w3c/domts/level2/core/hasAttributeNS02.java
new file mode 100644
index 0000000..4f71e99
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level2/core/hasAttributeNS02.java
@@ -0,0 +1,93 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+
+Copyright (c) 2001 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+
+*/
+
+package org.w3c.domts.level2.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The "hasAttributeNS()" method for an Element should
+ * return false if the element does not have an attribute with the given local name
+ * and/or namespace URI specified on this element or does not have a default value.
+ * Retrieve the first "address" element and the "hasAttributeNS()" method
+ * should return false since the element has "domestic" as the local name
+ * and "http://www.nomatch.com" as the namespace URI.
+* @author NIST
+* @author Mary Brady
+* @see <a href="http://www.w3.org/TR/DOM-Level-2-Core/core#ID-ElHasAttrNS">http://www.w3.org/TR/DOM-Level-2-Core/core#ID-ElHasAttrNS</a>
+*/
+public final class hasAttributeNS02 extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public hasAttributeNS02(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "staffNS", false);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ String localName = "domestic";
+ String namespaceURI = "http://www.nomatch.com";
+ Document doc;
+ NodeList elementList;
+ Element testNode;
+ boolean state;
+ doc = (Document) load("staffNS", false);
+ elementList = doc.getElementsByTagName("address");
+ testNode = (Element) elementList.item(0);
+ state = testNode.hasAttributeNS(namespaceURI, localName);
+ assertFalse("throw_False", state);
+}
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level2/core/hasAttributeNS02";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(hasAttributeNS02.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level2/core/hasAttributeNS03.java b/dom/src/test/java/org/w3c/domts/level2/core/hasAttributeNS03.java
new file mode 100644
index 0000000..f2f6792
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level2/core/hasAttributeNS03.java
@@ -0,0 +1,94 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+
+Copyright (c) 2001-2004 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+
+*/
+
+package org.w3c.domts.level2.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The "hasAttributeNS()" method for an Element should
+ * return false if the element does not have an attribute with the given local name
+ * and/or namespace URI specified on this element or does not have a default value.
+ * Retrieve the first "emp:address" element.
+ * The boolean value returned by the "hasAttributeNS()" should be false
+ * since the attribute does not have a default value.
+* @author NIST
+* @author Mary Brady
+* @see <a href="http://www.w3.org/TR/DOM-Level-2-Core/core#ID-ElHasAttrNS">http://www.w3.org/TR/DOM-Level-2-Core/core#ID-ElHasAttrNS</a>
+*/
+public final class hasAttributeNS03 extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public hasAttributeNS03(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "staffNS", false);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ String localName = "blank";
+ String namespaceURI = "http://www.nist.gov";
+ Document doc;
+ NodeList elementList;
+ Element testNode;
+ boolean state;
+ doc = (Document) load("staffNS", false);
+ elementList = doc.getElementsByTagName("emp:address");
+ testNode = (Element) elementList.item(0);
+ assertNotNull("empAddrNotNull", testNode);
+ state = testNode.hasAttributeNS(namespaceURI, localName);
+ assertFalse("throw_False", state);
+}
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level2/core/hasAttributeNS03";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(hasAttributeNS03.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level2/core/hasAttributeNS04.java b/dom/src/test/java/org/w3c/domts/level2/core/hasAttributeNS04.java
new file mode 100644
index 0000000..48e2050
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level2/core/hasAttributeNS04.java
@@ -0,0 +1,101 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+
+Copyright (c) 2001-2004 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+
+*/
+
+package org.w3c.domts.level2.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The "hasAttributeNS()" method for an Element should
+ * return true if the attribute with the given local name
+ * and namespace URI has a default value.
+ * Retrieve the first "emp:address" element.
+ * The boolean value returned by the "hasAttributeNS()" should be true
+ * since the attribute has a default value.
+* @author NIST
+* @author Mary Brady
+* @see <a href="http://www.w3.org/TR/DOM-Level-2-Core/core#ID-ElHasAttrNS">http://www.w3.org/TR/DOM-Level-2-Core/core#ID-ElHasAttrNS</a>
+*/
+public final class hasAttributeNS04 extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public hasAttributeNS04(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+
+ org.w3c.domts.DocumentBuilderSetting[] settings =
+ new org.w3c.domts.DocumentBuilderSetting[] {
+org.w3c.domts.DocumentBuilderSetting.namespaceAware,
+org.w3c.domts.DocumentBuilderSetting.validating
+ };
+ DOMTestDocumentBuilderFactory testFactory = factory.newInstance(settings);
+ setFactory(testFactory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "staffNS", false);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ String localName = "district";
+ String namespaceURI = "http://www.nist.gov";
+ Document doc;
+ NodeList elementList;
+ Element testNode;
+ boolean state;
+ doc = (Document) load("staffNS", false);
+ elementList = doc.getElementsByTagName("emp:address");
+ testNode = (Element) elementList.item(0);
+ assertNotNull("empAddressNotNull", testNode);
+ state = testNode.hasAttributeNS(namespaceURI, localName);
+ assertTrue("hasAttribute", state);
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level2/core/hasAttributeNS04";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(hasAttributeNS04.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level2/core/hasAttributeNS05.java b/dom/src/test/java/org/w3c/domts/level2/core/hasAttributeNS05.java
new file mode 100644
index 0000000..a4d99ed
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level2/core/hasAttributeNS05.java
@@ -0,0 +1,99 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+
+Copyright (c) 2001 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+
+*/
+
+package org.w3c.domts.level2.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The "hasAttributeNS()" method for an Element should
+ * return true if the element has an attribute with the given local name
+ * and the namespace URI is specified on this element or has a default value.
+ * Retrieve the first "address" element and the "hasAttributeNS()" method
+ * should return true since the element has "domestic" as the local name
+ * and "http://www.usa.com" as the namespace URI.
+* @author NIST
+* @author Mary Brady
+* @see <a href="http://www.w3.org/TR/DOM-Level-2-Core/core#ID-ElHasAttrNS">http://www.w3.org/TR/DOM-Level-2-Core/core#ID-ElHasAttrNS</a>
+*/
+public final class hasAttributeNS05 extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public hasAttributeNS05(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+
+ org.w3c.domts.DocumentBuilderSetting[] settings =
+ new org.w3c.domts.DocumentBuilderSetting[] {
+org.w3c.domts.DocumentBuilderSetting.namespaceAware
+ };
+ DOMTestDocumentBuilderFactory testFactory = factory.newInstance(settings);
+ setFactory(testFactory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "staffNS", false);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ String localName = "domestic";
+ String namespaceURI = "http://www.usa.com";
+ Document doc;
+ NodeList elementList;
+ Element testNode;
+ boolean state;
+ doc = (Document) load("staffNS", false);
+ elementList = doc.getElementsByTagName("address");
+ testNode = (Element) elementList.item(0);
+ state = testNode.hasAttributeNS(namespaceURI, localName);
+ assertTrue("hasAttribute", state);
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level2/core/hasAttributeNS05";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(hasAttributeNS05.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level2/core/hasAttributes01.java b/dom/src/test/java/org/w3c/domts/level2/core/hasAttributes01.java
new file mode 100644
index 0000000..412e132
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level2/core/hasAttributes01.java
@@ -0,0 +1,89 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+
+Copyright (c) 2001 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+
+*/
+
+package org.w3c.domts.level2.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The "hasAttributes()" method for a node should
+ * return false if the node does not have an attribute.
+ * Retrieve the first "name" node and invoke the "hasAttributes()" method.
+ * The method should return false since the node does not have an attribute.
+* @author NIST
+* @author Mary Brady
+* @see <a href="http://www.w3.org/TR/DOM-Level-2-Core/core#ID-NodeHasAttrs">http://www.w3.org/TR/DOM-Level-2-Core/core#ID-NodeHasAttrs</a>
+*/
+public final class hasAttributes01 extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public hasAttributes01(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "staff", false);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ NodeList addrList;
+ Node addrNode;
+ boolean state;
+ doc = (Document) load("staff", false);
+ addrList = doc.getElementsByTagName("name");
+ addrNode = addrList.item(0);
+ state = addrNode.hasAttributes();
+ assertFalse("throw_False", state);
+}
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level2/core/hasAttributes01";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(hasAttributes01.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level2/core/hasAttributes02.java b/dom/src/test/java/org/w3c/domts/level2/core/hasAttributes02.java
new file mode 100644
index 0000000..8855e58
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level2/core/hasAttributes02.java
@@ -0,0 +1,89 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+
+Copyright (c) 2001 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+
+*/
+
+package org.w3c.domts.level2.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The "hasAttributes()" method for a node should
+ * return true if the node has attributes.
+ * Retrieve the first address node and the "hasAttributes()" method
+ * should return true since the node has "domestic" as an attribute.
+* @author NIST
+* @author Mary Brady
+* @see <a href="http://www.w3.org/TR/DOM-Level-2-Core/core#ID-NodeHasAttrs">http://www.w3.org/TR/DOM-Level-2-Core/core#ID-NodeHasAttrs</a>
+*/
+public final class hasAttributes02 extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public hasAttributes02(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "staff", false);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ NodeList addrList;
+ Node addrNode;
+ boolean state;
+ doc = (Document) load("staff", false);
+ addrList = doc.getElementsByTagName("address");
+ addrNode = addrList.item(0);
+ state = addrNode.hasAttributes();
+ assertTrue("throw_True", state);
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level2/core/hasAttributes02";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(hasAttributes02.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level2/core/hc_entitiesremovenameditemns1.java b/dom/src/test/java/org/w3c/domts/level2/core/hc_entitiesremovenameditemns1.java
new file mode 100644
index 0000000..c57698f
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level2/core/hc_entitiesremovenameditemns1.java
@@ -0,0 +1,104 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+Copyright (c) 2004 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+*/
+
+package org.w3c.domts.level2.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * An attempt to add remove an entity using removeNamedItemNS should result in
+ * a NO_MODIFICATION_ERR or a NOT_FOUND_ERR.
+* @author Curt Arnold
+* @see <a href="http://www.w3.org/TR/DOM-Level-2-Core/core#ID-1788794630">http://www.w3.org/TR/DOM-Level-2-Core/core#ID-1788794630</a>
+* @see <a href="http://www.w3.org/TR/DOM-Level-2-Core/core#ID-removeNamedItemNS">http://www.w3.org/TR/DOM-Level-2-Core/core#ID-removeNamedItemNS</a>
+*/
+public final class hc_entitiesremovenameditemns1 extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public hc_entitiesremovenameditemns1(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "hc_staff", true);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ NamedNodeMap entities;
+ DocumentType docType;
+ Node retval;
+ doc = (Document) load("hc_staff", true);
+ docType = doc.getDoctype();
+
+ if (
+ !(("text/html".equals(getContentType())))
+) {
+ assertNotNull("docTypeNotNull", docType);
+ entities = docType.getEntities();
+ assertNotNull("entitiesNotNull", entities);
+
+ try {
+ retval = entities.removeNamedItemNS("http://www.w3.org/1999/xhtml", "alpha");
+ fail("throw_NO_MOD_OR_NOT_FOUND_ERR");
+
+ } catch (DOMException ex) {
+ switch (ex.code) {
+ case 7 :
+ break;
+ case 8 :
+ break;
+ default:
+ throw ex;
+ }
+ }
+}
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level2/core/hc_entitiesremovenameditemns1";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(hc_entitiesremovenameditemns1.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level2/core/hc_entitiessetnameditemns1.java b/dom/src/test/java/org/w3c/domts/level2/core/hc_entitiessetnameditemns1.java
new file mode 100644
index 0000000..47f6fd5
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level2/core/hc_entitiessetnameditemns1.java
@@ -0,0 +1,106 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+Copyright (c) 2004 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+*/
+
+package org.w3c.domts.level2.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * An attempt to add an element to the named node map returned by entities should
+ * result in a NO_MODIFICATION_ERR or HIERARCHY_REQUEST_ERR.
+* @author Curt Arnold
+* @see <a href="http://www.w3.org/TR/DOM-Level-2-Core/core#ID-1788794630">http://www.w3.org/TR/DOM-Level-2-Core/core#ID-1788794630</a>
+* @see <a href="http://www.w3.org/TR/DOM-Level-2-Core/core#ID-setNamedItemNS">http://www.w3.org/TR/DOM-Level-2-Core/core#ID-setNamedItemNS</a>
+*/
+public final class hc_entitiessetnameditemns1 extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public hc_entitiessetnameditemns1(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "hc_staff", true);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ NamedNodeMap entities;
+ DocumentType docType;
+ Node retval;
+ Element elem;
+ doc = (Document) load("hc_staff", true);
+ docType = doc.getDoctype();
+
+ if (
+ !(("text/html".equals(getContentType())))
+) {
+ assertNotNull("docTypeNotNull", docType);
+ entities = docType.getEntities();
+ assertNotNull("entitiesNotNull", entities);
+ elem = doc.createElementNS("http://www.w3.org/1999/xhtml", "br");
+
+ try {
+ retval = entities.setNamedItemNS(elem);
+ fail("throw_HIER_OR_NO_MOD_ERR");
+
+ } catch (DOMException ex) {
+ switch (ex.code) {
+ case 3 :
+ break;
+ case 7 :
+ break;
+ default:
+ throw ex;
+ }
+ }
+}
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level2/core/hc_entitiessetnameditemns1";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(hc_entitiessetnameditemns1.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level2/core/hc_namednodemapinvalidtype1.java b/dom/src/test/java/org/w3c/domts/level2/core/hc_namednodemapinvalidtype1.java
new file mode 100644
index 0000000..f9ee1c5
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level2/core/hc_namednodemapinvalidtype1.java
@@ -0,0 +1,95 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+Copyright (c) 2001-2004 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+*/
+
+package org.w3c.domts.level2.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * Attempt to insert an element into an attribute list,
+ * should raise a HIERARCHY_REQUEST_ERR.
+* @author Curt Arnold
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-258A00AF')/constant[@name='HIERARCHY_REQUEST_ERR'])">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-258A00AF')/constant[@name='HIERARCHY_REQUEST_ERR'])</a>
+* @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-1025163788">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-1025163788</a>
+* @see <a href="http://www.w3.org/2000/11/DOM-Level-2-errata#core-4">http://www.w3.org/2000/11/DOM-Level-2-errata#core-4</a>
+*/
+public final class hc_namednodemapinvalidtype1 extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public hc_namednodemapinvalidtype1(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "hc_staff", true);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ NamedNodeMap attributes;
+ Element docElem;
+ Element newElem;
+ Node retval;
+ doc = (Document) load("hc_staff", true);
+ docElem = doc.getDocumentElement();
+ attributes = docElem.getAttributes();
+ newElem = doc.createElement("html");
+
+ {
+ boolean success = false;
+ try {
+ retval = attributes.setNamedItem(newElem);
+ } catch (DOMException ex) {
+ success = (ex.code == DOMException.HIERARCHY_REQUEST_ERR);
+ }
+ assertTrue("throw_HIERARCHY_REQUEST_ERR", success);
+ }
+}
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level2/core/hc_namednodemapinvalidtype1";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(hc_namednodemapinvalidtype1.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level2/core/hc_nodedocumentfragmentnormalize1.java b/dom/src/test/java/org/w3c/domts/level2/core/hc_nodedocumentfragmentnormalize1.java
new file mode 100644
index 0000000..e065a66
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level2/core/hc_nodedocumentfragmentnormalize1.java
@@ -0,0 +1,92 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+Copyright (c) 2004 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+*/
+
+package org.w3c.domts.level2.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * Create a document fragment with two adjacent text nodes, normalize and see if the text nodes
+ * were combined.
+* @author Curt Arnold
+* @see <a href="http://www.w3.org/TR/DOM-Level-2-Core/core#ID-F68D095">http://www.w3.org/TR/DOM-Level-2-Core/core#ID-F68D095</a>
+* @see <a href="http://www.w3.org/TR/DOM-Level-2-Core/core#ID-B63ED1A3">http://www.w3.org/TR/DOM-Level-2-Core/core#ID-B63ED1A3</a>
+*/
+public final class hc_nodedocumentfragmentnormalize1 extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public hc_nodedocumentfragmentnormalize1(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "hc_staff", true);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ DocumentFragment docFragment;
+ String nodeValue;
+ Text txtNode;
+ Node retval;
+ doc = (Document) load("hc_staff", true);
+ docFragment = doc.createDocumentFragment();
+ txtNode = doc.createTextNode("foo");
+ retval = docFragment.appendChild(txtNode);
+ txtNode = doc.createTextNode("bar");
+ retval = docFragment.appendChild(txtNode);
+ docFragment.normalize();
+ txtNode = (Text) docFragment.getFirstChild();
+ nodeValue = txtNode.getNodeValue();
+ assertEquals("normalizedNodeValue", "foobar", nodeValue);
+ retval = txtNode.getNextSibling();
+ assertNull("singleChild", retval);
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level2/core/hc_nodedocumentfragmentnormalize1";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(hc_nodedocumentfragmentnormalize1.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level2/core/hc_nodedocumentfragmentnormalize2.java b/dom/src/test/java/org/w3c/domts/level2/core/hc_nodedocumentfragmentnormalize2.java
new file mode 100644
index 0000000..bd8e976
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level2/core/hc_nodedocumentfragmentnormalize2.java
@@ -0,0 +1,87 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+Copyright (c) 2004 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+*/
+
+package org.w3c.domts.level2.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * Create a document fragment with an empty text node, after normalization there should be no child nodes.
+ * were combined.
+* @author Curt Arnold
+* @see <a href="http://www.w3.org/TR/DOM-Level-2-Core/core#ID-F68D095">http://www.w3.org/TR/DOM-Level-2-Core/core#ID-F68D095</a>
+* @see <a href="http://www.w3.org/TR/DOM-Level-2-Core/core#ID-B63ED1A3">http://www.w3.org/TR/DOM-Level-2-Core/core#ID-B63ED1A3</a>
+*/
+public final class hc_nodedocumentfragmentnormalize2 extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public hc_nodedocumentfragmentnormalize2(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "hc_staff", true);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ DocumentFragment docFragment;
+ String nodeValue;
+ Text txtNode;
+ Node retval;
+ doc = (Document) load("hc_staff", true);
+ docFragment = doc.createDocumentFragment();
+ txtNode = doc.createTextNode("");
+ retval = docFragment.appendChild(txtNode);
+ docFragment.normalize();
+ txtNode = (Text) docFragment.getFirstChild();
+ assertNull("noChild", txtNode);
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level2/core/hc_nodedocumentfragmentnormalize2";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(hc_nodedocumentfragmentnormalize2.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level2/core/hc_notationsremovenameditemns1.java b/dom/src/test/java/org/w3c/domts/level2/core/hc_notationsremovenameditemns1.java
new file mode 100644
index 0000000..724dcc5
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level2/core/hc_notationsremovenameditemns1.java
@@ -0,0 +1,104 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+Copyright (c) 2004 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+*/
+
+package org.w3c.domts.level2.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * An attempt to add remove an notation using removeNamedItemNS should result in
+ * a NO_MODIFICATION_ERR or a NOT_FOUND_ERR.
+* @author Curt Arnold
+* @see <a href="http://www.w3.org/TR/DOM-Level-2-Core/core#ID-D46829EF">http://www.w3.org/TR/DOM-Level-2-Core/core#ID-D46829EF</a>
+* @see <a href="http://www.w3.org/TR/DOM-Level-2-Core/core#ID-removeNamedItemNS">http://www.w3.org/TR/DOM-Level-2-Core/core#ID-removeNamedItemNS</a>
+*/
+public final class hc_notationsremovenameditemns1 extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public hc_notationsremovenameditemns1(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "hc_staff", true);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ NamedNodeMap notations;
+ DocumentType docType;
+ Node retval;
+ doc = (Document) load("hc_staff", true);
+ docType = doc.getDoctype();
+
+ if (
+ !(("text/html".equals(getContentType())))
+) {
+ assertNotNull("docTypeNotNull", docType);
+ notations = docType.getNotations();
+ assertNotNull("notationsNotNull", notations);
+
+ try {
+ retval = notations.removeNamedItemNS("http://www.w3.org/1999/xhtml", "alpha");
+ fail("throw_NO_MOD_OR_NOT_FOUND_ERR");
+
+ } catch (DOMException ex) {
+ switch (ex.code) {
+ case 7 :
+ break;
+ case 8 :
+ break;
+ default:
+ throw ex;
+ }
+ }
+}
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level2/core/hc_notationsremovenameditemns1";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(hc_notationsremovenameditemns1.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level2/core/hc_notationssetnameditemns1.java b/dom/src/test/java/org/w3c/domts/level2/core/hc_notationssetnameditemns1.java
new file mode 100644
index 0000000..65a13f6
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level2/core/hc_notationssetnameditemns1.java
@@ -0,0 +1,106 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+Copyright (c) 2004 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+*/
+
+package org.w3c.domts.level2.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * An attempt to add an element to the named node map returned by notations should
+ * result in a NO_MODIFICATION_ERR or HIERARCHY_REQUEST_ERR.
+* @author Curt Arnold
+* @see <a href="http://www.w3.org/TR/DOM-Level-2-Core/core#ID-D46829EF">http://www.w3.org/TR/DOM-Level-2-Core/core#ID-D46829EF</a>
+* @see <a href="http://www.w3.org/TR/DOM-Level-2-Core/core#ID-setNamedItemNS">http://www.w3.org/TR/DOM-Level-2-Core/core#ID-setNamedItemNS</a>
+*/
+public final class hc_notationssetnameditemns1 extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public hc_notationssetnameditemns1(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "hc_staff", true);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ NamedNodeMap notations;
+ DocumentType docType;
+ Node retval;
+ Element elem;
+ doc = (Document) load("hc_staff", true);
+ docType = doc.getDoctype();
+
+ if (
+ !(("text/html".equals(getContentType())))
+) {
+ assertNotNull("docTypeNotNull", docType);
+ notations = docType.getNotations();
+ assertNotNull("notationsNotNull", notations);
+ elem = doc.createElementNS("http://www.w3.org/1999/xhtml", "br");
+
+ try {
+ retval = notations.setNamedItemNS(elem);
+ fail("throw_HIER_OR_NO_MOD_ERR");
+
+ } catch (DOMException ex) {
+ switch (ex.code) {
+ case 3 :
+ break;
+ case 7 :
+ break;
+ default:
+ throw ex;
+ }
+ }
+}
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level2/core/hc_notationssetnameditemns1";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(hc_notationssetnameditemns1.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level2/core/importNode01.java b/dom/src/test/java/org/w3c/domts/level2/core/importNode01.java
new file mode 100644
index 0000000..98f83f7
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level2/core/importNode01.java
@@ -0,0 +1,132 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+
+Copyright (c) 2001 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+
+*/
+
+package org.w3c.domts.level2.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The "importNode(importedNode,deep)" method for a
+ * Document should import the given importedNode into that Document.
+ * The importedNode is of type Attr.
+ * The ownerElement is set to null. Specified flag is set to true.
+ * Children is imported.
+ *
+ * Create a new attribute whose name is "elem:attr1" in a different document.
+ * Create a child Text node with value "importedText" for the attribute node above.
+ * Invoke method importNode(importedNode,deep) on this document with
+ * importedNode being the newly created attribute.
+ * Method should return a node whose name matches "elem:attr1" and a child node
+ * whose value equals "importedText".
+ * The returned node should belong to this document whose systemId is "staff.dtd"
+* @author NIST
+* @author Mary Brady
+* @see <a href="http://www.w3.org/TR/DOM-Level-2-Core/core#Core-Document-importNode">http://www.w3.org/TR/DOM-Level-2-Core/core#Core-Document-importNode</a>
+*/
+public final class importNode01 extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public importNode01(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "staffNS", true);
+ preload(contentType, "staffNS", true);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ Document aNewDoc;
+ Attr newAttr;
+ Text importedChild;
+ Node aNode;
+ Document ownerDocument;
+ Element attrOwnerElement;
+ DocumentType docType;
+ String system;
+ boolean specified;
+ NodeList childList;
+ String nodeName;
+ Node child;
+ String childValue;
+ java.util.List result = new java.util.ArrayList();
+
+ java.util.List expectedResult = new java.util.ArrayList();
+ expectedResult.add("elem:attr1");
+ expectedResult.add("importedText");
+
+ doc = (Document) load("staffNS", true);
+ aNewDoc = (Document) load("staffNS", true);
+ newAttr = aNewDoc.createAttribute("elem:attr1");
+ importedChild = aNewDoc.createTextNode("importedText");
+ aNode = newAttr.appendChild(importedChild);
+ aNode = doc.importNode(newAttr, false);
+ ownerDocument = aNode.getOwnerDocument();
+ docType = ownerDocument.getDoctype();
+ system = docType.getSystemId();
+ assertNotNull("aNode", aNode);
+ assertURIEquals("systemId", null, null, null, "staffNS.dtd", null, null, null, null, system);
+attrOwnerElement = ((Attr) /*Node */aNode).getOwnerElement();
+ assertNull("ownerElement", attrOwnerElement);
+ specified = ((Attr) /*Node */aNode).getSpecified();
+ assertTrue("specified", specified);
+ childList = aNode.getChildNodes();
+ assertSize("childList", 1, childList);
+ nodeName = aNode.getNodeName();
+ assertEquals("nodeName", "elem:attr1", nodeName);
+ child = aNode.getFirstChild();
+ childValue = child.getNodeValue();
+ assertEquals("childValue", "importedText", childValue);
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level2/core/importNode01";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(importNode01.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level2/core/importNode02.java b/dom/src/test/java/org/w3c/domts/level2/core/importNode02.java
new file mode 100644
index 0000000..dc01805
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level2/core/importNode02.java
@@ -0,0 +1,104 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+
+Copyright (c) 2001-2004 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+
+*/
+
+package org.w3c.domts.level2.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The "importNode(importedNode,deep)" method for a
+ * Document should import the given importedNode into that Document.
+ * The importedNode is of type CData_Section.
+ *
+ * Create a CDATASection node with value being the string "this is CDATASection data" in
+ * a different document. Invoke method importNode(importedNode,deep) on
+ * this document. Method should return a CDATASection node whose value matches
+ * the above string. The returned node should belong to this document whose systemId is "staff.dtd"
+* @author NIST
+* @author Mary Brady
+* @see <a href="http://www.w3.org/TR/DOM-Level-2-Core/core#Core-Document-importNode">http://www.w3.org/TR/DOM-Level-2-Core/core#Core-Document-importNode</a>
+*/
+public final class importNode02 extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public importNode02(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "staffNS", true);
+ preload(contentType, "staffNS", true);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ Document aNewDoc;
+ CDATASection cDataSec;
+ Node aNode;
+ Document ownerDocument;
+ DocumentType docType;
+ String system;
+ String value;
+ doc = (Document) load("staffNS", true);
+ aNewDoc = (Document) load("staffNS", true);
+ cDataSec = aNewDoc.createCDATASection("this is CDATASection data");
+ aNode = doc.importNode(cDataSec, false);
+ ownerDocument = aNode.getOwnerDocument();
+ assertNotNull("ownerDocumentNotNull", ownerDocument);
+ docType = ownerDocument.getDoctype();
+ system = docType.getSystemId();
+ assertURIEquals("dtdSystemId", null, null, null, "staffNS.dtd", null, null, null, null, system);
+value = aNode.getNodeValue();
+ assertEquals("nodeValue", "this is CDATASection data", value);
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level2/core/importNode02";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(importNode02.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level2/core/importNode03.java b/dom/src/test/java/org/w3c/domts/level2/core/importNode03.java
new file mode 100644
index 0000000..0a4eebe
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level2/core/importNode03.java
@@ -0,0 +1,105 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+
+Copyright (c) 2001-2004 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+
+*/
+
+package org.w3c.domts.level2.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The "importNode(importedNode,deep)" method for a
+ * Document should import the given importedNode into that Document.
+ * The importedNode is of type Comment.
+ *
+ * Create a comment node with value being the string "this is a comment" in
+ * a different document. Invoke method importNode(importedNode,deep) on
+ * this document. Method should return a comment node whose value matches
+ * the above string. The returned node should belong to this document whose
+ * systemId is "staff.dtd"
+* @author NIST
+* @author Mary Brady
+* @see <a href="http://www.w3.org/TR/DOM-Level-2-Core/core#Core-Document-importNode">http://www.w3.org/TR/DOM-Level-2-Core/core#Core-Document-importNode</a>
+*/
+public final class importNode03 extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public importNode03(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "staffNS", true);
+ preload(contentType, "staffNS", true);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ Document aNewDoc;
+ Comment comment;
+ Node aNode;
+ Document ownerDocument;
+ DocumentType docType;
+ String system;
+ String value;
+ doc = (Document) load("staffNS", true);
+ aNewDoc = (Document) load("staffNS", true);
+ comment = aNewDoc.createComment("this is a comment");
+ aNode = doc.importNode(comment, false);
+ ownerDocument = aNode.getOwnerDocument();
+ assertNotNull("ownerDocumentNotNull", ownerDocument);
+ docType = ownerDocument.getDoctype();
+ system = docType.getSystemId();
+ assertURIEquals("systemId", null, null, null, "staffNS.dtd", null, null, null, null, system);
+value = aNode.getNodeValue();
+ assertEquals("nodeValue", "this is a comment", value);
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level2/core/importNode03";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(importNode03.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level2/core/importNode04.java b/dom/src/test/java/org/w3c/domts/level2/core/importNode04.java
new file mode 100644
index 0000000..7723e43
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level2/core/importNode04.java
@@ -0,0 +1,106 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+
+Copyright (c) 2001 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+
+*/
+
+package org.w3c.domts.level2.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The "importNode(importedNode,deep)" method for a
+ * Document should import the given importedNode into that Document.
+ * The importedNode is of type Document_Fragment.
+ *
+ * Create a DocumentFragment in a different document.
+ * Create a Comment child node for the Document Fragment.
+ * Invoke method importNode(importedNode,deep) on this document
+ * with importedNode being the newly created DocumentFragment.
+ * Method should return a node of type DocumentFragment whose child has
+ * comment value "descendant1".
+* @author NIST
+* @author Mary Brady
+* @see <a href="http://www.w3.org/TR/DOM-Level-2-Core/core#Core-Document-importNode">http://www.w3.org/TR/DOM-Level-2-Core/core#Core-Document-importNode</a>
+*/
+public final class importNode04 extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public importNode04(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "staff", true);
+ preload(contentType, "staff", true);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ Document aNewDoc;
+ DocumentFragment docFrag;
+ Comment comment;
+ Node aNode;
+ NodeList children;
+ Node child;
+ String childValue;
+ doc = (Document) load("staff", true);
+ aNewDoc = (Document) load("staff", true);
+ docFrag = aNewDoc.createDocumentFragment();
+ comment = aNewDoc.createComment("descendant1");
+ aNode = docFrag.appendChild(comment);
+ aNode = doc.importNode(docFrag, true);
+ children = aNode.getChildNodes();
+ assertSize("throw_Size", 1, children);
+ child = aNode.getFirstChild();
+ childValue = child.getNodeValue();
+ assertEquals("descendant1", "descendant1", childValue);
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level2/core/importNode04";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(importNode04.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level2/core/importNode05.java b/dom/src/test/java/org/w3c/domts/level2/core/importNode05.java
new file mode 100644
index 0000000..cecaf22
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level2/core/importNode05.java
@@ -0,0 +1,111 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+
+Copyright (c) 2001 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+
+*/
+
+package org.w3c.domts.level2.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The "importNode(importedNode,deep)" method for a
+ * Document should import the given importedNode into that Document.
+ * The importedNode is of type Element.
+ *
+ * Retrieve element "emp:address" from staffNS.xml document.
+ * Invoke method importNode(importedNode,deep) on this document
+ * with importedNode being the element from above and deep is false.
+ * Method should return an element node whose name matches "emp:address"
+ * and whose children are not imported. The returned node should
+ * belong to this document whose systemId is "staff.dtd"
+* @author NIST
+* @author Mary Brady
+* @see <a href="http://www.w3.org/TR/DOM-Level-2-Core/core#Core-Document-importNode">http://www.w3.org/TR/DOM-Level-2-Core/core#Core-Document-importNode</a>
+*/
+public final class importNode05 extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public importNode05(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "staffNS", true);
+ preload(contentType, "staffNS", true);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ Document aNewDoc;
+ Element element;
+ Node aNode;
+ boolean hasChild;
+ Document ownerDocument;
+ DocumentType docType;
+ String system;
+ String name;
+ NodeList addresses;
+ doc = (Document) load("staffNS", true);
+ aNewDoc = (Document) load("staffNS", true);
+ addresses = aNewDoc.getElementsByTagName("emp:address");
+ element = (Element) addresses.item(0);
+ assertNotNull("empAddressNotNull", element);
+ aNode = doc.importNode(element, false);
+ hasChild = aNode.hasChildNodes();
+ assertFalse("hasChild", hasChild);
+ownerDocument = aNode.getOwnerDocument();
+ docType = ownerDocument.getDoctype();
+ system = docType.getSystemId();
+ assertURIEquals("dtdSystemId", null, null, null, "staffNS.dtd", null, null, null, null, system);
+name = aNode.getNodeName();
+ assertEquals("nodeName", "emp:address", name);
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level2/core/importNode05";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(importNode05.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level2/core/importNode06.java b/dom/src/test/java/org/w3c/domts/level2/core/importNode06.java
new file mode 100644
index 0000000..0e91eb5
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level2/core/importNode06.java
@@ -0,0 +1,108 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+
+Copyright (c) 2001 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+
+*/
+
+package org.w3c.domts.level2.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The "importNode(importedNode,deep)" method for a
+ * Document should import the given importedNode into that Document.
+ * The importedNode is of type Element.
+ *
+ * Retrieve element "emp:address" from staffNS.xml document.
+ * Invoke method importNode(importedNode,deep) on this document
+ * with importedNode being the element from above and deep is true.
+ * Method should return an element node whose name matches "emp:address" and
+ * whose descendant is imported.
+* @author NIST
+* @author Mary Brady
+* @see <a href="http://www.w3.org/TR/DOM-Level-2-Core/core#Core-Document-importNode">http://www.w3.org/TR/DOM-Level-2-Core/core#Core-Document-importNode</a>
+*/
+public final class importNode06 extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public importNode06(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "staffNS", true);
+ preload(contentType, "staffNS", true);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ Document aNewDoc;
+ Element element;
+ Node aNode;
+ boolean hasChild;
+ String name;
+ Node child;
+ String value;
+ NodeList addresses;
+ doc = (Document) load("staffNS", true);
+ aNewDoc = (Document) load("staffNS", true);
+ addresses = aNewDoc.getElementsByTagName("emp:address");
+ element = (Element) addresses.item(0);
+ assertNotNull("empAddressNotNull", element);
+ aNode = doc.importNode(element, true);
+ hasChild = aNode.hasChildNodes();
+ assertTrue("throw_True", hasChild);
+ name = aNode.getNodeName();
+ assertEquals("nodeName", "emp:address", name);
+ child = aNode.getFirstChild();
+ value = child.getNodeValue();
+ assertEquals("nodeValue", "27 South Road. Dallas, texas 98556", value);
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level2/core/importNode06";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(importNode06.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level2/core/importNode07.java b/dom/src/test/java/org/w3c/domts/level2/core/importNode07.java
new file mode 100644
index 0000000..199d1a8
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level2/core/importNode07.java
@@ -0,0 +1,116 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+
+Copyright (c) 2001-2003 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+
+*/
+
+package org.w3c.domts.level2.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The "importNode(importedNode,deep)" method for a
+ * Document should import the given importedNode into that Document.
+ * The importedNode is of type Element.
+ * If this document defines default attributes for this element name (importedNode),
+ * those default attributes are assigned.
+ *
+ * Create an element whose name is "emp:employee" in a different document.
+ * Invoke method importNode(importedNode,deep) on this document which
+ * defines default attribute for the element name "emp:employee".
+ * Method should return an the imported element with an assigned default attribute.
+* @author NIST
+* @author Mary Brady
+* @see <a href="http://www.w3.org/TR/DOM-Level-2-Core/core#Core-Document-importNode">http://www.w3.org/TR/DOM-Level-2-Core/core#Core-Document-importNode</a>
+* @see <a href="http://www.w3.org/Bugs/Public/show_bug.cgi?id=238">http://www.w3.org/Bugs/Public/show_bug.cgi?id=238</a>
+*/
+public final class importNode07 extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public importNode07(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+
+ org.w3c.domts.DocumentBuilderSetting[] settings =
+ new org.w3c.domts.DocumentBuilderSetting[] {
+org.w3c.domts.DocumentBuilderSetting.namespaceAware,
+org.w3c.domts.DocumentBuilderSetting.validating
+ };
+ DOMTestDocumentBuilderFactory testFactory = factory.newInstance(settings);
+ setFactory(testFactory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "staffNS", true);
+ preload(contentType, "staff", true);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ Document aNewDoc;
+ Element element;
+ Node aNode;
+ NamedNodeMap attributes;
+ String name;
+ Node attr;
+ String lname;
+ String namespaceURI = "http://www.nist.gov";
+ String qualifiedName = "emp:employee";
+ doc = (Document) load("staffNS", true);
+ aNewDoc = (Document) load("staff", true);
+ element = aNewDoc.createElementNS(namespaceURI, qualifiedName);
+ aNode = doc.importNode(element, false);
+ attributes = aNode.getAttributes();
+ assertSize("throw_Size", 1, attributes);
+ name = aNode.getNodeName();
+ assertEquals("nodeName", "emp:employee", name);
+ attr = attributes.item(0);
+ lname = attr.getLocalName();
+ assertEquals("lname", "defaultAttr", lname);
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level2/core/importNode07";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(importNode07.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level2/core/importNode08.java b/dom/src/test/java/org/w3c/domts/level2/core/importNode08.java
new file mode 100644
index 0000000..df8f0ce
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level2/core/importNode08.java
@@ -0,0 +1,105 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+
+Copyright (c) 2001 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+
+*/
+
+package org.w3c.domts.level2.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The "importNode(importedNode,deep)" method for a
+ * Document should import the given importedNode into that Document.
+ * The importedNode is of type Document_Fragment.
+ *
+ * Create a DocumentFragment in a different document.
+ * Invoke method importNode(importedNode,deep) on this document
+ * with importedNode being the newly created DocumentFragment.
+ * Method should return an empty DocumentFragment that belongs
+ * to this document whose systemId is "staff.dtd"
+* @author NIST
+* @author Mary Brady
+* @see <a href="http://www.w3.org/TR/DOM-Level-2-Core/core#Core-Document-importNode">http://www.w3.org/TR/DOM-Level-2-Core/core#Core-Document-importNode</a>
+* @see <a href="http://www.w3.org/TR/DOM-Level-2-Core/core#ID-Core-DocType-systemId">http://www.w3.org/TR/DOM-Level-2-Core/core#ID-Core-DocType-systemId</a>
+*/
+public final class importNode08 extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public importNode08(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "staffNS", true);
+ preload(contentType, "staffNS", true);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ Document aNewDoc;
+ DocumentFragment docFrag;
+ Node aNode;
+ boolean hasChild;
+ Document ownerDocument;
+ DocumentType docType;
+ String system;
+ doc = (Document) load("staffNS", true);
+ aNewDoc = (Document) load("staffNS", true);
+ docFrag = aNewDoc.createDocumentFragment();
+ aNode = doc.importNode(docFrag, false);
+ hasChild = aNode.hasChildNodes();
+ assertFalse("hasChild", hasChild);
+ownerDocument = aNode.getOwnerDocument();
+ docType = ownerDocument.getDoctype();
+ system = docType.getSystemId();
+ assertURIEquals("system", null, null, null, "staffNS.dtd", null, null, null, null, system);
+}
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level2/core/importNode08";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(importNode08.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level2/core/importNode09.java b/dom/src/test/java/org/w3c/domts/level2/core/importNode09.java
new file mode 100644
index 0000000..0186cee
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level2/core/importNode09.java
@@ -0,0 +1,117 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+
+Copyright (c) 2001-2004 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+
+*/
+
+package org.w3c.domts.level2.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The "importNode(importedNode,deep)" method for a
+ * Document should import the given importedNode into that Document.
+ * The importedNode is of type Entity.
+ *
+ * Retrieve entity "ent6" from staffNS.xml document.
+ * Invoke method importNode(importedNode,deep) on this document.
+ * Method should return a node of type Entity whose publicId, systemId and
+ * notationName attributes are copied.
+ * The returned node should belong to this document whose systemId is "staff.dtd"
+* @author NIST
+* @author Mary Brady
+* @see <a href="http://www.w3.org/TR/DOM-Level-2-Core/core#Core-Document-importNode">http://www.w3.org/TR/DOM-Level-2-Core/core#Core-Document-importNode</a>
+*/
+public final class importNode09 extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public importNode09(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "staffNS", true);
+ preload(contentType, "staffNS", true);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ Document aNewDoc;
+ DocumentType doc1Type;
+ NamedNodeMap entityList;
+ Entity entity2;
+ Entity entity1;
+ Document ownerDocument;
+ DocumentType docType;
+ String system;
+ String entityName;
+ String publicVal;
+ String notationName;
+ doc = (Document) load("staffNS", true);
+ aNewDoc = (Document) load("staffNS", true);
+ docType = aNewDoc.getDoctype();
+ entityList = docType.getEntities();
+ assertNotNull("entitiesNotNull", entityList);
+ entity2 = (Entity) entityList.getNamedItem("ent6");
+ entity1 = (Entity) doc.importNode(entity2, false);
+ ownerDocument = entity1.getOwnerDocument();
+ docType = ownerDocument.getDoctype();
+ system = docType.getSystemId();
+ assertURIEquals("dtdSystemId", null, null, null, "staffNS.dtd", null, null, null, null, system);
+entityName = entity1.getNodeName();
+ assertEquals("entityName", "ent6", entityName);
+ publicVal = entity1.getPublicId();
+ assertEquals("entityPublicId", "uri", publicVal);
+ system = entity1.getSystemId();
+ assertURIEquals("entitySystemId", null, null, null, "file", null, null, null, null, system);
+notationName = entity1.getNotationName();
+ assertEquals("notationName", "notation2", notationName);
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level2/core/importNode09";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(importNode09.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level2/core/importNode10.java b/dom/src/test/java/org/w3c/domts/level2/core/importNode10.java
new file mode 100644
index 0000000..3395506
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level2/core/importNode10.java
@@ -0,0 +1,108 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+
+Copyright (c) 2001-2004 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+
+*/
+
+package org.w3c.domts.level2.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The "importNode(importedNode,deep)" method for a
+ * Document should import the given importedNode into that Document.
+ * The importedNode is of type Entity_Reference.
+ * Only the EntityReference is copied, regardless of deep's value.
+ *
+ * Create an entity reference whose name is "entRef1" in a different document.
+ * Give it value "entRef1Value".
+ * Invoke method importNode(importedNode,deep) on this document with importedNode
+ * being "entRef1".
+ * Method should return a node of type Entity_Reference (whose value is null) that
+ * belongs to this document whose systemId is "staff.dtd".
+* @author NIST
+* @author Mary Brady
+* @see <a href="http://www.w3.org/TR/DOM-Level-2-Core/core#Core-Document-importNode">http://www.w3.org/TR/DOM-Level-2-Core/core#Core-Document-importNode</a>
+*/
+public final class importNode10 extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public importNode10(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "staffNS", true);
+ preload(contentType, "staffNS", true);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ Document aNewDoc;
+ EntityReference entRef;
+ Node aNode;
+ Document ownerDocument;
+ DocumentType docType;
+ String system;
+ String name;
+ doc = (Document) load("staffNS", true);
+ aNewDoc = (Document) load("staffNS", true);
+ entRef = aNewDoc.createEntityReference("entRef1");
+ assertNotNull("createdEntRefNotNull", entRef);
+ entRef.setNodeValue("entRef1Value");
+ aNode = doc.importNode(entRef, false);
+ ownerDocument = aNode.getOwnerDocument();
+ docType = ownerDocument.getDoctype();
+ system = docType.getSystemId();
+ assertURIEquals("systemId", null, null, null, "staffNS.dtd", null, null, null, null, system);
+name = aNode.getNodeName();
+ assertEquals("nodeName", "entRef1", name);
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level2/core/importNode10";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(importNode10.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level2/core/importNode11.java b/dom/src/test/java/org/w3c/domts/level2/core/importNode11.java
new file mode 100644
index 0000000..ae016c6
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level2/core/importNode11.java
@@ -0,0 +1,106 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+
+Copyright (c) 2001-2004 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+
+*/
+
+package org.w3c.domts.level2.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The "importNode(importedNode,deep)" method for a
+ * Document should import the given importedNode into that Document.
+ * The importedNode is of type Entity_Reference.
+ * Only the EntityReference is copied, regardless of deep's value.
+ * If the Document provides a definition for the entity name, its value is assigned.
+ *
+ * Create an entity reference whose name is "ent3" in a different document.
+ * Invoke method importNode(importedNode,deep) on this document with importedNode
+ * being "ent3".
+ * Method should return a node of type Entity_Reference whose first child's value is "Texas" as defined
+ * in this document.
+* @author NIST
+* @author Mary Brady
+* @see <a href="http://www.w3.org/TR/DOM-Level-2-Core/core#Core-Document-importNode">http://www.w3.org/TR/DOM-Level-2-Core/core#Core-Document-importNode</a>
+*/
+public final class importNode11 extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public importNode11(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "staff", true);
+ preload(contentType, "staff", true);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ Document aNewDoc;
+ EntityReference entRef;
+ Node aNode;
+ String name;
+ Node child;
+ String childValue;
+ doc = (Document) load("staff", true);
+ aNewDoc = (Document) load("staff", true);
+ entRef = aNewDoc.createEntityReference("ent3");
+ assertNotNull("createdEntRefNotNull", entRef);
+ aNode = doc.importNode(entRef, true);
+ name = aNode.getNodeName();
+ assertEquals("entityName", "ent3", name);
+ child = aNode.getFirstChild();
+ assertNotNull("child", child);
+ childValue = child.getNodeValue();
+ assertEquals("childValue", "Texas", childValue);
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level2/core/importNode11";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(importNode11.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level2/core/importNode12.java b/dom/src/test/java/org/w3c/domts/level2/core/importNode12.java
new file mode 100644
index 0000000..471c586
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level2/core/importNode12.java
@@ -0,0 +1,114 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+
+Copyright (c) 2001-2004 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+
+*/
+
+package org.w3c.domts.level2.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The "importNode(importedNode,deep)" method for a
+ * Document should import the given importedNode into that Document.
+ * The importedNode is of type Entity.
+ *
+ * Retrieve entity "ent4" from staffNS.xml document.
+ * Invoke method importNode(importedNode,deep) on this document with deep as false.
+ * Method should return a node of type Entity whose descendant is copied.
+ * The returned node should belong to this document whose systemId is "staffNS.dtd"
+* @author NIST
+* @author Mary Brady
+* @see <a href="http://www.w3.org/TR/DOM-Level-2-Core/core#Core-Document-importNode">http://www.w3.org/TR/DOM-Level-2-Core/core#Core-Document-importNode</a>
+*/
+public final class importNode12 extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public importNode12(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "staffNS", true);
+ preload(contentType, "staffNS", true);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ Document aNewDoc;
+ DocumentType doc1Type;
+ NamedNodeMap entityList;
+ Entity entity2;
+ Entity entity1;
+ Document ownerDocument;
+ DocumentType docType;
+ String system;
+ String entityName;
+ Node child;
+ String childName;
+ doc = (Document) load("staffNS", true);
+ aNewDoc = (Document) load("staffNS", true);
+ doc1Type = aNewDoc.getDoctype();
+ entityList = doc1Type.getEntities();
+ assertNotNull("entitiesNotNull", entityList);
+ entity2 = (Entity) entityList.getNamedItem("ent4");
+ entity1 = (Entity) doc.importNode(entity2, true);
+ ownerDocument = entity1.getOwnerDocument();
+ docType = ownerDocument.getDoctype();
+ system = docType.getSystemId();
+ assertURIEquals("systemId", null, null, null, "staffNS.dtd", null, null, null, null, system);
+entityName = entity1.getNodeName();
+ assertEquals("entityName", "ent4", entityName);
+ child = entity1.getFirstChild();
+ assertNotNull("notnull", child);
+ childName = child.getNodeName();
+ assertEquals("childName", "entElement1", childName);
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level2/core/importNode12";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(importNode12.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level2/core/importNode13.java b/dom/src/test/java/org/w3c/domts/level2/core/importNode13.java
new file mode 100644
index 0000000..265e6b0
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level2/core/importNode13.java
@@ -0,0 +1,111 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+
+Copyright (c) 2001-2004 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+
+*/
+
+package org.w3c.domts.level2.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The "importNode(importedNode,deep)" method for a
+ * Document should import the given importedNode into that Document.
+ * The importedNode is of type Notation.
+ *
+ * Retrieve notation named "notation1" from document staffNS.xml.
+ * Invoke method importNode(importedNode,deep) where importedNode
+ * contains the retrieved notation and deep is false. Method should
+ * return a node of type notation whose name is "notation1".
+ * The returned node should belong to this document whose systemId is "staff.dtd"
+* @author NIST
+* @author Mary Brady
+* @see <a href="http://www.w3.org/TR/DOM-Level-2-Core/core#Core-Document-importNode">http://www.w3.org/TR/DOM-Level-2-Core/core#Core-Document-importNode</a>
+*/
+public final class importNode13 extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public importNode13(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "staffNS", true);
+ preload(contentType, "staffNS", true);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ Document aNewDoc;
+ DocumentType doc1Type;
+ NamedNodeMap notationList;
+ Notation notation;
+ Notation aNode;
+ Document ownerDocument;
+ DocumentType docType;
+ String system;
+ String publicVal;
+ doc = (Document) load("staffNS", true);
+ aNewDoc = (Document) load("staffNS", true);
+ doc1Type = aNewDoc.getDoctype();
+ notationList = doc1Type.getNotations();
+ assertNotNull("notationsNotNull", notationList);
+ notation = (Notation) notationList.getNamedItem("notation1");
+ aNode = (Notation) doc.importNode(notation, false);
+ ownerDocument = aNode.getOwnerDocument();
+ docType = ownerDocument.getDoctype();
+ system = docType.getSystemId();
+ assertURIEquals("systemId", null, null, null, "staffNS.dtd", null, null, null, null, system);
+publicVal = aNode.getPublicId();
+ assertEquals("publicId", "notation1File", publicVal);
+ system = aNode.getSystemId();
+ assertNull("notationSystemId", system);
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level2/core/importNode13";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(importNode13.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level2/core/importNode14.java b/dom/src/test/java/org/w3c/domts/level2/core/importNode14.java
new file mode 100644
index 0000000..df77886
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level2/core/importNode14.java
@@ -0,0 +1,109 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+
+Copyright (c) 2001-2004 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+
+*/
+
+package org.w3c.domts.level2.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The "importNode(importedNode,deep)" method for a
+ * Document should import the given importedNode into that Document.
+ * The importedNode is of type Processing Instruction.
+ *
+ * Create a processing instruction with target as "target1" and data as "data1"
+ * in a different document. Invoke method importNode(importedNode,deep) on this document.
+ * Method should return a processing instruction whose target and data match the given
+ * parameters. The returned PI should belong to this document whose systemId is "staff.dtd".
+* @author NIST
+* @author Mary Brady
+* @see <a href="http://www.w3.org/TR/DOM-Level-2-Core/core#Core-Document-importNode">http://www.w3.org/TR/DOM-Level-2-Core/core#Core-Document-importNode</a>
+*/
+public final class importNode14 extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public importNode14(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "staffNS", true);
+ preload(contentType, "staffNS", true);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ Document aNewDoc;
+ ProcessingInstruction pi;
+ ProcessingInstruction aNode;
+ Document ownerDocument;
+ DocumentType docType;
+ String system;
+ String target;
+ String data;
+ java.util.List result = new java.util.ArrayList();
+
+ doc = (Document) load("staffNS", true);
+ aNewDoc = (Document) load("staffNS", true);
+ pi = aNewDoc.createProcessingInstruction("target1", "data1");
+ aNode = (ProcessingInstruction) doc.importNode(pi, false);
+ ownerDocument = aNode.getOwnerDocument();
+ assertNotNull("ownerDocumentNotNull", ownerDocument);
+ docType = ownerDocument.getDoctype();
+ system = docType.getSystemId();
+ assertURIEquals("systemId", null, null, null, "staffNS.dtd", null, null, null, null, system);
+target = aNode.getTarget();
+ assertEquals("piTarget", "target1", target);
+ data = aNode.getData();
+ assertEquals("piData", "data1", data);
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level2/core/importNode14";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(importNode14.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level2/core/importNode15.java b/dom/src/test/java/org/w3c/domts/level2/core/importNode15.java
new file mode 100644
index 0000000..e0d2b86
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level2/core/importNode15.java
@@ -0,0 +1,105 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+
+Copyright (c) 2001-2004 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+
+*/
+
+package org.w3c.domts.level2.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The "importNode(importedNode,deep)" method for a
+ * Document should import the given importedNode into that Document.
+ * The importedNode is of type Text.
+ *
+ * Create a text node with value being the string "this is text data" in
+ * a different document. Invoke method importNode(importedNode,deep) on
+ * this document. Method should return a text node whose value matches
+ * the above string. The returned node should belong to this document
+ * whose systemId is "staff.dtd"
+* @author NIST
+* @author Mary Brady
+* @see <a href="http://www.w3.org/TR/DOM-Level-2-Core/core#Core-Document-importNode">http://www.w3.org/TR/DOM-Level-2-Core/core#Core-Document-importNode</a>
+*/
+public final class importNode15 extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public importNode15(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "staffNS", true);
+ preload(contentType, "staffNS", true);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ Document aNewDoc;
+ Text text;
+ Node aNode;
+ Document ownerDocument;
+ DocumentType docType;
+ String system;
+ String value;
+ doc = (Document) load("staffNS", true);
+ aNewDoc = (Document) load("staffNS", true);
+ text = aNewDoc.createTextNode("this is text data");
+ aNode = doc.importNode(text, false);
+ ownerDocument = aNode.getOwnerDocument();
+ assertNotNull("ownerDocumentNotNull", ownerDocument);
+ docType = ownerDocument.getDoctype();
+ system = docType.getSystemId();
+ assertURIEquals("systemId", null, null, null, "staffNS.dtd", null, null, null, null, system);
+value = aNode.getNodeValue();
+ assertEquals("nodeValue", "this is text data", value);
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level2/core/importNode15";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(importNode15.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level2/core/importNode16.java b/dom/src/test/java/org/w3c/domts/level2/core/importNode16.java
new file mode 100644
index 0000000..0901d95
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level2/core/importNode16.java
@@ -0,0 +1,104 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+
+Copyright (c) 2001 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+
+*/
+
+package org.w3c.domts.level2.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The "importNode(importedNode,deep)" method for a
+ * Document should raise NOT_SUPPORTED_ERR DOMException if
+ * the type of node being imported is DocumentType.
+ *
+ * Retrieve document staff.xml and get its type.
+ * Invoke method importNode(importedNode,deep) where importedNode
+ * contains the document type of the staff.xml.
+ * Method should raise NOT_SUPPORT_ERR DOMException.
+* @author NIST
+* @author Mary Brady
+* @see <a href="http://www.w3.org/TR/DOM-Level-2-Core/core#xpointer(id('ID-258A00AF')/constant[@name='NOT_SUPPORTED_ERR'])">http://www.w3.org/TR/DOM-Level-2-Core/core#xpointer(id('ID-258A00AF')/constant[@name='NOT_SUPPORTED_ERR'])</a>
+* @see <a href="http://www.w3.org/TR/DOM-Level-2-Core/core#Core-Document-importNode">http://www.w3.org/TR/DOM-Level-2-Core/core#Core-Document-importNode</a>
+* @see <a href="http://www.w3.org/TR/DOM-Level-2-Core/core#xpointer(id('Core-Document-importNode')/raises/exception[@name='DOMException']/descr/p[substring-before(.,':')='NOT_SUPPORTED_ERR'])">http://www.w3.org/TR/DOM-Level-2-Core/core#xpointer(id('Core-Document-importNode')/raises/exception[@name='DOMException']/descr/p[substring-before(.,':')='NOT_SUPPORTED_ERR'])</a>
+*/
+public final class importNode16 extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public importNode16(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "staffNS", true);
+ preload(contentType, "staffNS", true);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ Document anotherDoc;
+ DocumentType docType;
+ Node node;
+ doc = (Document) load("staffNS", true);
+ anotherDoc = (Document) load("staffNS", true);
+ docType = anotherDoc.getDoctype();
+
+ {
+ boolean success = false;
+ try {
+ node = doc.importNode(docType, false);
+ } catch (DOMException ex) {
+ success = (ex.code == DOMException.NOT_SUPPORTED_ERR);
+ }
+ assertTrue("throw_NOT_SUPPORTED_ERR", success);
+ }
+}
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level2/core/importNode16";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(importNode16.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level2/core/importNode17.java b/dom/src/test/java/org/w3c/domts/level2/core/importNode17.java
new file mode 100644
index 0000000..e2ebe53
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level2/core/importNode17.java
@@ -0,0 +1,102 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+
+Copyright (c) 2001 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+
+*/
+
+package org.w3c.domts.level2.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The "importNode(importedNode,deep)" method for a
+ * Document should raise NOT_SUPPORTED_ERR DOMException if
+ * the type of node being imported is Document.
+ *
+ * Retrieve staff.xml document.
+ * Invoke method importNode(importedNode,deep) where importedNode
+ * contains staff.xml and deep is true.
+ * Method should raise NOT_SUPPORTED_ERR DOMException.
+* @author NIST
+* @author Mary Brady
+* @see <a href="http://www.w3.org/TR/DOM-Level-2-Core/core#xpointer(id('ID-258A00AF')/constant[@name='NOT_SUPPORTED_ERR'])">http://www.w3.org/TR/DOM-Level-2-Core/core#xpointer(id('ID-258A00AF')/constant[@name='NOT_SUPPORTED_ERR'])</a>
+* @see <a href="http://www.w3.org/TR/DOM-Level-2-Core/core#Core-Document-importNode">http://www.w3.org/TR/DOM-Level-2-Core/core#Core-Document-importNode</a>
+* @see <a href="http://www.w3.org/TR/DOM-Level-2-Core/core#xpointer(id('Core-Document-importNode')/raises/exception[@name='DOMException']/descr/p[substring-before(.,':')='NOT_SUPPORTED_ERR'])">http://www.w3.org/TR/DOM-Level-2-Core/core#xpointer(id('Core-Document-importNode')/raises/exception[@name='DOMException']/descr/p[substring-before(.,':')='NOT_SUPPORTED_ERR'])</a>
+*/
+public final class importNode17 extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public importNode17(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "staffNS", true);
+ preload(contentType, "staffNS", true);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ Document anotherDoc;
+ Node node;
+ doc = (Document) load("staffNS", true);
+ anotherDoc = (Document) load("staffNS", true);
+
+ {
+ boolean success = false;
+ try {
+ node = doc.importNode(anotherDoc, false);
+ } catch (DOMException ex) {
+ success = (ex.code == DOMException.NOT_SUPPORTED_ERR);
+ }
+ assertTrue("throw_NOT_SUPPORTED_ERR", success);
+ }
+}
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level2/core/importNode17";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(importNode17.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level2/core/internalSubset01.java b/dom/src/test/java/org/w3c/domts/level2/core/internalSubset01.java
new file mode 100644
index 0000000..64c4a7e
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level2/core/internalSubset01.java
@@ -0,0 +1,90 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+
+Copyright (c) 2001-2004 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+
+*/
+
+package org.w3c.domts.level2.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The "getInternalSubset()" method returns
+ * the internal subset as a string or null if there is none.
+ * This does not contain the delimiting brackets.
+ *
+ * Retrieve the documenttype.
+ * Apply the "getInternalSubset()" method. Null is returned since there
+ * is not an internal subset.
+* @author NIST
+* @author Mary Brady
+* @see <a href="http://www.w3.org/TR/DOM-Level-2-Core/core#ID-Core-DocType-internalSubset">http://www.w3.org/TR/DOM-Level-2-Core/core#ID-Core-DocType-internalSubset</a>
+*/
+public final class internalSubset01 extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public internalSubset01(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "staff2", false);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ DocumentType docType;
+ String internal;
+ doc = (Document) load("staff2", false);
+ docType = doc.getDoctype();
+ internal = docType.getInternalSubset();
+ assertNull("internalSubsetNull", internal);
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level2/core/internalSubset01";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(internalSubset01.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level2/core/isSupported01.java b/dom/src/test/java/org/w3c/domts/level2/core/isSupported01.java
new file mode 100644
index 0000000..e13aff3
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level2/core/isSupported01.java
@@ -0,0 +1,94 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+
+Copyright (c) 2001 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+
+*/
+
+package org.w3c.domts.level2.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The "feature" parameter in the
+ * isSupported(feature,version)" method is the name
+ * of the feature and the version is the version number of the
+ * feature to test. XXX is NOT a legal value for the feature parameter.
+ * The method should return "false" since XXX is not a valid feature.
+ *
+ * Retrieve the root node of the DOM document by invoking
+ * the "getDocumentElement()" method. This should create a
+ * node object on which the "isSupported(feature,version)"
+ * method is invoked with "feature" equal to "XXX" and version to "1.0".
+ * The method should return a boolean "false" since XXX is not a valid feature.
+* @author NIST
+* @author Mary Brady
+* @see <a href="http://www.w3.org/TR/DOM-Level-2-Core/core#Level-2-Core-Node-supports">http://www.w3.org/TR/DOM-Level-2-Core/core#Level-2-Core-Node-supports</a>
+*/
+public final class isSupported01 extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public isSupported01(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "staff", false);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ Node rootNode;
+ boolean state;
+ doc = (Document) load("staff", false);
+ rootNode = doc.getDocumentElement();
+ state = rootNode.isSupported("XXX", "1.0");
+ assertFalse("throw_False", state);
+}
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level2/core/isSupported01";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(isSupported01.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level2/core/isSupported02.java b/dom/src/test/java/org/w3c/domts/level2/core/isSupported02.java
new file mode 100644
index 0000000..cc842d7
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level2/core/isSupported02.java
@@ -0,0 +1,94 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+
+Copyright (c) 2001 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+
+*/
+
+package org.w3c.domts.level2.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The "feature" parameter in the
+ * isSupported(feature,version)" method is the name
+ * of the feature and the version is the version number of the
+ * feature to test. XML is a legal value for the feature parameter.
+ * The method should return "false" since 9.0 is not a valid version.
+ *
+ * Retrieve the root node of the DOM document by invoking
+ * the "getDocumentElement()" method. This should create a
+ * node object on which the "isSupported(feature,version)"
+ * method is invoked with "feature" equal to "XML" and version to "9.0".
+ * The method should return a boolean "false" since 9.0 is not a valid version.
+* @author NIST
+* @author Mary Brady
+* @see <a href="http://www.w3.org/TR/DOM-Level-2-Core/core#Level-2-Core-Node-supports">http://www.w3.org/TR/DOM-Level-2-Core/core#Level-2-Core-Node-supports</a>
+*/
+public final class isSupported02 extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public isSupported02(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "staff", false);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ Node rootNode;
+ boolean state;
+ doc = (Document) load("staff", false);
+ rootNode = doc.getDocumentElement();
+ state = rootNode.isSupported("XML", "9.0");
+ assertFalse("throw_False", state);
+}
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level2/core/isSupported02";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(isSupported02.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level2/core/isSupported04.java b/dom/src/test/java/org/w3c/domts/level2/core/isSupported04.java
new file mode 100644
index 0000000..fc499fc
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level2/core/isSupported04.java
@@ -0,0 +1,96 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+
+Copyright (c) 2001 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+
+*/
+
+package org.w3c.domts.level2.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The "feature" parameter in the
+ * isSupported(feature,version)" method is the name
+ * of the feature and the version is the version number of the
+ * feature to test. XML is a legal value for the feature parameter
+ * (Test for xml, lower case).
+ * Legal values for the version parameter are 1.0 and 2.0
+ * (Test for 1.0).
+ *
+ * Retrieve the root node of the DOM document by invoking
+ * the "getDocumentElement()" method. This should create a
+ * node object on which the "isSupported(feature,version)"
+ * method is invoked with "feature" equal to "xml" and the version equal to 1.0.
+ * The method should return a boolean "true".
+* @author NIST
+* @author Mary Brady
+* @see <a href="http://www.w3.org/TR/DOM-Level-2-Core/core#Level-2-Core-Node-supports">http://www.w3.org/TR/DOM-Level-2-Core/core#Level-2-Core-Node-supports</a>
+*/
+public final class isSupported04 extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public isSupported04(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "staff", false);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ Node rootNode;
+ boolean state;
+ doc = (Document) load("staff", false);
+ rootNode = doc.getDocumentElement();
+ state = rootNode.isSupported("xml", "1.0");
+ assertTrue("throw_True", state);
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level2/core/isSupported04";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(isSupported04.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level2/core/isSupported05.java b/dom/src/test/java/org/w3c/domts/level2/core/isSupported05.java
new file mode 100644
index 0000000..323ddec
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level2/core/isSupported05.java
@@ -0,0 +1,96 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+
+Copyright (c) 2001 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+
+*/
+
+package org.w3c.domts.level2.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The "feature" parameter in the
+ * isSupported(feature,version)" method is the name
+ * of the feature and the version is the version number of the
+ * feature to test. Core is a legal value for the feature parameter
+ * (Test for core, lower case).
+ * Legal values for the version parameter are 1.0 and 2.0
+ * (Test for 2.0).
+ *
+ * Retrieve the root node of the DOM document by invoking
+ * the "getDocumentElement()" method. This should create a
+ * node object on which the "isSupported(feature,version)"
+ * method is invoked with "feature" equal to "core" and the version equal to 2.0.
+ * The method should return a boolean "true".
+* @author NIST
+* @author Mary Brady
+* @see <a href="http://www.w3.org/TR/DOM-Level-2-Core/core#Level-2-Core-Node-supports">http://www.w3.org/TR/DOM-Level-2-Core/core#Level-2-Core-Node-supports</a>
+*/
+public final class isSupported05 extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public isSupported05(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "staff", false);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ Node rootNode;
+ boolean state;
+ doc = (Document) load("staff", false);
+ rootNode = doc.getDocumentElement();
+ state = rootNode.isSupported("core", "2.0");
+ assertTrue("throw_True", state);
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level2/core/isSupported05";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(isSupported05.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level2/core/isSupported06.java b/dom/src/test/java/org/w3c/domts/level2/core/isSupported06.java
new file mode 100644
index 0000000..5a49c73
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level2/core/isSupported06.java
@@ -0,0 +1,96 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+
+Copyright (c) 2001 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+
+*/
+
+package org.w3c.domts.level2.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The "feature" parameter in the
+ * isSupported(feature,version)" method is the name
+ * of the feature and the version is the version number of the
+ * feature to test. XML is a legal value for the feature parameter
+ * (Test for xml, lower case).
+ * Legal values for the version parameter are 1.0 and 2.0
+ * (Test for 2.0).
+ *
+ * Retrieve the root node of the DOM document by invoking
+ * the "getDocumentElement()" method. This should create a
+ * node object on which the "isSupported(feature,version)"
+ * method is invoked with "feature" equal to "xml" and the version equal to 2.0.
+ * The method should return a boolean "true".
+* @author NIST
+* @author Mary Brady
+* @see <a href="http://www.w3.org/TR/DOM-Level-2-Core/core#Level-2-Core-Node-supports">http://www.w3.org/TR/DOM-Level-2-Core/core#Level-2-Core-Node-supports</a>
+*/
+public final class isSupported06 extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public isSupported06(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "staff", false);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ Node rootNode;
+ boolean state;
+ doc = (Document) load("staff", false);
+ rootNode = doc.getDocumentElement();
+ state = rootNode.isSupported("xml", "2.0");
+ assertTrue("throw_True", state);
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level2/core/isSupported06";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(isSupported06.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level2/core/isSupported07.java b/dom/src/test/java/org/w3c/domts/level2/core/isSupported07.java
new file mode 100644
index 0000000..d01f71d
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level2/core/isSupported07.java
@@ -0,0 +1,96 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+
+Copyright (c) 2001 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+
+*/
+
+package org.w3c.domts.level2.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The "feature" parameter in the
+ * isSupported(feature,version)" method is the name
+ * of the feature and the version is the version number of the
+ * feature to test. XML is a legal value for the feature parameter
+ * (Test for XML).
+ * If the version is not specified, supporting any version of the
+ * method to return true.
+ *
+ * Retrieve the root node of the DOM document by invoking
+ * the "getDocumentElement()" method. This should create a
+ * node object on which the "isSupported(feature,version)"
+ * method is invoked with "feature" equal to "XML" and the version equal blank.
+ * The method should return a boolean "true".
+* @author NIST
+* @author Mary Brady
+* @see <a href="http://www.w3.org/TR/DOM-Level-2-Core/core#Level-2-Core-Node-supports">http://www.w3.org/TR/DOM-Level-2-Core/core#Level-2-Core-Node-supports</a>
+*/
+public final class isSupported07 extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public isSupported07(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "staff", false);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ Node rootNode;
+ boolean state;
+ doc = (Document) load("staff", false);
+ rootNode = doc.getDocumentElement();
+ state = rootNode.isSupported("XML", "");
+ assertTrue("throw_True", state);
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level2/core/isSupported07";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(isSupported07.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level2/core/isSupported09.java b/dom/src/test/java/org/w3c/domts/level2/core/isSupported09.java
new file mode 100644
index 0000000..8b4ae14
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level2/core/isSupported09.java
@@ -0,0 +1,96 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+
+Copyright (c) 2001 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+
+*/
+
+package org.w3c.domts.level2.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The "feature" parameter in the
+ * isSupported(feature,version)" method is the name
+ * of the feature and the version is the version number of the
+ * feature to test. XML is a legal value for the feature parameter
+ * (Test for XML, upper case).
+ * Legal values for the version parameter are 1.0 and 2.0
+ * (Test for 1.0).
+ *
+ * Retrieve the root node of the DOM document by invoking
+ * the "getDocumentElement()" method. This should create a
+ * node object on which the "isSupported(feature,version)"
+ * method is invoked with "feature" equal to "XML" and the version equal to 1.0.
+ * The method should return a boolean "true".
+* @author NIST
+* @author Mary Brady
+* @see <a href="http://www.w3.org/TR/DOM-Level-2-Core/core#Level-2-Core-Node-supports">http://www.w3.org/TR/DOM-Level-2-Core/core#Level-2-Core-Node-supports</a>
+*/
+public final class isSupported09 extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public isSupported09(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "staff", false);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ Node rootNode;
+ boolean state;
+ doc = (Document) load("staff", false);
+ rootNode = doc.getDocumentElement();
+ state = rootNode.isSupported("XML", "1.0");
+ assertTrue("throw_True", state);
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level2/core/isSupported09";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(isSupported09.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level2/core/isSupported10.java b/dom/src/test/java/org/w3c/domts/level2/core/isSupported10.java
new file mode 100644
index 0000000..4414db4
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level2/core/isSupported10.java
@@ -0,0 +1,96 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+
+Copyright (c) 2001 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+
+*/
+
+package org.w3c.domts.level2.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The "feature" parameter in the
+ * isSupported(feature,version)" method is the name
+ * of the feature and the version is the version number of the
+ * feature to test. CORE is a legal value for the feature parameter
+ * (Test for CORE, upper case).
+ * Legal values for the version parameter are 1.0 and 2.0
+ * (Test for 2.0).
+ *
+ * Retrieve the root node of the DOM document by invoking
+ * the "getDocumentElement()" method. This should create a
+ * node object on which the "isSupported(feature,version)"
+ * method is invoked with "feature" equal to "CORE" and the version equal to 2.0.
+ * The method should return a boolean "true".
+* @author NIST
+* @author Mary Brady
+* @see <a href="http://www.w3.org/TR/DOM-Level-2-Core/core#Level-2-Core-Node-supports">http://www.w3.org/TR/DOM-Level-2-Core/core#Level-2-Core-Node-supports</a>
+*/
+public final class isSupported10 extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public isSupported10(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "staff", false);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ Node rootNode;
+ boolean state;
+ doc = (Document) load("staff", false);
+ rootNode = doc.getDocumentElement();
+ state = rootNode.isSupported("CORE", "2.0");
+ assertTrue("throw_True", state);
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level2/core/isSupported10";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(isSupported10.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level2/core/isSupported11.java b/dom/src/test/java/org/w3c/domts/level2/core/isSupported11.java
new file mode 100644
index 0000000..77e28de
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level2/core/isSupported11.java
@@ -0,0 +1,96 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+
+Copyright (c) 2001 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+
+*/
+
+package org.w3c.domts.level2.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The "feature" parameter in the
+ * isSupported(feature,version)" method is the name
+ * of the feature and the version is the version number of the
+ * feature to test. XML is a legal value for the feature parameter
+ * (Test for XML, upper case).
+ * Legal values for the version parameter are 1.0 and 2.0
+ * (Test for 2.0).
+ *
+ * Retrieve the root node of the DOM document by invoking
+ * the "getDocumentElement()" method. This should create a
+ * node object on which the "isSupported(feature,version)"
+ * method is invoked with "feature" equal to "XML" and the version equal to 2.0.
+ * The method should return a boolean "true".
+* @author NIST
+* @author Mary Brady
+* @see <a href="http://www.w3.org/TR/DOM-Level-2-Core/core#Level-2-Core-Node-supports">http://www.w3.org/TR/DOM-Level-2-Core/core#Level-2-Core-Node-supports</a>
+*/
+public final class isSupported11 extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public isSupported11(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "staff", false);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ Node rootNode;
+ boolean state;
+ doc = (Document) load("staff", false);
+ rootNode = doc.getDocumentElement();
+ state = rootNode.isSupported("XML", "2.0");
+ assertTrue("throw_True", state);
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level2/core/isSupported11";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(isSupported11.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level2/core/isSupported12.java b/dom/src/test/java/org/w3c/domts/level2/core/isSupported12.java
new file mode 100644
index 0000000..6ec4988
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level2/core/isSupported12.java
@@ -0,0 +1,122 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+
+Copyright (c) 2001-2003 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+
+*/
+
+package org.w3c.domts.level2.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The "feature" parameter in the
+ * isSupported(feature,version)" method is the name
+ * of the feature and the version is the version number of the
+ * feature to test. CORE is a legal value for the feature parameter
+ * (Test for CORE, upper case).
+ * Legal values for the version parameter are 1.0 and 2.0
+ * (Test for 1.0).
+ *
+ * Retrieve the root node of the DOM document by invoking
+ * the "getDocumentElement()" method. This should create a
+ * node object on which the "isSupported(feature,version)"
+ * method is invoked with "feature" equal to "CORE" and the version equal to 1.0.
+ * The method should return a boolean "true".
+* @author NIST
+* @author Mary Brady
+* @see <a href="http://www.w3.org/TR/DOM-Level-2-Core/core#Level-2-Core-Node-supports">http://www.w3.org/TR/DOM-Level-2-Core/core#Level-2-Core-Node-supports</a>
+*/
+public final class isSupported12 extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public isSupported12(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "staff", false);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ java.util.List features = new java.util.ArrayList();
+ features.add("Core");
+ features.add("XML");
+ features.add("HTML");
+ features.add("Views");
+ features.add("StyleSheets");
+ features.add("CSS");
+ features.add("CSS2");
+ features.add("Events");
+ features.add("UIEvents");
+ features.add("MouseEvents");
+ features.add("MutationEvents");
+ features.add("HTMLEvents");
+ features.add("Range");
+ features.add("Traversal");
+ features.add("bogus.bogus.bogus");
+
+ Document doc;
+ Node rootNode;
+ String featureElement;
+ boolean state;
+ doc = (Document) load("staff", false);
+ rootNode = doc.getDocumentElement();
+ state = rootNode.isSupported("Core", "2.0");
+ assertTrue("Core2", state);
+ for (int indexN10078 = 0; indexN10078 < features.size(); indexN10078++) {
+ featureElement = (String) features.get(indexN10078);
+ state = rootNode.isSupported(featureElement, "1.0");
+ }
+ for (int indexN10083 = 0; indexN10083 < features.size(); indexN10083++) {
+ featureElement = (String) features.get(indexN10083);
+ state = rootNode.isSupported(featureElement, "2.0");
+ }
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level2/core/isSupported12";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(isSupported12.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level2/core/isSupported13.java b/dom/src/test/java/org/w3c/domts/level2/core/isSupported13.java
new file mode 100644
index 0000000..5c58674
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level2/core/isSupported13.java
@@ -0,0 +1,84 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+
+Copyright (c) 2001 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+
+*/
+
+package org.w3c.domts.level2.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * Calls isSupported("Core","") should return true for all implementations (by extension of core-14).
+* @author Curt Arnold
+* @see <a href="http://www.w3.org/TR/DOM-Level-2-Core/core#Level-2-Core-Node-supports">http://www.w3.org/TR/DOM-Level-2-Core/core#Level-2-Core-Node-supports</a>
+* @see <a href="http://www.w3.org/2000/11/DOM-Level-2-errata#core-14">http://www.w3.org/2000/11/DOM-Level-2-errata#core-14</a>
+*/
+public final class isSupported13 extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public isSupported13(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "staff", false);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ Node rootNode;
+ boolean state;
+ doc = (Document) load("staff", false);
+ rootNode = doc.getDocumentElement();
+ state = rootNode.isSupported("Core", "");
+ assertTrue("Core", state);
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level2/core/isSupported13";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(isSupported13.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level2/core/isSupported14.java b/dom/src/test/java/org/w3c/domts/level2/core/isSupported14.java
new file mode 100644
index 0000000..2c0cc6b
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level2/core/isSupported14.java
@@ -0,0 +1,86 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+
+Copyright (c) 2001 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+
+*/
+
+package org.w3c.domts.level2.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * Calls isSupported("Core",null) should return true for all implementations (by extension of core-14).
+* @author Curt Arnold
+* @see <a href="http://www.w3.org/TR/DOM-Level-2-Core/core#Level-2-Core-Node-supports">http://www.w3.org/TR/DOM-Level-2-Core/core#Level-2-Core-Node-supports</a>
+* @see <a href="http://www.w3.org/2000/11/DOM-Level-2-errata#core-14">http://www.w3.org/2000/11/DOM-Level-2-errata#core-14</a>
+*/
+public final class isSupported14 extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public isSupported14(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "staff", false);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ Node rootNode;
+ boolean state;
+ String nullString = null;
+
+ doc = (Document) load("staff", false);
+ rootNode = doc.getDocumentElement();
+ state = rootNode.isSupported("Core", nullString);
+ assertTrue("Core", state);
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level2/core/isSupported14";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(isSupported14.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level2/core/localName01.java b/dom/src/test/java/org/w3c/domts/level2/core/localName01.java
new file mode 100644
index 0000000..6b73193
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level2/core/localName01.java
@@ -0,0 +1,102 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+
+Copyright (c) 2001-2004 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+
+*/
+
+package org.w3c.domts.level2.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The "getLocalName()" method for a Node
+ * returns the local part of the qualified name of this node,
+ * and for nodes of any type other than ELEMENT_NODE and ATTRIBUTE_NODE
+ * and nodes created with a DOM Level 1 method, this is null.
+ *
+ * Retrieve the first emp:address node and get the attributes of this node."
+ * Then apply the getLocalName() method to the emp:domestic attribute.
+ * The method should return "domestic".
+* @author NIST
+* @author Mary Brady
+* @see <a href="http://www.w3.org/TR/DOM-Level-2-Core/core#ID-NodeNSLocalN">http://www.w3.org/TR/DOM-Level-2-Core/core#ID-NodeNSLocalN</a>
+*/
+public final class localName01 extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public localName01(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+
+ org.w3c.domts.DocumentBuilderSetting[] settings =
+ new org.w3c.domts.DocumentBuilderSetting[] {
+org.w3c.domts.DocumentBuilderSetting.namespaceAware
+ };
+ DOMTestDocumentBuilderFactory testFactory = factory.newInstance(settings);
+ setFactory(testFactory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "staffNS", false);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ NodeList elementList;
+ Element testAddr;
+ Attr addrAttr;
+ String localName;
+ doc = (Document) load("staffNS", false);
+ elementList = doc.getElementsByTagName("emp:address");
+ testAddr = (Element) elementList.item(0);
+ assertNotNull("empAddrNotNull", testAddr);
+ addrAttr = testAddr.getAttributeNode("emp:domestic");
+ localName = addrAttr.getLocalName();
+ assertEquals("localName", "domestic", localName);
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level2/core/localName01";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(localName01.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level2/core/localName02.java b/dom/src/test/java/org/w3c/domts/level2/core/localName02.java
new file mode 100644
index 0000000..5c9f3d1
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level2/core/localName02.java
@@ -0,0 +1,91 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+
+Copyright (c) 2001-2004 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+
+*/
+
+package org.w3c.domts.level2.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The "getLocalName()" method for a Node
+ * returns the local part of the qualified name of this node,
+ * and for nodes of any type other than ELEMENT_NODE and ATTRIBUTE_NODE
+ * and nodes created with a DOM Level 1 method, this is null.
+ *
+ * Create an new Element with the createElement() method.
+ * Invoke the "getLocalName()" method on the newly created element
+ * node will cause "null" to be returned.
+* @author NIST
+* @author Mary Brady
+* @see <a href="http://www.w3.org/TR/DOM-Level-2-Core/core#ID-NodeNSLocalN">http://www.w3.org/TR/DOM-Level-2-Core/core#ID-NodeNSLocalN</a>
+*/
+public final class localName02 extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public localName02(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "staffNS", false);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ Node createdNode;
+ String localName;
+ doc = (Document) load("staffNS", false);
+ createdNode = doc.createElement("test:employee");
+ localName = createdNode.getLocalName();
+ assertNull("localNameNull", localName);
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level2/core/localName02";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(localName02.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level2/core/localName03.java b/dom/src/test/java/org/w3c/domts/level2/core/localName03.java
new file mode 100644
index 0000000..8724c21
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level2/core/localName03.java
@@ -0,0 +1,95 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+
+Copyright (c) 2001 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+
+*/
+
+package org.w3c.domts.level2.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The "getLocalName()" method for a Node
+ * returns the local part of the qualified name of this node,
+ * and for nodes of any type other than ELEMENT_NODE and ATTRIBUTE_NODE
+ * and nodes created with a DOM Level 1 method, this is null.
+ *
+ * Retrieve the first employeeId node and get the first child of this node.
+ * Since the first child is Text node invoking the "getLocalName()"
+ * method will cause "null" to be returned.
+* @author NIST
+* @author Mary Brady
+* @see <a href="http://www.w3.org/TR/DOM-Level-2-Core/core#ID-NodeNSLocalN">http://www.w3.org/TR/DOM-Level-2-Core/core#ID-NodeNSLocalN</a>
+*/
+public final class localName03 extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public localName03(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "staffNS", false);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ NodeList elementList;
+ Node testEmployee;
+ Node textNode;
+ String localName;
+ doc = (Document) load("staffNS", false);
+ elementList = doc.getElementsByTagName("employeeId");
+ testEmployee = elementList.item(0);
+ textNode = testEmployee.getFirstChild();
+ localName = textNode.getLocalName();
+ assertNull("textNodeLocalName", localName);
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level2/core/localName03";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(localName03.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level2/core/localName04.java b/dom/src/test/java/org/w3c/domts/level2/core/localName04.java
new file mode 100644
index 0000000..28e047a
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level2/core/localName04.java
@@ -0,0 +1,98 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+
+Copyright (c) 2001 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+
+*/
+
+package org.w3c.domts.level2.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The "getLocalName()" method for a Node
+ * returns the local part of the qualified name of this node,
+ * and for nodes of any type other than ELEMENT_NODE and ATTRIBUTE_NODE
+ * and nodes created with a DOM Level 1 method, this is null.
+ *
+ * Retrieve the first employee node and invoke the "getLocalName()"
+ * method. The method should return "employee".
+* @author NIST
+* @author Mary Brady
+* @see <a href="http://www.w3.org/TR/DOM-Level-2-Core/core#ID-NodeNSLocalN">http://www.w3.org/TR/DOM-Level-2-Core/core#ID-NodeNSLocalN</a>
+*/
+public final class localName04 extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public localName04(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+
+ org.w3c.domts.DocumentBuilderSetting[] settings =
+ new org.w3c.domts.DocumentBuilderSetting[] {
+org.w3c.domts.DocumentBuilderSetting.namespaceAware
+ };
+ DOMTestDocumentBuilderFactory testFactory = factory.newInstance(settings);
+ setFactory(testFactory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "staffNS", false);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ NodeList elementList;
+ Node testEmployee;
+ String employeeLocalName;
+ doc = (Document) load("staffNS", false);
+ elementList = doc.getElementsByTagName("employee");
+ testEmployee = elementList.item(0);
+ employeeLocalName = testEmployee.getLocalName();
+ assertEquals("lname", "employee", employeeLocalName);
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level2/core/localName04";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(localName04.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level2/core/namednodemapgetnameditemns01.java b/dom/src/test/java/org/w3c/domts/level2/core/namednodemapgetnameditemns01.java
new file mode 100644
index 0000000..9346ba2
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level2/core/namednodemapgetnameditemns01.java
@@ -0,0 +1,108 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+
+Copyright (c) 2001-2004 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+
+*/
+
+package org.w3c.domts.level2.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * Using the method getNamedItemNS, retreive the entity "ent1" and notation "notation1"
+ * from a NamedNodeMap of this DocumentTypes entities and notations.
+ * Both should be null since entities and notations are not namespaced.
+* @author IBM
+* @author Neil Delima
+* @see <a href="http://www.w3.org/TR/DOM-Level-2-Core/core#ID-getNamedItemNS">http://www.w3.org/TR/DOM-Level-2-Core/core#ID-getNamedItemNS</a>
+* @see <a href="http://www.w3.org/Bugs/Public/show_bug.cgi?id=259">http://www.w3.org/Bugs/Public/show_bug.cgi?id=259</a>
+* @see <a href="http://www.w3.org/Bugs/Public/show_bug.cgi?id=407">http://www.w3.org/Bugs/Public/show_bug.cgi?id=407</a>
+* @see <a href="http://lists.w3.org/Archives/Member/w3c-dom-ig/2003Nov/0016.html">http://lists.w3.org/Archives/Member/w3c-dom-ig/2003Nov/0016.html</a>
+*/
+public final class namednodemapgetnameditemns01 extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public namednodemapgetnameditemns01(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+
+ org.w3c.domts.DocumentBuilderSetting[] settings =
+ new org.w3c.domts.DocumentBuilderSetting[] {
+org.w3c.domts.DocumentBuilderSetting.namespaceAware
+ };
+ DOMTestDocumentBuilderFactory testFactory = factory.newInstance(settings);
+ setFactory(testFactory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "staffNS", false);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ DocumentType docType;
+ NamedNodeMap entities;
+ NamedNodeMap notations;
+ Entity entity;
+ Notation notation;
+ String entityName;
+ String notationName;
+ String nullNS = null;
+
+ doc = (Document) load("staffNS", false);
+ docType = doc.getDoctype();
+ entities = docType.getEntities();
+ assertNotNull("entitiesNotNull", entities);
+ notations = docType.getNotations();
+ assertNotNull("notationsNotNull", notations);
+ entity = (Entity) entities.getNamedItemNS(nullNS, "ent1");
+ assertNull("entityNull", entity);
+ notation = (Notation) notations.getNamedItemNS(nullNS, "notation1");
+ assertNull("notationNull", notation);
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level2/core/namednodemapgetnameditemns01";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(namednodemapgetnameditemns01.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level2/core/namednodemapgetnameditemns02.java b/dom/src/test/java/org/w3c/domts/level2/core/namednodemapgetnameditemns02.java
new file mode 100644
index 0000000..a1da01a
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level2/core/namednodemapgetnameditemns02.java
@@ -0,0 +1,101 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+
+Copyright (c) 2001 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+
+*/
+
+package org.w3c.domts.level2.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The method getNamedItemNS retrieves a node specified by local name and namespace URI.
+ *
+ * Using the method getNamedItemNS, retreive an attribute node having namespaceURI=http://www.nist.gov
+ * and localName=domestic, from a NamedNodeMap of attribute nodes, for the second element
+ * whose namespaceURI=http://www.nist.gov and localName=address. Verify if the attr node
+ * has been retreived successfully by checking its nodeName atttribute.
+* @author IBM
+* @author Neil Delima
+* @see <a href="http://www.w3.org/TR/DOM-Level-2-Core/core#ID-getNamedItemNS">http://www.w3.org/TR/DOM-Level-2-Core/core#ID-getNamedItemNS</a>
+*/
+public final class namednodemapgetnameditemns02 extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public namednodemapgetnameditemns02(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+
+ org.w3c.domts.DocumentBuilderSetting[] settings =
+ new org.w3c.domts.DocumentBuilderSetting[] {
+org.w3c.domts.DocumentBuilderSetting.namespaceAware
+ };
+ DOMTestDocumentBuilderFactory testFactory = factory.newInstance(settings);
+ setFactory(testFactory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "staffNS", false);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ NamedNodeMap attributes;
+ Node element;
+ Attr attribute;
+ NodeList elementList;
+ String attrName;
+ doc = (Document) load("staffNS", false);
+ elementList = doc.getElementsByTagNameNS("http://www.nist.gov", "address");
+ element = elementList.item(1);
+ attributes = element.getAttributes();
+ attribute = (Attr) attributes.getNamedItemNS("http://www.nist.gov", "domestic");
+ attrName = attribute.getNodeName();
+ assertEquals("namednodemapgetnameditemns02", "emp:domestic", attrName);
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level2/core/namednodemapgetnameditemns02";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(namednodemapgetnameditemns02.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level2/core/namednodemapgetnameditemns03.java b/dom/src/test/java/org/w3c/domts/level2/core/namednodemapgetnameditemns03.java
new file mode 100644
index 0000000..370ee23
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level2/core/namednodemapgetnameditemns03.java
@@ -0,0 +1,105 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+
+Copyright (c) 2001 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+
+*/
+
+package org.w3c.domts.level2.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The method getNamedItemNS retrieves a node specified by local name and namespace URI.
+ *
+ * Create a new Element node and add 2 new attribute nodes having the same local name but different
+ * namespace names and namespace prefixes to it. Using the getNamedItemNS retreive the second attribute node.
+ * Verify if the attr node has been retreived successfully by checking its nodeName atttribute.
+* @author IBM
+* @author Neil Delima
+* @see <a href="http://www.w3.org/TR/DOM-Level-2-Core/core#ID-getNamedItemNS">http://www.w3.org/TR/DOM-Level-2-Core/core#ID-getNamedItemNS</a>
+*/
+public final class namednodemapgetnameditemns03 extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public namednodemapgetnameditemns03(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+
+ org.w3c.domts.DocumentBuilderSetting[] settings =
+ new org.w3c.domts.DocumentBuilderSetting[] {
+org.w3c.domts.DocumentBuilderSetting.namespaceAware
+ };
+ DOMTestDocumentBuilderFactory testFactory = factory.newInstance(settings);
+ setFactory(testFactory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "staffNS", false);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ NamedNodeMap attributes;
+ Node element;
+ Attr attribute;
+ Attr newAttr1;
+ Attr newAttr2;
+ Attr newAttribute;
+ String attrName;
+ doc = (Document) load("staffNS", false);
+ element = doc.createElementNS("http://www.w3.org/DOM/Test", "root");
+ newAttr1 = doc.createAttributeNS("http://www.w3.org/DOM/L1", "L1:att");
+ newAttribute = ((Element) /*Node */element).setAttributeNodeNS(newAttr1);
+ newAttr2 = doc.createAttributeNS("http://www.w3.org/DOM/L2", "L2:att");
+ newAttribute = ((Element) /*Node */element).setAttributeNodeNS(newAttr2);
+ attributes = element.getAttributes();
+ attribute = (Attr) attributes.getNamedItemNS("http://www.w3.org/DOM/L2", "att");
+ attrName = attribute.getNodeName();
+ assertEquals("namednodemapgetnameditemns03", "L2:att", attrName);
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level2/core/namednodemapgetnameditemns03";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(namednodemapgetnameditemns03.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level2/core/namednodemapgetnameditemns04.java b/dom/src/test/java/org/w3c/domts/level2/core/namednodemapgetnameditemns04.java
new file mode 100644
index 0000000..8e901b3
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level2/core/namednodemapgetnameditemns04.java
@@ -0,0 +1,106 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+
+Copyright (c) 2001 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+
+*/
+
+package org.w3c.domts.level2.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The method getNamedItemNS retrieves a node specified by local name and namespace URI.
+ *
+ * Retreive the second address element node having localName=adrress.
+ * Create a new attribute node having the same name as an existing node but different namespaceURI
+ * and add it to this element. Using the getNamedItemNS retreive the newly created attribute
+ * node from a nodemap of attributes of the retreive element node.
+ * Verify if the attr node has been retreived successfully by checking its nodeName atttribute.
+* @author IBM
+* @author Neil Delima
+* @see <a href="http://www.w3.org/TR/DOM-Level-2-Core/core#ID-getNamedItemNS">http://www.w3.org/TR/DOM-Level-2-Core/core#ID-getNamedItemNS</a>
+*/
+public final class namednodemapgetnameditemns04 extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public namednodemapgetnameditemns04(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+
+ org.w3c.domts.DocumentBuilderSetting[] settings =
+ new org.w3c.domts.DocumentBuilderSetting[] {
+org.w3c.domts.DocumentBuilderSetting.namespaceAware
+ };
+ DOMTestDocumentBuilderFactory testFactory = factory.newInstance(settings);
+ setFactory(testFactory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "staffNS", true);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ NamedNodeMap attributes;
+ Element element;
+ Attr attribute;
+ Attr newAttr1;
+ Attr newAttribute;
+ NodeList elementList;
+ String attrName;
+ doc = (Document) load("staffNS", true);
+ elementList = doc.getElementsByTagNameNS("*", "address");
+ element = (Element) elementList.item(1);
+ newAttr1 = doc.createAttributeNS("http://www.w3.org/DOM/L1", "street");
+ newAttribute = element.setAttributeNodeNS(newAttr1);
+ attributes = element.getAttributes();
+ attribute = (Attr) attributes.getNamedItemNS("http://www.w3.org/DOM/L1", "street");
+ attrName = attribute.getNodeName();
+ assertEquals("namednodemapgetnameditemns04", "street", attrName);
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level2/core/namednodemapgetnameditemns04";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(namednodemapgetnameditemns04.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level2/core/namednodemapgetnameditemns05.java b/dom/src/test/java/org/w3c/domts/level2/core/namednodemapgetnameditemns05.java
new file mode 100644
index 0000000..76f937a
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level2/core/namednodemapgetnameditemns05.java
@@ -0,0 +1,99 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+
+Copyright (c) 2001-2004 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+
+*/
+
+package org.w3c.domts.level2.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The method getNamedItemNS retrieves a node specified by local name and namespace URI.
+ *
+ * Retreieve the second address element and its attribute into a named node map.
+ * Try retreiving the street attribute from the namednodemap using the
+ * default namespace uri and the street attribute name. Since the default
+ * namespace doesnot apply to attributes this should return null.
+* @author IBM
+* @author Neil Delima
+* @see <a href="http://www.w3.org/TR/DOM-Level-2-Core/core#ID-getNamedItemNS">http://www.w3.org/TR/DOM-Level-2-Core/core#ID-getNamedItemNS</a>
+*/
+public final class namednodemapgetnameditemns05 extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public namednodemapgetnameditemns05(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+
+ org.w3c.domts.DocumentBuilderSetting[] settings =
+ new org.w3c.domts.DocumentBuilderSetting[] {
+org.w3c.domts.DocumentBuilderSetting.namespaceAware
+ };
+ DOMTestDocumentBuilderFactory testFactory = factory.newInstance(settings);
+ setFactory(testFactory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "staffNS", false);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ NamedNodeMap attributes;
+ Node element;
+ Attr attribute;
+ NodeList elementList;
+ doc = (Document) load("staffNS", false);
+ elementList = doc.getElementsByTagNameNS("*", "address");
+ element = elementList.item(1);
+ attributes = element.getAttributes();
+ attribute = (Attr) attributes.getNamedItemNS("*", "street");
+ assertNull("namednodemapgetnameditemns05", attribute);
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level2/core/namednodemapgetnameditemns05";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(namednodemapgetnameditemns05.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level2/core/namednodemapgetnameditemns06.java b/dom/src/test/java/org/w3c/domts/level2/core/namednodemapgetnameditemns06.java
new file mode 100644
index 0000000..4ee5a99
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level2/core/namednodemapgetnameditemns06.java
@@ -0,0 +1,109 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+
+Copyright (c) 2001 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+
+*/
+
+package org.w3c.domts.level2.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * Retreive the second address element node having localName=adrress. Retreive the attributes
+ * of this element into 2 nodemaps. Create a new attribute node and add it to this element.
+ * Since NamedNodeMaps are live each one should get updated, using the getNamedItemNS retreive
+ * the newly created attribute from each node map.
+ * Verify if the attr node has been retreived successfully by checking its nodeName atttribute.
+* @author IBM
+* @author Neil Delima
+* @see <a href="http://www.w3.org/TR/DOM-Level-2-Core/core#ID-getNamedItemNS">http://www.w3.org/TR/DOM-Level-2-Core/core#ID-getNamedItemNS</a>
+*/
+public final class namednodemapgetnameditemns06 extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public namednodemapgetnameditemns06(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+
+ org.w3c.domts.DocumentBuilderSetting[] settings =
+ new org.w3c.domts.DocumentBuilderSetting[] {
+org.w3c.domts.DocumentBuilderSetting.namespaceAware
+ };
+ DOMTestDocumentBuilderFactory testFactory = factory.newInstance(settings);
+ setFactory(testFactory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "staffNS", true);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ NamedNodeMap attributesMap1;
+ NamedNodeMap attributesMap2;
+ Element element;
+ Attr attribute;
+ Attr newAttr1;
+ Attr newAttribute;
+ NodeList elementList;
+ String attrName;
+ doc = (Document) load("staffNS", true);
+ elementList = doc.getElementsByTagNameNS("*", "address");
+ element = (Element) elementList.item(1);
+ attributesMap1 = element.getAttributes();
+ attributesMap2 = element.getAttributes();
+ newAttr1 = doc.createAttributeNS("http://www.w3.org/DOM/L1", "street");
+ newAttribute = element.setAttributeNodeNS(newAttr1);
+ attribute = (Attr) attributesMap1.getNamedItemNS("http://www.w3.org/DOM/L1", "street");
+ attrName = attribute.getNodeName();
+ assertEquals("namednodemapgetnameditemnsMap106", "street", attrName);
+ attribute = (Attr) attributesMap2.getNamedItemNS("http://www.w3.org/DOM/L1", "street");
+ attrName = attribute.getNodeName();
+ assertEquals("namednodemapgetnameditemnsMap206", "street", attrName);
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level2/core/namednodemapgetnameditemns06";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(namednodemapgetnameditemns06.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level2/core/namednodemapremovenameditemns01.java b/dom/src/test/java/org/w3c/domts/level2/core/namednodemapremovenameditemns01.java
new file mode 100644
index 0000000..9b2ed07
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level2/core/namednodemapremovenameditemns01.java
@@ -0,0 +1,98 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+
+Copyright (c) 2001 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+
+*/
+
+package org.w3c.domts.level2.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The method removeNamedItemNS removes a node specified by local name and namespace
+ *
+ * Retreive an attribute node and then remove from the NamedNodeMap. Verify if the attribute
+ * node was actually remove from the node map.
+* @author IBM
+* @author Neil Delima
+* @see <a href="http://www.w3.org/TR/DOM-Level-2-Core/core#ID-D58B193">http://www.w3.org/TR/DOM-Level-2-Core/core#ID-D58B193</a>
+*/
+public final class namednodemapremovenameditemns01 extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public namednodemapremovenameditemns01(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+
+ org.w3c.domts.DocumentBuilderSetting[] settings =
+ new org.w3c.domts.DocumentBuilderSetting[] {
+org.w3c.domts.DocumentBuilderSetting.namespaceAware
+ };
+ DOMTestDocumentBuilderFactory testFactory = factory.newInstance(settings);
+ setFactory(testFactory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "staffNS", true);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ NamedNodeMap attributes;
+ Node element;
+ Attr attribute;
+ NodeList elementList;
+ doc = (Document) load("staffNS", true);
+ elementList = doc.getElementsByTagNameNS("http://www.nist.gov", "address");
+ element = elementList.item(1);
+ attributes = element.getAttributes();
+ attribute = (Attr) attributes.removeNamedItemNS("http://www.nist.gov", "domestic");
+ attribute = (Attr) attributes.getNamedItemNS("http://www.nist.gov", "domestic");
+ assertNull("namednodemapremovenameditemns01", attribute);
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level2/core/namednodemapremovenameditemns01";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(namednodemapremovenameditemns01.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level2/core/namednodemapremovenameditemns02.java b/dom/src/test/java/org/w3c/domts/level2/core/namednodemapremovenameditemns02.java
new file mode 100644
index 0000000..24a4518
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level2/core/namednodemapremovenameditemns02.java
@@ -0,0 +1,109 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+
+Copyright (c) 2001-2004 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+
+*/
+
+package org.w3c.domts.level2.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The method removeNamedItemNS removes a node specified by local name and namespace
+ * A removed attribute may be known to have a default value when this map contains the
+ * attributes attached to an element, as returned by the attributes attribute of the Node
+ * interface. If so, an attribute immediately appears containing the default value as well
+ * as the corresponding namespace URI, local name, and prefix when applicable.
+ *
+ * Retreive a default attribute node. Remove it from the NodeMap. Check if a new one immediately
+ * appears containing the default value.
+* @author IBM
+* @author Neil Delima
+* @see <a href="http://www.w3.org/TR/DOM-Level-2-Core/core#ID-D58B193">http://www.w3.org/TR/DOM-Level-2-Core/core#ID-D58B193</a>
+* @see <a href="http://www.w3.org/Bugs/Public/show_bug.cgi?id=259">http://www.w3.org/Bugs/Public/show_bug.cgi?id=259</a>
+*/
+public final class namednodemapremovenameditemns02 extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public namednodemapremovenameditemns02(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+
+ org.w3c.domts.DocumentBuilderSetting[] settings =
+ new org.w3c.domts.DocumentBuilderSetting[] {
+org.w3c.domts.DocumentBuilderSetting.namespaceAware,
+org.w3c.domts.DocumentBuilderSetting.validating
+ };
+ DOMTestDocumentBuilderFactory testFactory = factory.newInstance(settings);
+ setFactory(testFactory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "staffNS", true);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ NamedNodeMap attributes;
+ Node element;
+ Attr attribute;
+ NodeList elementList;
+ String attrValue;
+ String nullNS = null;
+
+ doc = (Document) load("staffNS", true);
+ elementList = doc.getElementsByTagNameNS("http://www.nist.gov", "employee");
+ element = elementList.item(1);
+ attributes = element.getAttributes();
+ attribute = (Attr) attributes.removeNamedItemNS(nullNS, "defaultAttr");
+ attribute = (Attr) attributes.getNamedItemNS(nullNS, "defaultAttr");
+ attrValue = attribute.getNodeValue();
+ assertNotNull("namednodemapremovenameditemns02", attribute);
+ assertEquals("namednodemapremovenameditemns02_attrValue", "defaultVal", attrValue);
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level2/core/namednodemapremovenameditemns02";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(namednodemapremovenameditemns02.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level2/core/namednodemapremovenameditemns03.java b/dom/src/test/java/org/w3c/domts/level2/core/namednodemapremovenameditemns03.java
new file mode 100644
index 0000000..461ba7f
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level2/core/namednodemapremovenameditemns03.java
@@ -0,0 +1,106 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+
+Copyright (c) 2001 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+
+*/
+
+package org.w3c.domts.level2.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The method removeNamedItemNS removes a node specified by local name and namespace
+ *
+ * Create a new element node and add 2 new attribute nodes to it that have the same localName
+ * but different namespaceURI's. Remove the first attribute node from the namedNodeMap of the
+ * new element node and check to see that the second attribute still exists.
+* @author IBM
+* @author Neil Delima
+* @see <a href="http://www.w3.org/TR/DOM-Level-2-Core/core#ID-D58B193">http://www.w3.org/TR/DOM-Level-2-Core/core#ID-D58B193</a>
+*/
+public final class namednodemapremovenameditemns03 extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public namednodemapremovenameditemns03(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+
+ org.w3c.domts.DocumentBuilderSetting[] settings =
+ new org.w3c.domts.DocumentBuilderSetting[] {
+org.w3c.domts.DocumentBuilderSetting.namespaceAware
+ };
+ DOMTestDocumentBuilderFactory testFactory = factory.newInstance(settings);
+ setFactory(testFactory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "staffNS", true);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ NamedNodeMap attributes;
+ Node element;
+ Attr attribute;
+ Attr newAttribute;
+ Attr attribute1;
+ Attr attribute2;
+ String nodeName;
+ doc = (Document) load("staffNS", true);
+ element = doc.createElementNS("http://www.w3.org/DOM/Test", "root");
+ attribute1 = doc.createAttributeNS("http://www.w3.org/DOM/L1", "L1:att");
+ newAttribute = ((Element) /*Node */element).setAttributeNodeNS(attribute1);
+ attribute2 = doc.createAttributeNS("http://www.w3.org/DOM/L2", "L2:att");
+ newAttribute = ((Element) /*Node */element).setAttributeNodeNS(attribute2);
+ attributes = element.getAttributes();
+ attribute = (Attr) attributes.removeNamedItemNS("http://www.w3.org/DOM/L1", "att");
+ attribute = (Attr) attributes.getNamedItemNS("http://www.w3.org/DOM/L2", "att");
+ nodeName = attribute.getNodeName();
+ assertEquals("namednodemapremovenameditemns02", "L2:att", nodeName);
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level2/core/namednodemapremovenameditemns03";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(namednodemapremovenameditemns03.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level2/core/namednodemapremovenameditemns04.java b/dom/src/test/java/org/w3c/domts/level2/core/namednodemapremovenameditemns04.java
new file mode 100644
index 0000000..a7c361a
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level2/core/namednodemapremovenameditemns04.java
@@ -0,0 +1,102 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+
+Copyright (c) 2001 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+
+*/
+
+package org.w3c.domts.level2.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The method removeNamedItemNS removes a node specified by local name and namespace
+ *
+ * Attempt to remove the xmlns and dmstc attributes of the first element node with the localName
+ * employee. Verify if the 2 attributes were successfully removed.
+* @author IBM
+* @author Neil Delima
+* @see <a href="http://www.w3.org/TR/DOM-Level-2-Core/core#ID-D58B193">http://www.w3.org/TR/DOM-Level-2-Core/core#ID-D58B193</a>
+*/
+public final class namednodemapremovenameditemns04 extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public namednodemapremovenameditemns04(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+
+ org.w3c.domts.DocumentBuilderSetting[] settings =
+ new org.w3c.domts.DocumentBuilderSetting[] {
+org.w3c.domts.DocumentBuilderSetting.namespaceAware
+ };
+ DOMTestDocumentBuilderFactory testFactory = factory.newInstance(settings);
+ setFactory(testFactory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "staffNS", true);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ NamedNodeMap attributes;
+ Node element;
+ Attr attribute;
+ Attr attributeRemoved;
+ NodeList elementList;
+ doc = (Document) load("staffNS", true);
+ elementList = doc.getElementsByTagNameNS("*", "employee");
+ element = elementList.item(0);
+ attributes = element.getAttributes();
+ attributeRemoved = (Attr) attributes.removeNamedItemNS("http://www.w3.org/2000/xmlns/", "xmlns");
+ attribute = (Attr) attributes.getNamedItemNS("http://www.w3.org/2000/xmlns/", "xmlns");
+ assertNull("namednodemapremovenameditemns04_1", attribute);
+ attributeRemoved = (Attr) attributes.removeNamedItemNS("http://www.w3.org/2000/xmlns/", "dmstc");
+ attribute = (Attr) attributes.getNamedItemNS("http://www.w3.org/2000/xmlns/", "dmstc");
+ assertNull("namednodemapremovenameditemns04_2", attribute);
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level2/core/namednodemapremovenameditemns04";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(namednodemapremovenameditemns04.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level2/core/namednodemapremovenameditemns05.java b/dom/src/test/java/org/w3c/domts/level2/core/namednodemapremovenameditemns05.java
new file mode 100644
index 0000000..d5971f7
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level2/core/namednodemapremovenameditemns05.java
@@ -0,0 +1,131 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+
+Copyright (c) 2001-2004 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+
+*/
+
+package org.w3c.domts.level2.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * Retreive an entity and notation node and remove the first notation from the
+ * entity node map and first entity node from the notation map. Since both these
+ * maps are readonly, a NO_MODIFICATION_ALLOWED_ERR should be raised.
+* @author IBM
+* @author Neil Delima
+* @see <a href="http://www.w3.org/TR/DOM-Level-2-Core/core#ID-setNamedItemNS">http://www.w3.org/TR/DOM-Level-2-Core/core#ID-setNamedItemNS</a>
+* @see <a href="http://www.w3.org/Bugs/Public/show_bug.cgi?id=259">http://www.w3.org/Bugs/Public/show_bug.cgi?id=259</a>
+* @see <a href="http://www.w3.org/Bugs/Public/show_bug.cgi?id=407">http://www.w3.org/Bugs/Public/show_bug.cgi?id=407</a>
+* @see <a href="http://lists.w3.org/Archives/Member/w3c-dom-ig/2003Nov/0016.html">http://lists.w3.org/Archives/Member/w3c-dom-ig/2003Nov/0016.html</a>
+*/
+public final class namednodemapremovenameditemns05 extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public namednodemapremovenameditemns05(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+
+ org.w3c.domts.DocumentBuilderSetting[] settings =
+ new org.w3c.domts.DocumentBuilderSetting[] {
+org.w3c.domts.DocumentBuilderSetting.namespaceAware
+ };
+ DOMTestDocumentBuilderFactory testFactory = factory.newInstance(settings);
+ setFactory(testFactory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "staffNS", true);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ DocumentType docType;
+ NamedNodeMap entities;
+ NamedNodeMap notations;
+ Node removedNode;
+ String nullNS = null;
+
+ doc = (Document) load("staffNS", true);
+ docType = doc.getDoctype();
+ entities = docType.getEntities();
+ assertNotNull("entitiesNotNull", entities);
+ notations = docType.getNotations();
+ assertNotNull("notationsNotNull", notations);
+
+ try {
+ removedNode = entities.removeNamedItemNS(nullNS, "ent1");
+ fail("entity_throw_DOMException");
+
+ } catch (DOMException ex) {
+ switch (ex.code) {
+ case 8 :
+ break;
+ case 7 :
+ break;
+ default:
+ throw ex;
+ }
+ }
+
+ try {
+ removedNode = notations.removeNamedItemNS(nullNS, "notation1");
+ fail("notation_throw_DOMException");
+
+ } catch (DOMException ex) {
+ switch (ex.code) {
+ case 8 :
+ break;
+ case 7 :
+ break;
+ default:
+ throw ex;
+ }
+ }
+}
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level2/core/namednodemapremovenameditemns05";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(namednodemapremovenameditemns05.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level2/core/namednodemapremovenameditemns06.java b/dom/src/test/java/org/w3c/domts/level2/core/namednodemapremovenameditemns06.java
new file mode 100644
index 0000000..42d6eff
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level2/core/namednodemapremovenameditemns06.java
@@ -0,0 +1,107 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+
+Copyright (c) 2001-2004 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+
+*/
+
+package org.w3c.domts.level2.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The method removeNamedItemNS removes a node using its namespaceURI and localName and
+ * raises a NOT_FOUND_ERR if there is no node with the specified namespaceURI and
+ * localName in this map
+ *
+ * Retreive an attribute node into a namednodemap. While removing it from the map specify
+ * an incorrect namespaceURI. This should raise a NOT_FOUND_ERR.
+* @author IBM
+* @author Neil Delima
+* @see <a href="http://www.w3.org/TR/DOM-Level-2-Core/core#ID-D58B193">http://www.w3.org/TR/DOM-Level-2-Core/core#ID-D58B193</a>
+*/
+public final class namednodemapremovenameditemns06 extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public namednodemapremovenameditemns06(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+
+ org.w3c.domts.DocumentBuilderSetting[] settings =
+ new org.w3c.domts.DocumentBuilderSetting[] {
+org.w3c.domts.DocumentBuilderSetting.namespaceAware
+ };
+ DOMTestDocumentBuilderFactory testFactory = factory.newInstance(settings);
+ setFactory(testFactory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "staffNS", true);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ NamedNodeMap attributes;
+ Node element;
+ Attr attribute;
+ NodeList elementList;
+ doc = (Document) load("staffNS", true);
+ elementList = doc.getElementsByTagNameNS("http://www.nist.gov", "employee");
+ element = elementList.item(1);
+ attributes = element.getAttributes();
+
+ {
+ boolean success = false;
+ try {
+ attribute = (Attr) attributes.removeNamedItemNS("http://www.Nist.gov", "domestic");
+ } catch (DOMException ex) {
+ success = (ex.code == DOMException.NOT_FOUND_ERR);
+ }
+ assertTrue("throw_NOT_FOUND_ERR", success);
+ }
+}
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level2/core/namednodemapremovenameditemns06";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(namednodemapremovenameditemns06.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level2/core/namednodemapremovenameditemns07.java b/dom/src/test/java/org/w3c/domts/level2/core/namednodemapremovenameditemns07.java
new file mode 100644
index 0000000..86b9ee4
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level2/core/namednodemapremovenameditemns07.java
@@ -0,0 +1,107 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+
+Copyright (c) 2001-2004 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+
+*/
+
+package org.w3c.domts.level2.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The method removeNamedItemNS removes a node using its namespaceURI and localName and
+ * raises a NOT_FOUND_ERR if there is no node with the specified namespaceURI and
+ * localName in this map
+ *
+ * Retreive an attribute node from a namednodemap. While removing it from the map specify
+ * an incorrect localName. This should raise a NOT_FOUND_ERR.
+* @author IBM
+* @author Neil Delima
+* @see <a href="http://www.w3.org/TR/DOM-Level-2-Core/core#ID-D58B193">http://www.w3.org/TR/DOM-Level-2-Core/core#ID-D58B193</a>
+*/
+public final class namednodemapremovenameditemns07 extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public namednodemapremovenameditemns07(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+
+ org.w3c.domts.DocumentBuilderSetting[] settings =
+ new org.w3c.domts.DocumentBuilderSetting[] {
+org.w3c.domts.DocumentBuilderSetting.namespaceAware
+ };
+ DOMTestDocumentBuilderFactory testFactory = factory.newInstance(settings);
+ setFactory(testFactory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "staffNS", true);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ NamedNodeMap attributes;
+ Node element;
+ Attr attribute;
+ NodeList elementList;
+ doc = (Document) load("staffNS", true);
+ elementList = doc.getElementsByTagNameNS("http://www.nist.gov", "employee");
+ element = elementList.item(1);
+ attributes = element.getAttributes();
+
+ {
+ boolean success = false;
+ try {
+ attribute = (Attr) attributes.removeNamedItemNS("http://www.nist.gov", "domestic");
+ } catch (DOMException ex) {
+ success = (ex.code == DOMException.NOT_FOUND_ERR);
+ }
+ assertTrue("throw_NOT_FOUND_ERR", success);
+ }
+}
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level2/core/namednodemapremovenameditemns07";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(namednodemapremovenameditemns07.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level2/core/namednodemapremovenameditemns08.java b/dom/src/test/java/org/w3c/domts/level2/core/namednodemapremovenameditemns08.java
new file mode 100644
index 0000000..5c4cad3
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level2/core/namednodemapremovenameditemns08.java
@@ -0,0 +1,110 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+
+Copyright (c) 2001-2004 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+
+*/
+
+package org.w3c.domts.level2.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The method removeNamedItemNS removes a node using its namespaceURI and localName and
+ * raises a NOT_FOUND_ERR if there is no node with the specified namespaceURI and
+ * localName in this map
+ *
+ * Retreive an attribute node from a namednodemap. Remove the attribute node from the document
+ * object. Since NamedNodeMaps are live it should also automatically get removed from
+ * the node map. And so if an attempt is made to remove it using removeAttributeNS, this should
+ * raise a NOT_FOUND_ERR.
+* @author IBM
+* @author Neil Delima
+* @see <a href="http://www.w3.org/TR/DOM-Level-2-Core/core#ID-D58B193">http://www.w3.org/TR/DOM-Level-2-Core/core#ID-D58B193</a>
+*/
+public final class namednodemapremovenameditemns08 extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public namednodemapremovenameditemns08(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+
+ org.w3c.domts.DocumentBuilderSetting[] settings =
+ new org.w3c.domts.DocumentBuilderSetting[] {
+org.w3c.domts.DocumentBuilderSetting.namespaceAware
+ };
+ DOMTestDocumentBuilderFactory testFactory = factory.newInstance(settings);
+ setFactory(testFactory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "staffNS", true);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ NamedNodeMap attributes;
+ Element element;
+ Attr attribute;
+ NodeList elementList;
+ doc = (Document) load("staffNS", true);
+ elementList = doc.getElementsByTagNameNS("http://www.nist.gov", "address");
+ element = (Element) elementList.item(1);
+ attributes = element.getAttributes();
+ element.removeAttributeNS("http://www.nist.gov", "domestic");
+
+ {
+ boolean success = false;
+ try {
+ attribute = (Attr) attributes.removeNamedItemNS("http://www.nist.gov", "domestic");
+ } catch (DOMException ex) {
+ success = (ex.code == DOMException.NOT_FOUND_ERR);
+ }
+ assertTrue("throw_NOT_FOUND_ERR", success);
+ }
+}
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level2/core/namednodemapremovenameditemns08";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(namednodemapremovenameditemns08.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level2/core/namednodemapremovenameditemns09.java b/dom/src/test/java/org/w3c/domts/level2/core/namednodemapremovenameditemns09.java
new file mode 100644
index 0000000..a04e42f
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level2/core/namednodemapremovenameditemns09.java
@@ -0,0 +1,102 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+
+Copyright (c) 2001 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+
+*/
+
+package org.w3c.domts.level2.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The method removeNamedItemNS removes a node using its namespaceURI and localName and
+ * raises a NOT_FOUND_ERR if there is no node with the specified namespaceURI and
+ * localName in this map
+ *
+ * Retreive an attribute node. Remove the attribute node from the node map.
+ * Check the element object to ensure that the attribute node has been removed from it.
+* @author IBM
+* @author Neil Delima
+* @see <a href="http://www.w3.org/TR/DOM-Level-2-Core/core#ID-D58B193">http://www.w3.org/TR/DOM-Level-2-Core/core#ID-D58B193</a>
+*/
+public final class namednodemapremovenameditemns09 extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public namednodemapremovenameditemns09(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+
+ org.w3c.domts.DocumentBuilderSetting[] settings =
+ new org.w3c.domts.DocumentBuilderSetting[] {
+org.w3c.domts.DocumentBuilderSetting.namespaceAware
+ };
+ DOMTestDocumentBuilderFactory testFactory = factory.newInstance(settings);
+ setFactory(testFactory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "staffNS", true);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ NamedNodeMap attributes;
+ NamedNodeMap newAttributes;
+ Element element;
+ Attr attribute;
+ NodeList elementList;
+ doc = (Document) load("staffNS", true);
+ elementList = doc.getElementsByTagNameNS("http://www.nist.gov", "address");
+ element = (Element) elementList.item(1);
+ attributes = element.getAttributes();
+ attribute = (Attr) attributes.removeNamedItemNS("http://www.nist.gov", "domestic");
+ newAttributes = element.getAttributes();
+ attribute = (Attr) newAttributes.getNamedItemNS("http://www.nist.gov", "domestic");
+ assertNull("namednodemapremovenameditemns09", attribute);
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level2/core/namednodemapremovenameditemns09";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(namednodemapremovenameditemns09.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level2/core/namednodemapsetnameditemns01.java b/dom/src/test/java/org/w3c/domts/level2/core/namednodemapsetnameditemns01.java
new file mode 100644
index 0000000..c112463
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level2/core/namednodemapsetnameditemns01.java
@@ -0,0 +1,106 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+
+Copyright (c) 2001 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+
+*/
+
+package org.w3c.domts.level2.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The method setNamedItemNS adds a node using its namespaceURI and localName. If a node with
+ * that namespace URI and that local name is already present in this map, it is replaced
+ * by the new one.
+ *
+ * Retreive the first element whose localName is address and namespaceURI http://www.nist.gov",
+ * and put its attributes into a named node map. Create a new attribute node and add it to this map.
+ * Verify if the attr node was successfully added by checking the nodeName of the retreived atttribute.
+* @author IBM
+* @author Neil Delima
+* @see <a href="http://www.w3.org/TR/DOM-Level-2-Core/core#ID-getNamedItemNS">http://www.w3.org/TR/DOM-Level-2-Core/core#ID-getNamedItemNS</a>
+*/
+public final class namednodemapsetnameditemns01 extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public namednodemapsetnameditemns01(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+
+ org.w3c.domts.DocumentBuilderSetting[] settings =
+ new org.w3c.domts.DocumentBuilderSetting[] {
+org.w3c.domts.DocumentBuilderSetting.namespaceAware
+ };
+ DOMTestDocumentBuilderFactory testFactory = factory.newInstance(settings);
+ setFactory(testFactory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "staffNS", true);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ NamedNodeMap attributes;
+ Node element;
+ Attr attribute;
+ Attr newAttribute;
+ Attr newAttr1;
+ NodeList elementList;
+ String attrName;
+ doc = (Document) load("staffNS", true);
+ elementList = doc.getElementsByTagNameNS("http://www.nist.gov", "address");
+ element = elementList.item(0);
+ attributes = element.getAttributes();
+ newAttr1 = doc.createAttributeNS("http://www.w3.org/DOM/L1", "streets");
+ newAttribute = ((Element) /*Node */element).setAttributeNodeNS(newAttr1);
+ attribute = (Attr) attributes.getNamedItemNS("http://www.w3.org/DOM/L1", "streets");
+ attrName = attribute.getNodeName();
+ assertEquals("namednodemapsetnameditemns01", "streets", attrName);
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level2/core/namednodemapsetnameditemns01";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(namednodemapsetnameditemns01.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level2/core/namednodemapsetnameditemns02.java b/dom/src/test/java/org/w3c/domts/level2/core/namednodemapsetnameditemns02.java
new file mode 100644
index 0000000..1660694
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level2/core/namednodemapsetnameditemns02.java
@@ -0,0 +1,104 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+
+Copyright (c) 2001 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+
+*/
+
+package org.w3c.domts.level2.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The method setNamedItemNS adds a node using its namespaceURI and localName. If a node with
+ * that namespace URI and that local name is already present in this map, it is replaced
+ * by the new one.
+ *
+ * Create a new element and attribute Node and add the newly created attribute node to the elements
+ * NamedNodeMap. Verify if the new attr node has been successfully added to the map by checking
+ * the nodeName of the retreived atttribute from the list of attribute nodes in this map.
+* @author IBM
+* @author Neil Delima
+* @see <a href="http://www.w3.org/TR/DOM-Level-2-Core/core#ID-setNamedItemNS">http://www.w3.org/TR/DOM-Level-2-Core/core#ID-setNamedItemNS</a>
+*/
+public final class namednodemapsetnameditemns02 extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public namednodemapsetnameditemns02(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+
+ org.w3c.domts.DocumentBuilderSetting[] settings =
+ new org.w3c.domts.DocumentBuilderSetting[] {
+org.w3c.domts.DocumentBuilderSetting.namespaceAware
+ };
+ DOMTestDocumentBuilderFactory testFactory = factory.newInstance(settings);
+ setFactory(testFactory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "staffNS", true);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ NamedNodeMap attributes;
+ Element element;
+ Attr attribute;
+ Attr attribute1;
+ Node newNode;
+ String attrName;
+ doc = (Document) load("staffNS", true);
+ element = doc.createElementNS("http://www.w3.org/DOM/Test", "root");
+ attribute1 = doc.createAttributeNS("http://www.w3.org/DOM/L1", "L1:att");
+ attributes = element.getAttributes();
+ newNode = attributes.setNamedItemNS(attribute1);
+ attribute = (Attr) attributes.getNamedItemNS("http://www.w3.org/DOM/L1", "att");
+ attrName = attribute.getNodeName();
+ assertEquals("namednodemapsetnameditemns02", "L1:att", attrName);
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level2/core/namednodemapsetnameditemns02";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(namednodemapsetnameditemns02.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level2/core/namednodemapsetnameditemns03.java b/dom/src/test/java/org/w3c/domts/level2/core/namednodemapsetnameditemns03.java
new file mode 100644
index 0000000..2cc8279
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level2/core/namednodemapsetnameditemns03.java
@@ -0,0 +1,125 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+
+Copyright (c) 2001-2004 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+
+*/
+
+package org.w3c.domts.level2.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The method setNamedItemNS adds a node using its namespaceURI and localName and
+ * raises a WRONG_DOCUMENT_ERR if arg was created from a different document than the
+ * one that created this map.
+ *
+ * Retreieve the second element whose local name is address and its attribute into a named node map.
+ * Do the same for another document and retreive its street attribute. Call the setNamedItemNS
+ * using the first namedNodeMap and the retreive street attribute of the second. This should
+ * raise a WRONG_DOCUMENT_ERR.
+* @author IBM
+* @author Neil Delima
+* @see <a href="http://www.w3.org/TR/DOM-Level-2-Core/core#ID-setNamedItemNS">http://www.w3.org/TR/DOM-Level-2-Core/core#ID-setNamedItemNS</a>
+* @see <a href="http://www.w3.org/Bugs/Public/show_bug.cgi?id=259">http://www.w3.org/Bugs/Public/show_bug.cgi?id=259</a>
+* @see <a href="http://www.w3.org/Bugs/Public/show_bug.cgi?id=408">http://www.w3.org/Bugs/Public/show_bug.cgi?id=408</a>
+*/
+public final class namednodemapsetnameditemns03 extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public namednodemapsetnameditemns03(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+
+ org.w3c.domts.DocumentBuilderSetting[] settings =
+ new org.w3c.domts.DocumentBuilderSetting[] {
+org.w3c.domts.DocumentBuilderSetting.namespaceAware
+ };
+ DOMTestDocumentBuilderFactory testFactory = factory.newInstance(settings);
+ setFactory(testFactory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "staffNS", true);
+ preload(contentType, "staffNS", true);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ Document docAlt;
+ NamedNodeMap attributes;
+ NamedNodeMap attributesAlt;
+ NodeList elementList;
+ NodeList elementListAlt;
+ Element element;
+ Element elementAlt;
+ Attr attr;
+ Node newNode;
+ String nullNS = null;
+
+ doc = (Document) load("staffNS", true);
+ elementList = doc.getElementsByTagNameNS("*", "address");
+ element = (Element) elementList.item(1);
+ attributes = element.getAttributes();
+ docAlt = (Document) load("staffNS", true);
+ elementListAlt = docAlt.getElementsByTagNameNS("*", "address");
+ elementAlt = (Element) elementListAlt.item(1);
+ attributesAlt = elementAlt.getAttributes();
+ attr = (Attr) attributesAlt.getNamedItemNS(nullNS, "street");
+ newNode = attributesAlt.removeNamedItemNS(nullNS, "street");
+
+ {
+ boolean success = false;
+ try {
+ newNode = attributes.setNamedItemNS(attr);
+ } catch (DOMException ex) {
+ success = (ex.code == DOMException.WRONG_DOCUMENT_ERR);
+ }
+ assertTrue("throw_WRONG_DOCUMENT_ERR", success);
+ }
+}
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level2/core/namednodemapsetnameditemns03";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(namednodemapsetnameditemns03.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level2/core/namednodemapsetnameditemns04.java b/dom/src/test/java/org/w3c/domts/level2/core/namednodemapsetnameditemns04.java
new file mode 100644
index 0000000..475b95c
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level2/core/namednodemapsetnameditemns04.java
@@ -0,0 +1,120 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+
+Copyright (c) 2001-2004 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+
+*/
+
+package org.w3c.domts.level2.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The method setNamedItemNS adds a node using its namespaceURI and localName and
+ * raises a WRONG_DOCUMENT_ERR if arg was created from a different document than the
+ * one that created this map.
+ *
+ * Retreieve the second element whose local name is address and its attribute into a named node map.
+ * Create a new document and a new attribute node in it. Call the setNamedItemNS using the first
+ * namedNodeMap and the new attribute node attribute of the new document. This should
+ * raise a WRONG_DOCUMENT_ERR.
+* @author IBM
+* @author Neil Delima
+* @see <a href="http://www.w3.org/TR/DOM-Level-2-Core/core#ID-setNamedItemNS">http://www.w3.org/TR/DOM-Level-2-Core/core#ID-setNamedItemNS</a>
+* @see <a href="http://www.w3.org/Bugs/Public/show_bug.cgi?id=259">http://www.w3.org/Bugs/Public/show_bug.cgi?id=259</a>
+*/
+public final class namednodemapsetnameditemns04 extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public namednodemapsetnameditemns04(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+
+ org.w3c.domts.DocumentBuilderSetting[] settings =
+ new org.w3c.domts.DocumentBuilderSetting[] {
+org.w3c.domts.DocumentBuilderSetting.namespaceAware
+ };
+ DOMTestDocumentBuilderFactory testFactory = factory.newInstance(settings);
+ setFactory(testFactory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "staffNS", true);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ DOMImplementation domImpl;
+ Document docAlt;
+ DocumentType docType = null;
+
+ NamedNodeMap attributes;
+ NodeList elementList;
+ Element element;
+ Attr attrAlt;
+ Node newNode;
+ String nullNS = null;
+
+ doc = (Document) load("staffNS", true);
+ elementList = doc.getElementsByTagNameNS("*", "address");
+ element = (Element) elementList.item(1);
+ attributes = element.getAttributes();
+ domImpl = doc.getImplementation();
+ docAlt = domImpl.createDocument(nullNS, "newDoc", docType);
+ attrAlt = docAlt.createAttributeNS(nullNS, "street");
+
+ {
+ boolean success = false;
+ try {
+ newNode = attributes.setNamedItemNS(attrAlt);
+ } catch (DOMException ex) {
+ success = (ex.code == DOMException.WRONG_DOCUMENT_ERR);
+ }
+ assertTrue("throw_WRONG_DOCUMENT_ERR", success);
+ }
+}
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level2/core/namednodemapsetnameditemns04";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(namednodemapsetnameditemns04.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level2/core/namednodemapsetnameditemns05.java b/dom/src/test/java/org/w3c/domts/level2/core/namednodemapsetnameditemns05.java
new file mode 100644
index 0000000..673f46d
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level2/core/namednodemapsetnameditemns05.java
@@ -0,0 +1,125 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+
+Copyright (c) 2001-2004 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+
+*/
+
+package org.w3c.domts.level2.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * Retreive an entity and notation node and add the first notation to the
+ * notation node map and first entity node to the entity map. Since both these
+ * maps are for readonly node, a NO_MODIFICATION_ALLOWED_ERR should be raised.
+* @author IBM
+* @author Neil Delima
+* @see <a href="http://www.w3.org/TR/DOM-Level-2-Core/core#ID-setNamedItemNS">http://www.w3.org/TR/DOM-Level-2-Core/core#ID-setNamedItemNS</a>
+* @see <a href="http://www.w3.org/Bugs/Public/show_bug.cgi?id=259">http://www.w3.org/Bugs/Public/show_bug.cgi?id=259</a>
+* @see <a href="http://www.w3.org/Bugs/Public/show_bug.cgi?id=407">http://www.w3.org/Bugs/Public/show_bug.cgi?id=407</a>
+* @see <a href="http://lists.w3.org/Archives/Member/w3c-dom-ig/2003Nov/0016.html">http://lists.w3.org/Archives/Member/w3c-dom-ig/2003Nov/0016.html</a>
+*/
+public final class namednodemapsetnameditemns05 extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public namednodemapsetnameditemns05(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+
+ org.w3c.domts.DocumentBuilderSetting[] settings =
+ new org.w3c.domts.DocumentBuilderSetting[] {
+org.w3c.domts.DocumentBuilderSetting.namespaceAware
+ };
+ DOMTestDocumentBuilderFactory testFactory = factory.newInstance(settings);
+ setFactory(testFactory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "staffNS", true);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ DocumentType docType;
+ NamedNodeMap entities;
+ NamedNodeMap notations;
+ Entity entity;
+ Notation notation;
+ Node newNode;
+ String nullNS = null;
+
+ doc = (Document) load("staffNS", true);
+ docType = doc.getDoctype();
+ entities = docType.getEntities();
+ assertNotNull("entitiesNotNull", entities);
+ notations = docType.getNotations();
+ assertNotNull("notationsNotNull", notations);
+ entity = (Entity) entities.getNamedItem("ent1");
+ notation = (Notation) notations.getNamedItem("notation1");
+
+ {
+ boolean success = false;
+ try {
+ newNode = entities.setNamedItemNS(entity);
+ } catch (DOMException ex) {
+ success = (ex.code == DOMException.NO_MODIFICATION_ALLOWED_ERR);
+ }
+ assertTrue("throw_NO_MODIFICATION_ALLOWED_ERR_entities", success);
+ }
+
+ {
+ boolean success = false;
+ try {
+ newNode = notations.setNamedItemNS(notation);
+ } catch (DOMException ex) {
+ success = (ex.code == DOMException.NO_MODIFICATION_ALLOWED_ERR);
+ }
+ assertTrue("throw_NO_MODIFICATION_ALLOWED_ERR_notations", success);
+ }
+}
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level2/core/namednodemapsetnameditemns05";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(namednodemapsetnameditemns05.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level2/core/namednodemapsetnameditemns06.java b/dom/src/test/java/org/w3c/domts/level2/core/namednodemapsetnameditemns06.java
new file mode 100644
index 0000000..93c2886
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level2/core/namednodemapsetnameditemns06.java
@@ -0,0 +1,110 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+
+Copyright (c) 2001 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+
+*/
+
+package org.w3c.domts.level2.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * Retreieve the first element whose localName is address and its attributes into a named node map.
+ * Retreiving the domestic attribute from the namednodemap.
+ * Retreieve the second element whose localName is address and its attributes into a named node map.
+ * Invoke setNamedItemNS on the second NamedNodeMap specifying the first domestic attribute from
+ * the first map. This should raise an INUSE_ATTRIBIUTE_ERR.
+* @author IBM
+* @author Neil Delima
+* @see <a href="http://www.w3.org/TR/DOM-Level-2-Core/core#ID-setNamedItemNS">http://www.w3.org/TR/DOM-Level-2-Core/core#ID-setNamedItemNS</a>
+*/
+public final class namednodemapsetnameditemns06 extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public namednodemapsetnameditemns06(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+
+ org.w3c.domts.DocumentBuilderSetting[] settings =
+ new org.w3c.domts.DocumentBuilderSetting[] {
+org.w3c.domts.DocumentBuilderSetting.namespaceAware
+ };
+ DOMTestDocumentBuilderFactory testFactory = factory.newInstance(settings);
+ setFactory(testFactory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "staffNS", true);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ NamedNodeMap attributes;
+ NodeList elementList;
+ Element element;
+ Attr attr;
+ Node newNode;
+ doc = (Document) load("staffNS", true);
+ elementList = doc.getElementsByTagNameNS("*", "address");
+ element = (Element) elementList.item(0);
+ attributes = element.getAttributes();
+ attr = (Attr) attributes.getNamedItemNS("http://www.usa.com", "domestic");
+ element = (Element) elementList.item(1);
+ attributes = element.getAttributes();
+
+ {
+ boolean success = false;
+ try {
+ newNode = attributes.setNamedItemNS(attr);
+ } catch (DOMException ex) {
+ success = (ex.code == DOMException.INUSE_ATTRIBUTE_ERR);
+ }
+ assertTrue("namednodemapsetnameditemns06", success);
+ }
+}
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level2/core/namednodemapsetnameditemns06";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(namednodemapsetnameditemns06.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level2/core/namednodemapsetnameditemns07.java b/dom/src/test/java/org/w3c/domts/level2/core/namednodemapsetnameditemns07.java
new file mode 100644
index 0000000..69582cf
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level2/core/namednodemapsetnameditemns07.java
@@ -0,0 +1,116 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+
+Copyright (c) 2001 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+
+*/
+
+package org.w3c.domts.level2.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The method setNamedItemNS adds a node using its namespaceURI and localName and
+ * raises a INUSE_ATTRIBUTE_ERR Raised if arg is an Attr that is already an
+ * attribute of another Element object.
+ *
+ * Retreieve the attributes of first element whose localName is address into a named node map.
+ * Retreive the attribute whose namespaceURI=http://www.usa.com and localName=domestic
+ * from the NamedNodeMap. Retreieve the attributes of second element whose localName is address
+ * into a named node map. Call the setNamedItemNS method on the second nodemap with the domestic
+ * attribute that was retreived and removed from the first nodeMap as an argument.
+ * Assuming that when an attribute is removed from a nodemap, it still remains in the domtree
+ * his should raise an INUSE_ATTRIBIUTE_ERR.
+* @author IBM
+* @author Neil Delima
+* @see <a href="http://www.w3.org/TR/DOM-Level-2-Core/core#ID-setNamedItemNS">http://www.w3.org/TR/DOM-Level-2-Core/core#ID-setNamedItemNS</a>
+*/
+public final class namednodemapsetnameditemns07 extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public namednodemapsetnameditemns07(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+
+ org.w3c.domts.DocumentBuilderSetting[] settings =
+ new org.w3c.domts.DocumentBuilderSetting[] {
+org.w3c.domts.DocumentBuilderSetting.namespaceAware
+ };
+ DOMTestDocumentBuilderFactory testFactory = factory.newInstance(settings);
+ setFactory(testFactory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "staffNS", true);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ NamedNodeMap attributes;
+ NodeList elementList;
+ Element element;
+ Attr attr;
+ Node newNode;
+ doc = (Document) load("staffNS", true);
+ elementList = doc.getElementsByTagNameNS("*", "address");
+ element = (Element) elementList.item(0);
+ attributes = element.getAttributes();
+ attr = (Attr) attributes.getNamedItemNS("http://www.usa.com", "domestic");
+ element = (Element) elementList.item(1);
+ attributes = element.getAttributes();
+
+ {
+ boolean success = false;
+ try {
+ newNode = attributes.setNamedItemNS(attr);
+ } catch (DOMException ex) {
+ success = (ex.code == DOMException.INUSE_ATTRIBUTE_ERR);
+ }
+ assertTrue("namednodemapsetnameditemns07", success);
+ }
+}
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level2/core/namednodemapsetnameditemns07";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(namednodemapsetnameditemns07.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level2/core/namednodemapsetnameditemns08.java b/dom/src/test/java/org/w3c/domts/level2/core/namednodemapsetnameditemns08.java
new file mode 100644
index 0000000..fd0985a
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level2/core/namednodemapsetnameditemns08.java
@@ -0,0 +1,112 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+
+Copyright (c) 2001 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+
+*/
+
+package org.w3c.domts.level2.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * raises a INUSE_ATTRIBUTE_ERR Raised if arg is an Attr that is already an
+ * attribute of another Element object.
+ * Retreieve the first element whose localName is address and its attributes into a named node map.
+ * Retreiving the domestic attribute from the namednodemap. Retreieve the second element whose
+ * localName is address and its attributes into a named node map. Invoke setNamedItemNS on the
+ * second NamedNodeMap specifying the attribute from the first map.
+ * This should raise an INUSE_ATTRIBIUTE_ERR.
+* @author IBM
+* @author Neil Delima
+* @see <a href="http://www.w3.org/TR/DOM-Level-2-Core/core#ID-setNamedItemNS">http://www.w3.org/TR/DOM-Level-2-Core/core#ID-setNamedItemNS</a>
+*/
+public final class namednodemapsetnameditemns08 extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public namednodemapsetnameditemns08(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+
+ org.w3c.domts.DocumentBuilderSetting[] settings =
+ new org.w3c.domts.DocumentBuilderSetting[] {
+org.w3c.domts.DocumentBuilderSetting.namespaceAware
+ };
+ DOMTestDocumentBuilderFactory testFactory = factory.newInstance(settings);
+ setFactory(testFactory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "staffNS", true);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ NamedNodeMap attributes;
+ NodeList elementList;
+ Element element;
+ Attr attr;
+ Node newNode;
+ doc = (Document) load("staffNS", true);
+ elementList = doc.getElementsByTagNameNS("*", "address");
+ element = (Element) elementList.item(0);
+ attributes = element.getAttributes();
+ attr = (Attr) attributes.getNamedItemNS("http://www.usa.com", "domestic");
+ element = (Element) elementList.item(1);
+ attributes = element.getAttributes();
+
+ {
+ boolean success = false;
+ try {
+ newNode = attributes.setNamedItemNS(attr);
+ } catch (DOMException ex) {
+ success = (ex.code == DOMException.INUSE_ATTRIBUTE_ERR);
+ }
+ assertTrue("namednodemapsetnameditemns08", success);
+ }
+}
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level2/core/namednodemapsetnameditemns08";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(namednodemapsetnameditemns08.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level2/core/namednodemapsetnameditemns09.java b/dom/src/test/java/org/w3c/domts/level2/core/namednodemapsetnameditemns09.java
new file mode 100644
index 0000000..b9102ba
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level2/core/namednodemapsetnameditemns09.java
@@ -0,0 +1,118 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+
+Copyright (c) 2001-2004 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+
+*/
+
+package org.w3c.domts.level2.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The method setNamedItemNS adds a node using its namespaceURI and localName and
+ * raises a NO_MODIFICATION_ALLOWED_ERR if this map is readonly.
+ *
+ * Create a new attribute node and attempt to add it to the nodemap of entities and notations
+ * for this documenttype. This should reaise a NO_MODIFICATION_ALLOWED_ERR.
+* @author IBM
+* @author Neil Delima
+* @see <a href="http://www.w3.org/TR/DOM-Level-2-Core/core#ID-setNamedItemNS">http://www.w3.org/TR/DOM-Level-2-Core/core#ID-setNamedItemNS</a>
+*/
+public final class namednodemapsetnameditemns09 extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public namednodemapsetnameditemns09(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+
+ org.w3c.domts.DocumentBuilderSetting[] settings =
+ new org.w3c.domts.DocumentBuilderSetting[] {
+org.w3c.domts.DocumentBuilderSetting.namespaceAware
+ };
+ DOMTestDocumentBuilderFactory testFactory = factory.newInstance(settings);
+ setFactory(testFactory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "staffNS", true);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ DocumentType docType;
+ NamedNodeMap entities;
+ NamedNodeMap notations;
+ Attr attr;
+ Node newNode;
+ doc = (Document) load("staffNS", true);
+ docType = doc.getDoctype();
+ entities = docType.getEntities();
+ notations = docType.getNotations();
+ attr = doc.createAttributeNS("http://www.w3.org/DOM/Test", "test");
+
+ {
+ boolean success = false;
+ try {
+ newNode = entities.setNamedItemNS(attr);
+ } catch (DOMException ex) {
+ success = (ex.code == DOMException.NO_MODIFICATION_ALLOWED_ERR);
+ }
+ assertTrue("throw_NO_MODIFICATION_ALLOWED_ERR_entities", success);
+ }
+
+ {
+ boolean success = false;
+ try {
+ newNode = notations.setNamedItemNS(attr);
+ } catch (DOMException ex) {
+ success = (ex.code == DOMException.NO_MODIFICATION_ALLOWED_ERR);
+ }
+ assertTrue("throw_NO_MODIFICATION_ALLOWED_ERR_notations", success);
+ }
+}
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level2/core/namednodemapsetnameditemns09";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(namednodemapsetnameditemns09.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level2/core/namednodemapsetnameditemns10.java b/dom/src/test/java/org/w3c/domts/level2/core/namednodemapsetnameditemns10.java
new file mode 100644
index 0000000..abe6940
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level2/core/namednodemapsetnameditemns10.java
@@ -0,0 +1,116 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+
+Copyright (c) 2001-2004 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+
+*/
+
+package org.w3c.domts.level2.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The method setNamedItemNS adds a node using its namespaceURI and localName and
+ * raises a HIERARCHY_REQUEST_ERR if an attempt is made to add a node doesn't belong
+ * in this NamedNodeMap.
+ * Attempt to add an entity to a NamedNodeMap of attribute nodes,
+ * Since nodes of this type cannot be added to the attribute node map a HIERARCHY_REQUEST_ERR
+ * should be raised.
+* @author IBM
+* @author Neil Delima
+* @see <a href="http://www.w3.org/TR/DOM-Level-2-Core/core#ID-setNamedItemNS">http://www.w3.org/TR/DOM-Level-2-Core/core#ID-setNamedItemNS</a>
+* @see <a href="http://www.w3.org/Bugs/Public/show_bug.cgi?id=259">http://www.w3.org/Bugs/Public/show_bug.cgi?id=259</a>
+*/
+public final class namednodemapsetnameditemns10 extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public namednodemapsetnameditemns10(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+
+ org.w3c.domts.DocumentBuilderSetting[] settings =
+ new org.w3c.domts.DocumentBuilderSetting[] {
+org.w3c.domts.DocumentBuilderSetting.namespaceAware
+ };
+ DOMTestDocumentBuilderFactory testFactory = factory.newInstance(settings);
+ setFactory(testFactory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "staffNS", true);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ DocumentType docType;
+ NamedNodeMap entities;
+ NamedNodeMap attributes;
+ Entity entity;
+ Notation notation;
+ Element element;
+ NodeList elementList;
+ Node newNode;
+ doc = (Document) load("staffNS", true);
+ docType = doc.getDoctype();
+ entities = docType.getEntities();
+ assertNotNull("entitiesNotNull", entities);
+ entity = (Entity) entities.getNamedItem("ent1");
+ elementList = doc.getElementsByTagNameNS("http://www.nist.gov", "address");
+ element = (Element) elementList.item(0);
+ attributes = element.getAttributes();
+
+ {
+ boolean success = false;
+ try {
+ newNode = attributes.setNamedItemNS(entity);
+ } catch (DOMException ex) {
+ success = (ex.code == DOMException.HIERARCHY_REQUEST_ERR);
+ }
+ assertTrue("throw_HIERARCHY_REQUEST_ERR", success);
+ }
+}
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level2/core/namednodemapsetnameditemns10";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(namednodemapsetnameditemns10.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level2/core/namednodemapsetnameditemns11.java b/dom/src/test/java/org/w3c/domts/level2/core/namednodemapsetnameditemns11.java
new file mode 100644
index 0000000..cb9d1b6
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level2/core/namednodemapsetnameditemns11.java
@@ -0,0 +1,117 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+
+Copyright (c) 2001-2004 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+
+*/
+
+package org.w3c.domts.level2.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The method setNamedItemNS adds a node using its namespaceURI and localName and
+ * raises a HIERARCHY_REQUEST_ERR if an attempt is made to add a node doesn't belong
+ * in this NamedNodeMap.
+ * Attempt to add a notation node to a NamedNodeMap of attribute nodes,
+ * Since notations nodes do not belong in the attribute node map a HIERARCHY_REQUEST_ERR
+ * should be raised.
+* @author IBM
+* @author Neil Delima
+* @see <a href="http://www.w3.org/TR/DOM-Level-2-Core/core#ID-setNamedItemNS">http://www.w3.org/TR/DOM-Level-2-Core/core#ID-setNamedItemNS</a>
+* @see <a href="http://www.w3.org/Bugs/Public/show_bug.cgi?id=259">http://www.w3.org/Bugs/Public/show_bug.cgi?id=259</a>
+*/
+public final class namednodemapsetnameditemns11 extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public namednodemapsetnameditemns11(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+
+ org.w3c.domts.DocumentBuilderSetting[] settings =
+ new org.w3c.domts.DocumentBuilderSetting[] {
+org.w3c.domts.DocumentBuilderSetting.namespaceAware
+ };
+ DOMTestDocumentBuilderFactory testFactory = factory.newInstance(settings);
+ setFactory(testFactory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "staffNS", true);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ DocumentType docType;
+ NamedNodeMap notations;
+ NamedNodeMap attributes;
+ Notation notation;
+ Element element;
+ NodeList elementList;
+ Node newNode;
+ String nullNS = null;
+
+ doc = (Document) load("staffNS", true);
+ docType = doc.getDoctype();
+ notations = docType.getNotations();
+ assertNotNull("notationsNotNull", notations);
+ notation = (Notation) notations.getNamedItem("notation1");
+ elementList = doc.getElementsByTagNameNS("http://www.nist.gov", "address");
+ element = (Element) elementList.item(0);
+ attributes = element.getAttributes();
+
+ {
+ boolean success = false;
+ try {
+ newNode = attributes.setNamedItemNS(notation);
+ } catch (DOMException ex) {
+ success = (ex.code == DOMException.HIERARCHY_REQUEST_ERR);
+ }
+ assertTrue("throw_HIERARCHY_REQUEST_ERR", success);
+ }
+}
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level2/core/namednodemapsetnameditemns11";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(namednodemapsetnameditemns11.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level2/core/namespaceURI01.java b/dom/src/test/java/org/w3c/domts/level2/core/namespaceURI01.java
new file mode 100644
index 0000000..7f3b5d0
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level2/core/namespaceURI01.java
@@ -0,0 +1,102 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+
+Copyright (c) 2001-2003 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+
+*/
+
+package org.w3c.domts.level2.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The "getNamespaceURI()" method for an Attribute
+ * returns the namespace URI of this node, or null if unspecified.
+ *
+ * Retrieve the first "emp:address" node which has an attribute of "emp:district"
+ * that is specified in the DTD.
+ * Invoke the "getNamespaceURI()" method on the attribute.
+ * The method should return "http://www.nist.gov".
+* @author NIST
+* @author Mary Brady
+* @see <a href="http://www.w3.org/TR/DOM-Level-2-Core/core#ID-NodeNSname">http://www.w3.org/TR/DOM-Level-2-Core/core#ID-NodeNSname</a>
+* @see <a href="http://www.w3.org/Bugs/Public/show_bug.cgi?id=238">http://www.w3.org/Bugs/Public/show_bug.cgi?id=238</a>
+*/
+public final class namespaceURI01 extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public namespaceURI01(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+
+ org.w3c.domts.DocumentBuilderSetting[] settings =
+ new org.w3c.domts.DocumentBuilderSetting[] {
+org.w3c.domts.DocumentBuilderSetting.namespaceAware,
+org.w3c.domts.DocumentBuilderSetting.validating
+ };
+ DOMTestDocumentBuilderFactory testFactory = factory.newInstance(settings);
+ setFactory(testFactory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "staffNS", false);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ NodeList elementList;
+ Element testAddr;
+ Attr addrAttr;
+ String attrNamespaceURI;
+ doc = (Document) load("staffNS", false);
+ elementList = doc.getElementsByTagName("emp:address");
+ testAddr = (Element) elementList.item(0);
+ addrAttr = testAddr.getAttributeNodeNS("http://www.nist.gov", "district");
+ attrNamespaceURI = addrAttr.getNamespaceURI();
+ assertEquals("namespaceURI", "http://www.nist.gov", attrNamespaceURI);
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level2/core/namespaceURI01";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(namespaceURI01.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level2/core/namespaceURI02.java b/dom/src/test/java/org/w3c/domts/level2/core/namespaceURI02.java
new file mode 100644
index 0000000..ee548ba
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level2/core/namespaceURI02.java
@@ -0,0 +1,100 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+
+Copyright (c) 2001-2004 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+
+*/
+
+package org.w3c.domts.level2.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The "getNamespaceURI()" method for an Attribute
+ * returns the namespace URI of this node, or null if unspecified.
+ *
+ * Retrieve the first emp:address node and get the emp:domestic attribute.
+ * Invoke the "getNamespaceURI()" method on the attribute.
+ * The method should return "http://www.nist.gov".
+* @author NIST
+* @author Mary Brady
+* @see <a href="http://www.w3.org/TR/DOM-Level-2-Core/core#ID-NodeNSname">http://www.w3.org/TR/DOM-Level-2-Core/core#ID-NodeNSname</a>
+*/
+public final class namespaceURI02 extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public namespaceURI02(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+
+ org.w3c.domts.DocumentBuilderSetting[] settings =
+ new org.w3c.domts.DocumentBuilderSetting[] {
+org.w3c.domts.DocumentBuilderSetting.namespaceAware
+ };
+ DOMTestDocumentBuilderFactory testFactory = factory.newInstance(settings);
+ setFactory(testFactory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "staffNS", false);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ NodeList elementList;
+ Element testAddr;
+ Attr addrAttr;
+ String attrNamespaceURI;
+ doc = (Document) load("staffNS", false);
+ elementList = doc.getElementsByTagName("emp:address");
+ testAddr = (Element) elementList.item(0);
+ assertNotNull("empAddressNotNull", testAddr);
+ addrAttr = testAddr.getAttributeNodeNS("http://www.nist.gov", "domestic");
+ attrNamespaceURI = addrAttr.getNamespaceURI();
+ assertEquals("namespaceURI", "http://www.nist.gov", attrNamespaceURI);
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level2/core/namespaceURI02";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(namespaceURI02.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level2/core/namespaceURI03.java b/dom/src/test/java/org/w3c/domts/level2/core/namespaceURI03.java
new file mode 100644
index 0000000..9be77aa
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level2/core/namespaceURI03.java
@@ -0,0 +1,97 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+
+Copyright (c) 2001-2004 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+
+*/
+
+package org.w3c.domts.level2.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The "getNamespaceURI()" method for a Node
+ * returns the namespace URI of this node, or null if unspecified.
+ *
+ * Retrieve the first employee node and invoke the "getNamespaceURI()"
+ * method. The method should return "http://www.nist.gov".
+* @author NIST
+* @author Mary Brady
+* @see <a href="http://www.w3.org/TR/DOM-Level-2-Core/core#ID-NodeNSname">http://www.w3.org/TR/DOM-Level-2-Core/core#ID-NodeNSname</a>
+*/
+public final class namespaceURI03 extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public namespaceURI03(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+
+ org.w3c.domts.DocumentBuilderSetting[] settings =
+ new org.w3c.domts.DocumentBuilderSetting[] {
+org.w3c.domts.DocumentBuilderSetting.namespaceAware
+ };
+ DOMTestDocumentBuilderFactory testFactory = factory.newInstance(settings);
+ setFactory(testFactory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "staffNS", false);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ NodeList elementList;
+ Node testEmployee;
+ String employeeNamespace;
+ doc = (Document) load("staffNS", false);
+ elementList = doc.getElementsByTagName("employee");
+ testEmployee = elementList.item(0);
+ assertNotNull("employeeNotNull", testEmployee);
+ employeeNamespace = testEmployee.getNamespaceURI();
+ assertEquals("namespaceURI", "http://www.nist.gov", employeeNamespace);
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level2/core/namespaceURI03";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(namespaceURI03.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level2/core/namespaceURI04.java b/dom/src/test/java/org/w3c/domts/level2/core/namespaceURI04.java
new file mode 100644
index 0000000..ad602dc
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level2/core/namespaceURI04.java
@@ -0,0 +1,90 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+
+Copyright (c) 2001 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+
+*/
+
+package org.w3c.domts.level2.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The "getNamespaceURI()" method for a Node
+ * returns the namespace URI of this node, or null if unspecified.
+ *
+ * Retrieve the second employee node and invoke the "getNamespaceURI()"
+ * method. The method should return "null".
+* @author NIST
+* @author Mary Brady
+* @see <a href="http://www.w3.org/TR/DOM-Level-2-Core/core#ID-NodeNSname">http://www.w3.org/TR/DOM-Level-2-Core/core#ID-NodeNSname</a>
+*/
+public final class namespaceURI04 extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public namespaceURI04(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "staffNS", false);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ NodeList elementList;
+ Node testEmployee;
+ String employeeNamespace;
+ doc = (Document) load("staffNS", false);
+ elementList = doc.getElementsByTagName("employee");
+ testEmployee = elementList.item(1);
+ employeeNamespace = testEmployee.getNamespaceURI();
+ assertNull("throw_Null", employeeNamespace);
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level2/core/namespaceURI04";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(namespaceURI04.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level2/core/nodegetlocalname03.java b/dom/src/test/java/org/w3c/domts/level2/core/nodegetlocalname03.java
new file mode 100644
index 0000000..4ff651d
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level2/core/nodegetlocalname03.java
@@ -0,0 +1,109 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+
+Copyright (c) 2001 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+
+*/
+
+package org.w3c.domts.level2.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The method getLocalName returns the local part of the qualified name of this node.
+ *
+ * Ceate two new element nodes and atribute nodes, with and without namespace prefixes.
+ * Retreive the local part of their qualified names using getLocalName and verrify
+ * if it is correct.
+* @author IBM
+* @author Neil Delima
+* @see <a href="http://www.w3.org/TR/DOM-Level-2-Core/core#ID-NodeNSLocalN">http://www.w3.org/TR/DOM-Level-2-Core/core#ID-NodeNSLocalN</a>
+*/
+public final class nodegetlocalname03 extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public nodegetlocalname03(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+
+ org.w3c.domts.DocumentBuilderSetting[] settings =
+ new org.w3c.domts.DocumentBuilderSetting[] {
+org.w3c.domts.DocumentBuilderSetting.namespaceAware
+ };
+ DOMTestDocumentBuilderFactory testFactory = factory.newInstance(settings);
+ setFactory(testFactory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "staff", false);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ Element element;
+ Element qelement;
+ Attr attr;
+ Attr qattr;
+ String localElemName;
+ String localQElemName;
+ String localAttrName;
+ String localQAttrName;
+ doc = (Document) load("staff", false);
+ element = doc.createElementNS("http://www.w3.org/DOM/Test/elem", "elem");
+ qelement = doc.createElementNS("http://www.w3.org/DOM/Test/elem", "qual:qelem");
+ attr = doc.createAttributeNS("http://www.w3.org/DOM/Test/attr", "attr");
+ qattr = doc.createAttributeNS("http://www.w3.org/DOM/Test/attr", "qual:qattr");
+ localElemName = element.getLocalName();
+ localQElemName = qelement.getLocalName();
+ localAttrName = attr.getLocalName();
+ localQAttrName = qattr.getLocalName();
+ assertEquals("nodegetlocalname03_localElemName", "elem", localElemName);
+ assertEquals("nodegetlocalname03_localQElemName", "qelem", localQElemName);
+ assertEquals("nodegetlocalname03_localAttrName", "attr", localAttrName);
+ assertEquals("nodegetlocalname03_localQAttrName", "qattr", localQAttrName);
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level2/core/nodegetlocalname03";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(nodegetlocalname03.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level2/core/nodegetnamespaceuri03.java b/dom/src/test/java/org/w3c/domts/level2/core/nodegetnamespaceuri03.java
new file mode 100644
index 0000000..e4ee9fe
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level2/core/nodegetnamespaceuri03.java
@@ -0,0 +1,113 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+
+Copyright (c) 2001-2003 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+
+*/
+
+package org.w3c.domts.level2.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The method getNamespaceURI returns the namespace URI of this node, or null if it is unspecified
+ * For nodes of any type other than ELEMENT_NODE and ATTRIBUTE_NODE and nodes created with
+ * a DOM Level 1 method, such as createElement from the Document interface, this is always null.
+ *
+ * Ceate two new element nodes and atribute nodes, with and without namespace prefixes.
+ * Retreive their namespaceURI's using getNamespaceURI and verrify if it is correct.
+* @author IBM
+* @author Neil Delima
+* @see <a href="http://www.w3.org/TR/DOM-Level-2-Core/core#ID-NodeNSname">http://www.w3.org/TR/DOM-Level-2-Core/core#ID-NodeNSname</a>
+* @see <a href="http://www.w3.org/Bugs/Public/show_bug.cgi?id=259">http://www.w3.org/Bugs/Public/show_bug.cgi?id=259</a>
+*/
+public final class nodegetnamespaceuri03 extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public nodegetnamespaceuri03(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+
+ org.w3c.domts.DocumentBuilderSetting[] settings =
+ new org.w3c.domts.DocumentBuilderSetting[] {
+org.w3c.domts.DocumentBuilderSetting.namespaceAware
+ };
+ DOMTestDocumentBuilderFactory testFactory = factory.newInstance(settings);
+ setFactory(testFactory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "staff", false);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ Element element;
+ Element elementNS;
+ Attr attr;
+ Attr attrNS;
+ String elemNSURI;
+ String elemNSURINull;
+ String attrNSURI;
+ String attrNSURINull;
+ String nullNS = null;
+
+ doc = (Document) load("staff", false);
+ element = doc.createElementNS(nullNS, "elem");
+ elementNS = doc.createElementNS("http://www.w3.org/DOM/Test/elem", "qual:qelem");
+ attr = doc.createAttributeNS(nullNS, "attr");
+ attrNS = doc.createAttributeNS("http://www.w3.org/DOM/Test/attr", "qual:qattr");
+ elemNSURI = elementNS.getNamespaceURI();
+ elemNSURINull = element.getNamespaceURI();
+ attrNSURI = attrNS.getNamespaceURI();
+ attrNSURINull = attr.getNamespaceURI();
+ assertEquals("nodegetnamespaceuri03_elemNSURI", "http://www.w3.org/DOM/Test/elem", elemNSURI);
+ assertNull("nodegetnamespaceuri03_1", elemNSURINull);
+ assertEquals("nodegetnamespaceuri03_attrNSURI", "http://www.w3.org/DOM/Test/attr", attrNSURI);
+ assertNull("nodegetnamespaceuri03_2", attrNSURINull);
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level2/core/nodegetnamespaceuri03";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(nodegetnamespaceuri03.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level2/core/nodegetownerdocument01.java b/dom/src/test/java/org/w3c/domts/level2/core/nodegetownerdocument01.java
new file mode 100644
index 0000000..d90d866
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level2/core/nodegetownerdocument01.java
@@ -0,0 +1,98 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+
+Copyright (c) 2001-2003 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+
+*/
+
+package org.w3c.domts.level2.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The method getOwnerDocument returns the Document object associated with this node
+ *
+ * Create a new DocumentType node. Since this node is not used with any Document yet
+ * verify if the ownerDocument is null.
+* @author IBM
+* @author Neil Delima
+* @see <a href="http://www.w3.org/TR/DOM-Level-2-Core/core#node-ownerDoc">http://www.w3.org/TR/DOM-Level-2-Core/core#node-ownerDoc</a>
+* @see <a href="http://www.w3.org/Bugs/Public/show_bug.cgi?id=259">http://www.w3.org/Bugs/Public/show_bug.cgi?id=259</a>
+*/
+public final class nodegetownerdocument01 extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public nodegetownerdocument01(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+
+ org.w3c.domts.DocumentBuilderSetting[] settings =
+ new org.w3c.domts.DocumentBuilderSetting[] {
+org.w3c.domts.DocumentBuilderSetting.namespaceAware
+ };
+ DOMTestDocumentBuilderFactory testFactory = factory.newInstance(settings);
+ setFactory(testFactory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "staff", false);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ Document ownerDoc;
+ DOMImplementation domImpl;
+ DocumentType docType;
+ String nullID = null;
+
+ doc = (Document) load("staff", false);
+ domImpl = doc.getImplementation();
+ docType = domImpl.createDocumentType("mydoc", nullID, nullID);
+ ownerDoc = docType.getOwnerDocument();
+ assertNull("nodegetownerdocument01", ownerDoc);
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level2/core/nodegetownerdocument01";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(nodegetownerdocument01.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level2/core/nodegetownerdocument02.java b/dom/src/test/java/org/w3c/domts/level2/core/nodegetownerdocument02.java
new file mode 100644
index 0000000..9c7b89d
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level2/core/nodegetownerdocument02.java
@@ -0,0 +1,106 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+
+Copyright (c) 2001-2003 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+
+*/
+
+package org.w3c.domts.level2.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The method getOwnerDocument returns the Document object associated with this node
+ *
+ * Create a new Document node. Since this node is not used with any Document yet
+ * verify if the ownerDocument is null. Create a new element Node on the new Document
+ * object. Check the ownerDocument of the new element node.
+* @author IBM
+* @author Neil Delima
+* @see <a href="http://www.w3.org/TR/DOM-Level-2-Core/core#node-ownerDoc">http://www.w3.org/TR/DOM-Level-2-Core/core#node-ownerDoc</a>
+* @see <a href="http://www.w3.org/Bugs/Public/show_bug.cgi?id=259">http://www.w3.org/Bugs/Public/show_bug.cgi?id=259</a>
+*/
+public final class nodegetownerdocument02 extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public nodegetownerdocument02(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+
+ org.w3c.domts.DocumentBuilderSetting[] settings =
+ new org.w3c.domts.DocumentBuilderSetting[] {
+org.w3c.domts.DocumentBuilderSetting.namespaceAware
+ };
+ DOMTestDocumentBuilderFactory testFactory = factory.newInstance(settings);
+ setFactory(testFactory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "staff", false);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ Document newDoc;
+ Element newElem;
+ Document ownerDocDoc;
+ Document ownerDocElem;
+ DOMImplementation domImpl;
+ DocumentType docType;
+ String nullNS = null;
+
+ doc = (Document) load("staff", false);
+ domImpl = doc.getImplementation();
+ docType = domImpl.createDocumentType("mydoc", nullNS, nullNS);
+ newDoc = domImpl.createDocument("http://www.w3.org/DOM/Test", "mydoc", docType);
+ ownerDocDoc = newDoc.getOwnerDocument();
+ assertNull("nodegetownerdocument02_1", ownerDocDoc);
+ newElem = newDoc.createElementNS("http://www.w3.org/DOM/Test", "myelem");
+ ownerDocElem = newElem.getOwnerDocument();
+ assertNotNull("nodegetownerdocument02_2", ownerDocElem);
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level2/core/nodegetownerdocument02";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(nodegetownerdocument02.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level2/core/nodegetprefix03.java b/dom/src/test/java/org/w3c/domts/level2/core/nodegetprefix03.java
new file mode 100644
index 0000000..2cba0eb
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level2/core/nodegetprefix03.java
@@ -0,0 +1,109 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+
+Copyright (c) 2001 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+
+*/
+
+package org.w3c.domts.level2.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The method getPrefix returns the namespace prefix of this node, or null if it is unspecified.
+ *
+ * Ceate two new element nodes and atribute nodes, with and without namespace prefixes.
+ * Retreive the prefix part of their qualified names using getPrefix and verify
+ * if it is correct.
+* @author IBM
+* @author Neil Delima
+* @see <a href="http://www.w3.org/TR/DOM-Level-2-Core/core#ID-NodeNSPrefix">http://www.w3.org/TR/DOM-Level-2-Core/core#ID-NodeNSPrefix</a>
+*/
+public final class nodegetprefix03 extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public nodegetprefix03(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+
+ org.w3c.domts.DocumentBuilderSetting[] settings =
+ new org.w3c.domts.DocumentBuilderSetting[] {
+org.w3c.domts.DocumentBuilderSetting.namespaceAware
+ };
+ DOMTestDocumentBuilderFactory testFactory = factory.newInstance(settings);
+ setFactory(testFactory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "staff", false);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ Element element;
+ Element qelement;
+ Attr attr;
+ Attr qattr;
+ String elemNoPrefix;
+ String elemPrefix;
+ String attrNoPrefix;
+ String attrPrefix;
+ doc = (Document) load("staff", false);
+ element = doc.createElementNS("http://www.w3.org/DOM/Test/elem", "elem");
+ qelement = doc.createElementNS("http://www.w3.org/DOM/Test/elem", "qual:qelem");
+ attr = doc.createAttributeNS("http://www.w3.org/DOM/Test/attr", "attr");
+ qattr = doc.createAttributeNS("http://www.w3.org/DOM/Test/attr", "qual:qattr");
+ elemNoPrefix = element.getPrefix();
+ elemPrefix = qelement.getPrefix();
+ attrNoPrefix = attr.getPrefix();
+ attrPrefix = qattr.getPrefix();
+ assertNull("nodegetprefix03_1", elemNoPrefix);
+ assertEquals("nodegetprefix03_2", "qual", elemPrefix);
+ assertNull("nodegetprefix03_3", attrNoPrefix);
+ assertEquals("nodegetprefix03_4", "qual", attrPrefix);
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level2/core/nodegetprefix03";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(nodegetprefix03.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level2/core/nodehasattributes01.java b/dom/src/test/java/org/w3c/domts/level2/core/nodehasattributes01.java
new file mode 100644
index 0000000..45c90d2
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level2/core/nodehasattributes01.java
@@ -0,0 +1,92 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+
+Copyright (c) 2001 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+
+*/
+
+package org.w3c.domts.level2.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The method hasAttributes returns whether this node (if it is an element) has any attributes.
+ * Retreive an element node without attributes. Verify if hasAttributes returns false.
+ * Retreive another element node with attributes. Verify if hasAttributes returns true.
+* @author IBM
+* @author Neil Delima
+* @see <a href="http://www.w3.org/TR/DOM-Level-2-Core/core#ID-NodeHasAttrs">http://www.w3.org/TR/DOM-Level-2-Core/core#ID-NodeHasAttrs</a>
+*/
+public final class nodehasattributes01 extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public nodehasattributes01(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "staff", false);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ Element element;
+ NodeList elementList;
+ boolean hasAttributes;
+ doc = (Document) load("staff", false);
+ elementList = doc.getElementsByTagName("employee");
+ element = (Element) elementList.item(0);
+ hasAttributes = element.hasAttributes();
+ assertFalse("nodehasattributes01_1", hasAttributes);
+elementList = doc.getElementsByTagName("address");
+ element = (Element) elementList.item(0);
+ hasAttributes = element.hasAttributes();
+ assertTrue("nodehasattributes01_2", hasAttributes);
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level2/core/nodehasattributes01";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(nodehasattributes01.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level2/core/nodehasattributes02.java b/dom/src/test/java/org/w3c/domts/level2/core/nodehasattributes02.java
new file mode 100644
index 0000000..93660cd
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level2/core/nodehasattributes02.java
@@ -0,0 +1,99 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+
+
+
+Copyright (c) 2001 World Wide Web Consortium,
+
+(Massachusetts Institute of Technology, Institut National de
+
+Recherche en Informatique et en Automatique, Keio University). All
+
+Rights Reserved. This program is distributed under the W3C's Software
+
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+
+
+
+*/
+
+package org.w3c.domts.level2.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The method hasAttributes returns whether this node (if it is an element) has any attributes.
+ * Retrieve the docType node. Since this is not an element node check if hasAttributes returns
+ * null.
+* @author IBM
+* @author Neil Delima
+* @see <a href="http://www.w3.org/TR/DOM-Level-2-Core/core#ID-NodeHasAttrs">http://www.w3.org/TR/DOM-Level-2-Core/core#ID-NodeHasAttrs</a>
+*/
+public final class nodehasattributes02 extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public nodehasattributes02(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "staffNS", false);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ DocumentType docType;
+ boolean hasAttributes;
+ doc = (Document) load("staffNS", false);
+ docType = doc.getDoctype();
+ hasAttributes = docType.hasAttributes();
+ assertFalse("nodehasattributes02", hasAttributes);
+}
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level2/core/nodehasattributes02";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(nodehasattributes02.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level2/core/nodehasattributes03.java b/dom/src/test/java/org/w3c/domts/level2/core/nodehasattributes03.java
new file mode 100644
index 0000000..555b934
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level2/core/nodehasattributes03.java
@@ -0,0 +1,88 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+
+Copyright (c) 2001-2004 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+
+*/
+
+package org.w3c.domts.level2.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The method hasAttributes returns whether this node (if it is an element) has any attributes.
+ * Retreive an element node with a default attributes. Verify if hasAttributes returns true.
+* @author IBM
+* @author Neil Delima
+* @see <a href="http://www.w3.org/TR/DOM-Level-2-Core/core#ID-NodeHasAttrs">http://www.w3.org/TR/DOM-Level-2-Core/core#ID-NodeHasAttrs</a>
+*/
+public final class nodehasattributes03 extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public nodehasattributes03(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "staffNS", false);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ Element element;
+ NodeList elementList;
+ boolean hasAttributes;
+ doc = (Document) load("staffNS", false);
+ elementList = doc.getElementsByTagName("emp:employee");
+ element = (Element) elementList.item(0);
+ assertNotNull("empEmployeeNotNull", element);
+ hasAttributes = element.hasAttributes();
+ assertTrue("hasAttributes", hasAttributes);
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level2/core/nodehasattributes03";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(nodehasattributes03.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level2/core/nodehasattributes04.java b/dom/src/test/java/org/w3c/domts/level2/core/nodehasattributes04.java
new file mode 100644
index 0000000..eeef3d0
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level2/core/nodehasattributes04.java
@@ -0,0 +1,111 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+
+Copyright (c) 2001 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+
+*/
+
+package org.w3c.domts.level2.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The method hasAttributes returns whether this node (if it is an element) has any attributes.
+ * Create a new Document, Element and Attr node. Add the Attr to the Element and append the
+ * Element to the Document. Retreive the newly created element node from the document and check
+ * if it has attributes using hasAttributes.
+* @author IBM
+* @author Neil Delima
+* @see <a href="http://www.w3.org/TR/DOM-Level-2-Core/core#ID-NodeHasAttrs">http://www.w3.org/TR/DOM-Level-2-Core/core#ID-NodeHasAttrs</a>
+*/
+public final class nodehasattributes04 extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public nodehasattributes04(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+
+ org.w3c.domts.DocumentBuilderSetting[] settings =
+ new org.w3c.domts.DocumentBuilderSetting[] {
+org.w3c.domts.DocumentBuilderSetting.namespaceAware
+ };
+ DOMTestDocumentBuilderFactory testFactory = factory.newInstance(settings);
+ setFactory(testFactory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "staffNS", false);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ Document newDoc;
+ DocumentType docType = null;
+
+ DOMImplementation domImpl;
+ Element element;
+ Element elementTest;
+ Element elementDoc;
+ Attr attribute;
+ Node setNode;
+ Node appendedChild;
+ NodeList elementList;
+ boolean hasAttributes;
+ doc = (Document) load("staffNS", false);
+ domImpl = doc.getImplementation();
+ newDoc = domImpl.createDocument("http://www.w3.org/DOM/Test", "test", docType);
+ element = newDoc.createElementNS("http://www.w3.org/DOM/Test", "dom:elem");
+ attribute = newDoc.createAttribute("attr");
+ setNode = element.setAttributeNode(attribute);
+ elementDoc = newDoc.getDocumentElement();
+ appendedChild = elementDoc.appendChild(element);
+ elementList = newDoc.getElementsByTagNameNS("http://www.w3.org/DOM/Test", "elem");
+ elementTest = (Element) elementList.item(0);
+ hasAttributes = elementTest.hasAttributes();
+ assertTrue("nodehasattributes04", hasAttributes);
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level2/core/nodehasattributes04";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(nodehasattributes04.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level2/core/nodeissupported01.java b/dom/src/test/java/org/w3c/domts/level2/core/nodeissupported01.java
new file mode 100644
index 0000000..7747d98
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level2/core/nodeissupported01.java
@@ -0,0 +1,116 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+
+Copyright (c) 2001-2003 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+
+*/
+
+package org.w3c.domts.level2.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The method "isSupported(feature,version)" Tests whether the DOM implementation
+ * implements a specific feature and that feature is supported by this node.
+ *
+ * Call the isSupported method on the document element node with a combination of features
+ * versions and versions as below. Valid feature names are case insensitive and versions
+ * "2.0", "1.0" and if the version is not specified, supporting any version of the feature
+ * should return true. Check if the value returned value was true.
+* @author IBM
+* @author Neil Delima
+* @see <a href="http://www.w3.org/TR/DOM-Level-2-Core/core#Level-2-Core-Node-supports">http://www.w3.org/TR/DOM-Level-2-Core/core#Level-2-Core-Node-supports</a>
+*/
+public final class nodeissupported01 extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public nodeissupported01(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "staffNS", false);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ Element element;
+ String version = "";
+ String version1 = "1.0";
+ String version2 = "2.0";
+ String featureCore;
+ String featureXML;
+ boolean success;
+ java.util.List featuresXML = new java.util.ArrayList();
+ featuresXML.add("XML");
+ featuresXML.add("xmL");
+
+ java.util.List featuresCore = new java.util.ArrayList();
+ featuresCore.add("Core");
+ featuresCore.add("CORE");
+
+ doc = (Document) load("staffNS", false);
+ element = doc.getDocumentElement();
+ for (int indexN10063 = 0; indexN10063 < featuresXML.size(); indexN10063++) {
+ featureXML = (String) featuresXML.get(indexN10063);
+ success = element.isSupported(featureXML, version);
+ assertTrue("nodeissupported01_XML1", success);
+ success = element.isSupported(featureXML, version1);
+ assertTrue("nodeissupported01_XML2", success);
+ }
+ for (int indexN1007C = 0; indexN1007C < featuresCore.size(); indexN1007C++) {
+ featureCore = (String) featuresCore.get(indexN1007C);
+ success = element.isSupported(featureCore, version);
+ assertTrue("nodeissupported01_Core1", success);
+ success = element.isSupported(featureCore, version1);
+ success = element.isSupported(featureCore, version2);
+ assertTrue("nodeissupported01_Core3", success);
+ }
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level2/core/nodeissupported01";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(nodeissupported01.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level2/core/nodeissupported02.java b/dom/src/test/java/org/w3c/domts/level2/core/nodeissupported02.java
new file mode 100644
index 0000000..0db6e1a
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level2/core/nodeissupported02.java
@@ -0,0 +1,116 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+
+Copyright (c) 2001-2003 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+
+*/
+
+package org.w3c.domts.level2.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The method "isSupported(feature,version)" Tests whether the DOM implementation
+ * implements a specific feature and that feature is supported by this node.
+ *
+ * Call the isSupported method on a new attribute node with a combination of features
+ * versions and versions as below. Valid feature names are case insensitive and versions
+ * "2.0", "1.0" and if the version is not specified, supporting any version of the feature
+ * should return true. Check if the value returned value was true.
+* @author IBM
+* @author Neil Delima
+* @see <a href="http://www.w3.org/TR/DOM-Level-2-Core/core#Level-2-Core-Node-supports">http://www.w3.org/TR/DOM-Level-2-Core/core#Level-2-Core-Node-supports</a>
+*/
+public final class nodeissupported02 extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public nodeissupported02(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "staffNS", false);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ Attr attribute;
+ String version = "";
+ String version1 = "1.0";
+ String version2 = "2.0";
+ String featureCore;
+ String featureXML;
+ boolean success;
+ java.util.List featuresXML = new java.util.ArrayList();
+ featuresXML.add("XML");
+ featuresXML.add("xmL");
+
+ java.util.List featuresCore = new java.util.ArrayList();
+ featuresCore.add("Core");
+ featuresCore.add("CORE");
+
+ doc = (Document) load("staffNS", false);
+ attribute = doc.createAttribute("TestAttr");
+ for (int indexN10064 = 0; indexN10064 < featuresXML.size(); indexN10064++) {
+ featureXML = (String) featuresXML.get(indexN10064);
+ success = attribute.isSupported(featureXML, version);
+ assertTrue("nodeissupported02_XML1", success);
+ success = attribute.isSupported(featureXML, version1);
+ assertTrue("nodeissupported02_XML2", success);
+ }
+ for (int indexN1007D = 0; indexN1007D < featuresCore.size(); indexN1007D++) {
+ featureCore = (String) featuresCore.get(indexN1007D);
+ success = attribute.isSupported(featureCore, version);
+ assertTrue("nodeissupported02_Core1", success);
+ success = attribute.isSupported(featureCore, version1);
+ success = attribute.isSupported(featureCore, version2);
+ assertTrue("nodeissupported02_Core3", success);
+ }
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level2/core/nodeissupported02";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(nodeissupported02.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level2/core/nodeissupported03.java b/dom/src/test/java/org/w3c/domts/level2/core/nodeissupported03.java
new file mode 100644
index 0000000..2565c42
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level2/core/nodeissupported03.java
@@ -0,0 +1,101 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+
+
+
+Copyright (c) 2001 World Wide Web Consortium,
+
+(Massachusetts Institute of Technology, Institut National de
+
+Recherche en Informatique et en Automatique, Keio University). All
+
+Rights Reserved. This program is distributed under the W3C's Software
+
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+
+
+
+*/
+
+package org.w3c.domts.level2.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The method "isSupported(feature,version)" Tests whether the DOM implementation
+ * implements a specific feature and that feature is supported by this node.
+ *
+ * Call the isSupported method specifying empty strings for feature and version on a docType
+ * Node. Check if the value returned value was false.
+* @author IBM
+* @author Neil Delima
+* @see <a href="http://www.w3.org/TR/DOM-Level-2-Core/core#Level-2-Core-Node-supports">http://www.w3.org/TR/DOM-Level-2-Core/core#Level-2-Core-Node-supports</a>
+*/
+public final class nodeissupported03 extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public nodeissupported03(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "staffNS", false);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ DocumentType docType;
+ boolean success;
+ doc = (Document) load("staffNS", false);
+ docType = doc.getDoctype();
+ success = docType.isSupported("", "");
+ assertFalse("nodeissupported03", success);
+}
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level2/core/nodeissupported03";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(nodeissupported03.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level2/core/nodeissupported04.java b/dom/src/test/java/org/w3c/domts/level2/core/nodeissupported04.java
new file mode 100644
index 0000000..b3180c8
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level2/core/nodeissupported04.java
@@ -0,0 +1,89 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+
+Copyright (c) 2001-2004 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+
+*/
+
+package org.w3c.domts.level2.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The method "isSupported(feature,version)" Tests whether the DOM implementation
+ * implements a specific feature and that feature is supported by this node.
+ *
+ * Call the isSupported method specifying empty strings for feature and version on a
+ * new EntityReference node. Check if the value returned value was false.
+* @author IBM
+* @author Neil Delima
+* @see <a href="http://www.w3.org/TR/DOM-Level-2-Core/core#Level-2-Core-Node-supports">http://www.w3.org/TR/DOM-Level-2-Core/core#Level-2-Core-Node-supports</a>
+*/
+public final class nodeissupported04 extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public nodeissupported04(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "staffNS", false);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ EntityReference entRef;
+ boolean success;
+ doc = (Document) load("staffNS", false);
+ entRef = doc.createEntityReference("ent1");
+ assertNotNull("createdEntRefNotNull", entRef);
+ success = entRef.isSupported("XML CORE", "");
+ assertFalse("nodeissupported04", success);
+}
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level2/core/nodeissupported04";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(nodeissupported04.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level2/core/nodeissupported05.java b/dom/src/test/java/org/w3c/domts/level2/core/nodeissupported05.java
new file mode 100644
index 0000000..eaa5a90
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level2/core/nodeissupported05.java
@@ -0,0 +1,101 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+
+
+
+Copyright (c) 2001 World Wide Web Consortium,
+
+(Massachusetts Institute of Technology, Institut National de
+
+Recherche en Informatique et en Automatique, Keio University). All
+
+Rights Reserved. This program is distributed under the W3C's Software
+
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+
+
+
+*/
+
+package org.w3c.domts.level2.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The method "isSupported(feature,version)" Tests whether the DOM implementation
+ * implements a specific feature and that feature is supported by this node.
+ *
+ * Call the isSupported method specifying bad values for feature and version on a new
+ * Processing Instruction node. Check if the value returned from this method value was false.
+* @author IBM
+* @author Neil Delima
+* @see <a href="http://www.w3.org/TR/DOM-Level-2-Core/core#Level-2-Core-Node-supports">http://www.w3.org/TR/DOM-Level-2-Core/core#Level-2-Core-Node-supports</a>
+*/
+public final class nodeissupported05 extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public nodeissupported05(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "staffNS", false);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ ProcessingInstruction pi;
+ boolean success;
+ doc = (Document) load("staffNS", false);
+ pi = doc.createProcessingInstruction("PITarget", "PIData");
+ success = pi.isSupported("-", "+");
+ assertFalse("nodeissupported05", success);
+}
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level2/core/nodeissupported05";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(nodeissupported05.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level2/core/nodenormalize01.java b/dom/src/test/java/org/w3c/domts/level2/core/nodenormalize01.java
new file mode 100644
index 0000000..b2d4563
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level2/core/nodenormalize01.java
@@ -0,0 +1,193 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+
+Copyright (c) 2001-2004 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+
+*/
+
+package org.w3c.domts.level2.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The method "normalize" puts all Text nodes in the full depth of the sub-tree underneath
+ * this Node, including attribute nodes, into a "normal" form where only structure
+ * (e.g., elements, comments, processing instructions, CDATA sections, and entity references)
+ * separates Text nodes, i.e., there are neither adjacent Text nodes nor empty Text nodes.
+ *
+ * Create a dom tree consisting of elements, comments, processing instructions, CDATA sections,
+ * and entity references nodes seperated by text nodes. Check the length of the node list of each
+ * before and after normalize has been called.
+* @author IBM
+* @author Neil Delima
+* @see <a href="http://www.w3.org/TR/DOM-Level-2-Core/core#ID-normalize">http://www.w3.org/TR/DOM-Level-2-Core/core#ID-normalize</a>
+*/
+public final class nodenormalize01 extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public nodenormalize01(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "staffNS", true);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ Document newDoc;
+ DOMImplementation domImpl;
+ DocumentType docType;
+ DocumentType docTypeNull = null;
+
+ Element documentElement;
+ Element element1;
+ Element element2;
+ Element element3;
+ Element element4;
+ Element element5;
+ Element element6;
+ Element element7;
+ Text text1;
+ Text text2;
+ Text text3;
+ ProcessingInstruction pi;
+ CDATASection cData;
+ Comment comment;
+ EntityReference entRef;
+ NodeList elementList;
+ Node appendedChild;
+ doc = (Document) load("staffNS", true);
+ domImpl = doc.getImplementation();
+ newDoc = domImpl.createDocument("http://www.w3.org/DOM/Test", "dom:root", docTypeNull);
+ element1 = newDoc.createElement("element1");
+ element2 = newDoc.createElement("element2");
+ element3 = newDoc.createElement("element3");
+ element4 = newDoc.createElement("element4");
+ element5 = newDoc.createElement("element5");
+ element6 = newDoc.createElement("element6");
+ element7 = newDoc.createElement("element7");
+ text1 = newDoc.createTextNode("text1");
+ text2 = newDoc.createTextNode("text2");
+ text3 = newDoc.createTextNode("text3");
+ cData = newDoc.createCDATASection("Cdata");
+ comment = newDoc.createComment("comment");
+ pi = newDoc.createProcessingInstruction("PITarget", "PIData");
+ entRef = newDoc.createEntityReference("EntRef");
+ assertNotNull("createdEntRefNotNull", entRef);
+ documentElement = newDoc.getDocumentElement();
+ appendedChild = documentElement.appendChild(element1);
+ appendedChild = element2.appendChild(text1);
+ appendedChild = element2.appendChild(text2);
+ appendedChild = element2.appendChild(text3);
+ appendedChild = element1.appendChild(element2);
+ text1 = (Text) text1.cloneNode(false);
+ text2 = (Text) text2.cloneNode(false);
+ appendedChild = element3.appendChild(entRef);
+ appendedChild = element3.appendChild(text1);
+ appendedChild = element3.appendChild(text2);
+ appendedChild = element1.appendChild(element3);
+ text1 = (Text) text1.cloneNode(false);
+ text2 = (Text) text2.cloneNode(false);
+ appendedChild = element4.appendChild(cData);
+ appendedChild = element4.appendChild(text1);
+ appendedChild = element4.appendChild(text2);
+ appendedChild = element1.appendChild(element4);
+ text2 = (Text) text2.cloneNode(false);
+ text3 = (Text) text3.cloneNode(false);
+ appendedChild = element5.appendChild(comment);
+ appendedChild = element5.appendChild(text2);
+ appendedChild = element5.appendChild(text3);
+ appendedChild = element1.appendChild(element5);
+ text2 = (Text) text2.cloneNode(false);
+ text3 = (Text) text3.cloneNode(false);
+ appendedChild = element6.appendChild(pi);
+ appendedChild = element6.appendChild(text2);
+ appendedChild = element6.appendChild(text3);
+ appendedChild = element1.appendChild(element6);
+ entRef = (EntityReference) entRef.cloneNode(false);
+ text1 = (Text) text1.cloneNode(false);
+ text2 = (Text) text2.cloneNode(false);
+ text3 = (Text) text3.cloneNode(false);
+ appendedChild = element7.appendChild(entRef);
+ appendedChild = element7.appendChild(text1);
+ appendedChild = element7.appendChild(text2);
+ appendedChild = element7.appendChild(text3);
+ appendedChild = element1.appendChild(element7);
+ elementList = element1.getChildNodes();
+ assertSize("nodeNormalize01_1Bef", 6, elementList);
+ elementList = element2.getChildNodes();
+ assertSize("nodeNormalize01_2Bef", 3, elementList);
+ elementList = element3.getChildNodes();
+ assertSize("nodeNormalize01_3Bef", 3, elementList);
+ elementList = element4.getChildNodes();
+ assertSize("nodeNormalize01_4Bef", 3, elementList);
+ elementList = element5.getChildNodes();
+ assertSize("nodeNormalize01_5Bef", 3, elementList);
+ elementList = element6.getChildNodes();
+ assertSize("nodeNormalize01_6Bef", 3, elementList);
+ elementList = element7.getChildNodes();
+ assertSize("nodeNormalize01_7Bef", 4, elementList);
+ newDoc.normalize();
+ elementList = element1.getChildNodes();
+ assertSize("nodeNormalize01_1Aft", 6, elementList);
+ elementList = element2.getChildNodes();
+ assertSize("nodeNormalize01_2Aft", 1, elementList);
+ elementList = element3.getChildNodes();
+ assertSize("nodeNormalize01_3Aft", 2, elementList);
+ elementList = element4.getChildNodes();
+ assertSize("nodeNormalize01_4Aft", 2, elementList);
+ elementList = element5.getChildNodes();
+ assertSize("nodeNormalize01_5Aft", 2, elementList);
+ elementList = element6.getChildNodes();
+ assertSize("nodeNormalize01_6Aft", 2, elementList);
+ elementList = element7.getChildNodes();
+ assertSize("nodeNormalize01_7Aft", 2, elementList);
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level2/core/nodenormalize01";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(nodenormalize01.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level2/core/nodesetprefix01.java b/dom/src/test/java/org/w3c/domts/level2/core/nodesetprefix01.java
new file mode 100644
index 0000000..efd2e50
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level2/core/nodesetprefix01.java
@@ -0,0 +1,103 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+
+Copyright (c) 2001 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+
+*/
+
+package org.w3c.domts.level2.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The method setPrefix sets the namespace prefix of this node. Note that setting this attribute,
+ * when permitted, changes the nodeName attribute, which holds the qualified name, as well as the
+ * tagName and name attributes of the Element and Attr interfaces, when applicable.
+ *
+ * Create a new element node with a namespace prefix. Add it to a new DocumentFragment Node without
+ * a prefix. Call setPrefix on the elemen node. Check if the prefix was set correctly on the element.
+* @author IBM
+* @author Neil Delima
+* @see <a href="http://www.w3.org/TR/DOM-Level-2-Core/core#ID-NodeNSPrefix">http://www.w3.org/TR/DOM-Level-2-Core/core#ID-NodeNSPrefix</a>
+*/
+public final class nodesetprefix01 extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public nodesetprefix01(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+
+ org.w3c.domts.DocumentBuilderSetting[] settings =
+ new org.w3c.domts.DocumentBuilderSetting[] {
+org.w3c.domts.DocumentBuilderSetting.namespaceAware
+ };
+ DOMTestDocumentBuilderFactory testFactory = factory.newInstance(settings);
+ setFactory(testFactory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "staff", true);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ DocumentFragment docFragment;
+ Element element;
+ String elementTagName;
+ String elementNodeName;
+ Node appendedChild;
+ doc = (Document) load("staff", true);
+ docFragment = doc.createDocumentFragment();
+ element = doc.createElementNS("http://www.w3.org/DOM/Test", "emp:address");
+ appendedChild = docFragment.appendChild(element);
+ element.setPrefix("dmstc");
+ elementTagName = element.getTagName();
+ elementNodeName = element.getNodeName();
+ assertEquals("nodesetprefix01_tagname", "dmstc:address", elementTagName);
+ assertEquals("nodesetprefix01_nodeName", "dmstc:address", elementNodeName);
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level2/core/nodesetprefix01";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(nodesetprefix01.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level2/core/nodesetprefix02.java b/dom/src/test/java/org/w3c/domts/level2/core/nodesetprefix02.java
new file mode 100644
index 0000000..ef710d7
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level2/core/nodesetprefix02.java
@@ -0,0 +1,108 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+
+Copyright (c) 2001 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+
+*/
+
+package org.w3c.domts.level2.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The method setPrefix sets the namespace prefix of this node. Note that setting this attribute,
+ * when permitted, changes the nodeName attribute, which holds the qualified name, as well as the
+ * tagName and name attributes of the Element and Attr interfaces, when applicable.
+ * Create a new attribute node and add it to an element node with an existing attribute having
+ * the same localName as this attribute but different namespaceURI. Change the prefix of the
+ * newly created attribute using setPrefix. Check if the new attribute nodeName has changed
+ * and the existing attribute is the same.
+* @author IBM
+* @author Neil Delima
+* @see <a href="http://www.w3.org/TR/DOM-Level-2-Core/core#ID-NodeNSPrefix">http://www.w3.org/TR/DOM-Level-2-Core/core#ID-NodeNSPrefix</a>
+*/
+public final class nodesetprefix02 extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public nodesetprefix02(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+
+ org.w3c.domts.DocumentBuilderSetting[] settings =
+ new org.w3c.domts.DocumentBuilderSetting[] {
+org.w3c.domts.DocumentBuilderSetting.namespaceAware
+ };
+ DOMTestDocumentBuilderFactory testFactory = factory.newInstance(settings);
+ setFactory(testFactory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "staffNS", true);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ Element element;
+ Attr attribute;
+ Attr newAttribute;
+ Node setNode;
+ NodeList elementList;
+ String attrName;
+ String newAttrName;
+ doc = (Document) load("staffNS", true);
+ elementList = doc.getElementsByTagName("address");
+ element = (Element) elementList.item(1);
+ newAttribute = doc.createAttributeNS("http://www.w3.org/DOM/Test", "test:address");
+ setNode = element.setAttributeNodeNS(newAttribute);
+ newAttribute.setPrefix("dom");
+ attribute = element.getAttributeNodeNS("http://www.usa.com", "domestic");
+ attrName = attribute.getNodeName();
+ newAttrName = newAttribute.getNodeName();
+ assertEquals("nodesetprefix02_attrName", "dmstc:domestic", attrName);
+ assertEquals("nodesetprefix02_newAttrName", "dom:address", newAttrName);
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level2/core/nodesetprefix02";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(nodesetprefix02.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level2/core/nodesetprefix03.java b/dom/src/test/java/org/w3c/domts/level2/core/nodesetprefix03.java
new file mode 100644
index 0000000..ceaf5a7
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level2/core/nodesetprefix03.java
@@ -0,0 +1,100 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+
+Copyright (c) 2001-2004 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+
+*/
+
+package org.w3c.domts.level2.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The method setPrefix raises a NAMESPACE_ERR if the namespaceURI of this node is null.
+ *
+ * Create a new element node without a namespace prefix. Call setPrefix on the newly created elemenent node.
+ * Check if a NAMESPACE_ERR is thrown.
+* @author IBM
+* @author Neil Delima
+* @see <a href="http://www.w3.org/TR/DOM-Level-2-Core/core#ID-NodeNSPrefix">http://www.w3.org/TR/DOM-Level-2-Core/core#ID-NodeNSPrefix</a>
+*/
+public final class nodesetprefix03 extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public nodesetprefix03(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+
+ org.w3c.domts.DocumentBuilderSetting[] settings =
+ new org.w3c.domts.DocumentBuilderSetting[] {
+org.w3c.domts.DocumentBuilderSetting.namespaceAware
+ };
+ DOMTestDocumentBuilderFactory testFactory = factory.newInstance(settings);
+ setFactory(testFactory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "staffNS", true);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ Element element;
+ doc = (Document) load("staffNS", true);
+ element = doc.createElement("address");
+
+ {
+ boolean success = false;
+ try {
+ element.setPrefix("test");
+ } catch (DOMException ex) {
+ success = (ex.code == DOMException.NAMESPACE_ERR);
+ }
+ assertTrue("throw_NAMESPACE_ERR", success);
+ }
+}
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level2/core/nodesetprefix03";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(nodesetprefix03.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level2/core/nodesetprefix04.java b/dom/src/test/java/org/w3c/domts/level2/core/nodesetprefix04.java
new file mode 100644
index 0000000..9d17031
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level2/core/nodesetprefix04.java
@@ -0,0 +1,108 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+
+Copyright (c) 2001-2004 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+
+*/
+
+package org.w3c.domts.level2.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The method setPrefix raises a NAMESPACE_ERR if the namespaceURI of this node is null.
+ * Retreive the a default Attribute node which does not have a namespace prefix. Call the setPrefix
+ * method on it. Check if a NAMESPACE_ERR is thrown.
+* @author IBM
+* @author Neil Delima
+* @see <a href="http://www.w3.org/TR/DOM-Level-2-Core/core#ID-NodeNSPrefix">http://www.w3.org/TR/DOM-Level-2-Core/core#ID-NodeNSPrefix</a>
+* @see <a href="http://www.w3.org/Bugs/Public/show_bug.cgi?id=259">http://www.w3.org/Bugs/Public/show_bug.cgi?id=259</a>
+*/
+public final class nodesetprefix04 extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public nodesetprefix04(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+
+ org.w3c.domts.DocumentBuilderSetting[] settings =
+ new org.w3c.domts.DocumentBuilderSetting[] {
+org.w3c.domts.DocumentBuilderSetting.namespaceAware,
+org.w3c.domts.DocumentBuilderSetting.validating
+ };
+ DOMTestDocumentBuilderFactory testFactory = factory.newInstance(settings);
+ setFactory(testFactory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "staffNS", true);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ Element element;
+ Attr attribute;
+ NodeList elementList;
+ String nullNS = null;
+
+ doc = (Document) load("staffNS", true);
+ elementList = doc.getElementsByTagName("emp:employee");
+ element = (Element) elementList.item(0);
+ assertNotNull("empEmployeeNotNull", element);
+ attribute = element.getAttributeNodeNS(nullNS, "defaultAttr");
+
+ {
+ boolean success = false;
+ try {
+ attribute.setPrefix("test");
+ } catch (DOMException ex) {
+ success = (ex.code == DOMException.NAMESPACE_ERR);
+ }
+ assertTrue("nodesetprefix04", success);
+ }
+}
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level2/core/nodesetprefix04";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(nodesetprefix04.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level2/core/nodesetprefix05.java b/dom/src/test/java/org/w3c/domts/level2/core/nodesetprefix05.java
new file mode 100644
index 0000000..b9ba1c6
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level2/core/nodesetprefix05.java
@@ -0,0 +1,110 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+
+Copyright (c) 2001-2004 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+
+*/
+
+package org.w3c.domts.level2.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The method setPrefix raises a NAMESPACE_ERR if the specified prefix is malformed.
+ * Create a new namespace aware element node and call the setPrefix method on it with several malformed
+ * prefix values. Check if a NAMESPACE_ERR is thrown.
+* @author IBM
+* @author Neil Delima
+* @see <a href="http://www.w3.org/TR/DOM-Level-2-Core/core#ID-NodeNSPrefix">http://www.w3.org/TR/DOM-Level-2-Core/core#ID-NodeNSPrefix</a>
+*/
+public final class nodesetprefix05 extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public nodesetprefix05(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+
+ org.w3c.domts.DocumentBuilderSetting[] settings =
+ new org.w3c.domts.DocumentBuilderSetting[] {
+org.w3c.domts.DocumentBuilderSetting.namespaceAware
+ };
+ DOMTestDocumentBuilderFactory testFactory = factory.newInstance(settings);
+ setFactory(testFactory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "staffNS", true);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ Element element;
+ String prefixValue;
+ java.util.List prefixValues = new java.util.ArrayList();
+ prefixValues.add("_:");
+ prefixValues.add(":0");
+ prefixValues.add(":");
+ prefixValues.add("_::");
+ prefixValues.add("a:0:c");
+
+ doc = (Document) load("staffNS", true);
+ element = doc.createElementNS("http://www.w3.org/DOM/Test/L2", "dom:elem");
+ for (int indexN10050 = 0; indexN10050 < prefixValues.size(); indexN10050++) {
+ prefixValue = (String) prefixValues.get(indexN10050);
+
+ {
+ boolean success = false;
+ try {
+ element.setPrefix(prefixValue);
+ } catch (DOMException ex) {
+ success = (ex.code == DOMException.NAMESPACE_ERR);
+ }
+ assertTrue("throw_NAMESPACE_ERR", success);
+ }
+ }
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level2/core/nodesetprefix05";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(nodesetprefix05.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level2/core/nodesetprefix06.java b/dom/src/test/java/org/w3c/domts/level2/core/nodesetprefix06.java
new file mode 100644
index 0000000..6292d73
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level2/core/nodesetprefix06.java
@@ -0,0 +1,95 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+
+Copyright (c) 2001-2004 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+
+*/
+
+package org.w3c.domts.level2.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The method setPrefix raises a NAMESPACE_ERR if the specified prefix is "xml" and the namespaceURI
+ * of this node is different from "http://www.w3.org/XML/1998/namespace".
+ * Invoke the setPrefix method on this Element object with namespaceURI that is different from
+ * http://www..w3.org/xml/1998/namespace and a prefix whose values is xml.
+ * Check if the NAMESPACE_ERR was thrown.
+* @author IBM
+* @author Neil Delima
+* @see <a href="http://www.w3.org/TR/DOM-Level-2-Core/core#ID-NodeNSPrefix">http://www.w3.org/TR/DOM-Level-2-Core/core#ID-NodeNSPrefix</a>
+*/
+public final class nodesetprefix06 extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public nodesetprefix06(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "staffNS", true);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ Element element;
+ doc = (Document) load("staffNS", true);
+ element = doc.createElementNS("http://www.w3.org/DOM/Test/L2", "dom:elem");
+
+ {
+ boolean success = false;
+ try {
+ element.setPrefix("xml");
+ } catch (DOMException ex) {
+ success = (ex.code == DOMException.NAMESPACE_ERR);
+ }
+ assertTrue("throw_NAMESPACE_ERR", success);
+ }
+}
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level2/core/nodesetprefix06";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(nodesetprefix06.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level2/core/nodesetprefix07.java b/dom/src/test/java/org/w3c/domts/level2/core/nodesetprefix07.java
new file mode 100644
index 0000000..19dcb6e
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level2/core/nodesetprefix07.java
@@ -0,0 +1,96 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+
+Copyright (c) 2001-2004 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+
+*/
+
+package org.w3c.domts.level2.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The method setPrefix raises a NAMESPACE_ERR if this node is an attribute and the specified
+ * prefix is "xmlns" and the namespaceURI of this node is different from
+ * "http://www.w3.org/2000/xmlns/".
+ * Create a new attribute node whose namespaceURI is different form "http://www.w3.org/2000/xmlns/"
+ * and node prefix is "xmlns".
+ * Check if the NAMESPACE_ERR was thrown.
+* @author IBM
+* @author Neil Delima
+* @see <a href="http://www.w3.org/TR/DOM-Level-2-Core/core#ID-NodeNSPrefix">http://www.w3.org/TR/DOM-Level-2-Core/core#ID-NodeNSPrefix</a>
+*/
+public final class nodesetprefix07 extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public nodesetprefix07(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "staffNS", true);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ Attr attribute;
+ doc = (Document) load("staffNS", true);
+ attribute = doc.createAttributeNS("http://www.w3.org/DOM/Test/L2", "abc:elem");
+
+ {
+ boolean success = false;
+ try {
+ attribute.setPrefix("xmlns");
+ } catch (DOMException ex) {
+ success = (ex.code == DOMException.NAMESPACE_ERR);
+ }
+ assertTrue("throw_NAMESPACE_ERR", success);
+ }
+}
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level2/core/nodesetprefix07";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(nodesetprefix07.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level2/core/nodesetprefix08.java b/dom/src/test/java/org/w3c/domts/level2/core/nodesetprefix08.java
new file mode 100644
index 0000000..6ddad33
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level2/core/nodesetprefix08.java
@@ -0,0 +1,98 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+
+Copyright (c) 2001-2004 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+
+*/
+
+package org.w3c.domts.level2.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The method setPrefix raises a NAMESPACE_ERR if this node is an attribute and the qualifiedName
+ * of this node is "xmlns
+ * Retreive an attribute node whose qualifiedName is xmlns. Try setting a prefix on this node.
+ * Check if the NAMESPACE_ERR was thrown.
+* @author IBM
+* @author Neil Delima
+* @see <a href="http://www.w3.org/TR/DOM-Level-2-Core/core#ID-NodeNSPrefix">http://www.w3.org/TR/DOM-Level-2-Core/core#ID-NodeNSPrefix</a>
+*/
+public final class nodesetprefix08 extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public nodesetprefix08(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "staffNS", true);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ Element element;
+ NodeList elementList;
+ Attr attribute;
+ doc = (Document) load("staffNS", true);
+ elementList = doc.getElementsByTagName("employee");
+ element = (Element) elementList.item(0);
+ attribute = element.getAttributeNode("xmlns");
+
+ {
+ boolean success = false;
+ try {
+ attribute.setPrefix("xml");
+ } catch (DOMException ex) {
+ success = (ex.code == DOMException.NAMESPACE_ERR);
+ }
+ assertTrue("throw_NAMESPACE_ERR", success);
+ }
+}
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level2/core/nodesetprefix08";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(nodesetprefix08.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level2/core/nodesetprefix09.java b/dom/src/test/java/org/w3c/domts/level2/core/nodesetprefix09.java
new file mode 100644
index 0000000..426489f
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level2/core/nodesetprefix09.java
@@ -0,0 +1,94 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+
+Copyright (c) 2001-2004 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+
+*/
+
+package org.w3c.domts.level2.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The method setPrefix raises a INVALID_CHARACTER_ERR if the specified prefix contains an illegal character.
+ * Create a new namespace aware element node and call the setPrefix method on it with a prefix having
+ * an invalid character. Check if a NAMESPACE_ERR is thrown.
+* @author IBM
+* @author Neil Delima
+* @see <a href="http://www.w3.org/TR/DOM-Level-2-Core/core#ID-NodeNSPrefix">http://www.w3.org/TR/DOM-Level-2-Core/core#ID-NodeNSPrefix</a>
+*/
+public final class nodesetprefix09 extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public nodesetprefix09(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "staffNS", true);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ String value = "#$%&'()@";
+ Element element;
+ doc = (Document) load("staffNS", true);
+ element = doc.createElementNS("http://www.w3.org/DOM/Test/L2", "dom:elem");
+
+ {
+ boolean success = false;
+ try {
+ element.setPrefix(value);
+ } catch (DOMException ex) {
+ success = (ex.code == DOMException.INVALID_CHARACTER_ERR);
+ }
+ assertTrue("throw_INVALID_CHARACTER_ERR", success);
+ }
+}
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level2/core/nodesetprefix09";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(nodesetprefix09.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level2/core/normalize01.java b/dom/src/test/java/org/w3c/domts/level2/core/normalize01.java
new file mode 100644
index 0000000..d3b76bf
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level2/core/normalize01.java
@@ -0,0 +1,102 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+
+Copyright (c) 2001 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+
+*/
+
+package org.w3c.domts.level2.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The "normalize()" method puts all the nodes in the full
+ * depth of the sub-tree underneath this element into a
+ * "normal" form.
+ *
+ * Retrieve the third employee and access its second child.
+ * This child contains a block of text that is spread
+ * across multiple lines. The content of the "name" child
+ * should be parsed and treated as a single Text node.
+ * This appears to be a duplicate of elementnormalize.xml in DOM L1 Test Suite
+* @author NIST
+* @author Mary Brady
+* @see <a href="http://www.w3.org/TR/DOM-Level-2-Core/core#ID-normalize">http://www.w3.org/TR/DOM-Level-2-Core/core#ID-normalize</a>
+* @see <a href="http://www.w3.org/TR/DOM-Level-2-Core/core#ID-72AB8359">http://www.w3.org/TR/DOM-Level-2-Core/core#ID-72AB8359</a>
+*/
+public final class normalize01 extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public normalize01(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "staff", false);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ Element root;
+ NodeList elementList;
+ Node firstChild;
+ NodeList textList;
+ CharacterData textNode;
+ String data;
+ doc = (Document) load("staff", false);
+ root = doc.getDocumentElement();
+ root.normalize();
+ elementList = root.getElementsByTagName("name");
+ firstChild = elementList.item(2);
+ textList = firstChild.getChildNodes();
+ textNode = (CharacterData) textList.item(0);
+ data = textNode.getData();
+ assertEquals("data", "Roger\n Jones", data);
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level2/core/normalize01";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(normalize01.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level2/core/ownerDocument01.java b/dom/src/test/java/org/w3c/domts/level2/core/ownerDocument01.java
new file mode 100644
index 0000000..f77f32a
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level2/core/ownerDocument01.java
@@ -0,0 +1,86 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+
+Copyright (c) 2001 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+
+*/
+
+package org.w3c.domts.level2.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The "getOwnerDocument()" method returns null if the target
+ * node itself is a DocumentType which is not used with any document yet.
+ *
+ * Invoke the "getOwnerDocument()" method on the master
+ * document. The DocumentType returned should be null.
+* @author NIST
+* @author Mary Brady
+* @see <a href="http://www.w3.org/TR/DOM-Level-2-Core/core#node-ownerDoc">http://www.w3.org/TR/DOM-Level-2-Core/core#node-ownerDoc</a>
+*/
+public final class ownerDocument01 extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public ownerDocument01(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "staff", false);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ DocumentType ownerDocument;
+ doc = (Document) load("staff", false);
+ ownerDocument = (DocumentType) doc.getOwnerDocument();
+ assertNull("throw_Null", ownerDocument);
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level2/core/ownerDocument01";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(ownerDocument01.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level2/core/ownerElement01.java b/dom/src/test/java/org/w3c/domts/level2/core/ownerElement01.java
new file mode 100644
index 0000000..29fae6e
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level2/core/ownerElement01.java
@@ -0,0 +1,96 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+
+Copyright (c) 2001 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+
+*/
+
+package org.w3c.domts.level2.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The "getOwnerElement()" will return the Element node this attribute
+ * is attached to or null if this attribute is not in use.
+ * Get the "domestic" attribute from the first "address" node.
+ * Apply the "getOwnerElement()" method to get the Element associated
+ * with the attribute. The value returned should be "address".
+* @author NIST
+* @author Mary Brady
+* @see <a href="http://www.w3.org/TR/DOM-Level-2-Core/core#ID-F68D095">http://www.w3.org/TR/DOM-Level-2-Core/core#ID-F68D095</a>
+*/
+public final class ownerElement01 extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public ownerElement01(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "staff", false);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ NodeList addressList;
+ Node testNode;
+ NamedNodeMap attributes;
+ Attr domesticAttr;
+ Element elementNode;
+ String name;
+ doc = (Document) load("staff", false);
+ addressList = doc.getElementsByTagName("address");
+ testNode = addressList.item(0);
+ attributes = testNode.getAttributes();
+ domesticAttr = (Attr) attributes.getNamedItem("domestic");
+ elementNode = domesticAttr.getOwnerElement();
+ name = elementNode.getNodeName();
+ assertEquals("throw_Equals", "address", name);
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level2/core/ownerElement01";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(ownerElement01.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level2/core/ownerElement02.java b/dom/src/test/java/org/w3c/domts/level2/core/ownerElement02.java
new file mode 100644
index 0000000..f138c05
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level2/core/ownerElement02.java
@@ -0,0 +1,89 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+
+Copyright (c) 2001 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+
+*/
+
+package org.w3c.domts.level2.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The "getOwnerElement()" will return the Element node this attribute
+ * is attached to or null if this attribute is not in use.
+ * Create a new attribute.
+ * Apply the "getOwnerElement()" method to get the Element associated
+ * with the attribute. The value returned should be "null" since this
+ * attribute is not in use.
+* @author NIST
+* @author Mary Brady
+* @see <a href="http://www.w3.org/TR/DOM-Level-2-Core/core#Attr-ownerElement">http://www.w3.org/TR/DOM-Level-2-Core/core#Attr-ownerElement</a>
+*/
+public final class ownerElement02 extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public ownerElement02(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "staff", false);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ Attr newAttr;
+ Element elementNode;
+ doc = (Document) load("staff", false);
+ newAttr = doc.createAttribute("newAttribute");
+ elementNode = newAttr.getOwnerElement();
+ assertNull("throw_Null", elementNode);
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level2/core/ownerElement02";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(ownerElement02.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level2/core/prefix01.java b/dom/src/test/java/org/w3c/domts/level2/core/prefix01.java
new file mode 100644
index 0000000..b338452
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level2/core/prefix01.java
@@ -0,0 +1,91 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+
+Copyright (c) 2001 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+
+*/
+
+package org.w3c.domts.level2.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The "getPrefix()" method for a Node
+ * returns the namespace prefix of the node,
+ * and for nodes of any type other than ELEMENT_NODE and ATTRIBUTE_NODE
+ * and nodes created with a DOM Level 1 method, this is null.
+ *
+ * Create an new Element with the createElement() method.
+ * Invoke the "getPrefix()" method on the newly created element
+ * node will cause "null" to be returned.
+* @author NIST
+* @author Mary Brady
+* @see <a href="http://www.w3.org/TR/DOM-Level-2-Core/core#ID-NodeNSPrefix">http://www.w3.org/TR/DOM-Level-2-Core/core#ID-NodeNSPrefix</a>
+*/
+public final class prefix01 extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public prefix01(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "staffNS", false);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ Node createdNode;
+ String prefix;
+ doc = (Document) load("staffNS", false);
+ createdNode = doc.createElement("test:employee");
+ prefix = createdNode.getPrefix();
+ assertNull("throw_Null", prefix);
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level2/core/prefix01";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(prefix01.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level2/core/prefix02.java b/dom/src/test/java/org/w3c/domts/level2/core/prefix02.java
new file mode 100644
index 0000000..bed3f29
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level2/core/prefix02.java
@@ -0,0 +1,96 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+
+Copyright (c) 2001-2004 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+
+*/
+
+package org.w3c.domts.level2.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The "getPrefix()" method
+ * returns the namespace prefix of this node, or null if unspecified.
+ * For nodes of any type other than ELEMENT_NODE and ATTRIBUTE_NODE,
+ * this is always null.
+ *
+ * Retrieve the first emp:employeeId node and get the first child of this node.
+ * Since the first child is Text node invoking the "getPrefix()"
+ * method will cause "null" to be returned.
+* @author NIST
+* @author Mary Brady
+* @see <a href="http://www.w3.org/TR/DOM-Level-2-Core/core#ID-NodeNSPrefix">http://www.w3.org/TR/DOM-Level-2-Core/core#ID-NodeNSPrefix</a>
+*/
+public final class prefix02 extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public prefix02(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "staffNS", false);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ NodeList elementList;
+ Node testEmployee;
+ Node textNode;
+ String prefix;
+ doc = (Document) load("staffNS", false);
+ elementList = doc.getElementsByTagName("emp:employeeId");
+ testEmployee = elementList.item(0);
+ assertNotNull("empEmployeeNotNull", testEmployee);
+ textNode = testEmployee.getFirstChild();
+ prefix = textNode.getPrefix();
+ assertNull("textNodePrefix", prefix);
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level2/core/prefix02";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(prefix02.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level2/core/prefix03.java b/dom/src/test/java/org/w3c/domts/level2/core/prefix03.java
new file mode 100644
index 0000000..e3285d0
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level2/core/prefix03.java
@@ -0,0 +1,97 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+
+Copyright (c) 2001-2004 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+
+*/
+
+package org.w3c.domts.level2.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The "getPrefix()" method for a node
+ * returns the namespace prefix of this node, or null if it is unspecified.
+ *
+ * Retrieve the first emp:employee node and invoke the getPrefix() method."
+ * The method should return "emp".
+* @author NIST
+* @author Mary Brady
+* @see <a href="http://www.w3.org/TR/DOM-Level-2-Core/core#ID-NodeNSPrefix">http://www.w3.org/TR/DOM-Level-2-Core/core#ID-NodeNSPrefix</a>
+*/
+public final class prefix03 extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public prefix03(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+
+ org.w3c.domts.DocumentBuilderSetting[] settings =
+ new org.w3c.domts.DocumentBuilderSetting[] {
+org.w3c.domts.DocumentBuilderSetting.namespaceAware
+ };
+ DOMTestDocumentBuilderFactory testFactory = factory.newInstance(settings);
+ setFactory(testFactory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "staffNS", false);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ NodeList elementList;
+ Node testEmployee;
+ String prefix;
+ doc = (Document) load("staffNS", false);
+ elementList = doc.getElementsByTagName("emp:employee");
+ testEmployee = elementList.item(0);
+ assertNotNull("empEmployeeNotNull", testEmployee);
+ prefix = testEmployee.getPrefix();
+ assertEquals("prefix", "emp", prefix);
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level2/core/prefix03";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(prefix03.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level2/core/prefix04.java b/dom/src/test/java/org/w3c/domts/level2/core/prefix04.java
new file mode 100644
index 0000000..456e1f7
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level2/core/prefix04.java
@@ -0,0 +1,90 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+
+Copyright (c) 2001 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+
+*/
+
+package org.w3c.domts.level2.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The "getPrefix()" method for a node
+ * returns the namespace prefix of this node, or null if it is unspecified.
+ *
+ * Retrieve the first employee node and invoke the getPrefix() method."
+ * The method should return "null".
+* @author NIST
+* @author Mary Brady
+* @see <a href="http://www.w3.org/TR/DOM-Level-2-Core/core#ID-NodeNSPrefix">http://www.w3.org/TR/DOM-Level-2-Core/core#ID-NodeNSPrefix</a>
+*/
+public final class prefix04 extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public prefix04(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "staffNS", false);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ NodeList elementList;
+ Node testEmployee;
+ String prefix;
+ doc = (Document) load("staffNS", false);
+ elementList = doc.getElementsByTagName("employee");
+ testEmployee = elementList.item(0);
+ prefix = testEmployee.getPrefix();
+ assertNull("throw_Null", prefix);
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level2/core/prefix04";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(prefix04.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level2/core/prefix05.java b/dom/src/test/java/org/w3c/domts/level2/core/prefix05.java
new file mode 100644
index 0000000..61a4205
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level2/core/prefix05.java
@@ -0,0 +1,106 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+
+Copyright (c) 2001-2004 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+
+*/
+
+package org.w3c.domts.level2.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The "setPrefix(prefix)" method raises a
+ * NAMESPACE_ERR DOMException if the specified node is an attribute
+ * and the specified prefix is xmlns and the namespaceURI is different from
+ * http://www.w3.org/2000/xmlns.
+ *
+ * Attempt to insert "xmlns" as the new namespace prefix on the emp:domestic
+ * attribute within the emp:address node.
+ * An exception should be raised since the namespaceURI of this node is not
+ * http://www.w3.org/2000/xmlns.
+* @author NIST
+* @author Mary Brady
+* @see <a href="http://www.w3.org/TR/DOM-Level-2-Core/core#xpointer(id('ID-258A00AF')/constant[@name='NAMESPACE_ERR'])">http://www.w3.org/TR/DOM-Level-2-Core/core#xpointer(id('ID-258A00AF')/constant[@name='NAMESPACE_ERR'])</a>
+* @see <a href="http://www.w3.org/TR/DOM-Level-2-Core/core#ID-NodeNSPrefix">http://www.w3.org/TR/DOM-Level-2-Core/core#ID-NodeNSPrefix</a>
+* @see <a href="http://www.w3.org/TR/DOM-Level-2-Core/core#xpointer(id('ID-NodeNSPrefix')/setraises/exception[@name='DOMException']/descr/p[substring-before(.,':')='NAMESPACE_ERR'])">http://www.w3.org/TR/DOM-Level-2-Core/core#xpointer(id('ID-NodeNSPrefix')/setraises/exception[@name='DOMException']/descr/p[substring-before(.,':')='NAMESPACE_ERR'])</a>
+*/
+public final class prefix05 extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public prefix05(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "staffNS", true);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ NodeList elementList;
+ Element addrNode;
+ Attr addrAttr;
+ doc = (Document) load("staffNS", true);
+ elementList = doc.getElementsByTagName("emp:address");
+ addrNode = (Element) elementList.item(0);
+ assertNotNull("empAddrNotNull", addrNode);
+ addrAttr = addrNode.getAttributeNode("emp:domestic");
+
+ {
+ boolean success = false;
+ try {
+ addrAttr.setPrefix("xmlns");
+ } catch (DOMException ex) {
+ success = (ex.code == DOMException.NAMESPACE_ERR);
+ }
+ assertTrue("throw_NAMESPACE_ERR", success);
+ }
+}
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level2/core/prefix05";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(prefix05.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level2/core/prefix06.java b/dom/src/test/java/org/w3c/domts/level2/core/prefix06.java
new file mode 100644
index 0000000..2d0e251
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level2/core/prefix06.java
@@ -0,0 +1,107 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+
+Copyright (c) 2001 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+
+*/
+
+package org.w3c.domts.level2.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The "setPrefix(prefix)" method raises a
+ * INVALID_CHARACTER_ERR DOMException if the specified
+ * prefix contains an illegal character.
+ *
+ * Attempt to insert a new namespace prefix on the first employee node.
+ * An exception should be raised since the namespace prefix has an invalid
+ * character.
+* @author NIST
+* @author Mary Brady
+* @see <a href="http://www.w3.org/TR/DOM-Level-2-Core/core#xpointer(id('ID-258A00AF')/constant[@name='INVALID_CHARACTER_ERR'])">http://www.w3.org/TR/DOM-Level-2-Core/core#xpointer(id('ID-258A00AF')/constant[@name='INVALID_CHARACTER_ERR'])</a>
+* @see <a href="http://www.w3.org/TR/DOM-Level-2-Core/core#ID-NodeNSPrefix">http://www.w3.org/TR/DOM-Level-2-Core/core#ID-NodeNSPrefix</a>
+* @see <a href="http://www.w3.org/TR/DOM-Level-2-Core/core#xpointer(id('ID-NodeNSPrefix')/setraises/exception[@name='DOMException']/descr/p[substring-before(.,':')='INVALID_CHARACTER_ERR'])">http://www.w3.org/TR/DOM-Level-2-Core/core#xpointer(id('ID-NodeNSPrefix')/setraises/exception[@name='DOMException']/descr/p[substring-before(.,':')='INVALID_CHARACTER_ERR'])</a>
+*/
+public final class prefix06 extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public prefix06(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+
+ org.w3c.domts.DocumentBuilderSetting[] settings =
+ new org.w3c.domts.DocumentBuilderSetting[] {
+org.w3c.domts.DocumentBuilderSetting.namespaceAware
+ };
+ DOMTestDocumentBuilderFactory testFactory = factory.newInstance(settings);
+ setFactory(testFactory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "staffNS", true);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ NodeList elementList;
+ Node employeeNode;
+ doc = (Document) load("staffNS", true);
+ elementList = doc.getElementsByTagName("employee");
+ employeeNode = elementList.item(0);
+
+ {
+ boolean success = false;
+ try {
+ employeeNode.setPrefix("pre^fix xmlns='http//www.nist.gov'");
+ } catch (DOMException ex) {
+ success = (ex.code == DOMException.INVALID_CHARACTER_ERR);
+ }
+ assertTrue("throw_INVALID_CHARACTER_ERR", success);
+ }
+}
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level2/core/prefix06";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(prefix06.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level2/core/prefix07.java b/dom/src/test/java/org/w3c/domts/level2/core/prefix07.java
new file mode 100644
index 0000000..941a4e1
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level2/core/prefix07.java
@@ -0,0 +1,100 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+
+Copyright (c) 2001 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+
+*/
+
+package org.w3c.domts.level2.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The "setPrefix(prefix)" method raises a
+ * NAMESPACE_ERR DOMException if the specified
+ * prefix if malformed.
+ *
+ * Attempt to insert a new namespace prefix on the second employee node.
+ * An exception should be raised since the namespace prefix is malformed.
+* @author NIST
+* @author Mary Brady
+* @see <a href="http://www.w3.org/TR/DOM-Level-2-Core/core#xpointer(id('ID-258A00AF')/constant[@name='NAMESPACE_ERR'])">http://www.w3.org/TR/DOM-Level-2-Core/core#xpointer(id('ID-258A00AF')/constant[@name='NAMESPACE_ERR'])</a>
+* @see <a href="http://www.w3.org/TR/DOM-Level-2-Core/core#ID-NodeNSPrefix">http://www.w3.org/TR/DOM-Level-2-Core/core#ID-NodeNSPrefix</a>
+* @see <a href="http://www.w3.org/TR/DOM-Level-2-Core/core#xpointer(id('ID-NodeNSPrefix')/setraises/exception[@name='DOMException']/descr/p[substring-before(.,':')='NAMESPACE_ERR'])">http://www.w3.org/TR/DOM-Level-2-Core/core#xpointer(id('ID-NodeNSPrefix')/setraises/exception[@name='DOMException']/descr/p[substring-before(.,':')='NAMESPACE_ERR'])</a>
+*/
+public final class prefix07 extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public prefix07(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "staffNS", true);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ NodeList elementList;
+ Node employeeNode;
+ doc = (Document) load("staffNS", true);
+ elementList = doc.getElementsByTagName("employee");
+ employeeNode = elementList.item(0);
+
+ {
+ boolean success = false;
+ try {
+ employeeNode.setPrefix("emp::");
+ } catch (DOMException ex) {
+ success = (ex.code == DOMException.NAMESPACE_ERR);
+ }
+ assertTrue("throw_NAMESPACE_ERR", success);
+ }
+}
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level2/core/prefix07";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(prefix07.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level2/core/prefix08.java b/dom/src/test/java/org/w3c/domts/level2/core/prefix08.java
new file mode 100644
index 0000000..4fbd5bf
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level2/core/prefix08.java
@@ -0,0 +1,122 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+
+Copyright (c) 2001-2004 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+
+*/
+
+package org.w3c.domts.level2.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The "setPrefix(prefix)" method causes the
+ * DOMException NO_MODIFICATION_ALLOWED_ERR to be raised
+ * if the node is readonly.
+ *
+ * Obtain the children of the THIRD "gender" element. The elements
+ * content is an entity reference. Get the FIRST item
+ * from the entity reference and execute the "setPrefix(prefix)" method.
+ * This causes a NO_MODIFICATION_ALLOWED_ERR DOMException to be thrown.
+* @author NIST
+* @author Mary Brady
+* @see <a href="http://www.w3.org/TR/DOM-Level-2-Core/core#xpointer(id('ID-258A00AF')/constant[@name='NO_MODIFICATION_ALLOWED_ERR'])">http://www.w3.org/TR/DOM-Level-2-Core/core#xpointer(id('ID-258A00AF')/constant[@name='NO_MODIFICATION_ALLOWED_ERR'])</a>
+* @see <a href="http://www.w3.org/TR/DOM-Level-2-Core/core#ID-NodeNSPrefix">http://www.w3.org/TR/DOM-Level-2-Core/core#ID-NodeNSPrefix</a>
+* @see <a href="http://www.w3.org/TR/DOM-Level-2-Core/core#xpointer(id('ID-NodeNSPrefix')/raises/exception[@name='DOMException']/descr/p[substring-before(.,':')='NO_MODIFICATION_ALLOWED_ERR'])">http://www.w3.org/TR/DOM-Level-2-Core/core#xpointer(id('ID-NodeNSPrefix')/raises/exception[@name='DOMException']/descr/p[substring-before(.,':')='NO_MODIFICATION_ALLOWED_ERR'])</a>
+*/
+public final class prefix08 extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public prefix08(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+
+ org.w3c.domts.DocumentBuilderSetting[] settings =
+ new org.w3c.domts.DocumentBuilderSetting[] {
+org.w3c.domts.DocumentBuilderSetting.namespaceAware
+ };
+ DOMTestDocumentBuilderFactory testFactory = factory.newInstance(settings);
+ setFactory(testFactory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "staff", true);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ NodeList genderList;
+ Node genderNode;
+ Node entRef;
+ Node entElement;
+ Node createdNode;
+ int nodeType;
+ doc = (Document) load("staff", true);
+ genderList = doc.getElementsByTagName("gender");
+ genderNode = genderList.item(2);
+ entRef = genderNode.getFirstChild();
+ nodeType = (int) entRef.getNodeType();
+
+ if (equals(1, nodeType)) {
+ entRef = doc.createEntityReference("ent4");
+ assertNotNull("createdEntRefNotNull", entRef);
+ }
+ entElement = entRef.getFirstChild();
+ assertNotNull("entElement", entElement);
+ createdNode = doc.createElement("text3");
+
+ {
+ boolean success = false;
+ try {
+ entElement.setPrefix("newPrefix");
+ } catch (DOMException ex) {
+ success = (ex.code == DOMException.NO_MODIFICATION_ALLOWED_ERR);
+ }
+ assertTrue("throw_NO_MODIFICATION_ALLOWED_ERR", success);
+ }
+}
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level2/core/prefix08";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(prefix08.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level2/core/prefix09.java b/dom/src/test/java/org/w3c/domts/level2/core/prefix09.java
new file mode 100644
index 0000000..db2e027
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level2/core/prefix09.java
@@ -0,0 +1,110 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+
+Copyright (c) 2001 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+
+*/
+
+package org.w3c.domts.level2.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The "setPrefix(prefix)" method raises a
+ * NAMESPACE_ERR DOMException if the specified node is an attribute
+ * and the qualifiedName of this node is xmlns.
+ *
+ * Attempt to set the prefix on the xmlns attribute within the fourth address
+ * element.
+ * An exception should be raised since the qualifiedName of this attribute
+ * is "xmlns".
+* @author NIST
+* @author Mary Brady
+* @see <a href="http://www.w3.org/TR/DOM-Level-2-Core/core#xpointer(id('ID-258A00AF')/constant[@name='NAMESPACE_ERR'])">http://www.w3.org/TR/DOM-Level-2-Core/core#xpointer(id('ID-258A00AF')/constant[@name='NAMESPACE_ERR'])</a>
+* @see <a href="http://www.w3.org/TR/DOM-Level-2-Core/core#ID-NodeNSPrefix">http://www.w3.org/TR/DOM-Level-2-Core/core#ID-NodeNSPrefix</a>
+* @see <a href="http://www.w3.org/TR/DOM-Level-2-Core/core#xpointer(id('ID-NodeNSPrefix')/setraises/exception[@name='DOMException']/descr/p[substring-before(.,':')='NAMESPACE_ERR'])">http://www.w3.org/TR/DOM-Level-2-Core/core#xpointer(id('ID-NodeNSPrefix')/setraises/exception[@name='DOMException']/descr/p[substring-before(.,':')='NAMESPACE_ERR'])</a>
+*/
+public final class prefix09 extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public prefix09(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+
+ org.w3c.domts.DocumentBuilderSetting[] settings =
+ new org.w3c.domts.DocumentBuilderSetting[] {
+org.w3c.domts.DocumentBuilderSetting.namespaceAware
+ };
+ DOMTestDocumentBuilderFactory testFactory = factory.newInstance(settings);
+ setFactory(testFactory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "staffNS", true);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ NodeList elementList;
+ Element addrNode;
+ Attr addrAttr;
+ doc = (Document) load("staffNS", true);
+ elementList = doc.getElementsByTagName("address");
+ addrNode = (Element) elementList.item(3);
+ addrAttr = addrNode.getAttributeNode("xmlns");
+
+ {
+ boolean success = false;
+ try {
+ addrAttr.setPrefix("xxx");
+ } catch (DOMException ex) {
+ success = (ex.code == DOMException.NAMESPACE_ERR);
+ }
+ assertTrue("throw_NAMESPACE_ERR", success);
+ }
+}
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level2/core/prefix09";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(prefix09.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level2/core/prefix10.java b/dom/src/test/java/org/w3c/domts/level2/core/prefix10.java
new file mode 100644
index 0000000..3db6c84
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level2/core/prefix10.java
@@ -0,0 +1,102 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+
+Copyright (c) 2001 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+
+*/
+
+package org.w3c.domts.level2.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The "setPrefix(prefix)" method raises a
+ * NAMESPACE_ERR DOMException if the specified
+ * prefix is xml and the namespaceURI is different from
+ * http://www.w3.org/XML/1998/namespace.
+ *
+ * Attempt to insert "xml" as the new namespace prefix on the first employee node.
+ * An exception should be raised since the namespaceURI of this node is not
+ * http://www.w3.org/XML/1998/namespace.
+* @author NIST
+* @author Mary Brady
+* @see <a href="http://www.w3.org/TR/DOM-Level-2-Core/core#xpointer(id('ID-258A00AF')/constant[@name='NAMESPACE_ERR'])">http://www.w3.org/TR/DOM-Level-2-Core/core#xpointer(id('ID-258A00AF')/constant[@name='NAMESPACE_ERR'])</a>
+* @see <a href="http://www.w3.org/TR/DOM-Level-2-Core/core#ID-NodeNSPrefix">http://www.w3.org/TR/DOM-Level-2-Core/core#ID-NodeNSPrefix</a>
+* @see <a href="http://www.w3.org/TR/DOM-Level-2-Core/core#xpointer(id('ID-NodeNSPrefix')/setraises/exception[@name='DOMException']/descr/p[substring-before(.,':')='NAMESPACE_ERR'])">http://www.w3.org/TR/DOM-Level-2-Core/core#xpointer(id('ID-NodeNSPrefix')/setraises/exception[@name='DOMException']/descr/p[substring-before(.,':')='NAMESPACE_ERR'])</a>
+*/
+public final class prefix10 extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public prefix10(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "staffNS", true);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ NodeList elementList;
+ Node employeeNode;
+ doc = (Document) load("staffNS", true);
+ elementList = doc.getElementsByTagName("employee");
+ employeeNode = elementList.item(1);
+
+ {
+ boolean success = false;
+ try {
+ employeeNode.setPrefix("xml");
+ } catch (DOMException ex) {
+ success = (ex.code == DOMException.NAMESPACE_ERR);
+ }
+ assertTrue("throw_NAMESPACE_ERR", success);
+ }
+}
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level2/core/prefix10";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(prefix10.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level2/core/prefix11.java b/dom/src/test/java/org/w3c/domts/level2/core/prefix11.java
new file mode 100644
index 0000000..8e644a8
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level2/core/prefix11.java
@@ -0,0 +1,103 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+
+Copyright (c) 2001 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+
+*/
+
+package org.w3c.domts.level2.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The "setPrefix(prefix)" method raises a
+ * NAMESPACE_ERR DOMException if the specified
+ * prefix is set on a node with a namespaceURI that is null.
+ *
+ * Attempt to insert a new namespace prefix on the second employee node.
+ * An exception should be raised since the namespace prefix is set
+ * on a node whose namespaceURI is null.
+* @author NIST
+* @author Mary Brady
+* @see <a href="http://www.w3.org/TR/DOM-Level-2-Core/core#xpointer(id('ID-258A00AF')/constant[@name='NAMESPACE_ERR'])">http://www.w3.org/TR/DOM-Level-2-Core/core#xpointer(id('ID-258A00AF')/constant[@name='NAMESPACE_ERR'])</a>
+* @see <a href="http://www.w3.org/TR/DOM-Level-2-Core/core#">http://www.w3.org/TR/DOM-Level-2-Core/core#</a>
+* @see <a href="http://www.w3.org/TR/DOM-Level-2-Core/core#xpointer(id('')/setraises/exception[@name='DOMException']/descr/p[substring-before(.,':')='NAMESPACE_ERR'])">http://www.w3.org/TR/DOM-Level-2-Core/core#xpointer(id('')/setraises/exception[@name='DOMException']/descr/p[substring-before(.,':')='NAMESPACE_ERR'])</a>
+*/
+public final class prefix11 extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public prefix11(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "staffNS", true);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ NodeList elementList;
+ Node employeeNode;
+ String namespaceURI;
+ doc = (Document) load("staffNS", true);
+ elementList = doc.getElementsByTagName("employee");
+ employeeNode = elementList.item(1);
+ namespaceURI = employeeNode.getNamespaceURI();
+
+ {
+ boolean success = false;
+ try {
+ employeeNode.setPrefix("employee1");
+ } catch (DOMException ex) {
+ success = (ex.code == DOMException.NAMESPACE_ERR);
+ }
+ assertTrue("throw_NAMESPACE_ERR", success);
+ }
+}
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level2/core/prefix11";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(prefix11.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level2/core/publicId01.java b/dom/src/test/java/org/w3c/domts/level2/core/publicId01.java
new file mode 100644
index 0000000..156f2c4
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level2/core/publicId01.java
@@ -0,0 +1,89 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+
+Copyright (c) 2001 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+
+*/
+
+package org.w3c.domts.level2.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The "getPublicId()" method of a documenttype node contains
+ * the public identifier associated with the external subset.
+ *
+ * Retrieve the documenttype.
+ * Apply the "getPublicId()" method. The string "STAFF" should be
+ * returned.
+* @author NIST
+* @author Mary Brady
+* @see <a href="http://www.w3.org/TR/DOM-Level-2-Core/core#ID-Core-DocType-publicId">http://www.w3.org/TR/DOM-Level-2-Core/core#ID-Core-DocType-publicId</a>
+*/
+public final class publicId01 extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public publicId01(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "staffNS", false);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ DocumentType docType;
+ String publicId;
+ doc = (Document) load("staffNS", false);
+ docType = doc.getDoctype();
+ publicId = docType.getPublicId();
+ assertEquals("throw_Equals", "STAFF", publicId);
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level2/core/publicId01";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(publicId01.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level2/core/removeAttributeNS01.java b/dom/src/test/java/org/w3c/domts/level2/core/removeAttributeNS01.java
new file mode 100644
index 0000000..15a5384
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level2/core/removeAttributeNS01.java
@@ -0,0 +1,123 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+
+Copyright (c) 2001-2004 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+
+*/
+
+package org.w3c.domts.level2.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The "removeAttributeNS(namespaceURI,localName)" method for an attribute causes the
+ * DOMException NO_MODIFICATION_ALLOWED_ERR to be raised
+ * if the node is readonly.
+ *
+ * Obtain the children of the THIRD "gender" element. The elements
+ * content is an entity reference. Try to remove an attribute
+ * from the entity reference by executing the
+ * "removeAttributeNS(namespaceURI,localName)" method.
+ * This causes a NO_MODIFICATION_ALLOWED_ERR DOMException to be thrown.
+* @author NIST
+* @author Mary Brady
+* @see <a href="http://www.w3.org/TR/DOM-Level-2-Core/core#xpointer(id('ID-258A00AF')/constant[@name='NO_MODIFICATION_ALLOWED_ERR'])">http://www.w3.org/TR/DOM-Level-2-Core/core#xpointer(id('ID-258A00AF')/constant[@name='NO_MODIFICATION_ALLOWED_ERR'])</a>
+* @see <a href="http://www.w3.org/TR/DOM-Level-2-Core/core#ID-ElRemAtNS">http://www.w3.org/TR/DOM-Level-2-Core/core#ID-ElRemAtNS</a>
+* @see <a href="http://www.w3.org/TR/DOM-Level-2-Core/core#xpointer(id('ID-ElRemAtNS')/raises/exception[@name='DOMException']/descr/p[substring-before(.,':')='NO_MODIFICATION_ALLOWED_ERR'])">http://www.w3.org/TR/DOM-Level-2-Core/core#xpointer(id('ID-ElRemAtNS')/raises/exception[@name='DOMException']/descr/p[substring-before(.,':')='NO_MODIFICATION_ALLOWED_ERR'])</a>
+*/
+public final class removeAttributeNS01 extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public removeAttributeNS01(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+
+ org.w3c.domts.DocumentBuilderSetting[] settings =
+ new org.w3c.domts.DocumentBuilderSetting[] {
+org.w3c.domts.DocumentBuilderSetting.namespaceAware
+ };
+ DOMTestDocumentBuilderFactory testFactory = factory.newInstance(settings);
+ setFactory(testFactory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "staffNS", true);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ NodeList genderList;
+ Node gender;
+ Node gen;
+ NodeList gList;
+ Element genElement;
+ int nodeType;
+ doc = (Document) load("staffNS", true);
+ genderList = doc.getElementsByTagName("gender");
+ gender = genderList.item(2);
+ gen = gender.getFirstChild();
+ nodeType = (int) gen.getNodeType();
+
+ if (equals(1, nodeType)) {
+ gen = doc.createEntityReference("ent4");
+ assertNotNull("createdEntRefNotNull", gen);
+ }
+ gList = gen.getChildNodes();
+ genElement = (Element) gList.item(0);
+ assertNotNull("notnull", genElement);
+
+ {
+ boolean success = false;
+ try {
+ genElement.removeAttributeNS("www.xyz.com", "local1");
+ } catch (DOMException ex) {
+ success = (ex.code == DOMException.NO_MODIFICATION_ALLOWED_ERR);
+ }
+ assertTrue("throw_NO_MODIFICATION_ALLOWED_ERR", success);
+ }
+}
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level2/core/removeAttributeNS01";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(removeAttributeNS01.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level2/core/removeAttributeNS02.java b/dom/src/test/java/org/w3c/domts/level2/core/removeAttributeNS02.java
new file mode 100644
index 0000000..9b5277d
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level2/core/removeAttributeNS02.java
@@ -0,0 +1,118 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+
+Copyright (c) 2001-2003 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+
+*/
+
+package org.w3c.domts.level2.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The "removeAttributeNS(namespaceURI,localName)" removes an attribute by
+ * local name and namespace URI. If the removed attribute has a
+ * default value it is immediately replaced. The replacing attribute has the same
+ * namespace URI and local name, as well as the original prefix.
+ *
+ * Retrieve the attribute named "emp:local" from emp:address
+ * node, then remove the "emp:local"
+ * attribute by invoking the "removeAttributeNS(namespaceURI,localName)" method.
+ * The "emp:local" attribute has a default value defined in the
+ * DTD file, that value should immediately replace the old
+ * value.
+* @author NIST
+* @author Mary Brady
+* @see <a href="http://www.w3.org/TR/DOM-Level-2-Core/core#ID-ElRemAtNS">http://www.w3.org/TR/DOM-Level-2-Core/core#ID-ElRemAtNS</a>
+* @see <a href="http://www.w3.org/Bugs/Public/show_bug.cgi?id=238">http://www.w3.org/Bugs/Public/show_bug.cgi?id=238</a>
+*/
+public final class removeAttributeNS02 extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public removeAttributeNS02(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+
+ org.w3c.domts.DocumentBuilderSetting[] settings =
+ new org.w3c.domts.DocumentBuilderSetting[] {
+org.w3c.domts.DocumentBuilderSetting.namespaceAware,
+org.w3c.domts.DocumentBuilderSetting.validating
+ };
+ DOMTestDocumentBuilderFactory testFactory = factory.newInstance(settings);
+ setFactory(testFactory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "staffNS", true);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ NodeList elementList;
+ Node testAddr;
+ Attr addrAttr;
+ String attr;
+ String namespaceURI;
+ String localName;
+ String prefix;
+ doc = (Document) load("staffNS", true);
+ elementList = doc.getElementsByTagName("emp:address");
+ testAddr = elementList.item(0);
+ ((Element) /*Node */testAddr).removeAttributeNS("http://www.nist.gov", "local1");
+ elementList = doc.getElementsByTagName("emp:address");
+ testAddr = elementList.item(0);
+ addrAttr = ((Element) /*Node */testAddr).getAttributeNodeNS("http://www.nist.gov", "local1");
+ attr = ((Element) /*Node */testAddr).getAttributeNS("http://www.nist.gov", "local1");
+ namespaceURI = addrAttr.getNamespaceURI();
+ localName = addrAttr.getLocalName();
+ prefix = testAddr.getPrefix();
+ assertEquals("attr", "FALSE", attr);
+ assertEquals("uri", "http://www.nist.gov", namespaceURI);
+ assertEquals("lname", "local1", localName);
+ assertEquals("prefix", "emp", prefix);
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level2/core/removeAttributeNS02";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(removeAttributeNS02.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level2/core/removeNamedItemNS01.java b/dom/src/test/java/org/w3c/domts/level2/core/removeNamedItemNS01.java
new file mode 100644
index 0000000..ddd5d76
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level2/core/removeNamedItemNS01.java
@@ -0,0 +1,105 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+
+Copyright (c) 2001 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+
+*/
+
+package org.w3c.domts.level2.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The "removeNamedItemNS(namespaceURI,localName)" method for a
+ * NamedNodeMap should remove a node specified by localName and namespaceURI.
+ *
+ * Retrieve a list of elements with tag name "address".
+ * Access the second element from the list and get its attributes.
+ * Try to remove the attribute node with local name "domestic"
+ * and namespace uri "http://www.usa.com" with
+ * method removeNamedItemNS(namespaceURI,localName).
+ * Check to see if the node has been removed.
+* @author NIST
+* @author Mary Brady
+* @see <a href="http://www.w3.org/TR/DOM-Level-2-Core/core#ID-1074577549">http://www.w3.org/TR/DOM-Level-2-Core/core#ID-1074577549</a>
+*/
+public final class removeNamedItemNS01 extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public removeNamedItemNS01(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+
+ org.w3c.domts.DocumentBuilderSetting[] settings =
+ new org.w3c.domts.DocumentBuilderSetting[] {
+org.w3c.domts.DocumentBuilderSetting.namespaceAware
+ };
+ DOMTestDocumentBuilderFactory testFactory = factory.newInstance(settings);
+ setFactory(testFactory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "staffNS", true);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ NodeList elementList;
+ Node testAddress;
+ NamedNodeMap attributes;
+ Attr newAttr;
+ Node removedNode;
+ doc = (Document) load("staffNS", true);
+ elementList = doc.getElementsByTagName("address");
+ testAddress = elementList.item(1);
+ attributes = testAddress.getAttributes();
+ removedNode = attributes.removeNamedItemNS("http://www.usa.com", "domestic");
+ assertNotNull("retval", removedNode);
+ newAttr = (Attr) attributes.getNamedItem("dmstc:domestic");
+ assertNull("nodeRemoved", newAttr);
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level2/core/removeNamedItemNS01";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(removeNamedItemNS01.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level2/core/removeNamedItemNS02.java b/dom/src/test/java/org/w3c/domts/level2/core/removeNamedItemNS02.java
new file mode 100644
index 0000000..2dc34fe
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level2/core/removeNamedItemNS02.java
@@ -0,0 +1,109 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+
+Copyright (c) 2001 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+
+*/
+
+package org.w3c.domts.level2.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The "removeNamedItemNS(namespaceURI,localName)" method for a
+ * NamedNodeMap should raise NOT_FOUND_ERR DOMException if
+ * there is no node with the specified namespaceURI and localName in this map.
+ *
+ * Retrieve a list of elements with tag name "address".
+ * Access the second element from the list and get its attributes.
+ * Try to remove an attribute node with local name "domest"
+ * and namespace uri "http://www.usa.com" with
+ * method removeNamedItemNS(namespaceURI,localName).
+ * This should raise NOT_FOUND_ERR DOMException.
+* @author NIST
+* @author Mary Brady
+* @see <a href="http://www.w3.org/TR/DOM-Level-2-Core/core#xpointer(id('ID-258A00AF')/constant[@name='NOT_FOUND_ERR'])">http://www.w3.org/TR/DOM-Level-2-Core/core#xpointer(id('ID-258A00AF')/constant[@name='NOT_FOUND_ERR'])</a>
+* @see <a href="http://www.w3.org/TR/DOM-Level-2-Core/core#ID-removeNamedItemNS">http://www.w3.org/TR/DOM-Level-2-Core/core#ID-removeNamedItemNS</a>
+* @see <a href="http://www.w3.org/TR/DOM-Level-2-Core/core#xpointer(id('ID-removeNamedItemNS')/raises/exception[@name='DOMException']/descr/p[substring-before(.,':')='NOT_FOUND_ERR'])">http://www.w3.org/TR/DOM-Level-2-Core/core#xpointer(id('ID-removeNamedItemNS')/raises/exception[@name='DOMException']/descr/p[substring-before(.,':')='NOT_FOUND_ERR'])</a>
+*/
+public final class removeNamedItemNS02 extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public removeNamedItemNS02(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "staffNS", true);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ String namespaceURI = "http://www.usa.com";
+ String localName = "domest";
+ Document doc;
+ NodeList elementList;
+ Node testAddress;
+ NamedNodeMap attributes;
+ Node removedNode;
+ doc = (Document) load("staffNS", true);
+ elementList = doc.getElementsByTagName("address");
+ testAddress = elementList.item(1);
+ attributes = testAddress.getAttributes();
+
+ {
+ boolean success = false;
+ try {
+ removedNode = attributes.removeNamedItemNS(namespaceURI, localName);
+ } catch (DOMException ex) {
+ success = (ex.code == DOMException.NOT_FOUND_ERR);
+ }
+ assertTrue("throw_NOT_FOUND_ERR", success);
+ }
+}
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level2/core/removeNamedItemNS02";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(removeNamedItemNS02.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level2/core/removeNamedItemNS03.java b/dom/src/test/java/org/w3c/domts/level2/core/removeNamedItemNS03.java
new file mode 100644
index 0000000..3fd310d
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level2/core/removeNamedItemNS03.java
@@ -0,0 +1,130 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+
+Copyright (c) 2001-2004 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+
+*/
+
+package org.w3c.domts.level2.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The "removeNamedItemNS(namespaceURI,localName)" method for a
+ * NamedNodeMap should raise NO_MODIFICATION_ALLOWED_ERR DOMException if
+ * this map is readonly.
+ *
+ * Retrieve a list of "gender" elements. Get access to the THIRD element
+ * which contains an ENTITY_REFERENCE child node. Try to remove the attribute
+ * in the node's map with method removeNamedItemNS(namespaceURI,localName).
+ * This should result in NO_MODIFICATION_ALLOWED_ERR
+ * DOMException.
+* @author NIST
+* @author Mary Brady
+* @see <a href="http://www.w3.org/TR/DOM-Level-2-Core/core#xpointer(id('ID-258A00AF')/constant[@name='NO_MODIFICATION_ALLOWED_ERR'])">http://www.w3.org/TR/DOM-Level-2-Core/core#xpointer(id('ID-258A00AF')/constant[@name='NO_MODIFICATION_ALLOWED_ERR'])</a>
+* @see <a href="http://www.w3.org/TR/DOM-Level-2-Core/core#ID-removeNamedItemNS">http://www.w3.org/TR/DOM-Level-2-Core/core#ID-removeNamedItemNS</a>
+* @see <a href="http://www.w3.org/TR/DOM-Level-2-Core/core#xpointer(id('ID-removeNamedItemNS')/raises/exception[@name='DOMException']/descr/p[substring-before(.,':')='NO_MODIFICATION_ALLOWED_ERR'])">http://www.w3.org/TR/DOM-Level-2-Core/core#xpointer(id('ID-removeNamedItemNS')/raises/exception[@name='DOMException']/descr/p[substring-before(.,':')='NO_MODIFICATION_ALLOWED_ERR'])</a>
+*/
+public final class removeNamedItemNS03 extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public removeNamedItemNS03(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+
+ org.w3c.domts.DocumentBuilderSetting[] settings =
+ new org.w3c.domts.DocumentBuilderSetting[] {
+org.w3c.domts.DocumentBuilderSetting.namespaceAware
+ };
+ DOMTestDocumentBuilderFactory testFactory = factory.newInstance(settings);
+ setFactory(testFactory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "staffNS", true);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ String namespaceURI = "http://www.w3.org/2000/xmlns/";
+ String localName = "local1";
+ Document doc;
+ NodeList elementList;
+ Node testAddress;
+ NodeList nList;
+ Node child;
+ NodeList n2List;
+ Node child2;
+ NamedNodeMap attributes;
+ Node removedNode;
+ int nodeType;
+ doc = (Document) load("staffNS", true);
+ elementList = doc.getElementsByTagName("gender");
+ testAddress = elementList.item(2);
+ nList = testAddress.getChildNodes();
+ child = nList.item(0);
+ nodeType = (int) child.getNodeType();
+
+ if (equals(1, nodeType)) {
+ child = doc.createEntityReference("ent4");
+ assertNotNull("createdEntRefNotNull", child);
+ }
+ n2List = child.getChildNodes();
+ child2 = n2List.item(0);
+ assertNotNull("notnull", child2);
+ attributes = child2.getAttributes();
+
+ {
+ boolean success = false;
+ try {
+ removedNode = attributes.removeNamedItemNS(namespaceURI, localName);
+ } catch (DOMException ex) {
+ success = (ex.code == DOMException.NO_MODIFICATION_ALLOWED_ERR);
+ }
+ assertTrue("throw_NO_MODIFICATION_ALLOWED_ERR", success);
+ }
+}
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level2/core/removeNamedItemNS03";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(removeNamedItemNS03.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level2/core/setAttributeNS01.java b/dom/src/test/java/org/w3c/domts/level2/core/setAttributeNS01.java
new file mode 100644
index 0000000..ce0992b
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level2/core/setAttributeNS01.java
@@ -0,0 +1,103 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+
+Copyright (c) 2001 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+
+*/
+
+package org.w3c.domts.level2.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The "setAttributeNS(namespaceURI,qualifiedName,Value)" method raises a
+ * INVALID_CHARACTER_ERR DOMException if the specified
+ * prefix contains an illegal character.
+ *
+ * Attempt to add a new attribute on the first employee node.
+ * An exception should be raised since the "qualifiedName" has an invalid
+ * character.
+* @author NIST
+* @author Mary Brady
+* @see <a href="http://www.w3.org/TR/DOM-Level-2-Core/core#xpointer(id('ID-258A00AF')/constant[@name='INVALID_CHARACTER_ERR'])">http://www.w3.org/TR/DOM-Level-2-Core/core#xpointer(id('ID-258A00AF')/constant[@name='INVALID_CHARACTER_ERR'])</a>
+* @see <a href="http://www.w3.org/TR/DOM-Level-2-Core/core#ID-ElSetAttrNS">http://www.w3.org/TR/DOM-Level-2-Core/core#ID-ElSetAttrNS</a>
+* @see <a href="http://www.w3.org/TR/DOM-Level-2-Core/core#xpointer(id('ID-ElSetAttrNS')/raises/exception[@name='DOMException']/descr/p[substring-before(.,':')='INVALID_CHARACTER_ERR'])">http://www.w3.org/TR/DOM-Level-2-Core/core#xpointer(id('ID-ElSetAttrNS')/raises/exception[@name='DOMException']/descr/p[substring-before(.,':')='INVALID_CHARACTER_ERR'])</a>
+*/
+public final class setAttributeNS01 extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public setAttributeNS01(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "staffNS", true);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ String namespaceURI = "http://www.nist.gov";
+ String qualifiedName = "emp:qual?name";
+ Document doc;
+ NodeList elementList;
+ Node testAddr;
+ doc = (Document) load("staffNS", true);
+ elementList = doc.getElementsByTagName("employee");
+ testAddr = elementList.item(0);
+
+ {
+ boolean success = false;
+ try {
+ ((Element) /*Node */testAddr).setAttributeNS(namespaceURI, qualifiedName, "newValue");
+ } catch (DOMException ex) {
+ success = (ex.code == DOMException.INVALID_CHARACTER_ERR);
+ }
+ assertTrue("throw_INVALID_CHARACTER_ERR", success);
+ }
+}
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level2/core/setAttributeNS01";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(setAttributeNS01.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level2/core/setAttributeNS02.java b/dom/src/test/java/org/w3c/domts/level2/core/setAttributeNS02.java
new file mode 100644
index 0000000..7300f80
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level2/core/setAttributeNS02.java
@@ -0,0 +1,102 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+
+Copyright (c) 2001 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+
+*/
+
+package org.w3c.domts.level2.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The "setAttributeNS(namespaceURI,qualifiedName,value)" method raises a
+ * NAMESPACE_ERR DOMException if the specified
+ * qualifiedName if malformed.
+ *
+ * Attempt to add a new attribute on the second employee node.
+ * An exception should be raised since the "qualifiedName" is malformed.
+* @author NIST
+* @author Mary Brady
+* @see <a href="http://www.w3.org/TR/DOM-Level-2-Core/core#xpointer(id('ID-258A00AF')/constant[@name='NAMESPACE_ERR'])">http://www.w3.org/TR/DOM-Level-2-Core/core#xpointer(id('ID-258A00AF')/constant[@name='NAMESPACE_ERR'])</a>
+* @see <a href="http://www.w3.org/TR/DOM-Level-2-Core/core#ID-ElSetAttrNS">http://www.w3.org/TR/DOM-Level-2-Core/core#ID-ElSetAttrNS</a>
+* @see <a href="http://www.w3.org/TR/DOM-Level-2-Core/core#xpointer(id('ID-ElSetAttrNS')/raises/exception[@name='DOMException']/descr/p[substring-before(.,':')='NAMESPACE_ERR'])">http://www.w3.org/TR/DOM-Level-2-Core/core#xpointer(id('ID-ElSetAttrNS')/raises/exception[@name='DOMException']/descr/p[substring-before(.,':')='NAMESPACE_ERR'])</a>
+*/
+public final class setAttributeNS02 extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public setAttributeNS02(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "staffNS", true);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ String namespaceURI = "http://www.nist.gov";
+ String qualifiedName = "emp:";
+ Document doc;
+ NodeList elementList;
+ Node testAddr;
+ doc = (Document) load("staffNS", true);
+ elementList = doc.getElementsByTagName("emp:employee");
+ testAddr = elementList.item(0);
+
+ {
+ boolean success = false;
+ try {
+ ((Element) /*Node */testAddr).setAttributeNS(namespaceURI, qualifiedName, "newValue");
+ } catch (DOMException ex) {
+ success = (ex.code == DOMException.NAMESPACE_ERR);
+ }
+ assertTrue("throw_NAMESPACE_ERR", success);
+ }
+}
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level2/core/setAttributeNS02";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(setAttributeNS02.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level2/core/setAttributeNS03.java b/dom/src/test/java/org/w3c/domts/level2/core/setAttributeNS03.java
new file mode 100644
index 0000000..0177449
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level2/core/setAttributeNS03.java
@@ -0,0 +1,121 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+
+Copyright (c) 2001-2004 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+
+*/
+
+package org.w3c.domts.level2.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The "setAttributeNS(namespaceURI,qualifiedName,value)" method for an attribute causes the
+ * DOMException NO_MODIFICATION_ALLOWED_ERR to be raised
+ * if the node is readonly.
+ *
+ * Obtain the children of the THIRD "gender" element. The elements
+ * content is an entity reference. Try to set an attribute
+ * in the entity reference by executing the
+ * "setAttributeNS(namespaceURI,qualifiedName,value)" method.
+ * This causes a NO_MODIFICATION_ALLOWED_ERR DOMException to be thrown.
+* @author NIST
+* @author Mary Brady
+* @see <a href="http://www.w3.org/TR/DOM-Level-2-Core/core#xpointer(id('ID-258A00AF')/constant[@name='NO_MODIFICATION_ALLOWED_ERR'])">http://www.w3.org/TR/DOM-Level-2-Core/core#xpointer(id('ID-258A00AF')/constant[@name='NO_MODIFICATION_ALLOWED_ERR'])</a>
+* @see <a href="http://www.w3.org/TR/DOM-Level-2-Core/core#ID-ElSetAttrNS">http://www.w3.org/TR/DOM-Level-2-Core/core#ID-ElSetAttrNS</a>
+* @see <a href="http://www.w3.org/TR/DOM-Level-2-Core/core#xpointer(id('ID-ElSetAttrNS')/raises/exception[@name='DOMException']/descr/p[substring-before(.,':')='NO_MODIFICATION_ALLOWED_ERR'])">http://www.w3.org/TR/DOM-Level-2-Core/core#xpointer(id('ID-ElSetAttrNS')/raises/exception[@name='DOMException']/descr/p[substring-before(.,':')='NO_MODIFICATION_ALLOWED_ERR'])</a>
+*/
+public final class setAttributeNS03 extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public setAttributeNS03(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "staffNS", true);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ String namespaceURI = "www.xyz.com";
+ String qualifiedName = "emp:local1";
+ Document doc;
+ NodeList genderList;
+ Node gender;
+ NodeList genList;
+ Node gen;
+ NodeList gList;
+ Element genElement;
+ int nodeType;
+ doc = (Document) load("staffNS", true);
+ genderList = doc.getElementsByTagName("gender");
+ gender = genderList.item(2);
+ genList = gender.getChildNodes();
+ gen = genList.item(0);
+ nodeType = (int) gen.getNodeType();
+
+ if (equals(1, nodeType)) {
+ gen = doc.createEntityReference("ent4");
+ assertNotNull("createdEntRefNotNull", gen);
+ }
+ gList = gen.getChildNodes();
+ genElement = (Element) gList.item(0);
+ assertNotNull("notnull", genElement);
+
+ {
+ boolean success = false;
+ try {
+ genElement.setAttributeNS(namespaceURI, qualifiedName, "newValue");
+ } catch (DOMException ex) {
+ success = (ex.code == DOMException.NO_MODIFICATION_ALLOWED_ERR);
+ }
+ assertTrue("throw_NO_MODIFICATION_ALLOWED_ERR", success);
+ }
+}
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level2/core/setAttributeNS03";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(setAttributeNS03.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level2/core/setAttributeNS04.java b/dom/src/test/java/org/w3c/domts/level2/core/setAttributeNS04.java
new file mode 100644
index 0000000..f72fc63
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level2/core/setAttributeNS04.java
@@ -0,0 +1,116 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+
+Copyright (c) 2001-2004 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+
+*/
+
+package org.w3c.domts.level2.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The "setAttributeNS(namespaceURI,qualifiedName,value)" method adds a new attribute.
+ * If an attribute with the same local name and namespace URI is already present
+ * on the element, its prefix is changed to be the prefix part of the "qualifiedName",
+ * and its vale is changed to be the "value" paramter.
+ * null value if no previously existing Attr node with the
+ * same name was replaced.
+ *
+ * Add a new attribute to the "emp:address" element.
+ * Check to see if the new attribute has been successfully added to the document
+ * by getting the attributes value, namespace URI, local Name and prefix.
+ * The prefix will be changed to the prefix part of the "qualifiedName"
+ * and its value changed to the "value" parameter.
+* @author NIST
+* @author Mary Brady
+* @see <a href="http://www.w3.org/TR/DOM-Level-2-Core/core#">http://www.w3.org/TR/DOM-Level-2-Core/core#</a>
+*/
+public final class setAttributeNS04 extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public setAttributeNS04(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+
+ org.w3c.domts.DocumentBuilderSetting[] settings =
+ new org.w3c.domts.DocumentBuilderSetting[] {
+org.w3c.domts.DocumentBuilderSetting.namespaceAware
+ };
+ DOMTestDocumentBuilderFactory testFactory = factory.newInstance(settings);
+ setFactory(testFactory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "staffNS", true);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ NodeList elementList;
+ Node testAddr;
+ Attr addrAttr;
+ String resultAttr;
+ String resultNamespaceURI;
+ String resultLocalName;
+ String resultPrefix;
+ doc = (Document) load("staffNS", true);
+ elementList = doc.getElementsByTagName("emp:address");
+ testAddr = elementList.item(0);
+ assertNotNull("empAddrNotNull", testAddr);
+ ((Element) /*Node */testAddr).setAttributeNS("http://www.nist.gov", "newprefix:zone", "newValue");
+ addrAttr = ((Element) /*Node */testAddr).getAttributeNodeNS("http://www.nist.gov", "zone");
+ resultAttr = ((Element) /*Node */testAddr).getAttributeNS("http://www.nist.gov", "zone");
+ assertEquals("attrValue", "newValue", resultAttr);
+ resultNamespaceURI = addrAttr.getNamespaceURI();
+ assertEquals("nsuri", "http://www.nist.gov", resultNamespaceURI);
+ resultLocalName = addrAttr.getLocalName();
+ assertEquals("lname", "zone", resultLocalName);
+ resultPrefix = addrAttr.getPrefix();
+ assertEquals("prefix", "newprefix", resultPrefix);
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level2/core/setAttributeNS04";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(setAttributeNS04.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level2/core/setAttributeNS05.java b/dom/src/test/java/org/w3c/domts/level2/core/setAttributeNS05.java
new file mode 100644
index 0000000..c8c23ba
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level2/core/setAttributeNS05.java
@@ -0,0 +1,102 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+
+Copyright (c) 2001-2004 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+
+*/
+
+package org.w3c.domts.level2.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The "setAttributeNS(namespaceURI,qualifiedName,value)" method adds a new attribute.
+ * If an attribute with the same local name and namespace URI is already present
+ * on the element, its prefix is changed to be the prefix part of the "qualifiedName",
+ * and its vale is changed to be the "value" paramter.
+ * null value if no previously existing Attr node with the
+ * same name was replaced.
+ *
+ * Add a new attribute to the "emp:address" element.
+ * Check to see if the new attribute has been successfully added to the document.
+ * The new attribute "<newValue>" contains markup and therefore is escaped
+ * by the implementation.
+* @author NIST
+* @author Mary Brady
+* @see <a href="http://www.w3.org/TR/DOM-Level-2-Core/core#ID-ElGetAttrNS">http://www.w3.org/TR/DOM-Level-2-Core/core#ID-ElGetAttrNS</a>
+*/
+public final class setAttributeNS05 extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public setAttributeNS05(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "staffNS", true);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ String localName = "newAttr";
+ String namespaceURI = "http://www.newattr.com";
+ String qualifiedName = "emp:newAttr";
+ Document doc;
+ NodeList elementList;
+ Node testAddr;
+ Attr addrAttr;
+ String resultAttr;
+ doc = (Document) load("staffNS", true);
+ elementList = doc.getElementsByTagName("emp:address");
+ testAddr = elementList.item(0);
+ assertNotNull("empAddrNotNull", testAddr);
+ ((Element) /*Node */testAddr).setAttributeNS(namespaceURI, qualifiedName, "<newValue>");
+ resultAttr = ((Element) /*Node */testAddr).getAttributeNS(namespaceURI, localName);
+ assertEquals("throw_Equals", "<newValue>", resultAttr);
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level2/core/setAttributeNS05";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(setAttributeNS05.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level2/core/setAttributeNS06.java b/dom/src/test/java/org/w3c/domts/level2/core/setAttributeNS06.java
new file mode 100644
index 0000000..687fe39
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level2/core/setAttributeNS06.java
@@ -0,0 +1,104 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+
+Copyright (c) 2001 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+
+*/
+
+package org.w3c.domts.level2.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The "setAttributeNS(namespaceURI,localName,value)" method raises a
+ * NAMESPACE_ERR DOMException if the "qualifiedName" has a
+ * prefix of "xml" and the namespaceURI is different from
+ * http://www.w3.org/XML/1998/namespace.
+ *
+ * Attempt to add an attribute with a prefix of "xml" as the on the first employee node.
+ * An exception should be raised since the namespaceURI of this node is not
+ * http://www.w3.org/XML/1998/namespace.
+* @author NIST
+* @author Mary Brady
+* @see <a href="http://www.w3.org/TR/DOM-Level-2-Core/core#xpointer(id('ID-258A00AF')/constant[@name='NAMESPACE_ERR'])">http://www.w3.org/TR/DOM-Level-2-Core/core#xpointer(id('ID-258A00AF')/constant[@name='NAMESPACE_ERR'])</a>
+* @see <a href="http://www.w3.org/TR/DOM-Level-2-Core/core#ID-ElSetAttrNS">http://www.w3.org/TR/DOM-Level-2-Core/core#ID-ElSetAttrNS</a>
+* @see <a href="http://www.w3.org/TR/DOM-Level-2-Core/core#xpointer(id('ID-ElSetAttrNS')/raises/exception[@name='DOMException']/descr/p[substring-before(.,':')='NAMESPACE_ERR'])">http://www.w3.org/TR/DOM-Level-2-Core/core#xpointer(id('ID-ElSetAttrNS')/raises/exception[@name='DOMException']/descr/p[substring-before(.,':')='NAMESPACE_ERR'])</a>
+*/
+public final class setAttributeNS06 extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public setAttributeNS06(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "staffNS", true);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ String namespaceURI = "http://www.nist.gov";
+ String qualifiedName = "xml:qualifiedName";
+ Document doc;
+ NodeList elementList;
+ Node testAddr;
+ doc = (Document) load("staffNS", true);
+ elementList = doc.getElementsByTagName("employee");
+ testAddr = elementList.item(0);
+
+ {
+ boolean success = false;
+ try {
+ ((Element) /*Node */testAddr).setAttributeNS(namespaceURI, qualifiedName, "newValue");
+ } catch (DOMException ex) {
+ success = (ex.code == DOMException.NAMESPACE_ERR);
+ }
+ assertTrue("throw_NAMESPACE_ERR", success);
+ }
+}
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level2/core/setAttributeNS06";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(setAttributeNS06.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level2/core/setAttributeNS07.java b/dom/src/test/java/org/w3c/domts/level2/core/setAttributeNS07.java
new file mode 100644
index 0000000..a903eeb
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level2/core/setAttributeNS07.java
@@ -0,0 +1,105 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+
+Copyright (c) 2001 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+
+*/
+
+package org.w3c.domts.level2.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The "setAttributeNS(namespaceURI,localName,value)" method raises a
+ * NAMESPACE_ERR DOMException if the "qualifiedName" has a
+ * value of "xmlns" and the namespaceURI is different from
+ * http://www.w3.org/2000/xmlns.
+ *
+ * Attempt to add an attribute with a "qualifiedName" of "xmlns" as the
+ * on the first employee node.
+ * An exception should be raised since the namespaceURI of this node is not
+ * http://www.w3.org/2000/xmlns.
+* @author NIST
+* @author Mary Brady
+* @see <a href="http://www.w3.org/TR/DOM-Level-2-Core/core#xpointer(id('ID-258A00AF')/constant[@name='NAMESPACE_ERR'])">http://www.w3.org/TR/DOM-Level-2-Core/core#xpointer(id('ID-258A00AF')/constant[@name='NAMESPACE_ERR'])</a>
+* @see <a href="http://www.w3.org/TR/DOM-Level-2-Core/core#ID-ElSetAttrNS">http://www.w3.org/TR/DOM-Level-2-Core/core#ID-ElSetAttrNS</a>
+* @see <a href="http://www.w3.org/TR/DOM-Level-2-Core/core#xpointer(id('ID-ElSetAttrNS')/raises/exception[@name='DOMException']/descr/p[substring-before(.,':')='NAMESPACE_ERR'])">http://www.w3.org/TR/DOM-Level-2-Core/core#xpointer(id('ID-ElSetAttrNS')/raises/exception[@name='DOMException']/descr/p[substring-before(.,':')='NAMESPACE_ERR'])</a>
+*/
+public final class setAttributeNS07 extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public setAttributeNS07(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "staffNS", true);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ String namespaceURI = "http://www.nist.gov";
+ String qualifiedName = "xmlns";
+ Document doc;
+ NodeList elementList;
+ Node testAddr;
+ doc = (Document) load("staffNS", true);
+ elementList = doc.getElementsByTagName("employee");
+ testAddr = elementList.item(0);
+
+ {
+ boolean success = false;
+ try {
+ ((Element) /*Node */testAddr).setAttributeNS(namespaceURI, qualifiedName, "newValue");
+ } catch (DOMException ex) {
+ success = (ex.code == DOMException.NAMESPACE_ERR);
+ }
+ assertTrue("throw_NAMESPACE_ERR", success);
+ }
+}
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level2/core/setAttributeNS07";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(setAttributeNS07.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level2/core/setAttributeNS09.java b/dom/src/test/java/org/w3c/domts/level2/core/setAttributeNS09.java
new file mode 100644
index 0000000..78171d1
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level2/core/setAttributeNS09.java
@@ -0,0 +1,111 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+
+Copyright (c) 2001-2004 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+
+*/
+
+package org.w3c.domts.level2.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The "setAttributeNS(namespaceURI,qualifiedName,value)" method adds a new attribute.
+ * If an attribute with the same local name and namespace URI is already present
+ * on the element, its prefix is changed to be the prefix part of the "qualifiedName",
+ * and its vale is changed to be the "value" paramter.
+ * null value if no previously existing Attr node with the
+ * same name was replaced.
+ *
+ * Add a new attribute to the "emp:address" element.
+ * Check to see if the new attribute has been successfully added to the document
+ * by getting the attributes value, namespace URI, local Name and prefix.
+* @author NIST
+* @author Mary Brady
+* @see <a href="http://www.w3.org/TR/DOM-Level-2-Core/core#ID-ElSetAttrNS">http://www.w3.org/TR/DOM-Level-2-Core/core#ID-ElSetAttrNS</a>
+*/
+public final class setAttributeNS09 extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public setAttributeNS09(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "staffNS", true);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ String localName = "newAttr";
+ String namespaceURI = "http://www.newattr.com";
+ String qualifiedName = "emp:newAttr";
+ Document doc;
+ NodeList elementList;
+ Node testAddr;
+ Attr addrAttr;
+ String resultAttr;
+ String resultNamespaceURI;
+ String resultLocalName;
+ String resultPrefix;
+ doc = (Document) load("staffNS", true);
+ elementList = doc.getElementsByTagName("emp:address");
+ testAddr = elementList.item(0);
+ assertNotNull("empAddrNotNull", testAddr);
+ ((Element) /*Node */testAddr).setAttributeNS(namespaceURI, qualifiedName, "newValue");
+ addrAttr = ((Element) /*Node */testAddr).getAttributeNodeNS(namespaceURI, localName);
+ resultAttr = ((Element) /*Node */testAddr).getAttributeNS(namespaceURI, localName);
+ assertEquals("attrValue", "newValue", resultAttr);
+ resultNamespaceURI = addrAttr.getNamespaceURI();
+ assertEquals("nsuri", "http://www.newattr.com", resultNamespaceURI);
+ resultLocalName = addrAttr.getLocalName();
+ assertEquals("lname", "newAttr", resultLocalName);
+ resultPrefix = addrAttr.getPrefix();
+ assertEquals("prefix", "emp", resultPrefix);
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level2/core/setAttributeNS09";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(setAttributeNS09.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level2/core/setAttributeNS10.java b/dom/src/test/java/org/w3c/domts/level2/core/setAttributeNS10.java
new file mode 100644
index 0000000..73053a8
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level2/core/setAttributeNS10.java
@@ -0,0 +1,96 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+
+Copyright (c) 2004 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+
+*/
+
+package org.w3c.domts.level2.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * Element.setAttributeNS with an empty qualified name should cause an INVALID_CHARACTER_ERR.
+* @author Curt Arnold
+* @see <a href="http://www.w3.org/TR/DOM-Level-2-Core/core#xpointer(id('ID-258A00AF')/constant[@name='INVALID_CHARACTER_ERR'])">http://www.w3.org/TR/DOM-Level-2-Core/core#xpointer(id('ID-258A00AF')/constant[@name='INVALID_CHARACTER_ERR'])</a>
+* @see <a href="http://www.w3.org/TR/DOM-Level-2-Core/core#ID-ElSetAttrNS">http://www.w3.org/TR/DOM-Level-2-Core/core#ID-ElSetAttrNS</a>
+* @see <a href="http://www.w3.org/TR/DOM-Level-2-Core/core#xpointer(id('ID-ElSetAttrNS')/raises/exception[@name='DOMException']/descr/p[substring-before(.,':')='INVALID_CHARACTER_ERR'])">http://www.w3.org/TR/DOM-Level-2-Core/core#xpointer(id('ID-ElSetAttrNS')/raises/exception[@name='DOMException']/descr/p[substring-before(.,':')='INVALID_CHARACTER_ERR'])</a>
+* @see <a href="http://www.w3.org/Bugs/Public/show_bug.cgi?id=525">http://www.w3.org/Bugs/Public/show_bug.cgi?id=525</a>
+*/
+public final class setAttributeNS10 extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public setAttributeNS10(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "hc_staff", true);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ String namespaceURI = "http://www.example.gov";
+ Document doc;
+ NodeList elementList;
+ Node testAddr;
+ doc = (Document) load("hc_staff", true);
+ elementList = doc.getElementsByTagName("em");
+ testAddr = elementList.item(0);
+
+ {
+ boolean success = false;
+ try {
+ ((Element) /*Node */testAddr).setAttributeNS(namespaceURI, "", "newValue");
+ } catch (DOMException ex) {
+ success = (ex.code == DOMException.INVALID_CHARACTER_ERR);
+ }
+ assertTrue("throw_INVALID_CHARACTER_ERR", success);
+ }
+}
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level2/core/setAttributeNS10";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(setAttributeNS10.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level2/core/setAttributeNodeNS01.java b/dom/src/test/java/org/w3c/domts/level2/core/setAttributeNodeNS01.java
new file mode 100644
index 0000000..d2cd152
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level2/core/setAttributeNodeNS01.java
@@ -0,0 +1,118 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+
+Copyright (c) 2001-2004 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+
+*/
+
+package org.w3c.domts.level2.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The "setAttributeNode(newAttr)" method raises an
+ * "INUSE_ATTRIBUTE_ERR DOMException if the "newAttr"
+ * is already an attribute of another element.
+ *
+ * Retrieve the first emp:address and append
+ * a newly created element. The "createAttributeNS(namespaceURI,qualifiedName)"
+ * and "setAttributeNodeNS(newAttr)" methods are invoked
+ * to create and add a new attribute to the newly created
+ * Element. The "setAttributeNodeNS(newAttr)" method is
+ * once again called to add the new attribute causing an
+ * exception to be raised since the attribute is already
+ * an attribute of another element.
+* @author NIST
+* @author Mary Brady
+* @see <a href="http://www.w3.org/TR/DOM-Level-2-Core/core#xpointer(id('ID-258A00AF')/constant[@name='INUSE_ATTRIBUTE_ERR'])">http://www.w3.org/TR/DOM-Level-2-Core/core#xpointer(id('ID-258A00AF')/constant[@name='INUSE_ATTRIBUTE_ERR'])</a>
+* @see <a href="http://www.w3.org/TR/DOM-Level-2-Core/core#ID-ElSetAtNodeNS">http://www.w3.org/TR/DOM-Level-2-Core/core#ID-ElSetAtNodeNS</a>
+* @see <a href="http://www.w3.org/TR/DOM-Level-2-Core/core#xpointer(id('ID-ElSetAtNodeNS')/raises/exception[@name='DOMException']/descr/p[substring-before(.,':')='INUSE_ATTRIBUTE_ERR'])">http://www.w3.org/TR/DOM-Level-2-Core/core#xpointer(id('ID-ElSetAtNodeNS')/raises/exception[@name='DOMException']/descr/p[substring-before(.,':')='INUSE_ATTRIBUTE_ERR'])</a>
+*/
+public final class setAttributeNodeNS01 extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public setAttributeNodeNS01(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "staffNS", true);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ String namespaceURI = "http://www.newattr.com";
+ String qualifiedName = "emp:newAttr";
+ Document doc;
+ Element newElement;
+ Attr newAttr;
+ NodeList elementList;
+ Node testAddr;
+ Node appendedChild;
+ Attr setAttr1;
+ Attr setAttr2;
+ doc = (Document) load("staffNS", true);
+ elementList = doc.getElementsByTagName("emp:address");
+ testAddr = elementList.item(0);
+ assertNotNull("empAddrNotNull", testAddr);
+ newElement = doc.createElement("newElement");
+ appendedChild = testAddr.appendChild(newElement);
+ newAttr = doc.createAttributeNS(namespaceURI, qualifiedName);
+ setAttr1 = newElement.setAttributeNodeNS(newAttr);
+
+ {
+ boolean success = false;
+ try {
+ setAttr2 = ((Element) /*Node */testAddr).setAttributeNodeNS(newAttr);
+ } catch (DOMException ex) {
+ success = (ex.code == DOMException.INUSE_ATTRIBUTE_ERR);
+ }
+ assertTrue("throw_INUSE_ATTRIBUTE_ERR", success);
+ }
+}
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level2/core/setAttributeNodeNS01";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(setAttributeNodeNS01.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level2/core/setAttributeNodeNS02.java b/dom/src/test/java/org/w3c/domts/level2/core/setAttributeNodeNS02.java
new file mode 100644
index 0000000..2b2965a
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level2/core/setAttributeNodeNS02.java
@@ -0,0 +1,127 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+
+Copyright (c) 2001 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+
+*/
+
+package org.w3c.domts.level2.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The "setAttributeNodeNS(namespaceURI,qualifiedName,value)" method for an attribute causes the
+ * DOMException NO_MODIFICATION_ALLOWED_ERR to be raised
+ * if the node is readonly.
+ *
+ * Obtain the children of the THIRD "gender" element. The elements
+ * content is an entity reference. Try to set an attribute
+ * in the entity reference by executing the
+ * "setAttributeNodeNS(newAttr)" method.
+ * This causes a NO_MODIFICATION_ALLOWED_ERR DOMException to be thrown.
+* @author NIST
+* @author Mary Brady
+* @see <a href="http://www.w3.org/TR/DOM-Level-2-Core/core#xpointer(id('ID-258A00AF')/constant[@name='NO_MODIFICATION_ALLOWED_ERR'])">http://www.w3.org/TR/DOM-Level-2-Core/core#xpointer(id('ID-258A00AF')/constant[@name='NO_MODIFICATION_ALLOWED_ERR'])</a>
+* @see <a href="http://www.w3.org/TR/DOM-Level-2-Core/core#ID-ElSetAtNodeNS">http://www.w3.org/TR/DOM-Level-2-Core/core#ID-ElSetAtNodeNS</a>
+* @see <a href="http://www.w3.org/TR/DOM-Level-2-Core/core#xpointer(id('ID-ElSetAtNodeNS')/raises/exception[@name='DOMException']/descr/p[substring-before(.,':')='NO_MODIFICATION_ALLOWED_ERR'])">http://www.w3.org/TR/DOM-Level-2-Core/core#xpointer(id('ID-ElSetAtNodeNS')/raises/exception[@name='DOMException']/descr/p[substring-before(.,':')='NO_MODIFICATION_ALLOWED_ERR'])</a>
+*/
+public final class setAttributeNodeNS02 extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public setAttributeNodeNS02(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+
+ org.w3c.domts.DocumentBuilderSetting[] settings =
+ new org.w3c.domts.DocumentBuilderSetting[] {
+org.w3c.domts.DocumentBuilderSetting.notNamespaceAware
+ };
+ DOMTestDocumentBuilderFactory testFactory = factory.newInstance(settings);
+ setFactory(testFactory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "staffNS", true);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ NodeList genderList;
+ Node gender;
+ NodeList genList;
+ Node gen;
+ NodeList gList;
+ Element genElement;
+ Attr newAttr;
+ Attr setAttr1;
+ doc = (Document) load("staffNS", true);
+
+ if (!isExpandEntityReferences()) {
+ genderList = doc.getElementsByTagName("gender");
+ gender = genderList.item(2);
+ genList = gender.getChildNodes();
+ gen = genList.item(0);
+ } else {
+ gen = doc.createEntityReference("ent4");
+ }
+
+ gList = gen.getChildNodes();
+ genElement = (Element) gList.item(0);
+ assertNotNull("notnull", genElement);
+ newAttr = doc.createAttributeNS("www.xyz.com", "emp:local1");
+
+ {
+ boolean success = false;
+ try {
+ setAttr1 = genElement.setAttributeNodeNS(newAttr);
+ } catch (DOMException ex) {
+ success = (ex.code == DOMException.NO_MODIFICATION_ALLOWED_ERR);
+ }
+ assertTrue("throw_NO_MODIFICATION_ALLOWED_ERR", success);
+ }
+}
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level2/core/setAttributeNodeNS02";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(setAttributeNodeNS02.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level2/core/setAttributeNodeNS03.java b/dom/src/test/java/org/w3c/domts/level2/core/setAttributeNodeNS03.java
new file mode 100644
index 0000000..5215acb
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level2/core/setAttributeNodeNS03.java
@@ -0,0 +1,100 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+
+Copyright (c) 2001-2004 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+
+*/
+
+package org.w3c.domts.level2.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The "setAttributeNodeNS(newAttr)" adds a new attribute.
+ * If an attribute with that local name and that namespaceURI is already
+ * present in the element, it is replaced by the new one.
+ *
+ * Retrieve the first emp:address element and add a new attribute
+ * to the element. Since an attribute with the same local name
+ * and namespaceURI as the newly created attribute does not exist
+ * the value "null" is returned.
+ * This test uses the "createAttributeNS(namespaceURI,localName)
+ * method from the Document interface to create the new attribute to add.
+* @author NIST
+* @author Mary Brady
+* @see <a href="http://www.w3.org/TR/DOM-Level-2-Core/core#ID-ElSetAtNodeNS">http://www.w3.org/TR/DOM-Level-2-Core/core#ID-ElSetAtNodeNS</a>
+*/
+public final class setAttributeNodeNS03 extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public setAttributeNodeNS03(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "staffNS", true);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ String namespaceURI = "http://www.newattr.com";
+ String qualifiedName = "emp:newAttr";
+ Document doc;
+ NodeList elementList;
+ Node testAddr;
+ Attr newAttr;
+ Attr newAddrAttr;
+ doc = (Document) load("staffNS", true);
+ elementList = doc.getElementsByTagName("emp:address");
+ testAddr = elementList.item(0);
+ assertNotNull("empAddrNotNull", testAddr);
+ newAttr = doc.createAttributeNS(namespaceURI, qualifiedName);
+ newAddrAttr = ((Element) /*Node */testAddr).setAttributeNodeNS(newAttr);
+ assertNull("throw_Null", newAddrAttr);
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level2/core/setAttributeNodeNS03";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(setAttributeNodeNS03.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level2/core/setAttributeNodeNS04.java b/dom/src/test/java/org/w3c/domts/level2/core/setAttributeNodeNS04.java
new file mode 100644
index 0000000..b1b742d
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level2/core/setAttributeNodeNS04.java
@@ -0,0 +1,106 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+
+Copyright (c) 2001-2004 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+
+*/
+
+package org.w3c.domts.level2.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The "setAttributeNodeNS(newAttr)" adds a new attribute.
+ * If an attribute with that local name and that namespaceURI is already
+ * present in the element, it is replaced by the new one.
+ *
+ * Retrieve the first emp:address element and add a new attribute
+ * to the element. Since an attribute with the same local name
+ * and namespaceURI already exists, it is replaced by the new one and
+ * returns the replaced "Attr" node.
+ * This test uses the "createAttributeNS(namespaceURI,localName)
+ * method from the Document interface to create the new attribute to add.
+* @author NIST
+* @author Mary Brady
+* @see <a href="http://www.w3.org/TR/DOM-Level-2-Core/core#ID-F68D095">http://www.w3.org/TR/DOM-Level-2-Core/core#ID-F68D095</a>
+*/
+public final class setAttributeNodeNS04 extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public setAttributeNodeNS04(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+
+ org.w3c.domts.DocumentBuilderSetting[] settings =
+ new org.w3c.domts.DocumentBuilderSetting[] {
+org.w3c.domts.DocumentBuilderSetting.namespaceAware
+ };
+ DOMTestDocumentBuilderFactory testFactory = factory.newInstance(settings);
+ setFactory(testFactory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "staffNS", true);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ NodeList elementList;
+ Node testAddr;
+ Attr newAttr;
+ Attr newAddrAttr;
+ String newName;
+ doc = (Document) load("staffNS", true);
+ elementList = doc.getElementsByTagName("emp:address");
+ testAddr = elementList.item(0);
+ assertNotNull("empAddrNotNull", testAddr);
+ newAttr = doc.createAttributeNS("http://www.nist.gov", "xxx:domestic");
+ newAddrAttr = ((Element) /*Node */testAddr).setAttributeNodeNS(newAttr);
+ newName = newAddrAttr.getNodeName();
+ assertEquals("nodeName", "emp:domestic", newName);
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level2/core/setAttributeNodeNS04";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(setAttributeNodeNS04.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level2/core/setAttributeNodeNS05.java b/dom/src/test/java/org/w3c/domts/level2/core/setAttributeNodeNS05.java
new file mode 100644
index 0000000..8c24d39
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level2/core/setAttributeNodeNS05.java
@@ -0,0 +1,114 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+
+Copyright (c) 2001 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+
+*/
+
+package org.w3c.domts.level2.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The "setAttributeNodeNS(newAttr)" method raises an
+ * "WRONG_DOCUMENT_ERR DOMException if the "newAttr"
+ * was created from a different document than the one that
+ * created this document.
+ *
+ * Retrieve the first emp:address and attempt to set a new
+ * attribute node. The new
+ * attribute was created from a document other than the
+ * one that created this element, therefore a
+ * WRONG_DOCUMENT_ERR DOMException should be raised.
+ * This test uses the "createAttributeNS(newAttr)" method
+ * from the Document interface.
+* @author NIST
+* @author Mary Brady
+* @see <a href="http://www.w3.org/TR/DOM-Level-2-Core/core#xpointer(id('ID-258A00AF')/constant[@name='WRONG_DOCUMENT_ERR'])">http://www.w3.org/TR/DOM-Level-2-Core/core#xpointer(id('ID-258A00AF')/constant[@name='WRONG_DOCUMENT_ERR'])</a>
+* @see <a href="http://www.w3.org/TR/DOM-Level-2-Core/core#ID-ElSetAtNodeNS">http://www.w3.org/TR/DOM-Level-2-Core/core#ID-ElSetAtNodeNS</a>
+* @see <a href="http://www.w3.org/TR/DOM-Level-2-Core/core#xpointer(id('ID-ElSetAtNodeNS')/raises/exception[@name='DOMException']/descr/p[substring-before(.,':')='WRONG_DOCUMENT_ERR'])">http://www.w3.org/TR/DOM-Level-2-Core/core#xpointer(id('ID-ElSetAtNodeNS')/raises/exception[@name='DOMException']/descr/p[substring-before(.,':')='WRONG_DOCUMENT_ERR'])</a>
+*/
+public final class setAttributeNodeNS05 extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public setAttributeNodeNS05(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "staffNS", true);
+ preload(contentType, "staffNS", true);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ String namespaceURI = "http://www.newattr.com";
+ String qualifiedName = "emp:newAttr";
+ Document doc1;
+ Document doc2;
+ Attr newAttr;
+ NodeList elementList;
+ Node testAddr;
+ Attr setAttr1;
+ doc1 = (Document) load("staffNS", true);
+ doc2 = (Document) load("staffNS", true);
+ newAttr = doc2.createAttributeNS(namespaceURI, qualifiedName);
+ elementList = doc1.getElementsByTagName("emp:address");
+ testAddr = elementList.item(0);
+
+ {
+ boolean success = false;
+ try {
+ setAttr1 = ((Element) /*Node */testAddr).setAttributeNodeNS(newAttr);
+ } catch (DOMException ex) {
+ success = (ex.code == DOMException.WRONG_DOCUMENT_ERR);
+ }
+ assertTrue("throw_WRONG_DOCUMENT_ERR", success);
+ }
+}
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level2/core/setAttributeNodeNS05";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(setAttributeNodeNS05.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level2/core/setNamedItemNS01.java b/dom/src/test/java/org/w3c/domts/level2/core/setNamedItemNS01.java
new file mode 100644
index 0000000..469f023
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level2/core/setNamedItemNS01.java
@@ -0,0 +1,118 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+
+Copyright (c) 2001 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+
+*/
+
+package org.w3c.domts.level2.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The "setNamedItemNS(arg)" method for a
+ * NamedNodeMap should raise INUSE_ATTRIBUTE_ERR DOMException if
+ * arg is an Attr that is already an attribute of another Element object.
+ *
+ * Retrieve an attr node from the third "address" element whose local name
+ * is "domestic" and namespaceURI is "http://www.netzero.com".
+ * Invoke method setNamedItemNS(arg) on the map of the first "address" element with
+ * arg being the attr node from above. Method should raise
+ * INUSE_ATTRIBUTE_ERR DOMException.
+* @author NIST
+* @author Mary Brady
+* @see <a href="http://www.w3.org/TR/DOM-Level-2-Core/core#xpointer(id('ID-258A00AF')/constant[@name='INUSE_ATTRIBUTE_ERR'])">http://www.w3.org/TR/DOM-Level-2-Core/core#xpointer(id('ID-258A00AF')/constant[@name='INUSE_ATTRIBUTE_ERR'])</a>
+* @see <a href="http://www.w3.org/TR/DOM-Level-2-Core/core#ID-setNamedItemNS">http://www.w3.org/TR/DOM-Level-2-Core/core#ID-setNamedItemNS</a>
+* @see <a href="http://www.w3.org/TR/DOM-Level-2-Core/core#xpointer(id('ID-setNamedItemNS')/raises/exception[@name='DOMException']/descr/p[substring-before(.,':')='INUSE_ATTRIBUTE_ERR'])">http://www.w3.org/TR/DOM-Level-2-Core/core#xpointer(id('ID-setNamedItemNS')/raises/exception[@name='DOMException']/descr/p[substring-before(.,':')='INUSE_ATTRIBUTE_ERR'])</a>
+*/
+public final class setNamedItemNS01 extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public setNamedItemNS01(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+
+ org.w3c.domts.DocumentBuilderSetting[] settings =
+ new org.w3c.domts.DocumentBuilderSetting[] {
+org.w3c.domts.DocumentBuilderSetting.namespaceAware
+ };
+ DOMTestDocumentBuilderFactory testFactory = factory.newInstance(settings);
+ setFactory(testFactory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "staffNS", true);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ NodeList elementList;
+ Node anotherElement;
+ NamedNodeMap anotherMap;
+ Node arg;
+ Node testAddress;
+ NamedNodeMap map;
+ Node setNode;
+ doc = (Document) load("staffNS", true);
+ elementList = doc.getElementsByTagName("address");
+ anotherElement = elementList.item(2);
+ anotherMap = anotherElement.getAttributes();
+ arg = anotherMap.getNamedItemNS("http://www.netzero.com", "domestic");
+ testAddress = elementList.item(0);
+ map = testAddress.getAttributes();
+
+ {
+ boolean success = false;
+ try {
+ setNode = map.setNamedItemNS(arg);
+ } catch (DOMException ex) {
+ success = (ex.code == DOMException.INUSE_ATTRIBUTE_ERR);
+ }
+ assertTrue("throw_INUSE_ATTRIBUTE_ERR", success);
+ }
+}
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level2/core/setNamedItemNS01";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(setNamedItemNS01.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level2/core/setNamedItemNS02.java b/dom/src/test/java/org/w3c/domts/level2/core/setNamedItemNS02.java
new file mode 100644
index 0000000..ac2b4a3
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level2/core/setNamedItemNS02.java
@@ -0,0 +1,114 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+
+Copyright (c) 2001 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+
+*/
+
+package org.w3c.domts.level2.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The "setNamedItemNS(arg)" method for a
+ * NamedNodeMap should raise WRONG_DOCUMENT_ERR DOMException if arg was
+ * created from a different document than the one that created this map.
+ *
+ * Create an attr node in a different document with qualifiedName equals
+ * "dmstc:domestic" and namespaceURI is "http://www.usa.com".
+ * Access the namednodemap of the first "address" element in this document.
+ * Invoke method setNamedItemNS(arg) with arg being the attr node from above.
+ * Method should raise WRONG_DOCUMENT_ERR DOMException.
+* @author NIST
+* @author Mary Brady
+* @see <a href="http://www.w3.org/TR/DOM-Level-2-Core/core#xpointer(id('ID-258A00AF')/constant[@name='WRONG_DOCUMENT_ERR'])">http://www.w3.org/TR/DOM-Level-2-Core/core#xpointer(id('ID-258A00AF')/constant[@name='WRONG_DOCUMENT_ERR'])</a>
+* @see <a href="http://www.w3.org/TR/DOM-Level-2-Core/core#ID-setNamedItemNS">http://www.w3.org/TR/DOM-Level-2-Core/core#ID-setNamedItemNS</a>
+* @see <a href="http://www.w3.org/TR/DOM-Level-2-Core/core#xpointer(id('ID-setNamedItemNS')/raises/exception[@name='DOMException']/descr/p[substring-before(.,':')='WRONG_DOCUMENT_ERR'])">http://www.w3.org/TR/DOM-Level-2-Core/core#xpointer(id('ID-setNamedItemNS')/raises/exception[@name='DOMException']/descr/p[substring-before(.,':')='WRONG_DOCUMENT_ERR'])</a>
+*/
+public final class setNamedItemNS02 extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public setNamedItemNS02(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "staffNS", true);
+ preload(contentType, "staffNS", true);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ String namespaceURI = "http://www.usa.com";
+ String qualifiedName = "dmstc:domestic";
+ Document doc;
+ Document anotherDoc;
+ Node arg;
+ NodeList elementList;
+ Node testAddress;
+ NamedNodeMap attributes;
+ Node setNode;
+ doc = (Document) load("staffNS", true);
+ anotherDoc = (Document) load("staffNS", true);
+ arg = anotherDoc.createAttributeNS(namespaceURI, qualifiedName);
+ arg.setNodeValue("Maybe");
+ elementList = doc.getElementsByTagName("address");
+ testAddress = elementList.item(0);
+ attributes = testAddress.getAttributes();
+
+ {
+ boolean success = false;
+ try {
+ setNode = attributes.setNamedItemNS(arg);
+ } catch (DOMException ex) {
+ success = (ex.code == DOMException.WRONG_DOCUMENT_ERR);
+ }
+ assertTrue("throw_WRONG_DOCUMENT_ERR", success);
+ }
+}
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level2/core/setNamedItemNS02";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(setNamedItemNS02.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level2/core/setNamedItemNS03.java b/dom/src/test/java/org/w3c/domts/level2/core/setNamedItemNS03.java
new file mode 100644
index 0000000..a7002d2
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level2/core/setNamedItemNS03.java
@@ -0,0 +1,105 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+
+Copyright (c) 2001 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+
+*/
+
+package org.w3c.domts.level2.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The "setNamedItemNS(arg)" method for a
+ * NamedNodeMap should add a node using its namespaceURI and localName given that
+ * there is no existing node with the same namespaceURI and localName in the map.
+ *
+ * Create an attr node with namespaceURI "http://www.nist.gov",qualifiedName
+ * "prefix:newAttr" and value "newValue".
+ * Invoke method setNamedItemNS(arg) on the map of the first "address"
+ * element where arg is identified by the namespaceURI and qualifiedName
+ * from above. Method should return the newly added attr node.
+* @author NIST
+* @author Mary Brady
+* @see <a href="http://www.w3.org/TR/DOM-Level-2-Core/core#ID-F68D080">http://www.w3.org/TR/DOM-Level-2-Core/core#ID-F68D080</a>
+*/
+public final class setNamedItemNS03 extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public setNamedItemNS03(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "staffNS", true);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ String namespaceURI = "http://www.nist.gov";
+ String qualifiedName = "prefix:newAttr";
+ Document doc;
+ Node arg;
+ NodeList elementList;
+ Node testAddress;
+ NamedNodeMap attributes;
+ Node retnode;
+ String value;
+ Node setNode;
+ doc = (Document) load("staffNS", true);
+ arg = doc.createAttributeNS(namespaceURI, qualifiedName);
+ arg.setNodeValue("newValue");
+ elementList = doc.getElementsByTagName("address");
+ testAddress = elementList.item(0);
+ attributes = testAddress.getAttributes();
+ setNode = attributes.setNamedItemNS(arg);
+ retnode = attributes.getNamedItemNS(namespaceURI, "newAttr");
+ value = retnode.getNodeValue();
+ assertEquals("throw_Equals", "newValue", value);
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level2/core/setNamedItemNS03";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(setNamedItemNS03.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level2/core/setNamedItemNS04.java b/dom/src/test/java/org/w3c/domts/level2/core/setNamedItemNS04.java
new file mode 100644
index 0000000..f2cffdf
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level2/core/setNamedItemNS04.java
@@ -0,0 +1,132 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+
+Copyright (c) 2001-2004 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+
+*/
+
+package org.w3c.domts.level2.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The "setNamedItemNS(arg)" method for a
+ * NamedNodeMap should raise NO_MODIFICATION_ALLOWED_ERR DOMException if
+ * this map is readonly.
+ *
+ * Retrieve a list of "gender" elements. Get access to the THIRD element
+ * which contains an ENTITY_REFERENCE child node. Get access to the node's
+ * map. Try to add an attribute node specified by arg with
+ * method setNamedItemNS(arg). This should result in NO_MODIFICATION_ALLOWED_ERR
+ * DOMException.
+* @author NIST
+* @author Mary Brady
+* @see <a href="http://www.w3.org/TR/DOM-Level-2-Core/core#xpointer(id('ID-258A00AF')/constant[@name='NO_MODIFICATION_ALLOWED_ERR'])">http://www.w3.org/TR/DOM-Level-2-Core/core#xpointer(id('ID-258A00AF')/constant[@name='NO_MODIFICATION_ALLOWED_ERR'])</a>
+* @see <a href="http://www.w3.org/TR/DOM-Level-2-Core/core#ID-setNamedItemNS">http://www.w3.org/TR/DOM-Level-2-Core/core#ID-setNamedItemNS</a>
+* @see <a href="http://www.w3.org/TR/DOM-Level-2-Core/core#xpointer(id('ID-setNamedItemNS')/raises/exception[@name='DOMException']/descr/p[substring-before(.,':')='NO_MODIFICATION_ALLOWED_ERR'])">http://www.w3.org/TR/DOM-Level-2-Core/core#xpointer(id('ID-setNamedItemNS')/raises/exception[@name='DOMException']/descr/p[substring-before(.,':')='NO_MODIFICATION_ALLOWED_ERR'])</a>
+*/
+public final class setNamedItemNS04 extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public setNamedItemNS04(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+
+ org.w3c.domts.DocumentBuilderSetting[] settings =
+ new org.w3c.domts.DocumentBuilderSetting[] {
+org.w3c.domts.DocumentBuilderSetting.namespaceAware
+ };
+ DOMTestDocumentBuilderFactory testFactory = factory.newInstance(settings);
+ setFactory(testFactory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "staffNS", true);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ String namespaceURI = "http://www.w3.org/2000/xmlns/";
+ String localName = "local1";
+ Document doc;
+ NodeList elementList;
+ Node testAddress;
+ NodeList nList;
+ Node child;
+ NodeList n2List;
+ Node child2;
+ NamedNodeMap attributes;
+ Node arg;
+ Node setNode;
+ int nodeType;
+ doc = (Document) load("staffNS", true);
+ elementList = doc.getElementsByTagName("gender");
+ testAddress = elementList.item(2);
+ nList = testAddress.getChildNodes();
+ child = nList.item(0);
+ nodeType = (int) child.getNodeType();
+
+ if (equals(1, nodeType)) {
+ child = doc.createEntityReference("ent4");
+ assertNotNull("createdEntRefNotNull", child);
+ }
+ n2List = child.getChildNodes();
+ child2 = n2List.item(0);
+ assertNotNull("notnull", child2);
+ attributes = child2.getAttributes();
+ arg = attributes.getNamedItemNS(namespaceURI, localName);
+
+ {
+ boolean success = false;
+ try {
+ setNode = attributes.setNamedItemNS(arg);
+ } catch (DOMException ex) {
+ success = (ex.code == DOMException.NO_MODIFICATION_ALLOWED_ERR);
+ }
+ assertTrue("throw_NO_MODIFICATION_ALLOWED_ERR", success);
+ }
+}
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level2/core/setNamedItemNS04";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(setNamedItemNS04.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level2/core/setNamedItemNS05.java b/dom/src/test/java/org/w3c/domts/level2/core/setNamedItemNS05.java
new file mode 100644
index 0000000..509dad6
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level2/core/setNamedItemNS05.java
@@ -0,0 +1,103 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+
+Copyright (c) 2001 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+
+*/
+
+package org.w3c.domts.level2.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The "setNamedItemNS(arg)" method for a
+ * NamedNodeMap should replace an existing node n1 found in the map with arg if n1
+ * has the same namespaceURI and localName as arg and return n1.
+ *
+ * Create an attribute node in with namespaceURI "http://www.usa.com"
+ * and qualifiedName "dmstc:domestic" whose value is "newVal".
+ * Invoke method setNamedItemNS(arg) on the map of the first "address"
+ * element. Method should return the old attribute node identified
+ * by namespaceURI and qualifiedName from above,whose value is "Yes".
+* @author NIST
+* @author Mary Brady
+* @see <a href="http://www.w3.org/TR/DOM-Level-2-Core/core#ID-ElSetAtNodeNS">http://www.w3.org/TR/DOM-Level-2-Core/core#ID-ElSetAtNodeNS</a>
+*/
+public final class setNamedItemNS05 extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public setNamedItemNS05(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "staffNS", true);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ String namespaceURI = "http://www.usa.com";
+ String qualifiedName = "dmstc:domestic";
+ Document doc;
+ Node arg;
+ NodeList elementList;
+ Node testAddress;
+ NamedNodeMap attributes;
+ Node retnode;
+ String value;
+ doc = (Document) load("staffNS", true);
+ arg = doc.createAttributeNS(namespaceURI, qualifiedName);
+ arg.setNodeValue("newValue");
+ elementList = doc.getElementsByTagName("address");
+ testAddress = elementList.item(0);
+ attributes = testAddress.getAttributes();
+ retnode = attributes.setNamedItemNS(arg);
+ value = retnode.getNodeValue();
+ assertEquals("throw_Equals", "Yes", value);
+ }
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level2/core/setNamedItemNS05";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(setNamedItemNS05.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level2/core/systemId01.java b/dom/src/test/java/org/w3c/domts/level2/core/systemId01.java
new file mode 100644
index 0000000..396904b
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level2/core/systemId01.java
@@ -0,0 +1,90 @@
+
+/*
+This Java source file was generated by test-to-java.xsl
+and is a derived work from the source document.
+The source document contained the following notice:
+
+
+
+Copyright (c) 2001 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+
+*/
+
+package org.w3c.domts.level2.core;
+
+import org.w3c.dom.*;
+
+
+import org.w3c.domts.DOMTestCase;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+
+
+
+/**
+ * The "getSystemId()" method of a documenttype node contains
+ * the system identifier associated with the external subset.
+ *
+ * Retrieve the documenttype.
+ * Apply the "getSystemId()" method. The string "staffNS.dtd" should be
+ * returned.
+* @author NIST
+* @author Mary Brady
+* @see <a href="http://www.w3.org/TR/DOM-Level-2-Core/core#ID-Core-DocType-systemId">http://www.w3.org/TR/DOM-Level-2-Core/core#ID-Core-DocType-systemId</a>
+*/
+public final class systemId01 extends DOMTestCase {
+
+ /**
+ * Constructor.
+ * @param factory document factory, may not be null
+ * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
+ */
+ public systemId01(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
+ super(factory);
+
+ //
+ // check if loaded documents are supported for content type
+ //
+ String contentType = getContentType();
+ preload(contentType, "staffNS", false);
+ }
+
+ /**
+ * Runs the test case.
+ * @throws Throwable Any uncaught exception causes test to fail
+ */
+ public void runTest() throws Throwable {
+ Document doc;
+ DocumentType docType;
+ String systemId;
+ int index;
+ doc = (Document) load("staffNS", false);
+ docType = doc.getDoctype();
+ systemId = docType.getSystemId();
+ assertURIEquals("systemId", null, null, null, "staffNS.dtd", null, null, null, null, systemId);
+}
+ /**
+ * Gets URI that identifies the test.
+ * @return uri identifier of test
+ */
+ public String getTargetURI() {
+ return "http://www.w3.org/2001/DOM-Test-Suite/level2/core/systemId01";
+ }
+ /**
+ * Runs this test from the command line.
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ DOMTestCase.doMain(systemId01.class, args);
+ }
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level2/events/TestBatik.java b/dom/src/test/java/org/w3c/domts/level2/events/TestBatik.java
new file mode 100644
index 0000000..044911d
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level2/events/TestBatik.java
@@ -0,0 +1,43 @@
+/*
+ * Copyright (c) 2001-2004 World Wide Web Consortium,
+ * (Massachusetts Institute of Technology, Institut National de
+ * Recherche en Informatique et en Automatique, Keio University). All
+ * Rights Reserved. This program is distributed under the W3C's Software
+ * Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+ */
+
+
+package org.w3c.domts.level2.events;
+
+import java.lang.reflect.Constructor;
+
+import junit.framework.TestSuite;
+
+import org.w3c.domts.BatikTestDocumentBuilderFactory;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+import org.w3c.domts.DOMTestSuite;
+import org.w3c.domts.DocumentBuilderSetting;
+import org.w3c.domts.JUnitTestSuiteAdapter;
+
+public class TestBatik extends TestSuite {
+
+ public static TestSuite suite() throws Exception
+ {
+ Class testClass = ClassLoader.getSystemClassLoader().loadClass("org.w3c.domts.level2.events.alltests");
+ Constructor testConstructor = testClass.getConstructor(new Class[] { DOMTestDocumentBuilderFactory.class });
+
+ DOMTestDocumentBuilderFactory factory =
+ new BatikTestDocumentBuilderFactory(new DocumentBuilderSetting[0]);
+
+ Object test = testConstructor.newInstance(new Object[] { factory });
+
+ return new JUnitTestSuiteAdapter((DOMTestSuite) test);
+ }
+
+
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level2/events/TestDefaultLS.java b/dom/src/test/java/org/w3c/domts/level2/events/TestDefaultLS.java
new file mode 100644
index 0000000..67faacd
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level2/events/TestDefaultLS.java
@@ -0,0 +1,51 @@
+/*
+ * Copyright (c) 2001-2004 World Wide Web Consortium, (Massachusetts Institute
+ * of Technology, Institut National de Recherche en Informatique et en
+ * Automatique, Keio University). All Rights Reserved. This program is
+ * distributed under the W3C's Software Intellectual Property License. This
+ * program 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 W3C License
+ * http://www.w3.org/Consortium/Legal/ for more details.
+ */
+
+package org.w3c.domts.level2.events;
+
+import java.lang.reflect.Constructor;
+
+import junit.framework.TestSuite;
+
+
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+import org.w3c.domts.DOMTestSuite;
+import org.w3c.domts.LSDocumentBuilderFactory;
+import org.w3c.domts.JAXPDOMTestDocumentBuilderFactory;
+import org.w3c.domts.JUnitTestSuiteAdapter;
+
+/**
+ * Test suite that runs all DOM L2 Events tests using the
+ * Default LS parser in default configuration.
+ *
+ * @author Curt Arnold
+ *
+ */
+public class TestDefaultLS extends TestSuite {
+
+ public static TestSuite suite() throws Exception {
+ Class testClass =
+ ClassLoader.getSystemClassLoader().loadClass(
+ "org.w3c.domts.level2.events.alltests");
+ Constructor testConstructor =
+ testClass.getConstructor(
+ new Class[] { DOMTestDocumentBuilderFactory.class });
+
+ DOMTestDocumentBuilderFactory factory =
+ new LSDocumentBuilderFactory(
+ JAXPDOMTestDocumentBuilderFactory.getConfiguration1());
+
+ Object test = testConstructor.newInstance(new Object[] { factory });
+
+ return new JUnitTestSuiteAdapter((DOMTestSuite) test);
+ }
+
+}
diff --git a/dom/src/test/java/org/w3c/domts/level2/events/TestDefaultLSAltConfig.java b/dom/src/test/java/org/w3c/domts/level2/events/TestDefaultLSAltConfig.java
new file mode 100644
index 0000000..f6976af
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level2/events/TestDefaultLSAltConfig.java
@@ -0,0 +1,51 @@
+/*
+ * Copyright (c) 2001-2004 World Wide Web Consortium, (Massachusetts Institute
+ * of Technology, Institut National de Recherche en Informatique et en
+ * Automatique, Keio University). All Rights Reserved. This program is
+ * distributed under the W3C's Software Intellectual Property License. This
+ * program 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 W3C License
+ * http://www.w3.org/Consortium/Legal/ for more details.
+ */
+
+package org.w3c.domts.level2.events;
+
+import java.lang.reflect.Constructor;
+
+import junit.framework.TestSuite;
+
+
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+import org.w3c.domts.DOMTestSuite;
+import org.w3c.domts.LSDocumentBuilderFactory;
+import org.w3c.domts.JAXPDOMTestDocumentBuilderFactory;
+import org.w3c.domts.JUnitTestSuiteAdapter;
+
+/**
+ * Test suite that runs all DOM L2 Events tests using the
+ * Default LS parser in an alternate configuration
+ *
+ * @author Curt Arnold
+ *
+ */
+public class TestDefaultLSAltConfig extends TestSuite {
+
+ public static TestSuite suite() throws Exception {
+ Class testClass =
+ ClassLoader.getSystemClassLoader().loadClass(
+ "org.w3c.domts.level2.events.alltests");
+ Constructor testConstructor =
+ testClass.getConstructor(
+ new Class[] { DOMTestDocumentBuilderFactory.class });
+
+ DOMTestDocumentBuilderFactory factory =
+ new LSDocumentBuilderFactory(
+ JAXPDOMTestDocumentBuilderFactory.getConfiguration2());
+
+ Object test = testConstructor.newInstance(new Object[] { factory });
+
+ return new JUnitTestSuiteAdapter((DOMTestSuite) test);
+ }
+
+}
diff --git a/dom/src/test/java/org/w3c/domts/level2/events/TestDefaultParser.java b/dom/src/test/java/org/w3c/domts/level2/events/TestDefaultParser.java
new file mode 100644
index 0000000..fa51d23
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level2/events/TestDefaultParser.java
@@ -0,0 +1,43 @@
+/*
+ * Copyright (c) 2001-2004 World Wide Web Consortium,
+ * (Massachusetts Institute of Technology, Institut National de
+ * Recherche en Informatique et en Automatique, Keio University). All
+ * Rights Reserved. This program is distributed under the W3C's Software
+ * Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+ */
+
+
+package org.w3c.domts.level2.events;
+
+import java.lang.reflect.Constructor;
+
+import junit.framework.TestSuite;
+
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+import org.w3c.domts.DOMTestSuite;
+import org.w3c.domts.JAXPDOMTestDocumentBuilderFactory;
+import org.w3c.domts.JUnitTestSuiteAdapter;
+
+public class TestDefaultParser extends TestSuite {
+
+ public static TestSuite suite() throws Exception
+ {
+ Class testClass = ClassLoader.getSystemClassLoader().loadClass("org.w3c.domts.level2.events.alltests");
+ Constructor testConstructor = testClass.getConstructor(new Class[] { DOMTestDocumentBuilderFactory.class });
+
+ DOMTestDocumentBuilderFactory factory =
+ new JAXPDOMTestDocumentBuilderFactory(null,
+ JAXPDOMTestDocumentBuilderFactory.getConfiguration1());
+
+ Object test = testConstructor.newInstance(new Object[] { factory });
+
+ return new JUnitTestSuiteAdapter((DOMTestSuite) test);
+ }
+
+
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level2/events/TestDefaultParserAltConfig.java b/dom/src/test/java/org/w3c/domts/level2/events/TestDefaultParserAltConfig.java
new file mode 100644
index 0000000..f56dae4
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level2/events/TestDefaultParserAltConfig.java
@@ -0,0 +1,43 @@
+/*
+ * Copyright (c) 2001-2004 World Wide Web Consortium,
+ * (Massachusetts Institute of Technology, Institut National de
+ * Recherche en Informatique et en Automatique, Keio University). All
+ * Rights Reserved. This program is distributed under the W3C's Software
+ * Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+ */
+
+
+package org.w3c.domts.level2.events;
+
+import java.lang.reflect.Constructor;
+
+import junit.framework.TestSuite;
+
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+import org.w3c.domts.DOMTestSuite;
+import org.w3c.domts.JAXPDOMTestDocumentBuilderFactory;
+import org.w3c.domts.JUnitTestSuiteAdapter;
+
+public class TestDefaultParserAltConfig extends TestSuite {
+
+ public static TestSuite suite() throws Exception
+ {
+ Class testClass = ClassLoader.getSystemClassLoader().loadClass("org.w3c.domts.level2.events.alltests");
+ Constructor testConstructor = testClass.getConstructor(new Class[] { DOMTestDocumentBuilderFactory.class });
+
+ DOMTestDocumentBuilderFactory factory =
+ new JAXPDOMTestDocumentBuilderFactory(null,
+ JAXPDOMTestDocumentBuilderFactory.getConfiguration2());
+
+ Object test = testConstructor.newInstance(new Object[] { factory });
+
+ return new JUnitTestSuiteAdapter((DOMTestSuite) test);
+ }
+
+
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level2/events/TestOracle.java b/dom/src/test/java/org/w3c/domts/level2/events/TestOracle.java
new file mode 100644
index 0000000..adc0a4f
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level2/events/TestOracle.java
@@ -0,0 +1,63 @@
+/*
+ * Copyright (c) 2001-2004 World Wide Web Consortium, (Massachusetts Institute of
+ * Technology, Institut National de Recherche en Informatique et en
+ * Automatique, Keio University). All Rights Reserved. This program is
+ * distributed under the W3C's Software Intellectual Property License. This
+ * program 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 W3C License
+ * http://www.w3.org/Consortium/Legal/ for more details.
+ */
+
+package org.w3c.domts.level2.events;
+
+import java.lang.reflect.Constructor;
+
+import javax.xml.parsers.DocumentBuilderFactory;
+
+import junit.framework.TestSuite;
+
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+import org.w3c.domts.DOMTestSuite;
+import org.w3c.domts.JAXPDOMTestDocumentBuilderFactory;
+import org.w3c.domts.JUnitTestSuiteAdapter;
+
+/**
+ * Test suite that runs all DOM L2 Events tests using the
+ * Oracle Parser for Java in default configuration.
+ *
+ * @author Curt Arnold
+ *
+ */
+public class TestOracle extends TestSuite {
+
+ /**
+ * Constructor
+ * @return test suite
+ * @throws Exception
+ */
+ public static TestSuite suite() throws Exception {
+ Class testClass =
+ ClassLoader.getSystemClassLoader().loadClass(
+ "org.w3c.domts.level2.events.alltests");
+ Constructor testConstructor =
+ testClass.getConstructor(
+ new Class[] { DOMTestDocumentBuilderFactory.class });
+
+ DocumentBuilderFactory oracleFactory =
+ (DocumentBuilderFactory) ClassLoader
+ .getSystemClassLoader()
+ .loadClass("oracle.xml.jaxp.JXDocumentBuilderFactory")
+ .newInstance();
+
+ DOMTestDocumentBuilderFactory factory =
+ new JAXPDOMTestDocumentBuilderFactory(
+ oracleFactory,
+ JAXPDOMTestDocumentBuilderFactory.getConfiguration1());
+
+ Object test = testConstructor.newInstance(new Object[] { factory });
+
+ return new JUnitTestSuiteAdapter((DOMTestSuite) test);
+ }
+
+}
diff --git a/dom/src/test/java/org/w3c/domts/level2/events/TestOracleAltConfig.java b/dom/src/test/java/org/w3c/domts/level2/events/TestOracleAltConfig.java
new file mode 100644
index 0000000..2a6c2f3
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level2/events/TestOracleAltConfig.java
@@ -0,0 +1,62 @@
+/*
+ * Copyright (c) 2001-2004 World Wide Web Consortium, (Massachusetts Institute of
+ * Technology, Institut National de Recherche en Informatique et en
+ * Automatique, Keio University). All Rights Reserved. This program is
+ * distributed under the W3C's Software Intellectual Property License. This
+ * program 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 W3C License
+ * http://www.w3.org/Consortium/Legal/ for more details.
+ */
+
+package org.w3c.domts.level2.events;
+
+import java.lang.reflect.Constructor;
+
+import javax.xml.parsers.DocumentBuilderFactory;
+
+import junit.framework.TestSuite;
+
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+import org.w3c.domts.DOMTestSuite;
+import org.w3c.domts.JAXPDOMTestDocumentBuilderFactory;
+import org.w3c.domts.JUnitTestSuiteAdapter;
+
+/**
+ * Test suite that runs all DOM L2 Events tests using the
+ * Oracle Parser for Java in an alternative configuration.
+ *
+ * @author Curt Arnold
+ *
+ */
+public class TestOracleAltConfig extends TestSuite {
+ /**
+ * Constructor
+ * @return test suite
+ * @throws Exception
+ */
+ public static TestSuite suite() throws Exception {
+ Class testClass =
+ ClassLoader.getSystemClassLoader().loadClass(
+ "org.w3c.domts.level2.events.alltests");
+ Constructor testConstructor =
+ testClass.getConstructor(
+ new Class[] { DOMTestDocumentBuilderFactory.class });
+
+ DocumentBuilderFactory oracleFactory =
+ (DocumentBuilderFactory) ClassLoader
+ .getSystemClassLoader()
+ .loadClass("oracle.xml.jaxp.JXDocumentBuilderFactory")
+ .newInstance();
+
+ DOMTestDocumentBuilderFactory factory =
+ new JAXPDOMTestDocumentBuilderFactory(
+ oracleFactory,
+ JAXPDOMTestDocumentBuilderFactory.getConfiguration2());
+
+ Object test = testConstructor.newInstance(new Object[] { factory });
+
+ return new JUnitTestSuiteAdapter((DOMTestSuite) test);
+ }
+
+}
diff --git a/dom/src/test/java/org/w3c/domts/level2/events/TestXerces.java b/dom/src/test/java/org/w3c/domts/level2/events/TestXerces.java
new file mode 100644
index 0000000..8cced71
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level2/events/TestXerces.java
@@ -0,0 +1,49 @@
+/*
+ * Copyright (c) 2001-2004 World Wide Web Consortium,
+ * (Massachusetts Institute of Technology, Institut National de
+ * Recherche en Informatique et en Automatique, Keio University). All
+ * Rights Reserved. This program is distributed under the W3C's Software
+ * Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+ */
+
+
+package org.w3c.domts.level2.events;
+
+import java.lang.reflect.Constructor;
+
+import javax.xml.parsers.DocumentBuilderFactory;
+
+import junit.framework.TestSuite;
+
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+import org.w3c.domts.DOMTestSuite;
+import org.w3c.domts.JAXPDOMTestDocumentBuilderFactory;
+import org.w3c.domts.JUnitTestSuiteAdapter;
+
+public class TestXerces extends TestSuite {
+
+ public static TestSuite suite() throws Exception
+ {
+ Class testClass = ClassLoader.getSystemClassLoader().loadClass("org.w3c.domts.level2.events.alltests");
+ Constructor testConstructor = testClass.getConstructor(new Class[] { DOMTestDocumentBuilderFactory.class });
+
+ DocumentBuilderFactory xercesFactory = (DocumentBuilderFactory)
+ ClassLoader.getSystemClassLoader().loadClass("org.apache.xerces.jaxp.DocumentBuilderFactoryImpl").newInstance();
+
+ DOMTestDocumentBuilderFactory factory =
+ new JAXPDOMTestDocumentBuilderFactory(xercesFactory,
+ JAXPDOMTestDocumentBuilderFactory.getConfiguration1());
+
+
+ Object test = testConstructor.newInstance(new Object[] { factory });
+
+ return new JUnitTestSuiteAdapter((DOMTestSuite) test);
+ }
+
+
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level2/events/TestXercesAltConfig.java b/dom/src/test/java/org/w3c/domts/level2/events/TestXercesAltConfig.java
new file mode 100644
index 0000000..6079c6f
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level2/events/TestXercesAltConfig.java
@@ -0,0 +1,48 @@
+/*
+ * Copyright (c) 2001-2004 World Wide Web Consortium,
+ * (Massachusetts Institute of Technology, Institut National de
+ * Recherche en Informatique et en Automatique, Keio University). All
+ * Rights Reserved. This program is distributed under the W3C's Software
+ * Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+ */
+
+
+package org.w3c.domts.level2.events;
+
+import java.lang.reflect.Constructor;
+
+import javax.xml.parsers.DocumentBuilderFactory;
+
+import junit.framework.TestSuite;
+
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+import org.w3c.domts.DOMTestSuite;
+import org.w3c.domts.JAXPDOMTestDocumentBuilderFactory;
+import org.w3c.domts.JUnitTestSuiteAdapter;
+
+public class TestXercesAltConfig extends TestSuite {
+
+ public static TestSuite suite() throws Exception
+ {
+ Class testClass = ClassLoader.getSystemClassLoader().loadClass("org.w3c.domts.level2.events.alltests");
+ Constructor testConstructor = testClass.getConstructor(new Class[] { DOMTestDocumentBuilderFactory.class });
+
+ DocumentBuilderFactory xercesFactory = (DocumentBuilderFactory)
+ ClassLoader.getSystemClassLoader().loadClass("org.apache.xerces.jaxp.DocumentBuilderFactoryImpl").newInstance();
+
+ DOMTestDocumentBuilderFactory factory =
+ new JAXPDOMTestDocumentBuilderFactory(xercesFactory,
+ JAXPDOMTestDocumentBuilderFactory.getConfiguration2());
+
+ Object test = testConstructor.newInstance(new Object[] { factory });
+
+ return new JUnitTestSuiteAdapter((DOMTestSuite) test);
+ }
+
+
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level2/html/TestDefaultLS.java b/dom/src/test/java/org/w3c/domts/level2/html/TestDefaultLS.java
new file mode 100644
index 0000000..b78726d
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level2/html/TestDefaultLS.java
@@ -0,0 +1,51 @@
+/*
+ * Copyright (c) 2001-2004 World Wide Web Consortium, (Massachusetts Institute
+ * of Technology, Institut National de Recherche en Informatique et en
+ * Automatique, Keio University). All Rights Reserved. This program is
+ * distributed under the W3C's Software Intellectual Property License. This
+ * program 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 W3C License
+ * http://www.w3.org/Consortium/Legal/ for more details.
+ */
+
+package org.w3c.domts.level2.html;
+
+import java.lang.reflect.Constructor;
+
+import junit.framework.TestSuite;
+
+
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+import org.w3c.domts.DOMTestSuite;
+import org.w3c.domts.LSDocumentBuilderFactory;
+import org.w3c.domts.JAXPDOMTestDocumentBuilderFactory;
+import org.w3c.domts.JUnitTestSuiteAdapter;
+
+/**
+ * Test suite that runs all DOM L2 HTML tests using the
+ * Default LS parser in default configuration.
+ *
+ * @author Curt Arnold
+ *
+ */
+public class TestDefaultLS extends TestSuite {
+
+ public static TestSuite suite() throws Exception {
+ Class testClass =
+ ClassLoader.getSystemClassLoader().loadClass(
+ "org.w3c.domts.level2.html.alltests");
+ Constructor testConstructor =
+ testClass.getConstructor(
+ new Class[] { DOMTestDocumentBuilderFactory.class });
+
+ DOMTestDocumentBuilderFactory factory =
+ new LSDocumentBuilderFactory(
+ JAXPDOMTestDocumentBuilderFactory.getConfiguration1());
+
+ Object test = testConstructor.newInstance(new Object[] { factory });
+
+ return new JUnitTestSuiteAdapter((DOMTestSuite) test);
+ }
+
+}
diff --git a/dom/src/test/java/org/w3c/domts/level2/html/TestDefaultLSAltConfig.java b/dom/src/test/java/org/w3c/domts/level2/html/TestDefaultLSAltConfig.java
new file mode 100644
index 0000000..26f70b9
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level2/html/TestDefaultLSAltConfig.java
@@ -0,0 +1,51 @@
+/*
+ * Copyright (c) 2001-2004 World Wide Web Consortium, (Massachusetts Institute
+ * of Technology, Institut National de Recherche en Informatique et en
+ * Automatique, Keio University). All Rights Reserved. This program is
+ * distributed under the W3C's Software Intellectual Property License. This
+ * program 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 W3C License
+ * http://www.w3.org/Consortium/Legal/ for more details.
+ */
+
+package org.w3c.domts.level2.html;
+
+import java.lang.reflect.Constructor;
+
+import junit.framework.TestSuite;
+
+
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+import org.w3c.domts.DOMTestSuite;
+import org.w3c.domts.LSDocumentBuilderFactory;
+import org.w3c.domts.JAXPDOMTestDocumentBuilderFactory;
+import org.w3c.domts.JUnitTestSuiteAdapter;
+
+/**
+ * Test suite that runs all DOM L2 HTML tests using the
+ * Default LS parser in an alternative configuration.
+ *
+ * @author Curt Arnold
+ *
+ */
+public class TestDefaultLSAltConfig extends TestSuite {
+
+ public static TestSuite suite() throws Exception {
+ Class testClass =
+ ClassLoader.getSystemClassLoader().loadClass(
+ "org.w3c.domts.level2.html.alltests");
+ Constructor testConstructor =
+ testClass.getConstructor(
+ new Class[] { DOMTestDocumentBuilderFactory.class });
+
+ DOMTestDocumentBuilderFactory factory =
+ new LSDocumentBuilderFactory(
+ JAXPDOMTestDocumentBuilderFactory.getConfiguration2());
+
+ Object test = testConstructor.newInstance(new Object[] { factory });
+
+ return new JUnitTestSuiteAdapter((DOMTestSuite) test);
+ }
+
+}
diff --git a/dom/src/test/java/org/w3c/domts/level2/html/TestXercesHTML.java b/dom/src/test/java/org/w3c/domts/level2/html/TestXercesHTML.java
new file mode 100644
index 0000000..52b20f9
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level2/html/TestXercesHTML.java
@@ -0,0 +1,43 @@
+/*
+ * Copyright (c) 2001-2004 World Wide Web Consortium,
+ * (Massachusetts Institute of Technology, Institut National de
+ * Recherche en Informatique et en Automatique, Keio University). All
+ * Rights Reserved. This program is distributed under the W3C's Software
+ * Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+ */
+
+
+package org.w3c.domts.level2.html;
+
+import java.lang.reflect.Constructor;
+
+import junit.framework.TestSuite;
+
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+import org.w3c.domts.DOMTestSuite;
+import org.w3c.domts.JUnitTestSuiteAdapter;
+import org.w3c.domts.XercesHTML2DocumentBuilderFactory;
+
+public class TestXercesHTML extends TestSuite {
+
+ public static TestSuite suite() throws Exception
+ {
+ Class testClass = ClassLoader.getSystemClassLoader().loadClass("org.w3c.domts.level2.html.alltests");
+ Constructor testConstructor = testClass.getConstructor(new Class[] { DOMTestDocumentBuilderFactory.class });
+
+ DOMTestDocumentBuilderFactory factory =
+ new XercesHTML2DocumentBuilderFactory(
+ XercesHTML2DocumentBuilderFactory.getConfiguration1());
+
+ Object test = testConstructor.newInstance(new Object[] { factory });
+
+ return new JUnitTestSuiteAdapter((DOMTestSuite) test);
+ }
+
+
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level3/core/TestBatik.java b/dom/src/test/java/org/w3c/domts/level3/core/TestBatik.java
new file mode 100644
index 0000000..e1256bd
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level3/core/TestBatik.java
@@ -0,0 +1,45 @@
+/*
+ * Copyright (c) 2001-2004 World Wide Web Consortium,
+ * (Massachusetts Institute of Technology, Institut National de
+ * Recherche en Informatique et en Automatique, Keio University). All
+ * Rights Reserved. This program is distributed under the W3C's Software
+ * Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+ */
+package org.w3c.domts.level3.core;
+import java.lang.reflect.Constructor;
+
+import junit.framework.TestSuite;
+
+import org.w3c.domts.BatikTestDocumentBuilderFactory;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+import org.w3c.domts.DOMTestSuite;
+import org.w3c.domts.DocumentBuilderSetting;
+import org.w3c.domts.JUnitTestSuiteAdapter;
+
+/**
+ *
+ * Runs test suite using Batik SVG.
+ *
+ */
+public class TestBatik extends TestSuite {
+ /**
+ * Factory method for suite.
+ *
+ * @return suite
+ * @throws Exception if Batik is not available or could not be instantiated
+ */
+ public static TestSuite suite() throws Exception {
+ Class testClass = ClassLoader.getSystemClassLoader().loadClass(
+ "org.w3c.domts.level3.core.alltests");
+ Constructor testConstructor = testClass
+ .getConstructor(new Class[]{DOMTestDocumentBuilderFactory.class});
+ DOMTestDocumentBuilderFactory factory = new BatikTestDocumentBuilderFactory(
+ new DocumentBuilderSetting[0]);
+ Object test = testConstructor.newInstance(new Object[]{factory});
+ return new JUnitTestSuiteAdapter((DOMTestSuite) test);
+ }
+}
diff --git a/dom/src/test/java/org/w3c/domts/level3/core/TestDefaultLS.java b/dom/src/test/java/org/w3c/domts/level3/core/TestDefaultLS.java
new file mode 100644
index 0000000..b9e3a15
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level3/core/TestDefaultLS.java
@@ -0,0 +1,57 @@
+/*
+ * Copyright (c) 2001-2004 World Wide Web Consortium, (Massachusetts Institute
+ * of Technology, Institut National de Recherche en Informatique et en
+ * Automatique, Keio University). All Rights Reserved. This program is
+ * distributed under the W3C's Software Intellectual Property License. This
+ * program 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 W3C License
+ * http://www.w3.org/Consortium/Legal/ for more details.
+ */
+
+package org.w3c.domts.level3.core;
+
+import java.lang.reflect.Constructor;
+
+import junit.framework.TestSuite;
+
+
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+import org.w3c.domts.DOMTestSuite;
+import org.w3c.domts.LSDocumentBuilderFactory;
+import org.w3c.domts.JAXPDOMTestDocumentBuilderFactory;
+import org.w3c.domts.JUnitTestSuiteAdapter;
+
+/**
+ * Test suite that runs all DOM L3 Core tests using the
+ * a parser provided by DOM L3 Core bootstrapping.
+ *
+ * @author Curt Arnold
+ *
+ */
+public class TestDefaultLS extends TestSuite {
+
+ /**
+ * Create instance of test suite.
+ *
+ * @return test suite
+ * @throws Exception if tests or implementation could not be loaded
+ */
+ public static TestSuite suite() throws Exception {
+ Class testClass =
+ ClassLoader.getSystemClassLoader().loadClass(
+ "org.w3c.domts.level3.core.alltests");
+ Constructor testConstructor =
+ testClass.getConstructor(
+ new Class[] { DOMTestDocumentBuilderFactory.class });
+
+ DOMTestDocumentBuilderFactory factory =
+ new LSDocumentBuilderFactory(
+ JAXPDOMTestDocumentBuilderFactory.getConfiguration1());
+
+ Object test = testConstructor.newInstance(new Object[] { factory });
+
+ return new JUnitTestSuiteAdapter((DOMTestSuite) test);
+ }
+
+}
diff --git a/dom/src/test/java/org/w3c/domts/level3/core/TestDefaultLSAltConfig.java b/dom/src/test/java/org/w3c/domts/level3/core/TestDefaultLSAltConfig.java
new file mode 100644
index 0000000..1ce4d74
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level3/core/TestDefaultLSAltConfig.java
@@ -0,0 +1,57 @@
+/*
+ * Copyright (c) 2001-2004 World Wide Web Consortium, (Massachusetts Institute
+ * of Technology, Institut National de Recherche en Informatique et en
+ * Automatique, Keio University). All Rights Reserved. This program is
+ * distributed under the W3C's Software Intellectual Property License. This
+ * program 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 W3C License
+ * http://www.w3.org/Consortium/Legal/ for more details.
+ */
+
+package org.w3c.domts.level3.core;
+
+import java.lang.reflect.Constructor;
+
+import junit.framework.TestSuite;
+
+
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+import org.w3c.domts.DOMTestSuite;
+import org.w3c.domts.LSDocumentBuilderFactory;
+import org.w3c.domts.JAXPDOMTestDocumentBuilderFactory;
+import org.w3c.domts.JUnitTestSuiteAdapter;
+
+/**
+ * Test suite that runs all DOM L3 Core tests using a
+ * parser provided by DOM L3 Core bootstrapping
+ * in alternative configuration
+ *
+ * @author Curt Arnold
+ *
+ */
+public class TestDefaultLSAltConfig extends TestSuite {
+
+ /**
+ * Create a new instance of the test suite
+ * @return test suite
+ * @throws Exception if tests or implementation not loaded
+ */
+ public static TestSuite suite() throws Exception {
+ Class testClass =
+ ClassLoader.getSystemClassLoader().loadClass(
+ "org.w3c.domts.level3.core.alltests");
+ Constructor testConstructor =
+ testClass.getConstructor(
+ new Class[] { DOMTestDocumentBuilderFactory.class });
+
+ DOMTestDocumentBuilderFactory factory =
+ new LSDocumentBuilderFactory(
+ JAXPDOMTestDocumentBuilderFactory.getConfiguration2());
+
+ Object test = testConstructor.newInstance(new Object[] { factory });
+
+ return new JUnitTestSuiteAdapter((DOMTestSuite) test);
+ }
+
+}
diff --git a/dom/src/test/java/org/w3c/domts/level3/core/TestDefaultParser.java b/dom/src/test/java/org/w3c/domts/level3/core/TestDefaultParser.java
new file mode 100644
index 0000000..541a13a
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level3/core/TestDefaultParser.java
@@ -0,0 +1,53 @@
+/*
+ * Copyright (c) 2001-2004 World Wide Web Consortium,
+ * (Massachusetts Institute of Technology, Institut National de
+ * Recherche en Informatique et en Automatique, Keio University). All
+ * Rights Reserved. This program is distributed under the W3C's Software
+ * Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+ */
+
+
+package org.w3c.domts.level3.core;
+
+import java.lang.reflect.Constructor;
+
+import junit.framework.TestSuite;
+
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+import org.w3c.domts.DOMTestSuite;
+import org.w3c.domts.JAXPDOMTestDocumentBuilderFactory;
+import org.w3c.domts.JUnitTestSuiteAdapter;
+
+/**
+ * Test suite using the default JAXP parser in the default configuration
+ *
+ *
+ */
+public class TestDefaultParser extends TestSuite {
+
+ /**
+ * Create a new instance of the test suite
+ * @return new test suite
+ * @exception Exception if tests or implementation can be created.
+ */
+ public static TestSuite suite() throws Exception
+ {
+ Class testClass = ClassLoader.getSystemClassLoader().loadClass("org.w3c.domts.level3.core.alltests");
+ Constructor testConstructor = testClass.getConstructor(new Class[] { DOMTestDocumentBuilderFactory.class });
+
+ DOMTestDocumentBuilderFactory factory =
+ new JAXPDOMTestDocumentBuilderFactory(null,
+ JAXPDOMTestDocumentBuilderFactory.getConfiguration1());
+
+ Object test = testConstructor.newInstance(new Object[] { factory });
+
+ return new JUnitTestSuiteAdapter((DOMTestSuite) test);
+ }
+
+
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level3/core/TestDefaultParserAltConfig.java b/dom/src/test/java/org/w3c/domts/level3/core/TestDefaultParserAltConfig.java
new file mode 100644
index 0000000..7cf0241
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level3/core/TestDefaultParserAltConfig.java
@@ -0,0 +1,56 @@
+/*
+ * Copyright (c) 2001-2004 World Wide Web Consortium,
+ * (Massachusetts Institute of Technology, Institut National de
+ * Recherche en Informatique et en Automatique, Keio University). All
+ * Rights Reserved. This program is distributed under the W3C's Software
+ * Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+ */
+
+
+package org.w3c.domts.level3.core;
+
+import java.lang.reflect.Constructor;
+
+import junit.framework.TestSuite;
+
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+import org.w3c.domts.DOMTestSuite;
+import org.w3c.domts.JAXPDOMTestDocumentBuilderFactory;
+import org.w3c.domts.JUnitTestSuiteAdapter;
+
+
+
+/**
+ * Test suite using the default JAXP parser in the alternative configuration
+ *
+ *
+ */
+public class TestDefaultParserAltConfig extends TestSuite {
+
+ /**
+ * Create a new instance of the test suite
+ * @return new test suite
+ * @exception Exception if tests or implementation can be created.
+ */
+
+ public static TestSuite suite() throws Exception
+ {
+ Class testClass = ClassLoader.getSystemClassLoader().loadClass("org.w3c.domts.level3.core.alltests");
+ Constructor testConstructor = testClass.getConstructor(new Class[] { DOMTestDocumentBuilderFactory.class });
+
+ DOMTestDocumentBuilderFactory factory =
+ new JAXPDOMTestDocumentBuilderFactory(null,
+ JAXPDOMTestDocumentBuilderFactory.getConfiguration2());
+
+ Object test = testConstructor.newInstance(new Object[] { factory });
+
+ return new JUnitTestSuiteAdapter((DOMTestSuite) test);
+ }
+
+
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level3/core/TestOracle.java b/dom/src/test/java/org/w3c/domts/level3/core/TestOracle.java
new file mode 100644
index 0000000..56932ee
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level3/core/TestOracle.java
@@ -0,0 +1,63 @@
+/*
+ * Copyright (c) 2001-2003 World Wide Web Consortium, (Massachusetts Institute of
+ * Technology, Institut National de Recherche en Informatique et en
+ * Automatique, Keio University). All Rights Reserved. This program is
+ * distributed under the W3C's Software Intellectual Property License. This
+ * program 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 W3C License
+ * http://www.w3.org/Consortium/Legal/ for more details.
+ */
+
+package org.w3c.domts.level3.core;
+
+import java.lang.reflect.Constructor;
+
+import javax.xml.parsers.DocumentBuilderFactory;
+
+import junit.framework.TestSuite;
+
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+import org.w3c.domts.DOMTestSuite;
+import org.w3c.domts.JAXPDOMTestDocumentBuilderFactory;
+import org.w3c.domts.JUnitTestSuiteAdapter;
+
+/**
+ * Test suite that runs all DOM L3 Core tests using the
+ * Oracle Parser for Java in default configuration.
+ *
+ * @author Curt Arnold
+ *
+ */
+public class TestOracle extends TestSuite {
+
+ /**
+ * Constructor
+ * @return test suite
+ * @throws Exception
+ */
+ public static TestSuite suite() throws Exception {
+ Class testClass =
+ ClassLoader.getSystemClassLoader().loadClass(
+ "org.w3c.domts.level3.core.alltests");
+ Constructor testConstructor =
+ testClass.getConstructor(
+ new Class[] { DOMTestDocumentBuilderFactory.class });
+
+ DocumentBuilderFactory oracleFactory =
+ (DocumentBuilderFactory) ClassLoader
+ .getSystemClassLoader()
+ .loadClass("oracle.xml.jaxp.JXDocumentBuilderFactory")
+ .newInstance();
+
+ DOMTestDocumentBuilderFactory factory =
+ new JAXPDOMTestDocumentBuilderFactory(
+ oracleFactory,
+ JAXPDOMTestDocumentBuilderFactory.getConfiguration1());
+
+ Object test = testConstructor.newInstance(new Object[] { factory });
+
+ return new JUnitTestSuiteAdapter((DOMTestSuite) test);
+ }
+
+}
diff --git a/dom/src/test/java/org/w3c/domts/level3/core/TestOracleAltConfig.java b/dom/src/test/java/org/w3c/domts/level3/core/TestOracleAltConfig.java
new file mode 100644
index 0000000..830af44
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level3/core/TestOracleAltConfig.java
@@ -0,0 +1,62 @@
+/*
+ * Copyright (c) 2001-2003 World Wide Web Consortium, (Massachusetts Institute of
+ * Technology, Institut National de Recherche en Informatique et en
+ * Automatique, Keio University). All Rights Reserved. This program is
+ * distributed under the W3C's Software Intellectual Property License. This
+ * program 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 W3C License
+ * http://www.w3.org/Consortium/Legal/ for more details.
+ */
+
+package org.w3c.domts.level3.core;
+
+import java.lang.reflect.Constructor;
+
+import javax.xml.parsers.DocumentBuilderFactory;
+
+import junit.framework.TestSuite;
+
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+import org.w3c.domts.DOMTestSuite;
+import org.w3c.domts.JAXPDOMTestDocumentBuilderFactory;
+import org.w3c.domts.JUnitTestSuiteAdapter;
+
+/**
+ * Test suite that runs all DOM L3 Core tests using the
+ * Oracle Parser for Java in an alternative configuration.
+ *
+ * @author Curt Arnold
+ *
+ */
+public class TestOracleAltConfig extends TestSuite {
+ /**
+ * Constructor
+ * @return test suite
+ * @throws Exception
+ */
+ public static TestSuite suite() throws Exception {
+ Class testClass =
+ ClassLoader.getSystemClassLoader().loadClass(
+ "org.w3c.domts.level3.core.alltests");
+ Constructor testConstructor =
+ testClass.getConstructor(
+ new Class[] { DOMTestDocumentBuilderFactory.class });
+
+ DocumentBuilderFactory oracleFactory =
+ (DocumentBuilderFactory) ClassLoader
+ .getSystemClassLoader()
+ .loadClass("oracle.xml.jaxp.JXDocumentBuilderFactory")
+ .newInstance();
+
+ DOMTestDocumentBuilderFactory factory =
+ new JAXPDOMTestDocumentBuilderFactory(
+ oracleFactory,
+ JAXPDOMTestDocumentBuilderFactory.getConfiguration2());
+
+ Object test = testConstructor.newInstance(new Object[] { factory });
+
+ return new JUnitTestSuiteAdapter((DOMTestSuite) test);
+ }
+
+}
diff --git a/dom/src/test/java/org/w3c/domts/level3/core/TestXerces.java b/dom/src/test/java/org/w3c/domts/level3/core/TestXerces.java
new file mode 100644
index 0000000..e7f3b27
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level3/core/TestXerces.java
@@ -0,0 +1,58 @@
+/*
+ * Copyright (c) 2001-2003 World Wide Web Consortium, (Massachusetts Institute
+ * of Technology, Institut National de Recherche en Informatique et en
+ * Automatique, Keio University). All Rights Reserved. This program is
+ * distributed under the W3C's Software Intellectual Property License. This
+ * program 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 W3C License
+ * http://www.w3.org/Consortium/Legal/ for more details.
+ */
+
+package org.w3c.domts.level3.core;
+
+import java.lang.reflect.Constructor;
+
+import junit.framework.TestSuite;
+
+import javax.xml.parsers.DocumentBuilderFactory;
+
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+import org.w3c.domts.DOMTestSuite;
+import org.w3c.domts.JAXPDOMTestDocumentBuilderFactory;
+import org.w3c.domts.JUnitTestSuiteAdapter;
+
+/**
+ * Test suite that runs all DOM L3 Core tests using the
+ * Xerces-J in default configuration.
+ *
+ * @author Curt Arnold
+ *
+ */
+public class TestXerces extends TestSuite {
+
+ public static TestSuite suite() throws Exception {
+ Class testClass =
+ ClassLoader.getSystemClassLoader().loadClass(
+ "org.w3c.domts.level3.core.alltests");
+ Constructor testConstructor =
+ testClass.getConstructor(
+ new Class[] { DOMTestDocumentBuilderFactory.class });
+
+ DocumentBuilderFactory xercesFactory =
+ (DocumentBuilderFactory) ClassLoader
+ .getSystemClassLoader()
+ .loadClass("org.apache.xerces.jaxp.DocumentBuilderFactoryImpl")
+ .newInstance();
+
+ DOMTestDocumentBuilderFactory factory =
+ new JAXPDOMTestDocumentBuilderFactory(
+ xercesFactory,
+ JAXPDOMTestDocumentBuilderFactory.getConfiguration1());
+
+ Object test = testConstructor.newInstance(new Object[] { factory });
+
+ return new JUnitTestSuiteAdapter((DOMTestSuite) test);
+ }
+
+}
diff --git a/dom/src/test/java/org/w3c/domts/level3/core/TestXercesAltConfig.java b/dom/src/test/java/org/w3c/domts/level3/core/TestXercesAltConfig.java
new file mode 100644
index 0000000..b7dc2a9
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level3/core/TestXercesAltConfig.java
@@ -0,0 +1,58 @@
+/*
+ * Copyright (c) 2001-2003 World Wide Web Consortium, (Massachusetts Institute
+ * of Technology, Institut National de Recherche en Informatique et en
+ * Automatique, Keio University). All Rights Reserved. This program is
+ * distributed under the W3C's Software Intellectual Property License. This
+ * program 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 W3C License
+ * http://www.w3.org/Consortium/Legal/ for more details.
+ */
+
+package org.w3c.domts.level3.core;
+
+import java.lang.reflect.Constructor;
+
+import junit.framework.TestSuite;
+
+import javax.xml.parsers.DocumentBuilderFactory;
+
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+import org.w3c.domts.DOMTestSuite;
+import org.w3c.domts.JAXPDOMTestDocumentBuilderFactory;
+import org.w3c.domts.JUnitTestSuiteAdapter;
+
+/**
+ * Test suite that runs all DOM L3 Core tests using the
+ * Xerces-J in an alternative configuration.
+ *
+ * @author Curt Arnold
+ *
+ */
+public class TestXercesAltConfig extends TestSuite {
+
+ public static TestSuite suite() throws Exception {
+ Class testClass =
+ ClassLoader.getSystemClassLoader().loadClass(
+ "org.w3c.domts.level3.core.alltests");
+ Constructor testConstructor =
+ testClass.getConstructor(
+ new Class[] { DOMTestDocumentBuilderFactory.class });
+
+ DocumentBuilderFactory xercesFactory =
+ (DocumentBuilderFactory) ClassLoader
+ .getSystemClassLoader()
+ .loadClass("org.apache.xerces.jaxp.DocumentBuilderFactoryImpl")
+ .newInstance();
+
+ DOMTestDocumentBuilderFactory factory =
+ new JAXPDOMTestDocumentBuilderFactory(
+ xercesFactory,
+ JAXPDOMTestDocumentBuilderFactory.getConfiguration2());
+
+ Object test = testConstructor.newInstance(new Object[] { factory });
+
+ return new JUnitTestSuiteAdapter((DOMTestSuite) test);
+ }
+
+}
diff --git a/dom/src/test/java/org/w3c/domts/level3/ls/TestBatik.java b/dom/src/test/java/org/w3c/domts/level3/ls/TestBatik.java
new file mode 100644
index 0000000..f76c600
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level3/ls/TestBatik.java
@@ -0,0 +1,45 @@
+/*
+ * Copyright (c) 2001-2004 World Wide Web Consortium,
+ * (Massachusetts Institute of Technology, Institut National de
+ * Recherche en Informatique et en Automatique, Keio University). All
+ * Rights Reserved. This program is distributed under the W3C's Software
+ * Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+ */
+package org.w3c.domts.level3.ls;
+import java.lang.reflect.Constructor;
+
+import junit.framework.TestSuite;
+
+import org.w3c.domts.BatikTestDocumentBuilderFactory;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+import org.w3c.domts.DOMTestSuite;
+import org.w3c.domts.DocumentBuilderSetting;
+import org.w3c.domts.JUnitTestSuiteAdapter;
+
+/**
+ *
+ * Runs test suite using Batik SVG.
+ *
+ */
+public class TestBatik extends TestSuite {
+ /**
+ * Factory method for suite.
+ *
+ * @return suite
+ * @throws Exception if Batik is not available or could not be instantiated
+ */
+ public static TestSuite suite() throws Exception {
+ Class testClass = ClassLoader.getSystemClassLoader().loadClass(
+ "org.w3c.domts.level3.ls.alltests");
+ Constructor testConstructor = testClass
+ .getConstructor(new Class[]{DOMTestDocumentBuilderFactory.class});
+ DOMTestDocumentBuilderFactory factory = new BatikTestDocumentBuilderFactory(
+ new DocumentBuilderSetting[0]);
+ Object test = testConstructor.newInstance(new Object[]{factory});
+ return new JUnitTestSuiteAdapter((DOMTestSuite) test);
+ }
+}
diff --git a/dom/src/test/java/org/w3c/domts/level3/ls/TestDefaultLS.java b/dom/src/test/java/org/w3c/domts/level3/ls/TestDefaultLS.java
new file mode 100644
index 0000000..2a20d6c
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level3/ls/TestDefaultLS.java
@@ -0,0 +1,57 @@
+/*
+ * Copyright (c) 2001-2004 World Wide Web Consortium, (Massachusetts Institute
+ * of Technology, Institut National de Recherche en Informatique et en
+ * Automatique, Keio University). All Rights Reserved. This program is
+ * distributed under the W3C's Software Intellectual Property License. This
+ * program 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 W3C License
+ * http://www.w3.org/Consortium/Legal/ for more details.
+ */
+
+package org.w3c.domts.level3.ls;
+
+import java.lang.reflect.Constructor;
+
+import junit.framework.TestSuite;
+
+
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+import org.w3c.domts.DOMTestSuite;
+import org.w3c.domts.LSDocumentBuilderFactory;
+import org.w3c.domts.JAXPDOMTestDocumentBuilderFactory;
+import org.w3c.domts.JUnitTestSuiteAdapter;
+
+/**
+ * Test suite that runs all DOM L3 Core tests using the
+ * a parser provided by DOM L3 Core bootstrapping.
+ *
+ * @author Curt Arnold
+ *
+ */
+public class TestDefaultLS extends TestSuite {
+
+ /**
+ * Create instance of test suite.
+ *
+ * @return test suite
+ * @throws Exception if tests or implementation could not be loaded
+ */
+ public static TestSuite suite() throws Exception {
+ Class testClass =
+ ClassLoader.getSystemClassLoader().loadClass(
+ "org.w3c.domts.level3.ls.alltests");
+ Constructor testConstructor =
+ testClass.getConstructor(
+ new Class[] { DOMTestDocumentBuilderFactory.class });
+
+ DOMTestDocumentBuilderFactory factory =
+ new LSDocumentBuilderFactory(
+ JAXPDOMTestDocumentBuilderFactory.getConfiguration1());
+
+ Object test = testConstructor.newInstance(new Object[] { factory });
+
+ return new JUnitTestSuiteAdapter((DOMTestSuite) test);
+ }
+
+}
diff --git a/dom/src/test/java/org/w3c/domts/level3/ls/TestDefaultParser.java b/dom/src/test/java/org/w3c/domts/level3/ls/TestDefaultParser.java
new file mode 100644
index 0000000..3b317d3
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level3/ls/TestDefaultParser.java
@@ -0,0 +1,53 @@
+/*
+ * Copyright (c) 2001-2004 World Wide Web Consortium,
+ * (Massachusetts Institute of Technology, Institut National de
+ * Recherche en Informatique et en Automatique, Keio University). All
+ * Rights Reserved. This program is distributed under the W3C's Software
+ * Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+ */
+
+
+package org.w3c.domts.level3.ls;
+
+import java.lang.reflect.Constructor;
+
+import junit.framework.TestSuite;
+
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+import org.w3c.domts.DOMTestSuite;
+import org.w3c.domts.JAXPDOMTestDocumentBuilderFactory;
+import org.w3c.domts.JUnitTestSuiteAdapter;
+
+/**
+ * Test suite using the default JAXP parser in the default configuration
+ *
+ *
+ */
+public class TestDefaultParser extends TestSuite {
+
+ /**
+ * Create a new instance of the test suite
+ * @return new test suite
+ * @exception Exception if tests or implementation can be created.
+ */
+ public static TestSuite suite() throws Exception
+ {
+ Class testClass = ClassLoader.getSystemClassLoader().loadClass("org.w3c.domts.level3.ls.alltests");
+ Constructor testConstructor = testClass.getConstructor(new Class[] { DOMTestDocumentBuilderFactory.class });
+
+ DOMTestDocumentBuilderFactory factory =
+ new JAXPDOMTestDocumentBuilderFactory(null,
+ JAXPDOMTestDocumentBuilderFactory.getConfiguration1());
+
+ Object test = testConstructor.newInstance(new Object[] { factory });
+
+ return new JUnitTestSuiteAdapter((DOMTestSuite) test);
+ }
+
+
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level3/ls/TestOracle.java b/dom/src/test/java/org/w3c/domts/level3/ls/TestOracle.java
new file mode 100644
index 0000000..ec882c0
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level3/ls/TestOracle.java
@@ -0,0 +1,66 @@
+/*
+ * Copyright (c) 2003 World Wide Web Consortium, (Massachusetts Institute
+ * of Technology, Institut National de Recherche en Informatique et en
+ * Automatique, Keio University). All Rights Reserved. This program is
+ * distributed under the W3C's Software Intellectual Property License. This
+ * program 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 W3C License
+ * http://www.w3.org/Consortium/Legal/ for more details.
+ */
+
+package org.w3c.domts.level3.ls;
+
+import java.lang.reflect.Constructor;
+
+import javax.xml.parsers.DocumentBuilderFactory;
+
+import junit.framework.TestSuite;
+
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+import org.w3c.domts.DOMTestSuite;
+import org.w3c.domts.JAXPDOMTestDocumentBuilderFactory;
+import org.w3c.domts.JUnitTestSuiteAdapter;
+
+/**
+ * A JUnit test suite that will run all Load and Save tests
+ * using the Oracle XML Parser for Java
+ *
+ * @author Curt Arnold
+ *
+ */
+public class TestOracle extends TestSuite {
+
+ /**
+ * Constructs the test suite
+ *
+ * @return test suite
+ * @throws Exception can throw class load exceptions
+ * if class path does not contain dom3-ls.jar or
+ * xmlparserv2.jar
+ */
+ public static TestSuite suite() throws Exception {
+ Class testClass =
+ ClassLoader.getSystemClassLoader().loadClass(
+ "org.w3c.domts.level3.ls.alltests");
+ Constructor testConstructor =
+ testClass.getConstructor(
+ new Class[] { DOMTestDocumentBuilderFactory.class });
+
+ DocumentBuilderFactory jxFactory =
+ (DocumentBuilderFactory) ClassLoader
+ .getSystemClassLoader()
+ .loadClass("oracle.xml.jaxp.JXDocumentBuilderFactory")
+ .newInstance();
+
+ DOMTestDocumentBuilderFactory factory =
+ new JAXPDOMTestDocumentBuilderFactory(
+ jxFactory,
+ JAXPDOMTestDocumentBuilderFactory.getConfiguration1());
+
+ Object test = testConstructor.newInstance(new Object[] { factory });
+
+ return new JUnitTestSuiteAdapter((DOMTestSuite) test);
+ }
+
+}
diff --git a/dom/src/test/java/org/w3c/domts/level3/ls/TestXerces.java b/dom/src/test/java/org/w3c/domts/level3/ls/TestXerces.java
new file mode 100644
index 0000000..8a18367
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level3/ls/TestXerces.java
@@ -0,0 +1,56 @@
+/*
+ * Copyright (c) 2001-2003 World Wide Web Consortium,
+ * (Massachusetts Institute of Technology, Institut National de
+ * Recherche en Informatique et en Automatique, Keio University). All
+ * Rights Reserved. This program is distributed under the W3C's Software
+ * Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+ */
+
+
+package org.w3c.domts.level3.ls;
+
+import java.lang.reflect.Constructor;
+
+import javax.xml.parsers.DocumentBuilderFactory;
+
+import junit.framework.TestSuite;
+
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+import org.w3c.domts.DOMTestSuite;
+import org.w3c.domts.JAXPDOMTestDocumentBuilderFactory;
+import org.w3c.domts.JUnitTestSuiteAdapter;
+
+/**
+ * A JUnit test suite that will run all Load and Save tests
+ * using Xerces-J
+ *
+ * @author Curt Arnold
+ *
+ */
+public class TestXerces extends TestSuite {
+
+ public static TestSuite suite() throws Exception
+ {
+ Class testClass = ClassLoader.getSystemClassLoader().loadClass("org.w3c.domts.level3.ls.alltests");
+ Constructor testConstructor = testClass.getConstructor(new Class[] { DOMTestDocumentBuilderFactory.class });
+
+ DocumentBuilderFactory xercesFactory = (DocumentBuilderFactory)
+ ClassLoader.getSystemClassLoader().loadClass("org.apache.xerces.jaxp.DocumentBuilderFactoryImpl").newInstance();
+
+ DOMTestDocumentBuilderFactory factory =
+ new JAXPDOMTestDocumentBuilderFactory(xercesFactory,
+ JAXPDOMTestDocumentBuilderFactory.getConfiguration1());
+
+
+ Object test = testConstructor.newInstance(new Object[] { factory });
+
+ return new JUnitTestSuiteAdapter((DOMTestSuite) test);
+ }
+
+
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level3/validation/TestBatik.java b/dom/src/test/java/org/w3c/domts/level3/validation/TestBatik.java
new file mode 100644
index 0000000..1199768
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level3/validation/TestBatik.java
@@ -0,0 +1,45 @@
+/*
+ * Copyright (c) 2001-2004 World Wide Web Consortium,
+ * (Massachusetts Institute of Technology, Institut National de
+ * Recherche en Informatique et en Automatique, Keio University). All
+ * Rights Reserved. This program is distributed under the W3C's Software
+ * Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+ */
+package org.w3c.domts.level3.validation;
+import java.lang.reflect.Constructor;
+
+import junit.framework.TestSuite;
+
+import org.w3c.domts.BatikTestDocumentBuilderFactory;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+import org.w3c.domts.DOMTestSuite;
+import org.w3c.domts.DocumentBuilderSetting;
+import org.w3c.domts.JUnitTestSuiteAdapter;
+
+/**
+ *
+ * Runs test suite using Batik SVG.
+ *
+ */
+public class TestBatik extends TestSuite {
+ /**
+ * Factory method for suite.
+ *
+ * @return suite
+ * @throws Exception if Batik is not available or could not be instantiated
+ */
+ public static TestSuite suite() throws Exception {
+ Class testClass = ClassLoader.getSystemClassLoader().loadClass(
+ "org.w3c.domts.level3.validation.alltests");
+ Constructor testConstructor = testClass
+ .getConstructor(new Class[]{DOMTestDocumentBuilderFactory.class});
+ DOMTestDocumentBuilderFactory factory = new BatikTestDocumentBuilderFactory(
+ new DocumentBuilderSetting[0]);
+ Object test = testConstructor.newInstance(new Object[]{factory});
+ return new JUnitTestSuiteAdapter((DOMTestSuite) test);
+ }
+}
diff --git a/dom/src/test/java/org/w3c/domts/level3/validation/TestDefaultLS.java b/dom/src/test/java/org/w3c/domts/level3/validation/TestDefaultLS.java
new file mode 100644
index 0000000..71d759d
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level3/validation/TestDefaultLS.java
@@ -0,0 +1,57 @@
+/*
+ * Copyright (c) 2001-2004 World Wide Web Consortium, (Massachusetts Institute
+ * of Technology, Institut National de Recherche en Informatique et en
+ * Automatique, Keio University). All Rights Reserved. This program is
+ * distributed under the W3C's Software Intellectual Property License. This
+ * program 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 W3C License
+ * http://www.w3.org/Consortium/Legal/ for more details.
+ */
+
+package org.w3c.domts.level3.validation;
+
+import java.lang.reflect.Constructor;
+
+import junit.framework.TestSuite;
+
+
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+import org.w3c.domts.DOMTestSuite;
+import org.w3c.domts.LSDocumentBuilderFactory;
+import org.w3c.domts.JAXPDOMTestDocumentBuilderFactory;
+import org.w3c.domts.JUnitTestSuiteAdapter;
+
+/**
+ * Test suite that runs all DOM L3 Validation tests using the
+ * a parser provided by DOM L3 Core bootstrapping.
+ *
+ * @author Curt Arnold
+ *
+ */
+public class TestDefaultLS extends TestSuite {
+
+ /**
+ * Create instance of test suite.
+ *
+ * @return test suite
+ * @throws Exception if tests or implementation could not be loaded
+ */
+ public static TestSuite suite() throws Exception {
+ Class testClass =
+ ClassLoader.getSystemClassLoader().loadClass(
+ "org.w3c.domts.level3.validation.alltests");
+ Constructor testConstructor =
+ testClass.getConstructor(
+ new Class[] { DOMTestDocumentBuilderFactory.class });
+
+ DOMTestDocumentBuilderFactory factory =
+ new LSDocumentBuilderFactory(
+ JAXPDOMTestDocumentBuilderFactory.getConfiguration1());
+
+ Object test = testConstructor.newInstance(new Object[] { factory });
+
+ return new JUnitTestSuiteAdapter((DOMTestSuite) test);
+ }
+
+}
diff --git a/dom/src/test/java/org/w3c/domts/level3/validation/TestDefaultLSAltConfig.java b/dom/src/test/java/org/w3c/domts/level3/validation/TestDefaultLSAltConfig.java
new file mode 100644
index 0000000..66160c2
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level3/validation/TestDefaultLSAltConfig.java
@@ -0,0 +1,57 @@
+/*
+ * Copyright (c) 2001-2004 World Wide Web Consortium, (Massachusetts Institute
+ * of Technology, Institut National de Recherche en Informatique et en
+ * Automatique, Keio University). All Rights Reserved. This program is
+ * distributed under the W3C's Software Intellectual Property License. This
+ * program 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 W3C License
+ * http://www.w3.org/Consortium/Legal/ for more details.
+ */
+
+package org.w3c.domts.level3.validation;
+
+import java.lang.reflect.Constructor;
+
+import junit.framework.TestSuite;
+
+
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+import org.w3c.domts.DOMTestSuite;
+import org.w3c.domts.LSDocumentBuilderFactory;
+import org.w3c.domts.JAXPDOMTestDocumentBuilderFactory;
+import org.w3c.domts.JUnitTestSuiteAdapter;
+
+/**
+ * Test suite that runs all DOM L3 Validation tests using a
+ * parser provided by DOM L3 Core bootstrapping
+ * in alternative configuration
+ *
+ * @author Curt Arnold
+ *
+ */
+public class TestDefaultLSAltConfig extends TestSuite {
+
+ /**
+ * Create a new instance of the test suite
+ * @return test suite
+ * @throws Exception if tests or implementation not loaded
+ */
+ public static TestSuite suite() throws Exception {
+ Class testClass =
+ ClassLoader.getSystemClassLoader().loadClass(
+ "org.w3c.domts.level3.validation.alltests");
+ Constructor testConstructor =
+ testClass.getConstructor(
+ new Class[] { DOMTestDocumentBuilderFactory.class });
+
+ DOMTestDocumentBuilderFactory factory =
+ new LSDocumentBuilderFactory(
+ JAXPDOMTestDocumentBuilderFactory.getConfiguration2());
+
+ Object test = testConstructor.newInstance(new Object[] { factory });
+
+ return new JUnitTestSuiteAdapter((DOMTestSuite) test);
+ }
+
+}
diff --git a/dom/src/test/java/org/w3c/domts/level3/validation/TestDefaultParser.java b/dom/src/test/java/org/w3c/domts/level3/validation/TestDefaultParser.java
new file mode 100644
index 0000000..4d50461
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level3/validation/TestDefaultParser.java
@@ -0,0 +1,53 @@
+/*
+ * Copyright (c) 2001-2004 World Wide Web Consortium,
+ * (Massachusetts Institute of Technology, Institut National de
+ * Recherche en Informatique et en Automatique, Keio University). All
+ * Rights Reserved. This program is distributed under the W3C's Software
+ * Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+ */
+
+
+package org.w3c.domts.level3.validation;
+
+import java.lang.reflect.Constructor;
+
+import junit.framework.TestSuite;
+
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+import org.w3c.domts.DOMTestSuite;
+import org.w3c.domts.JAXPDOMTestDocumentBuilderFactory;
+import org.w3c.domts.JUnitTestSuiteAdapter;
+
+/**
+ * Test suite using the default JAXP parser in the default configuration
+ *
+ *
+ */
+public class TestDefaultParser extends TestSuite {
+
+ /**
+ * Create a new instance of the test suite
+ * @return new test suite
+ * @exception Exception if tests or implementation can be created.
+ */
+ public static TestSuite suite() throws Exception
+ {
+ Class testClass = ClassLoader.getSystemClassLoader().loadClass("org.w3c.domts.level3.validation.alltests");
+ Constructor testConstructor = testClass.getConstructor(new Class[] { DOMTestDocumentBuilderFactory.class });
+
+ DOMTestDocumentBuilderFactory factory =
+ new JAXPDOMTestDocumentBuilderFactory(null,
+ JAXPDOMTestDocumentBuilderFactory.getConfiguration1());
+
+ Object test = testConstructor.newInstance(new Object[] { factory });
+
+ return new JUnitTestSuiteAdapter((DOMTestSuite) test);
+ }
+
+
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level3/validation/TestDefaultParserAltConfig.java b/dom/src/test/java/org/w3c/domts/level3/validation/TestDefaultParserAltConfig.java
new file mode 100644
index 0000000..904fa99
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level3/validation/TestDefaultParserAltConfig.java
@@ -0,0 +1,56 @@
+/*
+ * Copyright (c) 2001-2004 World Wide Web Consortium,
+ * (Massachusetts Institute of Technology, Institut National de
+ * Recherche en Informatique et en Automatique, Keio University). All
+ * Rights Reserved. This program is distributed under the W3C's Software
+ * Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+ */
+
+
+package org.w3c.domts.level3.validation;
+
+import java.lang.reflect.Constructor;
+
+import junit.framework.TestSuite;
+
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+import org.w3c.domts.DOMTestSuite;
+import org.w3c.domts.JAXPDOMTestDocumentBuilderFactory;
+import org.w3c.domts.JUnitTestSuiteAdapter;
+
+
+
+/**
+ * Test suite using the default JAXP parser in the alternative configuration
+ *
+ *
+ */
+public class TestDefaultParserAltConfig extends TestSuite {
+
+ /**
+ * Create a new instance of the test suite
+ * @return new test suite
+ * @exception Exception if tests or implementation can be created.
+ */
+
+ public static TestSuite suite() throws Exception
+ {
+ Class testClass = ClassLoader.getSystemClassLoader().loadClass("org.w3c.domts.level3.validation.alltests");
+ Constructor testConstructor = testClass.getConstructor(new Class[] { DOMTestDocumentBuilderFactory.class });
+
+ DOMTestDocumentBuilderFactory factory =
+ new JAXPDOMTestDocumentBuilderFactory(null,
+ JAXPDOMTestDocumentBuilderFactory.getConfiguration2());
+
+ Object test = testConstructor.newInstance(new Object[] { factory });
+
+ return new JUnitTestSuiteAdapter((DOMTestSuite) test);
+ }
+
+
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level3/validation/TestOracle.java b/dom/src/test/java/org/w3c/domts/level3/validation/TestOracle.java
new file mode 100644
index 0000000..f178d28
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level3/validation/TestOracle.java
@@ -0,0 +1,63 @@
+/*
+ * Copyright (c) 2001-2004 World Wide Web Consortium, (Massachusetts Institute of
+ * Technology, Institut National de Recherche en Informatique et en
+ * Automatique, Keio University). All Rights Reserved. This program is
+ * distributed under the W3C's Software Intellectual Property License. This
+ * program 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 W3C License
+ * http://www.w3.org/Consortium/Legal/ for more details.
+ */
+
+package org.w3c.domts.level3.validation;
+
+import java.lang.reflect.Constructor;
+
+import javax.xml.parsers.DocumentBuilderFactory;
+
+import junit.framework.TestSuite;
+
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+import org.w3c.domts.DOMTestSuite;
+import org.w3c.domts.JAXPDOMTestDocumentBuilderFactory;
+import org.w3c.domts.JUnitTestSuiteAdapter;
+
+/**
+ * Test suite that runs all DOM L3 Validation tests using the
+ * Oracle Parser for Java in default configuration.
+ *
+ * @author Curt Arnold
+ *
+ */
+public class TestOracle extends TestSuite {
+
+ /**
+ * Constructor
+ * @return test suite
+ * @throws Exception
+ */
+ public static TestSuite suite() throws Exception {
+ Class testClass =
+ ClassLoader.getSystemClassLoader().loadClass(
+ "org.w3c.domts.level3.validation.alltests");
+ Constructor testConstructor =
+ testClass.getConstructor(
+ new Class[] { DOMTestDocumentBuilderFactory.class });
+
+ DocumentBuilderFactory oracleFactory =
+ (DocumentBuilderFactory) ClassLoader
+ .getSystemClassLoader()
+ .loadClass("oracle.xml.jaxp.JXDocumentBuilderFactory")
+ .newInstance();
+
+ DOMTestDocumentBuilderFactory factory =
+ new JAXPDOMTestDocumentBuilderFactory(
+ oracleFactory,
+ JAXPDOMTestDocumentBuilderFactory.getConfiguration1());
+
+ Object test = testConstructor.newInstance(new Object[] { factory });
+
+ return new JUnitTestSuiteAdapter((DOMTestSuite) test);
+ }
+
+}
diff --git a/dom/src/test/java/org/w3c/domts/level3/validation/TestOracleAltConfig.java b/dom/src/test/java/org/w3c/domts/level3/validation/TestOracleAltConfig.java
new file mode 100644
index 0000000..bbac83b
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level3/validation/TestOracleAltConfig.java
@@ -0,0 +1,62 @@
+/*
+ * Copyright (c) 2001-2004 World Wide Web Consortium, (Massachusetts Institute of
+ * Technology, Institut National de Recherche en Informatique et en
+ * Automatique, Keio University). All Rights Reserved. This program is
+ * distributed under the W3C's Software Intellectual Property License. This
+ * program 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 W3C License
+ * http://www.w3.org/Consortium/Legal/ for more details.
+ */
+
+package org.w3c.domts.level3.validation;
+
+import java.lang.reflect.Constructor;
+
+import javax.xml.parsers.DocumentBuilderFactory;
+
+import junit.framework.TestSuite;
+
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+import org.w3c.domts.DOMTestSuite;
+import org.w3c.domts.JAXPDOMTestDocumentBuilderFactory;
+import org.w3c.domts.JUnitTestSuiteAdapter;
+
+/**
+ * Test suite that runs all DOM L3 Validation tests using the
+ * Oracle Parser for Java in an alternative configuration.
+ *
+ * @author Curt Arnold
+ *
+ */
+public class TestOracleAltConfig extends TestSuite {
+ /**
+ * Constructor
+ * @return test suite
+ * @throws Exception
+ */
+ public static TestSuite suite() throws Exception {
+ Class testClass =
+ ClassLoader.getSystemClassLoader().loadClass(
+ "org.w3c.domts.level3.validation.alltests");
+ Constructor testConstructor =
+ testClass.getConstructor(
+ new Class[] { DOMTestDocumentBuilderFactory.class });
+
+ DocumentBuilderFactory oracleFactory =
+ (DocumentBuilderFactory) ClassLoader
+ .getSystemClassLoader()
+ .loadClass("oracle.xml.jaxp.JXDocumentBuilderFactory")
+ .newInstance();
+
+ DOMTestDocumentBuilderFactory factory =
+ new JAXPDOMTestDocumentBuilderFactory(
+ oracleFactory,
+ JAXPDOMTestDocumentBuilderFactory.getConfiguration2());
+
+ Object test = testConstructor.newInstance(new Object[] { factory });
+
+ return new JUnitTestSuiteAdapter((DOMTestSuite) test);
+ }
+
+}
diff --git a/dom/src/test/java/org/w3c/domts/level3/xpath/TestBatik.java b/dom/src/test/java/org/w3c/domts/level3/xpath/TestBatik.java
new file mode 100644
index 0000000..91e2ab5
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level3/xpath/TestBatik.java
@@ -0,0 +1,45 @@
+/*
+ * Copyright (c) 2001-2004 World Wide Web Consortium,
+ * (Massachusetts Institute of Technology, Institut National de
+ * Recherche en Informatique et en Automatique, Keio University). All
+ * Rights Reserved. This program is distributed under the W3C's Software
+ * Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+ */
+package org.w3c.domts.level3.xpath;
+import java.lang.reflect.Constructor;
+
+import junit.framework.TestSuite;
+
+import org.w3c.domts.BatikTestDocumentBuilderFactory;
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+import org.w3c.domts.DOMTestSuite;
+import org.w3c.domts.DocumentBuilderSetting;
+import org.w3c.domts.JUnitTestSuiteAdapter;
+
+/**
+ *
+ * Runs test suite using Batik SVG.
+ *
+ */
+public class TestBatik extends TestSuite {
+ /**
+ * Factory method for suite.
+ *
+ * @return suite
+ * @throws Exception if Batik is not available or could not be instantiated
+ */
+ public static TestSuite suite() throws Exception {
+ Class testClass = ClassLoader.getSystemClassLoader().loadClass(
+ "org.w3c.domts.level3.xpath.alltests");
+ Constructor testConstructor = testClass
+ .getConstructor(new Class[]{DOMTestDocumentBuilderFactory.class});
+ DOMTestDocumentBuilderFactory factory = new BatikTestDocumentBuilderFactory(
+ new DocumentBuilderSetting[0]);
+ Object test = testConstructor.newInstance(new Object[]{factory});
+ return new JUnitTestSuiteAdapter((DOMTestSuite) test);
+ }
+}
diff --git a/dom/src/test/java/org/w3c/domts/level3/xpath/TestDefaultLS.java b/dom/src/test/java/org/w3c/domts/level3/xpath/TestDefaultLS.java
new file mode 100644
index 0000000..7e4a56a
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level3/xpath/TestDefaultLS.java
@@ -0,0 +1,57 @@
+/*
+ * Copyright (c) 2001-2004 World Wide Web Consortium, (Massachusetts Institute
+ * of Technology, Institut National de Recherche en Informatique et en
+ * Automatique, Keio University). All Rights Reserved. This program is
+ * distributed under the W3C's Software Intellectual Property License. This
+ * program 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 W3C License
+ * http://www.w3.org/Consortium/Legal/ for more details.
+ */
+
+package org.w3c.domts.level3.xpath;
+
+import java.lang.reflect.Constructor;
+
+import junit.framework.TestSuite;
+
+
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+import org.w3c.domts.DOMTestSuite;
+import org.w3c.domts.LSDocumentBuilderFactory;
+import org.w3c.domts.JAXPDOMTestDocumentBuilderFactory;
+import org.w3c.domts.JUnitTestSuiteAdapter;
+
+/**
+ * Test suite that runs all DOM L3 XPath tests using the
+ * a parser provided by DOM L3 Core bootstrapping.
+ *
+ * @author Curt Arnold
+ *
+ */
+public class TestDefaultLS extends TestSuite {
+
+ /**
+ * Create instance of test suite.
+ *
+ * @return test suite
+ * @throws Exception if tests or implementation could not be loaded
+ */
+ public static TestSuite suite() throws Exception {
+ Class testClass =
+ ClassLoader.getSystemClassLoader().loadClass(
+ "org.w3c.domts.level3.xpath.alltests");
+ Constructor testConstructor =
+ testClass.getConstructor(
+ new Class[] { DOMTestDocumentBuilderFactory.class });
+
+ DOMTestDocumentBuilderFactory factory =
+ new LSDocumentBuilderFactory(
+ JAXPDOMTestDocumentBuilderFactory.getConfiguration1());
+
+ Object test = testConstructor.newInstance(new Object[] { factory });
+
+ return new JUnitTestSuiteAdapter((DOMTestSuite) test);
+ }
+
+}
diff --git a/dom/src/test/java/org/w3c/domts/level3/xpath/TestDefaultLSAltConfig.java b/dom/src/test/java/org/w3c/domts/level3/xpath/TestDefaultLSAltConfig.java
new file mode 100644
index 0000000..dbbe502
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level3/xpath/TestDefaultLSAltConfig.java
@@ -0,0 +1,57 @@
+/*
+ * Copyright (c) 2001-2004 World Wide Web Consortium, (Massachusetts Institute
+ * of Technology, Institut National de Recherche en Informatique et en
+ * Automatique, Keio University). All Rights Reserved. This program is
+ * distributed under the W3C's Software Intellectual Property License. This
+ * program 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 W3C License
+ * http://www.w3.org/Consortium/Legal/ for more details.
+ */
+
+package org.w3c.domts.level3.xpath;
+
+import java.lang.reflect.Constructor;
+
+import junit.framework.TestSuite;
+
+
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+import org.w3c.domts.DOMTestSuite;
+import org.w3c.domts.LSDocumentBuilderFactory;
+import org.w3c.domts.JAXPDOMTestDocumentBuilderFactory;
+import org.w3c.domts.JUnitTestSuiteAdapter;
+
+/**
+ * Test suite that runs all DOM L3 XPath tests using a
+ * parser provided by DOM L3 XPath bootstrapping
+ * in alternative configuration
+ *
+ * @author Curt Arnold
+ *
+ */
+public class TestDefaultLSAltConfig extends TestSuite {
+
+ /**
+ * Create a new instance of the test suite
+ * @return test suite
+ * @throws Exception if tests or implementation not loaded
+ */
+ public static TestSuite suite() throws Exception {
+ Class testClass =
+ ClassLoader.getSystemClassLoader().loadClass(
+ "org.w3c.domts.level3.xpath.alltests");
+ Constructor testConstructor =
+ testClass.getConstructor(
+ new Class[] { DOMTestDocumentBuilderFactory.class });
+
+ DOMTestDocumentBuilderFactory factory =
+ new LSDocumentBuilderFactory(
+ JAXPDOMTestDocumentBuilderFactory.getConfiguration2());
+
+ Object test = testConstructor.newInstance(new Object[] { factory });
+
+ return new JUnitTestSuiteAdapter((DOMTestSuite) test);
+ }
+
+}
diff --git a/dom/src/test/java/org/w3c/domts/level3/xpath/TestDefaultParser.java b/dom/src/test/java/org/w3c/domts/level3/xpath/TestDefaultParser.java
new file mode 100644
index 0000000..2ecaba1
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level3/xpath/TestDefaultParser.java
@@ -0,0 +1,53 @@
+/*
+ * Copyright (c) 2001-2004 World Wide Web Consortium,
+ * (Massachusetts Institute of Technology, Institut National de
+ * Recherche en Informatique et en Automatique, Keio University). All
+ * Rights Reserved. This program is distributed under the W3C's Software
+ * Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+ */
+
+
+package org.w3c.domts.level3.xpath;
+
+import java.lang.reflect.Constructor;
+
+import junit.framework.TestSuite;
+
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+import org.w3c.domts.DOMTestSuite;
+import org.w3c.domts.JAXPDOMTestDocumentBuilderFactory;
+import org.w3c.domts.JUnitTestSuiteAdapter;
+
+/**
+ * Test suite using the default JAXP parser in the default configuration
+ *
+ *
+ */
+public class TestDefaultParser extends TestSuite {
+
+ /**
+ * Create a new instance of the test suite
+ * @return new test suite
+ * @exception Exception if tests or implementation can be created.
+ */
+ public static TestSuite suite() throws Exception
+ {
+ Class testClass = ClassLoader.getSystemClassLoader().loadClass("org.w3c.domts.level3.xpath.alltests");
+ Constructor testConstructor = testClass.getConstructor(new Class[] { DOMTestDocumentBuilderFactory.class });
+
+ DOMTestDocumentBuilderFactory factory =
+ new JAXPDOMTestDocumentBuilderFactory(null,
+ JAXPDOMTestDocumentBuilderFactory.getConfiguration1());
+
+ Object test = testConstructor.newInstance(new Object[] { factory });
+
+ return new JUnitTestSuiteAdapter((DOMTestSuite) test);
+ }
+
+
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level3/xpath/TestDefaultParserAltConfig.java b/dom/src/test/java/org/w3c/domts/level3/xpath/TestDefaultParserAltConfig.java
new file mode 100644
index 0000000..acc9141
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level3/xpath/TestDefaultParserAltConfig.java
@@ -0,0 +1,56 @@
+/*
+ * Copyright (c) 2001-2004 World Wide Web Consortium,
+ * (Massachusetts Institute of Technology, Institut National de
+ * Recherche en Informatique et en Automatique, Keio University). All
+ * Rights Reserved. This program is distributed under the W3C's Software
+ * Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+ */
+
+
+package org.w3c.domts.level3.xpath;
+
+import java.lang.reflect.Constructor;
+
+import junit.framework.TestSuite;
+
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+import org.w3c.domts.DOMTestSuite;
+import org.w3c.domts.JAXPDOMTestDocumentBuilderFactory;
+import org.w3c.domts.JUnitTestSuiteAdapter;
+
+
+
+/**
+ * Test suite using the default JAXP parser in the alternative configuration
+ *
+ *
+ */
+public class TestDefaultParserAltConfig extends TestSuite {
+
+ /**
+ * Create a new instance of the test suite
+ * @return new test suite
+ * @exception Exception if tests or implementation can be created.
+ */
+
+ public static TestSuite suite() throws Exception
+ {
+ Class testClass = ClassLoader.getSystemClassLoader().loadClass("org.w3c.domts.level3.xpath.alltests");
+ Constructor testConstructor = testClass.getConstructor(new Class[] { DOMTestDocumentBuilderFactory.class });
+
+ DOMTestDocumentBuilderFactory factory =
+ new JAXPDOMTestDocumentBuilderFactory(null,
+ JAXPDOMTestDocumentBuilderFactory.getConfiguration2());
+
+ Object test = testConstructor.newInstance(new Object[] { factory });
+
+ return new JUnitTestSuiteAdapter((DOMTestSuite) test);
+ }
+
+
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level3/xpath/TestXalan.java b/dom/src/test/java/org/w3c/domts/level3/xpath/TestXalan.java
new file mode 100644
index 0000000..83ffe79
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level3/xpath/TestXalan.java
@@ -0,0 +1,48 @@
+/*
+ * Copyright (c) 2001-2003 World Wide Web Consortium,
+ * (Massachusetts Institute of Technology, Institut National de
+ * Recherche en Informatique et en Automatique, Keio University). All
+ * Rights Reserved. This program is distributed under the W3C's Software
+ * Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+ */
+
+
+package org.w3c.domts.level3.xpath;
+
+import java.lang.reflect.Constructor;
+
+import javax.xml.parsers.DocumentBuilderFactory;
+
+import junit.framework.TestSuite;
+
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+import org.w3c.domts.DOMTestSuite;
+import org.w3c.domts.JUnitTestSuiteAdapter;
+import org.w3c.domts.XalanDOMTestDocumentBuilderFactory;
+
+public class TestXalan extends TestSuite {
+
+ public static TestSuite suite() throws Exception
+ {
+ Class testClass = ClassLoader.getSystemClassLoader().loadClass("org.w3c.domts.level3.xpath.alltests");
+ Constructor testConstructor = testClass.getConstructor(new Class[] { DOMTestDocumentBuilderFactory.class });
+
+ DocumentBuilderFactory jaxpFactory = DocumentBuilderFactory.newInstance();
+
+ DOMTestDocumentBuilderFactory factory =
+ new XalanDOMTestDocumentBuilderFactory(jaxpFactory,
+ XalanDOMTestDocumentBuilderFactory.getConfiguration1());
+
+
+ Object test = testConstructor.newInstance(new Object[] { factory });
+
+ return new JUnitTestSuiteAdapter((DOMTestSuite) test);
+ }
+
+
+}
+
diff --git a/dom/src/test/java/org/w3c/domts/level3/xpath/TestXalanAltConfig.java b/dom/src/test/java/org/w3c/domts/level3/xpath/TestXalanAltConfig.java
new file mode 100644
index 0000000..268d341
--- /dev/null
+++ b/dom/src/test/java/org/w3c/domts/level3/xpath/TestXalanAltConfig.java
@@ -0,0 +1,47 @@
+/*
+ * Copyright (c) 2001-2003 World Wide Web Consortium,
+ * (Massachusetts Institute of Technology, Institut National de
+ * Recherche en Informatique et en Automatique, Keio University). All
+ * Rights Reserved. This program is distributed under the W3C's Software
+ * Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+ */
+
+
+package org.w3c.domts.level3.xpath;
+
+import java.lang.reflect.Constructor;
+
+import javax.xml.parsers.DocumentBuilderFactory;
+
+import junit.framework.TestSuite;
+
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+import org.w3c.domts.DOMTestSuite;
+import org.w3c.domts.JUnitTestSuiteAdapter;
+import org.w3c.domts.XalanDOMTestDocumentBuilderFactory;
+
+public class TestXalanAltConfig extends TestSuite {
+
+ public static TestSuite suite() throws Exception
+ {
+ Class testClass = ClassLoader.getSystemClassLoader().loadClass("org.w3c.domts.level3.xpath.alltests");
+ Constructor testConstructor = testClass.getConstructor(new Class[] { DOMTestDocumentBuilderFactory.class });
+
+ DocumentBuilderFactory jaxpFactory = DocumentBuilderFactory.newInstance();
+
+ DOMTestDocumentBuilderFactory factory =
+ new XalanDOMTestDocumentBuilderFactory(jaxpFactory,
+ XalanDOMTestDocumentBuilderFactory.getConfiguration2());
+
+ Object test = testConstructor.newInstance(new Object[] { factory });
+
+ return new JUnitTestSuiteAdapter((DOMTestSuite) test);
+ }
+
+
+}
+
diff --git a/dom/src/test/java/tests/api/org/w3c/dom/AllTests.java b/dom/src/test/java/tests/api/org/w3c/dom/AllTests.java
new file mode 100644
index 0000000..677780a
--- /dev/null
+++ b/dom/src/test/java/tests/api/org/w3c/dom/AllTests.java
@@ -0,0 +1,36 @@
+/*
+ * Copyright (C) 2008 Google Inc.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package tests.api.org.w3c.dom;
+
+import junit.framework.Test;
+import junit.framework.TestSuite;
+
+/**
+ *
+ */
+public class AllTests {
+ /*public static void run() {
+ TestRunner.main(new String[] {AllTests.class.getName()});
+ }*/
+
+ public static final Test suite() {
+ TestSuite suite = tests.TestSuiteFactory.createTestSuite();
+ suite.addTest(AllTests_Level1.suite());
+ suite.addTest(AllTests_Level2.suite());
+ return suite;
+ }
+}
diff --git a/dom/src/test/java/tests/api/org/w3c/dom/AllTests_Level1.java b/dom/src/test/java/tests/api/org/w3c/dom/AllTests_Level1.java
new file mode 100644
index 0000000..778633b
--- /dev/null
+++ b/dom/src/test/java/tests/api/org/w3c/dom/AllTests_Level1.java
@@ -0,0 +1,53 @@
+/*
+ * Copyright (C) 2008 Google Inc.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not
+ * use this file except in compliance with the License. You may obtain a copy of
+ * the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations under
+ * the License.
+ */
+
+package tests.api.org.w3c.dom;
+
+import junit.framework.Test;
+import junit.framework.TestSuite;
+
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+import org.w3c.domts.DOMTestSuite;
+import org.w3c.domts.JAXPDOMTestDocumentBuilderFactory;
+import org.w3c.domts.JUnitTestSuiteAdapter;
+
+/**
+ * Listing of all the tests that are to be run.
+ */
+public class AllTests_Level1 {
+ /*public static void run() {
+ TestRunner.main(new String[] {Main_AllTests.class.getName()});
+ }*/
+
+ public static final Test suite() {
+ // from http://www.w3.org/DOM/Test/
+ // Level 1 Core tests
+ DOMTestSuite domSuite;
+ try {
+ DOMTestDocumentBuilderFactory factory1 =
+ new JAXPDOMTestDocumentBuilderFactory(null,
+ JAXPDOMTestDocumentBuilderFactory.getConfiguration1());
+
+ // android: coalescing, epand, ignorewhitespace, namespace, NOT validation
+
+ domSuite = new org.w3c.domts.level1.core.alltests(factory1);
+ } catch (Exception e) {
+ throw new RuntimeException("problem creating dom test suite, "+e.getClass().getName()+", "+e.getMessage(), e);
+ }
+ TestSuite suite = new JUnitTestSuiteAdapter(domSuite);
+ return suite;
+ }
+}
diff --git a/dom/src/test/java/tests/api/org/w3c/dom/AllTests_Level2.java b/dom/src/test/java/tests/api/org/w3c/dom/AllTests_Level2.java
new file mode 100644
index 0000000..dff3d0d
--- /dev/null
+++ b/dom/src/test/java/tests/api/org/w3c/dom/AllTests_Level2.java
@@ -0,0 +1,53 @@
+/*
+ * Copyright (C) 2008 Google Inc.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not
+ * use this file except in compliance with the License. You may obtain a copy of
+ * the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations under
+ * the License.
+ */
+
+package tests.api.org.w3c.dom;
+
+import junit.framework.Test;
+import junit.framework.TestSuite;
+
+import org.w3c.domts.DOMTestDocumentBuilderFactory;
+import org.w3c.domts.DOMTestSuite;
+import org.w3c.domts.JAXPDOMTestDocumentBuilderFactory;
+import org.w3c.domts.JUnitTestSuiteAdapter;
+
+/**
+ * Listing of all the tests that are to be run.
+ */
+public class AllTests_Level2 {
+ /*public static void run() {
+ TestRunner.main(new String[] {Main_AllTests.class.getName()});
+ }*/
+
+ public static final Test suite() {
+ // from http://www.w3.org/DOM/Test/
+ // Level 2 Core tests
+ DOMTestSuite domSuite;
+ try {
+ DOMTestDocumentBuilderFactory factory1 =
+ new JAXPDOMTestDocumentBuilderFactory(null,
+ JAXPDOMTestDocumentBuilderFactory.getConfiguration1());
+
+ // android: coalescing, epand, ignorewhitespace, namespace, NOT validation
+
+ domSuite = new org.w3c.domts.level2.core.alltests(factory1);
+ } catch (Exception e) {
+ throw new RuntimeException("problem creating dom test suite", e);
+ }
+ TestSuite suite = new JUnitTestSuiteAdapter(domSuite);
+ return suite;
+ }
+}
diff --git a/dom/src/test/java/tests/dom/AllTests.java b/dom/src/test/java/tests/dom/AllTests.java
new file mode 100644
index 0000000..7a50c0a
--- /dev/null
+++ b/dom/src/test/java/tests/dom/AllTests.java
@@ -0,0 +1,31 @@
+/*
+ * Copyright (C) 2007 Google Inc.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package tests.dom;
+
+import junit.framework.Test;
+import junit.framework.TestSuite;
+
+public class AllTests {
+
+ public static Test suite() {
+ TestSuite suite = tests.TestSuiteFactory.createTestSuite();
+ suite.addTest(tests.api.org.w3c.dom.AllTests_Level1.suite());
+ suite.addTest(tests.api.org.w3c.dom.AllTests_Level2.suite());
+ return suite;
+ }
+
+}
diff --git a/dom/src/test/resources/META-INF/MANIFEST.MF b/dom/src/test/resources/META-INF/MANIFEST.MF
new file mode 100644
index 0000000..aaf3eba
--- /dev/null
+++ b/dom/src/test/resources/META-INF/MANIFEST.MF
@@ -0,0 +1,16 @@
+Manifest-Version: 2.0
+Class-Path: dom3-xml-apis.jar dom3-xercesImpl.jar xmlParserAPIs.jar x
+ ercesImpl.jar xerces.jar xml4j.jar xmlparserv2.jar crimson.jar parser
+ .jar jaxp.jar xml-apis.jar gnujaxp.jar dom4j-full.jar batik-svg-dom.j
+ ar crimson-parser.jar avalon-run.jar
+Created-By: 1.4.2_04 (Sun Microsystems Inc.)
+Main-Class: org.w3c.domts.level2.core.alltests
+
+Name: org/w3c/domts/level2/core
+Implementation-Title: W3C/NIST Test Suite for DOM Level 2 Core
+Specification-Title: W3C/NIST Test Suite for DOM Level 2 Core
+Specification-Version: 0.0.1
+Specification-Vendor: World Wide Web Consortium
+Implementation-Version: 0.0.1
+Implementation-Vendor: World Wide Web Consortium
+
diff --git a/dom/src/test/resources/build.xml b/dom/src/test/resources/build.xml
new file mode 100644
index 0000000..50060e0
--- /dev/null
+++ b/dom/src/test/resources/build.xml
@@ -0,0 +1,106 @@
+<!-- JUnit build script using ant 1.3 -->
+<project name="junit" default="dist" basedir=".">
+ <target name="init">
+ <tstamp/>
+ <property name="version" value="3.7" />
+ <property name="dist" value="junit${version}" />
+ <property name="versionfile" value="junit/runner/Version.java" />
+ <property name="zipfile" value="${dist}.zip" />
+ </target>
+
+ <target name="versiontag" depends="init">
+ <filter token="version" value="${version}" />
+ <copy
+ file="${versionfile}"
+ tofile="${versionfile}tmp"
+ filtering="on"
+ />
+ <move file="${versionfile}tmp" tofile="${versionfile}" />
+ </target>
+
+ <target name="build" depends="versiontag">
+ <javac
+ srcdir="."
+ destdir="."
+ debug="on"
+ />
+ </target>
+
+ <target name="dist" depends="build">
+ <delete dir="${dist}" />
+ <mkdir dir="${dist}" />
+ <jar
+ jarfile="${dist}/src.jar"
+ basedir="."
+ excludes="${dist}/src.jar, junit/tests/**, junit/samples/**, **/*.class, doc/**, README.html, build.xml"
+ />
+ <jar
+ jarfile="${dist}/junit.jar"
+ basedir="."
+ excludes="${dist}/junit.jar, junit/tests/**, junit/samples/**, **/*.java, doc/**, README.html, jar-manifest.txt"
+ />
+ <copy todir="${dist}/junit/samples">
+ <fileset dir="junit/samples" />
+ </copy>
+ <copy todir="${dist}/junit/tests">
+ <fileset dir="junit/tests" />
+ </copy>
+ <delete file="${dist}/junit/tests/test.jar"/>
+ <jar
+ jarfile="${dist}/junit/tests/test.jar"
+ basedir="."
+ includes="junit/tests/LoadedFromJar.class"
+ />
+ <mkdir dir="${dist}/javadoc" />
+ <javadoc
+ sourcepath="."
+ packagenames="junit.framework.*, junit.extensions.*"
+ destdir="${dist}/javadoc"
+ author="false"
+ version="false"
+ use="false"
+ windowtitle="JUnit API"
+ />
+ <copy todir="${dist}/doc">
+ <fileset dir="doc"/>
+ </copy>
+ <copy file="README.html" tofile="${dist}/README.html" />
+
+ <java classname="junit.textui.TestRunner" fork="yes">
+ <arg value="junit.samples.AllTests" />
+ <classpath>
+ <pathelement location="${dist}" />
+ <pathelement location="${dist}/junit.jar" />
+ </classpath>
+ </java>
+ </target>
+
+ <target name="zip">
+ <!-- !!! hard code names, variable substitution doesn't work !!! -->
+ <zip
+ zipfile="junit3.6.zip"
+ basedir="."
+ includes="junit3.6/**"
+ />
+ </target>
+
+ <target name="awtui" depends="dist">
+ <java classname="junit.awtui.TestRunner" fork="yes">
+ <arg value="junit.samples.AllTests" />
+ <classpath>
+ <pathelement location="${dist}" />
+ <pathelement location="${dist}/junit.jar" />
+ </classpath>
+ </java>
+ </target>
+
+ <target name="swingui" depends="dist">
+ <java classname="junit.swingui.TestRunner" fork="yes">
+ <arg value="junit.samples.AllTests" />
+ <classpath>
+ <pathelement location="${dist}" />
+ <pathelement location="${dist}/junit.jar" />
+ </classpath>
+ </java>
+ </target>
+</project>
diff --git a/dom/src/test/resources/hc_nodtdstaff.html b/dom/src/test/resources/hc_nodtdstaff.html
new file mode 100644
index 0000000..f98d0be
--- /dev/null
+++ b/dom/src/test/resources/hc_nodtdstaff.html
@@ -0,0 +1,10 @@
+<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>hc_nodtdstaff</title></head><body onload="parent.loadComplete()">
+ <p>
+ <em>EMP0001</em>
+ <strong>Margaret Martin</strong>
+ <code>Accountant</code>
+ <sup>56,000</sup>
+ <var>Female</var>
+ <acronym title="Yes">1230 North Ave. Dallas, Texas 98551</acronym>
+ </p>
+</body></html>
diff --git a/dom/src/test/resources/hc_nodtdstaff.svg b/dom/src/test/resources/hc_nodtdstaff.svg
new file mode 100644
index 0000000..89f26f6
--- /dev/null
+++ b/dom/src/test/resources/hc_nodtdstaff.svg
@@ -0,0 +1,10 @@
+<svg xmlns='http://www.w3.org/2000/svg'><rect x="0" y="0" width="100" height="100"/><head xmlns='http://www.w3.org/1999/xhtml'><title>hc_nodtdstaff</title></head><body xmlns='http://www.w3.org/1999/xhtml'>
+ <p>
+ <em>EMP0001</em>
+ <strong>Margaret Martin</strong>
+ <code>Accountant</code>
+ <sup>56,000</sup>
+ <var>Female</var>
+ <acronym title="Yes">1230 North Ave. Dallas, Texas 98551</acronym>
+ </p>
+</body></svg>
diff --git a/dom/src/test/resources/hc_nodtdstaff.xhtml b/dom/src/test/resources/hc_nodtdstaff.xhtml
new file mode 100644
index 0000000..8a5d8a8
--- /dev/null
+++ b/dom/src/test/resources/hc_nodtdstaff.xhtml
@@ -0,0 +1,10 @@
+<html xmlns="http://www.w3.org/1999/xhtml"><head><title>hc_nodtdstaff</title></head><body onload="parent.loadComplete()">
+ <p>
+ <em>EMP0001</em>
+ <strong>Margaret Martin</strong>
+ <code>Accountant</code>
+ <sup>56,000</sup>
+ <var>Female</var>
+ <acronym title="Yes">1230 North Ave. Dallas, Texas 98551</acronym>
+ </p>
+</body></html>
diff --git a/dom/src/test/resources/hc_nodtdstaff.xml b/dom/src/test/resources/hc_nodtdstaff.xml
new file mode 100644
index 0000000..85c0693
--- /dev/null
+++ b/dom/src/test/resources/hc_nodtdstaff.xml
@@ -0,0 +1,10 @@
+<html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/><title>hc_nodtdstaff</title></head><body onload="parent.loadComplete()">
+ <p>
+ <em>EMP0001</em>
+ <strong>Margaret Martin</strong>
+ <code>Accountant</code>
+ <sup>56,000</sup>
+ <var>Female</var>
+ <acronym title="Yes">1230 North Ave. Dallas, Texas 98551</acronym>
+ </p>
+</body></html>
diff --git a/dom/src/test/resources/hc_staff.html b/dom/src/test/resources/hc_staff.html
new file mode 100644
index 0000000..9acf750
--- /dev/null
+++ b/dom/src/test/resources/hc_staff.html
@@ -0,0 +1,48 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN"
+ "http://www.w3.org/TR/html4/strict.dtd" >
+<!-- This is comment number 1.-->
+<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>hc_staff</title><script type="text/javascript" src="svgunit.js"></script><script charset="UTF-8" type="text/javascript" src="svgtest.js"></script><script type='text/javascript'>function loadComplete() { startTest(); }</script></head><body onload="parent.loadComplete()">
+ <p>
+ <em>EMP0001</em>
+ <strong>Margaret Martin</strong>
+ <code>Accountant</code>
+ <sup>56,000</sup>
+ <var>Female</var>
+ <acronym title="Yes">1230 North Ave. Dallas, Texas 98551</acronym>
+ </p>
+ <p>
+ <em>EMP0002</em>
+ <strong>Martha RaynoldsThis is a CDATASection with EntityReference number 2 &amp;ent2;
+This is an adjacent CDATASection with a reference to a tab &amp;tab;</strong>
+ <code>Secretary</code>
+ <sup>35,000</sup>
+ <var>Female</var>
+ <acronym title="Yes" class="Yes">&beta; Dallas, &gamma;
+ 98554</acronym>
+ </p>
+ <p>
+ <em>EMP0003</em>
+ <strong>Roger
+ Jones</strong>
+ <code>Department Manager</code>
+ <sup>100,000</sup>
+ <var>&delta;</var>
+ <acronym title="Yes" class="No">PO Box 27 Irving, texas 98553</acronym>
+ </p>
+ <p>
+ <em>EMP0004</em>
+ <strong>Jeny Oconnor</strong>
+ <code>Personnel Director</code>
+ <sup>95,000</sup>
+ <var>Female</var>
+ <acronym title="Yes" class="Y&alpha;">27 South Road. Dallas, Texas 98556</acronym>
+ </p>
+ <p>
+ <em>EMP0005</em>
+ <strong>Robert Myers</strong>
+ <code>Computer Specialist</code>
+ <sup>90,000</sup>
+ <var>male</var>
+ <acronym title="Yes">1821 Nordic. Road, Irving Texas 98558</acronym>
+ </p>
+</body></html>
diff --git a/dom/src/test/resources/hc_staff.svg b/dom/src/test/resources/hc_staff.svg
new file mode 100644
index 0000000..cd0cc47
--- /dev/null
+++ b/dom/src/test/resources/hc_staff.svg
@@ -0,0 +1,72 @@
+<?xml version="1.0"?><?TEST-STYLE PIDATA?>
+<!DOCTYPE svg
+ PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
+ "xhtml1-strict.dtd" [
+ <!ENTITY alpha "&#945;">
+ <!ENTITY beta "&#946;">
+ <!ENTITY gamma "&#947;">
+ <!ENTITY delta "&#948;">
+ <!ENTITY epsilon "&#949;">
+ <!ENTITY alpha "&#950;">
+ <!NOTATION notation1 PUBLIC "notation1File">
+ <!NOTATION notation2 SYSTEM "notation2File">
+ <!ATTLIST acronym dir CDATA "ltr">
+ <!ATTLIST head xmlns CDATA #IMPLIED>
+ <!ATTLIST body xmlns CDATA #IMPLIED>
+ <!ELEMENT svg (rect, script, head, body)>
+ <!ATTLIST svg xmlns CDATA #IMPLIED>
+ <!ELEMENT rect EMPTY>
+ <!ATTLIST rect
+ x CDATA #IMPLIED
+ y CDATA #IMPLIED
+ width CDATA #IMPLIED
+ height CDATA #IMPLIED>
+ <!ENTITY svgunit SYSTEM "svgunit.js">
+ <!ENTITY svgtest SYSTEM "svgtest.js">
+]>
+<!-- This is comment number 1.-->
+<svg xmlns='http://www.w3.org/2000/svg'><rect x="0" y="0" width="100" height="100"/><script type="text/ecmascript">&svgtest;&svgunit;</script><head xmlns='http://www.w3.org/1999/xhtml'><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/><title>hc_staff</title></head><body xmlns='http://www.w3.org/1999/xhtml'>
+ <p>
+ <em>EMP0001</em>
+ <strong>Margaret Martin</strong>
+ <code>Accountant</code>
+ <sup>56,000</sup>
+ <var>Female</var>
+ <acronym title="Yes">1230 North Ave. Dallas, Texas 98551</acronym>
+ </p>
+ <p>
+ <em>EMP0002</em>
+ <strong>Martha RaynoldsThis is a CDATASection with EntityReference number 2 &amp;ent2;
+This is an adjacent CDATASection with a reference to a tab &amp;tab;</strong>
+ <code>Secretary</code>
+ <sup>35,000</sup>
+ <var>Female</var>
+ <acronym title="Yes" class="Yes">&beta; Dallas, &gamma;
+ 98554</acronym>
+ </p>
+ <p>
+ <em>EMP0003</em>
+ <strong>Roger
+ Jones</strong>
+ <code>Department Manager</code>
+ <sup>100,000</sup>
+ <var>&delta;</var>
+ <acronym title="Yes" class="No">PO Box 27 Irving, texas 98553</acronym>
+ </p>
+ <p>
+ <em>EMP0004</em>
+ <strong>Jeny Oconnor</strong>
+ <code>Personnel Director</code>
+ <sup>95,000</sup>
+ <var>Female</var>
+ <acronym title="Yes" class="Y&alpha;">27 South Road. Dallas, Texas 98556</acronym>
+ </p>
+ <p>
+ <em>EMP0005</em>
+ <strong>Robert Myers</strong>
+ <code>Computer Specialist</code>
+ <sup>90,000</sup>
+ <var>male</var>
+ <acronym title="Yes">1821 Nordic. Road, Irving Texas 98558</acronym>
+ </p>
+</body></svg>
diff --git a/dom/src/test/resources/hc_staff.xhtml b/dom/src/test/resources/hc_staff.xhtml
new file mode 100644
index 0000000..2df9a74
--- /dev/null
+++ b/dom/src/test/resources/hc_staff.xhtml
@@ -0,0 +1,60 @@
+<?xml version="1.0"?><?TEST-STYLE PIDATA?>
+<!DOCTYPE html
+ PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
+ "xhtml1-strict.dtd" [
+ <!ENTITY alpha "&#945;">
+ <!ENTITY beta "&#946;">
+ <!ENTITY gamma "&#947;">
+ <!ENTITY delta "&#948;">
+ <!ENTITY epsilon "&#949;">
+ <!ENTITY alpha "&#950;">
+ <!NOTATION notation1 PUBLIC "notation1File">
+ <!NOTATION notation2 SYSTEM "notation2File">
+ <!ATTLIST acronym dir CDATA "ltr">
+]>
+<!-- This is comment number 1.-->
+<html xmlns='http://www.w3.org/1999/xhtml'><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/><title>hc_staff</title><script type="text/javascript" src="svgunit.js"/><script charset="UTF-8" type="text/javascript" src="svgtest.js"/><script type='text/javascript'>function loadComplete() { startTest(); }</script></head><body onload="parent.loadComplete()">
+ <p>
+ <em>EMP0001</em>
+ <strong>Margaret Martin</strong>
+ <code>Accountant</code>
+ <sup>56,000</sup>
+ <var>Female</var>
+ <acronym title="Yes">1230 North Ave. Dallas, Texas 98551</acronym>
+ </p>
+ <p>
+ <em>EMP0002</em>
+ <strong>Martha RaynoldsThis is a CDATASection with EntityReference number 2 &amp;ent2;
+This is an adjacent CDATASection with a reference to a tab &amp;tab;</strong>
+ <code>Secretary</code>
+ <sup>35,000</sup>
+ <var>Female</var>
+ <acronym title="Yes" class="Yes">&beta; Dallas, &gamma;
+ 98554</acronym>
+ </p>
+ <p>
+ <em>EMP0003</em>
+ <strong>Roger
+ Jones</strong>
+ <code>Department Manager</code>
+ <sup>100,000</sup>
+ <var>&delta;</var>
+ <acronym title="Yes" class="No">PO Box 27 Irving, texas 98553</acronym>
+ </p>
+ <p>
+ <em>EMP0004</em>
+ <strong>Jeny Oconnor</strong>
+ <code>Personnel Director</code>
+ <sup>95,000</sup>
+ <var>Female</var>
+ <acronym title="Yes" class="Y&alpha;">27 South Road. Dallas, Texas 98556</acronym>
+ </p>
+ <p>
+ <em>EMP0005</em>
+ <strong>Robert Myers</strong>
+ <code>Computer Specialist</code>
+ <sup>90,000</sup>
+ <var>male</var>
+ <acronym title="Yes">1821 Nordic. Road, Irving Texas 98558</acronym>
+ </p>
+</body></html>
diff --git a/dom/src/test/resources/hc_staff.xml b/dom/src/test/resources/hc_staff.xml
new file mode 100644
index 0000000..2df9a74
--- /dev/null
+++ b/dom/src/test/resources/hc_staff.xml
@@ -0,0 +1,60 @@
+<?xml version="1.0"?><?TEST-STYLE PIDATA?>
+<!DOCTYPE html
+ PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
+ "xhtml1-strict.dtd" [
+ <!ENTITY alpha "&#945;">
+ <!ENTITY beta "&#946;">
+ <!ENTITY gamma "&#947;">
+ <!ENTITY delta "&#948;">
+ <!ENTITY epsilon "&#949;">
+ <!ENTITY alpha "&#950;">
+ <!NOTATION notation1 PUBLIC "notation1File">
+ <!NOTATION notation2 SYSTEM "notation2File">
+ <!ATTLIST acronym dir CDATA "ltr">
+]>
+<!-- This is comment number 1.-->
+<html xmlns='http://www.w3.org/1999/xhtml'><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/><title>hc_staff</title><script type="text/javascript" src="svgunit.js"/><script charset="UTF-8" type="text/javascript" src="svgtest.js"/><script type='text/javascript'>function loadComplete() { startTest(); }</script></head><body onload="parent.loadComplete()">
+ <p>
+ <em>EMP0001</em>
+ <strong>Margaret Martin</strong>
+ <code>Accountant</code>
+ <sup>56,000</sup>
+ <var>Female</var>
+ <acronym title="Yes">1230 North Ave. Dallas, Texas 98551</acronym>
+ </p>
+ <p>
+ <em>EMP0002</em>
+ <strong>Martha RaynoldsThis is a CDATASection with EntityReference number 2 &amp;ent2;
+This is an adjacent CDATASection with a reference to a tab &amp;tab;</strong>
+ <code>Secretary</code>
+ <sup>35,000</sup>
+ <var>Female</var>
+ <acronym title="Yes" class="Yes">&beta; Dallas, &gamma;
+ 98554</acronym>
+ </p>
+ <p>
+ <em>EMP0003</em>
+ <strong>Roger
+ Jones</strong>
+ <code>Department Manager</code>
+ <sup>100,000</sup>
+ <var>&delta;</var>
+ <acronym title="Yes" class="No">PO Box 27 Irving, texas 98553</acronym>
+ </p>
+ <p>
+ <em>EMP0004</em>
+ <strong>Jeny Oconnor</strong>
+ <code>Personnel Director</code>
+ <sup>95,000</sup>
+ <var>Female</var>
+ <acronym title="Yes" class="Y&alpha;">27 South Road. Dallas, Texas 98556</acronym>
+ </p>
+ <p>
+ <em>EMP0005</em>
+ <strong>Robert Myers</strong>
+ <code>Computer Specialist</code>
+ <sup>90,000</sup>
+ <var>male</var>
+ <acronym title="Yes">1821 Nordic. Road, Irving Texas 98558</acronym>
+ </p>
+</body></html>
diff --git a/dom/src/test/resources/internalSubset01.js b/dom/src/test/resources/internalSubset01.js
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/dom/src/test/resources/internalSubset01.js
diff --git a/dom/src/test/resources/nodtdstaff.svg b/dom/src/test/resources/nodtdstaff.svg
new file mode 100644
index 0000000..01aa823
--- /dev/null
+++ b/dom/src/test/resources/nodtdstaff.svg
@@ -0,0 +1,11 @@
+<?xml version="1.0"?>
+<svg xmlns="http://www.w3.org/2000/svg"><rect x="0" y="0" width="100" height="100"/>
+ <employee xmlns="http://www.w3.org/2001/DOM-Test-Suite/Level-1/Files">
+ <employeeId>EMP0001</employeeId>
+ <name>Margaret Martin</name>
+ <position>Accountant</position>
+ <salary>56,000</salary>
+ <gender>Female</gender>
+ <address domestic="Yes">1230 North Ave. Dallas, Texas 98551</address>
+ </employee>
+</svg>
diff --git a/dom/src/test/resources/nodtdstaff.xml b/dom/src/test/resources/nodtdstaff.xml
new file mode 100644
index 0000000..054a5e1
--- /dev/null
+++ b/dom/src/test/resources/nodtdstaff.xml
@@ -0,0 +1,11 @@
+<?xml version="1.0"?>
+<staff>
+ <employee>
+ <employeeId>EMP0001</employeeId>
+ <name>Margaret Martin</name>
+ <position>Accountant</position>
+ <salary>56,000</salary>
+ <gender>Female</gender>
+ <address domestic="Yes">1230 North Ave. Dallas, Texas 98551</address>
+ </employee>
+</staff>
diff --git a/dom/src/test/resources/staff.dtd b/dom/src/test/resources/staff.dtd
new file mode 100644
index 0000000..02a994d
--- /dev/null
+++ b/dom/src/test/resources/staff.dtd
@@ -0,0 +1,17 @@
+<!ELEMENT employeeId (#PCDATA)>
+<!ELEMENT name (#PCDATA)>
+<!ELEMENT position (#PCDATA)>
+<!ELEMENT salary (#PCDATA)>
+<!ELEMENT address (#PCDATA)>
+<!ELEMENT entElement ( #PCDATA ) >
+<!ELEMENT gender ( #PCDATA | entElement )* >
+<!ELEMENT employee (employeeId, name, position, salary, gender, address) >
+<!ELEMENT staff (employee)+>
+<!ATTLIST entElement
+ attr1 CDATA "Attr">
+<!ATTLIST address
+ domestic CDATA #IMPLIED
+ street CDATA "Yes">
+<!ATTLIST entElement
+ domestic CDATA "MALE" >
+
diff --git a/dom/src/test/resources/staff.svg b/dom/src/test/resources/staff.svg
new file mode 100644
index 0000000..fd67323
--- /dev/null
+++ b/dom/src/test/resources/staff.svg
@@ -0,0 +1,72 @@
+<?xml version="1.0"?><?TEST-STYLE PIDATA?>
+<!DOCTYPE svg SYSTEM "staff.dtd" [
+ <!ENTITY ent1 "es">
+ <!ENTITY ent2 "1900 Dallas Road">
+ <!ENTITY ent3 "Texas">
+ <!ENTITY ent4 "<entElement domestic='Yes'>Element data</entElement><?PItarget PIdata?>">
+ <!ENTITY ent5 PUBLIC "entityURI" "entityFile" NDATA notation1>
+ <!ENTITY ent1 "This entity should be discarded">
+ <!NOTATION notation1 PUBLIC "notation1File">
+ <!NOTATION notation2 SYSTEM "notation2File">
+ <!ATTLIST employee xmlns CDATA #IMPLIED>
+ <!ELEMENT svg (rect, script, employee+)>
+ <!ATTLIST svg
+ xmlns CDATA #FIXED "http://www.w3.org/2000/svg"
+ name CDATA #IMPLIED>
+ <!ELEMENT rect EMPTY>
+ <!ATTLIST rect
+ x CDATA #REQUIRED
+ y CDATA #REQUIRED
+ width CDATA #REQUIRED
+ height CDATA #REQUIRED>
+ <!ELEMENT script (#PCDATA)>
+ <!ATTLIST script type CDATA #IMPLIED>
+ <!ENTITY svgunit SYSTEM "svgunit.js">
+ <!ENTITY svgtest SYSTEM "svgtest.js">
+]>
+<!-- This is comment number 1.-->
+<svg xmlns="http://www.w3.org/2000/svg"><rect x="0" y="0" width="100" height="100"/><script type="text/ecmascript">&svgtest;&svgunit;</script>
+ <employee xmlns="http://www.w3.org/2001/DOM-Test-Suite/Level-1/Files">
+ <employeeId>EMP0001</employeeId>
+ <name>Margaret Martin</name>
+ <position>Accountant</position>
+ <salary>56,000</salary>
+ <gender>Female</gender>
+ <address domestic="Yes">1230 North Ave. Dallas, Texas 98551</address>
+ </employee>
+ <employee xmlns="http://www.w3.org/2001/DOM-Test-Suite/Level-1/Files">
+ <employeeId>EMP0002</employeeId>
+ <name>Martha Raynolds<![CDATA[This is a CDATASection with EntityReference number 2 &ent2;]]>
+<![CDATA[This is an adjacent CDATASection with a reference to a tab &tab;]]></name>
+ <position>Secretary</position>
+ <salary>35,000</salary>
+ <gender>Female</gender>
+ <address domestic="Yes" street="Yes">&ent2; Dallas, &ent3;
+ 98554</address>
+ </employee>
+ <employee xmlns="http://www.w3.org/2001/DOM-Test-Suite/Level-1/Files">
+ <employeeId>EMP0003</employeeId>
+ <name>Roger
+ Jones</name>
+ <position>Department Manager</position>
+ <salary>100,000</salary>
+ <gender>&ent4;</gender>
+ <address domestic="Yes" street="No">PO Box 27 Irving, texas 98553</address>
+ </employee>
+ <employee xmlns="http://www.w3.org/2001/DOM-Test-Suite/Level-1/Files">
+ <employeeId>EMP0004</employeeId>
+ <name>Jeny Oconnor</name>
+ <position>Personnel Director</position>
+ <salary>95,000</salary>
+ <gender>Female</gender>
+ <address domestic="Yes" street="Y&ent1;">27 South Road. Dallas, Texas 98556</address>
+ </employee>
+ <employee xmlns="http://www.w3.org/2001/DOM-Test-Suite/Level-1/Files">
+ <employeeId>EMP0005</employeeId>
+ <name>Robert Myers</name>
+ <position>Computer Specialist</position>
+ <salary>90,000</salary>
+ <gender>male</gender>
+ <address street="Yes">1821 Nordic. Road, Irving Texas 98558</address>
+ </employee>
+ </svg>
diff --git a/dom/src/test/resources/staff.xml b/dom/src/test/resources/staff.xml
new file mode 100644
index 0000000..f89c510
--- /dev/null
+++ b/dom/src/test/resources/staff.xml
@@ -0,0 +1,57 @@
+<?xml version="1.0"?><?TEST-STYLE PIDATA?>
+<!DOCTYPE staff SYSTEM "staff.dtd" [
+ <!ENTITY ent1 "es">
+ <!ENTITY ent2 "1900 Dallas Road">
+ <!ENTITY ent3 "Texas">
+ <!ENTITY ent4 "<entElement domestic='Yes'>Element data</entElement><?PItarget PIdata?>">
+ <!ENTITY ent5 PUBLIC "entityURI" "entityFile" NDATA notation1>
+ <!ENTITY ent1 "This entity should be discarded">
+ <!NOTATION notation1 PUBLIC "notation1File">
+ <!NOTATION notation2 SYSTEM "notation2File">
+]>
+<!-- This is comment number 1.-->
+<staff>
+ <employee>
+ <employeeId>EMP0001</employeeId>
+ <name>Margaret Martin</name>
+ <position>Accountant</position>
+ <salary>56,000</salary>
+ <gender>Female</gender>
+ <address domestic="Yes">1230 North Ave. Dallas, Texas 98551</address>
+ </employee>
+ <employee>
+ <employeeId>EMP0002</employeeId>
+ <name>Martha Raynolds<![CDATA[This is a CDATASection with EntityReference number 2 &ent2;]]>
+<![CDATA[This is an adjacent CDATASection with a reference to a tab &tab;]]></name>
+ <position>Secretary</position>
+ <salary>35,000</salary>
+ <gender>Female</gender>
+ <address domestic="Yes" street="Yes">&ent2; Dallas, &ent3;
+ 98554</address>
+ </employee>
+ <employee>
+ <employeeId>EMP0003</employeeId>
+ <name>Roger
+ Jones</name>
+ <position>Department Manager</position>
+ <salary>100,000</salary>
+ <gender>&ent4;</gender>
+ <address domestic="Yes" street="No">PO Box 27 Irving, texas 98553</address>
+ </employee>
+ <employee>
+ <employeeId>EMP0004</employeeId>
+ <name>Jeny Oconnor</name>
+ <position>Personnel Director</position>
+ <salary>95,000</salary>
+ <gender>Female</gender>
+ <address domestic="Yes" street="Y&ent1;">27 South Road. Dallas, Texas 98556</address>
+ </employee>
+ <employee>
+ <employeeId>EMP0005</employeeId>
+ <name>Robert Myers</name>
+ <position>Computer Specialist</position>
+ <salary>90,000</salary>
+ <gender>male</gender>
+ <address street="Yes">1821 Nordic. Road, Irving Texas 98558</address>
+ </employee>
+ </staff>
diff --git a/dom/src/test/resources/staff2.dtd b/dom/src/test/resources/staff2.dtd
new file mode 100644
index 0000000..0bac8f2
--- /dev/null
+++ b/dom/src/test/resources/staff2.dtd
@@ -0,0 +1,24 @@
+<!ELEMENT employeeId (#PCDATA)>
+<!ELEMENT name (#PCDATA)>
+<!ELEMENT position (#PCDATA)>
+<!ELEMENT salary (#PCDATA)>
+<!ELEMENT address (#PCDATA)>
+<!ELEMENT gender ( #PCDATA)>
+<!ELEMENT employee (employeeId, name, position, salary, gender, address) >
+<!ATTLIST employee xmlns CDATA #IMPLIED>
+<!ELEMENT staff (employee)+>
+<!ELEMENT svg (rect, script, employee+)>
+<!ATTLIST svg
+ xmlns CDATA #FIXED "http://www.w3.org/2000/svg"
+ name CDATA #IMPLIED>
+<!ELEMENT rect EMPTY>
+<!ATTLIST rect
+ x CDATA #REQUIRED
+ y CDATA #REQUIRED
+ width CDATA #REQUIRED
+ height CDATA #REQUIRED>
+<!ELEMENT script (#PCDATA)>
+<!ATTLIST script type CDATA #IMPLIED>
+<!ENTITY svgunit SYSTEM "svgunit.js">
+<!ENTITY svgtest SYSTEM "internalSubset01.js">
+
diff --git a/dom/src/test/resources/staff2.svg b/dom/src/test/resources/staff2.svg
new file mode 100644
index 0000000..6f89dad
--- /dev/null
+++ b/dom/src/test/resources/staff2.svg
@@ -0,0 +1,13 @@
+<?xml version="1.0"?><?TEST-STYLE PIDATA?>
+<!DOCTYPE svg SYSTEM "staff2.dtd" []>
+<!-- This is comment number 1.-->
+<svg xmlns="http://www.w3.org/2000/svg"><rect x="0" y="0" width="100" height="100"/><script type="text/ecmascript">&svgtest;&svgunit;</script>
+ <employee xmlns="http://www.example.com">
+ <employeeId>EMP0001</employeeId>
+ <name>Margaret Martin</name>
+ <position>Accountant</position>
+ <salary>56,000</salary>
+ <gender>Female</gender>
+ <address>1230 North Ave. Dallas, Texas 98551</address>
+ </employee>
+ </svg>
diff --git a/dom/src/test/resources/staff2.xml b/dom/src/test/resources/staff2.xml
new file mode 100644
index 0000000..d3d9a13
--- /dev/null
+++ b/dom/src/test/resources/staff2.xml
@@ -0,0 +1,13 @@
+<?xml version="1.0"?><?TEST-STYLE PIDATA?>
+<!DOCTYPE staff SYSTEM "staff2.dtd" []>
+<!-- This is comment number 1.-->
+<staff>
+ <employee>
+ <employeeId>EMP0001</employeeId>
+ <name>Margaret Martin</name>
+ <position>Accountant</position>
+ <salary>56,000</salary>
+ <gender>Female</gender>
+ <address>1230 North Ave. Dallas, Texas 98551</address>
+ </employee>
+ </staff>
diff --git a/dom/src/test/resources/staffNS.dtd b/dom/src/test/resources/staffNS.dtd
new file mode 100644
index 0000000..7643773
--- /dev/null
+++ b/dom/src/test/resources/staffNS.dtd
@@ -0,0 +1,45 @@
+<!ELEMENT staff (employee+,emp:employee,employee) >
+<!ELEMENT employee (employeeId,name,position,salary,gender,address) >
+<!ATTLIST employee xmlns CDATA #IMPLIED>
+<!ATTLIST employee xmlns:dmstc CDATA #IMPLIED>
+<!ATTLIST employee xmlns:emp2 CDATA #IMPLIED>
+
+<!ELEMENT employeeId (#PCDATA) >
+
+<!ELEMENT name (#PCDATA) >
+
+<!ELEMENT position (#PCDATA) >
+
+<!ELEMENT salary (#PCDATA) >
+
+<!ELEMENT entElement1 (#PCDATA) >
+<!ELEMENT gender (#PCDATA | entElement1)* >
+<!ATTLIST entElement1 xmlns:local1 CDATA #IMPLIED >
+
+<!ELEMENT address (#PCDATA) >
+<!ATTLIST address dmstc:domestic CDATA #IMPLIED>
+<!ATTLIST address street CDATA #IMPLIED>
+<!ATTLIST address domestic CDATA #IMPLIED>
+<!ATTLIST address xmlns CDATA #IMPLIED>
+
+<!ELEMENT emp:employee (emp:employeeId,nm:name,emp:position,emp:salary,emp:gender,emp:address) >
+<!ATTLIST emp:employee xmlns:emp CDATA #IMPLIED>
+<!ATTLIST emp:employee xmlns:nm CDATA #IMPLIED>
+<!ATTLIST emp:employee defaultAttr CDATA 'defaultVal'>
+
+<!ELEMENT emp:employeeId (#PCDATA) >
+
+<!ELEMENT nm:name (#PCDATA) >
+
+<!ELEMENT emp:position (#PCDATA) >
+
+<!ELEMENT emp:salary (#PCDATA) >
+
+<!ELEMENT emp:gender (#PCDATA) >
+
+<!ELEMENT emp:address (#PCDATA) >
+<!ATTLIST emp:address emp:domestic CDATA #IMPLIED>
+<!ATTLIST emp:address street CDATA #IMPLIED>
+<!ATTLIST emp:address emp:zone ID #IMPLIED>
+<!ATTLIST emp:address emp:district CDATA 'DISTRICT'>
+<!ATTLIST emp:address emp:local1 CDATA 'FALSE'>
diff --git a/dom/src/test/resources/staffNS.svg b/dom/src/test/resources/staffNS.svg
new file mode 100644
index 0000000..7a7c26e
--- /dev/null
+++ b/dom/src/test/resources/staffNS.svg
@@ -0,0 +1,73 @@
+<?xml version="1.0"?><?TEST-STYLE PIDATA?>
+<!DOCTYPE svg PUBLIC "STAFF" "staffNS.dtd"
+[
+ <!ENTITY ent1 "es">
+ <!ENTITY ent2 "1900 Dallas Road">
+ <!ENTITY ent3 "Texas">
+ <!ENTITY ent4 "<entElement1 xmlns:local1='www.xyz.com'>Element data</entElement1><?PItarget PIdata?>">
+ <!ENTITY ent5 PUBLIC "entityURI" "entityFile" NDATA notation1>
+ <!ENTITY ent6 PUBLIC "uri" "file" NDATA notation2>
+ <!ENTITY ent1 "This entity should be discarded">
+ <!NOTATION notation1 PUBLIC "notation1File">
+ <!NOTATION notation2 SYSTEM "notation2File">
+ <!ELEMENT svg (rect, script, employee+, emp:employee, employee*)>
+ <!ATTLIST svg
+ xmlns CDATA #FIXED "http://www.w3.org/2000/svg"
+ name CDATA #IMPLIED>
+ <!ELEMENT rect EMPTY>
+ <!ATTLIST rect
+ x CDATA #REQUIRED
+ y CDATA #REQUIRED
+ width CDATA #REQUIRED
+ height CDATA #REQUIRED>
+ <!ELEMENT script (#PCDATA)>
+ <!ATTLIST script type CDATA #IMPLIED>
+ <!ENTITY svgunit SYSTEM "svgunit.js">
+ <!ENTITY svgtest SYSTEM "svgtest.js">
+]>
+<!-- This is comment number 1.-->
+<svg xmlns="http://www.w3.org/2000/svg"><rect x="0" y="0" width="100" height="100"/><script type="text/ecmascript">&svgtest;&svgunit;</script>
+ <employee xmlns="http://www.nist.gov" xmlns:dmstc="http://www.usa.com">
+ <employeeId>EMP0001</employeeId>
+ <name>Margaret Martin</name>
+ <position>Accountant</position>
+ <salary>56,000</salary>
+ <gender>Female</gender>
+ <address dmstc:domestic="Yes">1230 North Ave. Dallas, Texas 98551</address>
+ </employee>
+ <employee xmlns:dmstc="http://www.usa.com" xmlns="http://www.w3.org/2001/DOM-Test-Suite/Level-2/Files">
+ <employeeId>EMP0002</employeeId>
+ <name>Martha Raynolds
+<![CDATA[This is a CDATASection with EntityReference number 2 &ent2;]]>
+<![CDATA[This is an adjacent CDATASection with a reference to a tab &tab;]]></name>
+ <position>Secretary</position>
+ <salary>35,000</salary>
+ <gender>Female</gender>
+ <address dmstc:domestic="Yes" street="Yes">&ent2; Dallas, &ent3;
+ 98554</address>
+ </employee>
+ <employee xmlns:dmstc="http://www.netzero.com" xmlns="http://www.w3.org/2001/DOM-Test-Suite/Level-2/Files">
+ <employeeId>EMP0003</employeeId>
+ <name>Roger
+ Jones</name>
+ <position>Department Manager</position>
+ <salary>100,000</salary>
+ <gender>&ent4;</gender>
+ <address dmstc:domestic="Yes" street="No">PO Box 27 Irving, texas 98553</address>
+ </employee>
+ <emp:employee xmlns:emp="http://www.nist.gov" xmlns:nm="http://www.altavista.com" > <emp:employeeId>EMP0004</emp:employeeId>
+ <nm:name>Jeny Oconnor</nm:name>
+ <emp:position>Personnel Director</emp:position>
+ <emp:salary>95,000</emp:salary>
+ <emp:gender>Female</emp:gender>
+ <emp:address emp:domestic="Yes" street="Y&ent1;" emp:zone="CANADA" emp:local1="TRUE">27 South Road. Dallas, texas 98556</emp:address>
+ </emp:employee>
+ <employee xmlns:emp2="http://www.nist.gov" xmlns="http://www.w3.org/2001/DOM-Test-Suite/Level-2/Files">
+ <employeeId>EMP0005</employeeId>
+ <name>Robert Myers</name>
+ <position>Computer Specialist</position>
+ <salary>90,000</salary>
+ <gender>male</gender>
+ <address street="Yes" xmlns="http://www.nist.gov">1821 Nordic. Road, Irving Texas 98558</address>
+ </employee>
+ </svg>
diff --git a/dom/src/test/resources/staffNS.xml b/dom/src/test/resources/staffNS.xml
new file mode 100644
index 0000000..1cb1459
--- /dev/null
+++ b/dom/src/test/resources/staffNS.xml
@@ -0,0 +1,59 @@
+<?xml version="1.0"?><?TEST-STYLE PIDATA?>
+<!DOCTYPE staff PUBLIC "STAFF" "staffNS.dtd"
+[
+ <!ENTITY ent1 "es">
+ <!ENTITY ent2 "1900 Dallas Road">
+ <!ENTITY ent3 "Texas">
+ <!ENTITY ent4 "<entElement1 xmlns:local1='www.xyz.com'>Element data</entElement1><?PItarget PIdata?>">
+ <!ENTITY ent5 PUBLIC "entityURI" "entityFile" NDATA notation1>
+ <!ENTITY ent6 PUBLIC "uri" "file" NDATA notation2>
+ <!ENTITY ent1 "This entity should be discarded">
+ <!NOTATION notation1 PUBLIC "notation1File">
+ <!NOTATION notation2 SYSTEM "notation2File">
+]>
+<!-- This is comment number 1.-->
+<staff>
+ <employee xmlns="http://www.nist.gov" xmlns:dmstc="http://www.usa.com">
+ <employeeId>EMP0001</employeeId>
+ <name>Margaret Martin</name>
+ <position>Accountant</position>
+ <salary>56,000</salary>
+ <gender>Female</gender>
+ <address dmstc:domestic="Yes">1230 North Ave. Dallas, Texas 98551</address>
+ </employee>
+ <employee xmlns:dmstc="http://www.usa.com">
+ <employeeId>EMP0002</employeeId>
+ <name>Martha Raynolds
+<![CDATA[This is a CDATASection with EntityReference number 2 &ent2;]]>
+<![CDATA[This is an adjacent CDATASection with a reference to a tab &tab;]]></name>
+ <position>Secretary</position>
+ <salary>35,000</salary>
+ <gender>Female</gender>
+ <address dmstc:domestic="Yes" street="Yes">&ent2; Dallas, &ent3;
+ 98554</address>
+ </employee>
+ <employee xmlns:dmstc="http://www.netzero.com">
+ <employeeId>EMP0003</employeeId>
+ <name>Roger
+ Jones</name>
+ <position>Department Manager</position>
+ <salary>100,000</salary>
+ <gender>&ent4;</gender>
+ <address dmstc:domestic="Yes" street="No">PO Box 27 Irving, texas 98553</address>
+ </employee>
+ <emp:employee xmlns:emp="http://www.nist.gov" xmlns:nm="http://www.altavista.com" > <emp:employeeId>EMP0004</emp:employeeId>
+ <nm:name>Jeny Oconnor</nm:name>
+ <emp:position>Personnel Director</emp:position>
+ <emp:salary>95,000</emp:salary>
+ <emp:gender>Female</emp:gender>
+ <emp:address emp:domestic="Yes" street="Y&ent1;" emp:zone="CANADA" emp:local1="TRUE">27 South Road. Dallas, texas 98556</emp:address>
+ </emp:employee>
+ <employee xmlns:emp2="http://www.nist.gov">
+ <employeeId>EMP0005</employeeId>
+ <name>Robert Myers</name>
+ <position>Computer Specialist</position>
+ <salary>90,000</salary>
+ <gender>male</gender>
+ <address street="Yes" xmlns="http://www.nist.gov">1821 Nordic. Road, Irving Texas 98558</address>
+ </employee>
+ </staff>
diff --git a/dom/src/test/resources/svgtest.js b/dom/src/test/resources/svgtest.js
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/dom/src/test/resources/svgtest.js
diff --git a/dom/src/test/resources/svgunit.js b/dom/src/test/resources/svgunit.js
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/dom/src/test/resources/svgunit.js
diff --git a/dom/src/test/resources/xhtml1-strict.dtd b/dom/src/test/resources/xhtml1-strict.dtd
new file mode 100644
index 0000000..fefb77f
--- /dev/null
+++ b/dom/src/test/resources/xhtml1-strict.dtd
@@ -0,0 +1,65 @@
+<!--
+
+Copyright (c) 2001-2004 World Wide Web Consortium,
+(Massachusetts Institute of Technology, Institut National de
+Recherche en Informatique et en Automatique, Keio University). All
+Rights Reserved. This program is distributed under the W3C's Software
+Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
+
+-->
+
+<!--
+
+This is a radically simplified DTD for use in the DOM Test Suites
+due to a XML non-conformance of one implementation in processing
+parameter entities. When that non-conformance is resolved,
+this DTD can be replaced by the normal DTD for XHTML.
+
+-->
+
+
+<!ELEMENT html (head, body)>
+<!ATTLIST html xmlns CDATA #IMPLIED>
+<!ELEMENT head (meta,title,script*)>
+<!ELEMENT meta EMPTY>
+<!ATTLIST meta
+ http-equiv CDATA #IMPLIED
+ content CDATA #IMPLIED>
+<!ELEMENT title (#PCDATA)>
+<!ELEMENT body (p*)>
+<!ATTLIST body onload CDATA #IMPLIED>
+<!ELEMENT p (#PCDATA|em|strong|code|sup|var|acronym|abbr)*>
+<!ATTLIST p
+ xmlns:dmstc CDATA #IMPLIED
+ xmlns:nm CDATA #IMPLIED
+ xmlns:emp2 CDATA #IMPLIED
+ id ID #IMPLIED
+>
+<!ELEMENT em (#PCDATA)>
+<!ELEMENT span (#PCDATA)>
+<!ELEMENT strong (#PCDATA)>
+<!ELEMENT code (#PCDATA)>
+<!ELEMENT sup (#PCDATA)>
+<!ELEMENT var (#PCDATA|span)*>
+<!ELEMENT acronym (#PCDATA)>
+<!ATTLIST acronym
+ title CDATA #IMPLIED
+ class CDATA #IMPLIED
+ id ID #IMPLIED
+>
+<!ELEMENT abbr (#PCDATA)>
+<!ATTLIST abbr
+ title CDATA #IMPLIED
+ class CDATA #IMPLIED
+ id ID #IMPLIED
+>
+<!ELEMENT script (#PCDATA)>
+<!ATTLIST script
+ type CDATA #IMPLIED
+ src CDATA #IMPLIED
+ charset CDATA #IMPLIED>