Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

XML Translator Recommendation

Posted on 2004-10-27
9
Medium Priority
?
580 Views
Last Modified: 2008-01-09
My company has migrated from a inhouse software system to a webbased software for rental property management.  The GL data they are creating from the transactions is in XML format.  I need to get that XML data into GL entries which is still on the AS400.  What is the best way to do that, with the least cost regarding software.  My idea is to have standalone PC talking to this web program that will export data on a given time.  A transfer would then happen, transferring the data from the PC to the AS400.  An XML translator would then kick off translating the data into an AS400 Physical file.  A call would then occur to create the GL.

Any better, more efficient ideas?  Regarding the XML translator, any recommendations?
Kevin Caldwell
0
Comment
Question by:Kevin Caldwell
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
9 Comments
 
LVL 14

Expert Comment

by:daveslater
ID: 12427183
Hi
First I am not that up to date on this; but I am sure there will be JAVA stuff out there that can do it.

The AS/400 can run Java and have RPGLE programs interface to it.

You many want to look at that route.

Dave
0
 
LVL 33

Expert Comment

by:shalomc
ID: 12427291
Hey,
The AS400 fully supports Xalan and Xerces, which are the de-facto standard XML parsers in the Java world.

Read about it in my article http://search400.techtarget.com/tip/0,289483,sid3_gci858495,00.html

If you have any problems with this site I'll repost it here.

ShalomC
0
 
LVL 16

Expert Comment

by:theo kouwenhoven
ID: 12432699
Please check this out:



http://www.datamission.co.uk/dwnlds.html
http://www.alltel.net/%7Ecraigru/jcrdown2.html#XMLGEN_tag
http://www.alltel.net/%7Ecraigru/jcrdown2.html#XMLPREVIEW_tag

The first link contains a lot of info and free tools (XML)

the other two contains free sources also, but I didn't investigate in detail.




0
Get free NFR key for Veeam Availability Suite 9.5

Veeam is happy to provide a free NFR license (1 year, 2 sockets) to all certified IT Pros. The license allows for the non-production use of Veeam Availability Suite v9.5 in your home lab, without any feature limitations. It works for both VMware and Hyper-V environments

 
LVL 4

Expert Comment

by:reginab
ID: 12493644
we have done this with the xerces at a company I worked for in the past, there was wrapper code on the 400, we wrote that, and bridge code on the java side, not really sure there is a cheap way though,  though cost is probably very dependent on the size of what you are doing and we were working with enourmous scope sounds like you are not. good luck.
0
 
LVL 33

Expert Comment

by:shalomc
ID: 12495379

/* CRTCMD CMD(XALAN) PGM(*LIBL/XALANCPP) ... */
CMD PROMPT('Translate XML using XSLT')

PARM KWD(XML) TYPE(*PNAME) LEN(256) MIN(1) +
CASE(*MIXED) PROMPT('Full XML file path')

PARM KWD(XSL) TYPE(*PNAME) LEN(256) MIN(1) +
CASE(*MIXED) PROMPT('Full XSL file path')

PARM KWD(out) TYPE(*PNAME) LEN(256) MIN(1) +
CASE(*MIXED) PROMPT('Full Result file path')

