Discussion:
ooRexx and XML
(too old to reply)
m***@hotmail.com
2006-07-24 10:27:28 UTC
Permalink
Can anyone supply me with a solution for reading XML files?

I have tried to read about it, found rexxxml by Patrick McPhee, but I
dont know what to do about that libxml, libxlt stuff.

I am running on an Win/XP system, with ooRexx 3 - running Java 5.

Any hints?

regards
Mette
Salvador Parra Camacho
2006-07-24 21:27:37 UTC
Permalink
Post by m***@hotmail.com
Can anyone supply me with a solution for reading XML files?
I have tried to read about it, found rexxxml by Patrick McPhee, but I
dont know what to do about that libxml, libxlt stuff.
Unfortunatly, you need a lot of files to make RexxXML working:

1. The RexxXML package from the Patrick McPhee webpage:
http://home.interlog.com/~ptjm/rexxxml100.zip

2. The Rexx/Trans package (version 1.8) from:
http://sourceforge.net/project/showfiles.php?group_id=30841

3. The following packages:
http://www.zlatkovic.com/pub/libxml/libxml2-2.6.26.win32.zip
http://www.zlatkovic.com/pub/libxml/libxslt-1.1.17.win32.zip
http://www.zlatkovic.com/pub/libxml/iconv-1.9.2.win32.zip
http://www.zlatkovic.com/pub/libxml/zlib-1.2.3.win32.zip

Put rexxxml.dll, rexxtrans.dll, libxml2.dll, libxslt.dll,
libexslt.dll, iconv.dll and zlib1.dll somewhere in your PATH. If Open
Object REXX (rexx.dll) is not the only REXX interpreter in your PATH
(because, for example, Regina -regina.dll- is your secondary REXX
interpreter), add the REXXTRANS_INTERPRETER environment variable with
the value "oorexx".
Now, RexxXML is ready.
Post by m***@hotmail.com
I am running on an Win/XP system, with ooRexx 3 - running Java 5.
Any hints?
Java has classes for XML, but I don't know how this works.

David Ashley was working in a XML class for Object REXX, I think.

Best regards:

Salvador Parra Camacho
rony
2006-07-25 11:48:57 UTC
Permalink
Post by m***@hotmail.com
Can anyone supply me with a solution for reading XML files?
I have tried to read about it, found rexxxml by Patrick McPhee, but I
dont know what to do about that libxml, libxlt stuff.
I am running on an Win/XP system, with ooRexx 3 - running Java 5.
Any hints?
Well, you could use the extension to Rexx and ooRexx called BSF4Rexx (an external Rexx function
library), which enables you to directly use Java classes from Rexx.

The BSF4Rexx technology is explained (with an XML processing example) in the work of

Görlich, Realfsen, Spanberger: BSF4Rexx and OpenOffice.org - Nutshell-Examples
<http://wi.wu-wien.ac.at/rgf/diplomarbeiten/Seminararbeiten/2006s_wu/20060628_BSF4RexxSnippets_version_4.pdf>

<http://wi.wu-wien.ac.at/rgf/diplomarbeiten/Seminararbeiten/2006s_wu/20060628_BSF4RexxSnippets_code.zip>

This work has numerous examples using "plain" Java class libraries (e.g. reading/writing MP3 tags,
but also text-2-speech, using JDOM to process XML fiels, scripting OpenOffice, etc.)

It is "brand"-new (just available via the net since a few minutes).

It makes good reading also for people generally interested in the possibilities of combining a
scripting language with Java.

Hope that helps,

---rony
m***@hotmail.com
2006-07-26 12:59:21 UTC
Permalink
Hi Tony,

I dl'ed and installed the jdom stuff, unzipped it and copyed the 4 jar
files into the ...\lib\ext (the ext folder did not exist before).
Bit I still get the message:
--------------------------

G:\E3-Personal-files\Mette\Rexx>xmltest.rex
/// Java-exception (RexxAndJava) occurred:
[method invocation failed: java.lang.reflect.InvocationTargetException
target exception: java.lang.ClassNotFoundException: org.jdom.Document]
\\\
Exception in thread "main" org.apache.bsf.BSFException: "invoke":
object 'Class.class' - method [forName], method not found or error
(exception) execu
ting method!
at
org.rexxla.bsf.engines.rexx.RexxAndJava.javaCallBSF(RexxAndJava.java:2289)
699 *-* call BSF "invoke", "Class.class", "FORNAME" , a.1
49 *-* .bsf~bsf.import("org.jdom.Document","Document")
Error 40 running G:\E3-Personal-files\Mette\Rexx\xmltest.rex line 49:
Incorrect call to routine
Error 40.1: External routine "BSF" failed

