Liebe alle,
Wir haben bei dieser Hausübung leider auch eine Fehlermeldung ausgespuckt bekommen.
Liebe Grüße
Kenan Selak und Katharina Müller
"test=https://www.rexxla.org/events/"
/* create an instance of the JAXP DocumentBuilderFactory */
factory=bsf.loadClass("javax.xml.parsers.DocumentBuilderFactory")~newInstance
factory~setNamespaceAware(.true) -- set desired parser to namespace aware
eh=.errorHandler~new -- create an error handler Rexx object
-- wrap up the Rexx error handler as a Java object
javaEH=BsfCreateRexxProxy(eh, , "org.xml.sax.ErrorHandler")
/* make important constants available via .local */
clzDomNode=bsf.loadClass("org.w3c.dom.Node") -- load the Java interface class
.local~CDATA_SECTION_NODE=clzDomNode~CDATA_SECTION_NODE -- save field value
.local~TEXT_NODE =clzDomNode~TEXT_NODE -- save field value
/* now collect all text and CDATA nodes and display them */
call followNode rootNode
::requires BSF.CLS /* get the Java support */
::routine followNode /* walks the document tree recursively */
use arg node
call processNode node -- process received node
if node~hasChildNodes then
do
children=node~getChildNodes -- get NodeList
loop i=0 to children~length-1 -- 0-based indexes!
call followNode children~item(i) -- recurse
end
end
::routine processNode /* processes each node */
use arg node
if nodeType=.text_node | nodeType=.cdata_section_node then
say pp(node~nodeValue)
::class ErrorHandler -- a Rexx error handler ("org.xml.sax.ErrorHandler")
::method unknown /* handles "warning", "error" and "fatalError" events */
use arg methName, argArray -- arguments from the Java SAX parser
exception=argArray[1] -- retrieve SAXException argument
.error~say(methName":" -
"line="exception~getLineNumber",col="exception~getColumnNumber":" -
pp(exception~getMessage))
Code Is Executing
REXXerr>org.rexxla.bsf.engines.rexx.RexxException: BSF4ooRexx850/routine/jniRexxRunProgram(), error 9:
REXXerr> 18 *-* if node~hasChildNodes
REXXerr>Error 97 running testcode.code line 18: Object method not found.
REXXerr>Error 97.1: Object "ROOTNODE" does not understand message "HASCHILDNODES".
Mag.a Katharina Müller-Weismann
Rechtsabteilung
Legal Affairs Office
WU
Wirtschaftsuniversität Wien
Vienna University of Economics and Business
Welthandelsplatz 1, 1020 Vienna, Austria
Building AR (Perspektivstraße 4)
Tel: +43-1-313 36-5265
Fax: +43-1-313 36-90 9208
E-Mail:
katharina.mueller@wu.ac.at