PARM KWD(CCSID) TYPE(*CHAR) LEN(7) PROMPT('CCSID +
of result file')

PARM KWD(VER) TYPE(*CHAR) LEN(7) RSTD(*YES) +
DFT(V5R1M0) VALUES(V5R1M0 V5R2M0 *PRV) +
PROMPT('OS400 release')
/* End of Command XALAN */

++++++++++++++++++++++++++++++++++++++++++++++++
/* Command Processing Program XALANCPP */
PGM PARM(&XML &XSL &OUT &CCSID &VER)
DCL &JAVA       *CHAR      1024
DCL &JAVAparm   *CHAR      1024
DCL &err_flg    *LGL

DCL VAR(&qshell) TYPE(*CHAR) LEN(1024)
DCL VAR(&XML) TYPE(*CHAR) LEN(256)
DCL VAR(&XSL) TYPE(*CHAR) LEN(256)
DCL VAR(&OUT) TYPE(*CHAR) LEN(256)
DCL VAR(&CCSID) TYPE(*CHAR) LEN(7)
DCL VAR(&VER) TYPE(*CHAR) LEN(6)

DCLF            QTXTSRC


/* Prepare java call */
IF COND(&VER = '*PRV') THEN(DO)

CHGVAR VAR(&JAVAparm) VALUE(                 +
'-IN ' *BCAT &XML *BCAT ' -XSL ' *BCAT +
&XSL *BCAT ' -OUT ' *BCAT &OUT *BCAT ' +
-TEXT')

CHGVAR VAR(&JAVA) VALUE('java -classpath +
/xml/xalan_1_0_1/xalan.jar:/xml/xalan_1_0_1+
/xerces.jar:. + org.apache.xalan.xslt.Process ' *BCAT +
'-IN ' *BCAT &XML *BCAT ' -XSL ' *BCAT +
&XSL *BCAT ' -OUT ' *BCAT &OUT *BCAT ' +
-TEXT')


enddo
ELSE CMD(DO)
CHGVAR VAR(&JAVAparm) VALUE(                 +
'-IN ' *BCAT &XML *BCAT ' -XSL ' *BCAT +
&XSL *BCAT ' -OUT ' *BCAT &OUT *BCAT ' +
-TEXT')

CHGVAR VAR(&JAVA) VALUE('java -classpath +
/QIBM/ProdData/OS400/xml/lib/xalan101.jar:/+
QIBM/ProdData/OS400/xml/lib/xerces103.jar:. +
org.apache.xalan.xslt.Process ' *BCAT +
'-IN ' *BCAT &xml *BCAT ' -XSL ' *BCAT +
&xsl *BCAT ' -OUT ' *BCAT &out *BCAT ' -TEXT'    )


enddo

             DLTF       FILE(QTEMP/QSHRESP)
             MONMSG     MSGID(CPF9999) EXEC(DO)
             ENDDO
             CRTSRCPF   FILE(QTEMP/QSHRESP) MBR(*FILE)

             OVRDBF     FILE(STDOUT) TOFILE(QTEMP/QSHRESP)

    STRQSH CMD(&JAVA)

/* Change CCSID of OUT file   */
CHGVAR VAR(&QSHELL) VALUE('setccsid' *bcat &ccsid *BCAT &out )
STRQSH CMD(&qshell)
             OVRDBF     FILE(QTXTSRC) TOFILE(QTEMP/QSHRESP)
LOOP:
             RCVF
             MONMSG CPF0864 EXEC(GOTO ENDLOOP)
             IF         COND(&SRCDTA = 'Xalan: was not successful.') +
                          THEN(DO)
             chgvar &err_flg '1'
             enddo
             SNDPGMMSG  MSG(&SRCDTA) TOPGMQ(*SAME)
             GOTO LOOP
ENDLOOP:
             IF         COND(&ERR_FLG = '1') THEN(DO)
             SNDPGMMSG  MSGID(CPF9898) MSGF(QCPFMSG) MSGDTA('Error +
                          in Xalan: look at joblog') MSGTYPE(*DIAG)
enddo
DLTOVR STDOUT
DLTOVR QTXTSRC
EXIT:
RETURN
ENDPGM

/* End of Program XALANCPP */


Sample XML file:
<?xml version="1.0" encoding="iso-8859-8" standalone="yes"?>
<CURRENCIES>
<LAST_UPDATE>2004-11-04</LAST_UPDATE>
<CURRENCY>
<NAME>dollar</NAME>
<UNIT>1</UNIT>
<CURRENCYCODE>USD</CURRENCYCODE>
<COUNTRY>USA</COUNTRY>
<RATE>4.437</RATE>
<CHANGE>-0.292</CHANGE>
</CURRENCY>
<CURRENCY>
<NAME>pound</NAME>
<UNIT>1</UNIT>
<CURRENCYCODE>GBP</CURRENCYCODE>
<COUNTRY>Great Britain</COUNTRY>
<RATE>8.1974</RATE>
<CHANGE>-0.059</CHANGE>
</CURRENCY>
</CURRENCIES>


Sample XSL file:
====================
<?xml version="1.0"?>  
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">  
<xsl:template match="CURRENCIES">    
<xsl:for-each select="CURRENCY">      
  <xsl:apply-templates select="." />  
</xsl:for-each>                      
</xsl:template>                      
<xsl:template match="CURRENCY">      
<xsl:variable name="dt" select="/CURRENCIES/LAST_UPDATE"/>  
<xsl:value-of select="concat(substring($dt,1,4), substring($dt,6,2), substring($dt,9,2))"/>  
 <xsl:text>  , </xsl:text>        
<xsl:value-of select="NAME"/>  
 <xsl:text>  , </xsl:text>        
<xsl:value-of select="UNIT"/>  
 <xsl:text>  , </xsl:text>          
<xsl:value-of select="COUNTRY"/>  
 <xsl:text>  , </xsl:text>          
<xsl:value-of select="RATE"/>      
 <xsl:text>  , </xsl:text>          
<xsl:value-of select="CHANGE"/>    
 <xsl:text>  
</xsl:text>        
</xsl:template>                    
</xsl:stylesheet>                  
<!-- End of sample XSL -->  

The command:
XALAN XML('/gl/currency.xml')  
      XSL('/gl/conversion.xsl')
      OUT('/gl/currency.csv')  
      CCSID(819)                
      VER(V5R1M0)              

The result:

20041104  , dollar  , 1  , USA  , 4.437  , -0.292          
20041104  , pound  , 1  , Great Britain  , 8.1974  , -0.059

You can use CPYFRMIMPF to place it in a database.

ShalomC
0
 
LVL 14

Expert Comment

by:daveslater
ID: 12499308
wow - good stuff - I don't understand it but good stuff
Why doesn't IBM make this easy to access - How many other features are on this box that can it easy for us?
0
 
LVL 33

Accepted Solution

by:
shalomc earned 1000 total points
ID: 12499852
For a small fee of a couple of hundred points I'll let you in on it [:={)]
0
 

Expert Comment

by:midwestexp
ID: 14915053
Hi shalomc  you are simply Supperrrrrrrrrrr,
WOW ..........Brilliant , Sparkling man .............

midwestexp.
0

Featured Post

Learn Veeam advantages over legacy backup

Every day, more and more legacy backup customers switch to Veeam. Technologies designed for the client-server era cannot restore any IT service running in the hybrid cloud within seconds. Learn top Veeam advantages over legacy backup and get Veeam for the price of your renewal

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Explore the ways to Unlock VBA Project Password Excel 2010 & 2013 documents. Go through the article and perform the steps carefully to remove VBA Excel .xls file.
This week I attended a Startup Week Chattanooga talk on Gender Diversity in Technology. Check out what I learned.
This course is ideal for IT System Administrators working with VMware vSphere and its associated products in their company infrastructure. This course teaches you how to install and maintain this virtualization technology to store data, prevent vuln…
Is your data getting by on basic protection measures? In today’s climate of debilitating malware and ransomware—like WannaCry—that may not be enough. You need to establish more than basics, like a recovery plan that protects both data and endpoints.…
Suggested Courses

610 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question