--------------------------------

Not knowing java apart from the ifs and elses :-) - can you give me a
hint of what is wring?

regards
Mette
Post by rony
Post by m***@hotmail.com
Can anyone supply me with a solution for reading XML files?
I have tried to read about it, found rexxxml by Patrick McPhee, but I
dont know what to do about that libxml, libxlt stuff.
I am running on an Win/XP system, with ooRexx 3 - running Java 5.
Any hints?
Well, you could use the extension to Rexx and ooRexx called BSF4Rexx (an external Rexx function
library), which enables you to directly use Java classes from Rexx.
The BSF4Rexx technology is explained (with an XML processing example) in the work of
Görlich, Realfsen, Spanberger: BSF4Rexx and OpenOffice.org - Nutshell-Examples
<http://wi.wu-wien.ac.at/rgf/diplomarbeiten/Seminararbeiten/2006s_wu/20060628_BSF4RexxSnippets_version_4.pdf>
<http://wi.wu-wien.ac.at/rgf/diplomarbeiten/Seminararbeiten/2006s_wu/20060628_BSF4RexxSnippets_code.zip>
This work has numerous examples using "plain" Java class libraries (e.g. reading/writing MP3 tags,
but also text-2-speech, using JDOM to process XML fiels, scripting OpenOffice, etc.)
It is "brand"-new (just available via the net since a few minutes).
It makes good reading also for people generally interested in the possibilities of combining a
scripting language with Java.
Hope that helps,
---rony
rony
2006-07-26 14:33:13 UTC
Permalink
Hi Mette,
Post by m***@hotmail.com
I dl'ed and installed the jdom stuff, unzipped it and copyed the 4 jar
files into the ...\lib\ext (the ext folder did not exist before).
--------------------------
G:\E3-Personal-files\Mette\Rexx>xmltest.rex
[method invocation failed: java.lang.reflect.InvocationTargetException
target exception: java.lang.ClassNotFoundException: org.jdom.Document]
\\\
object 'Class.class' - method [forName], method not found or error
(exception) execu
ting method!
at
org.rexxla.bsf.engines.rexx.RexxAndJava.javaCallBSF(RexxAndJava.java:2289)
699 *-* call BSF "invoke", "Class.class", "FORNAME" , a.1
49 *-* .bsf~bsf.import("org.jdom.Document","Document")
Incorrect call to routine
Error 40.1: External routine "BSF" failed
--------------------------------
Not knowing java apart from the ifs and elses :-) - can you give me a
hint of what is wring?
Hmm, this looks as if the Java side does not find the JDom classes, probably, because you did not
list "jdom.jar" on your CLASSPATH (= Java environment PATH variable). You must list all needed
jar-files ("jar=Java archive file", actually a zip-archive!) there, e.g. issue the following set
statement before launching "xmltest.rex":

set CLASSPATH=%CLASSPATH%;G:\E3-Personal-files\Mette\Rexx\jdom.jar

if "jdom.jar" is located in the directory where "xmltest.rex" resides. It is possible that
"jdom.jar" needs access to the classes of other jar-archives (like "xerces.jar" etc. in which case
you must list them in the CLASSPATH environment variabel as well). Also, be careful to use the
correct case in your path and file names (Java is case-sensitive!).

Hope that helps,

---rony
David Ashley
2006-07-26 21:53:26 UTC
Permalink
Post by m***@hotmail.com
Can anyone supply me with a solution for reading XML files?
I have tried to read about it, found rexxxml by Patrick McPhee, but I
dont know what to do about that libxml, libxlt stuff.
I am running on an Win/XP system, with ooRexx 3 - running Java 5.
Any hints?
regards
Mette
Send an email to me and I will send you an ooRexx solution for reading
XML files. It has been used with very good success. It is a SAX-like
solution but uses an ooRexx class. Basically, you subclass the main
class and add in your own processing routines. It come with an example
program that converts an XML file to CSV format.

W. David Ashley
ooRexx Team

Loading...