commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
Subject Re: Scripting Suggestion?
Date Wed, 10 Sep 2008 11:40:17 GMT
To add to this, some source fields I may not want to substring from index=0.  I
may want to substring from the middle of the source value.
(Embedded image moved to file: pic22704.jpg)

             09/10/2008 07:38 AM                
              Please respond to                                         Subject 
               "Commons Users            Scripting Suggestion?                  

Yesterday I successfully implemented my first digester class and it works great,
just like I would want it to.  Now I need to take my XML file a step further by
including some form of scripting.  My XML file is basically used to map tables
and fields between 2 datasources so that my java process can pull from one and
dump to the other.  The issue however is that the columns in the target
datasource are all string columns and my source data columns aren't always
string columns and are sometimes also longer in length than the target columns.
My process will have logic to determine the source datatype and convert it to a
proper string, I just don't want to create methods for each field that might
need to be substringed before inserting into the target datasource because I
want the java process to be independent of the actual data it's processing,
hence the XML file.  It's not enough to say I can just check the length of the
target column and substring the source accordingly, because the result might not
be what I want, ie: a boolean won't automatically convert to Y or N which my
target datasource wants.  Does anybody have any suggestions?  Thanks in advance.

Here's a sample of what my XML file might look like:


                                    <!-- would like some kind of script here
to say how to convert/trim the source value
(Embedded image moved to file: pic15141.jpg)
To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message