Focal Point
[SOLVED] How to strip quotes from XML

This topic can be found at:
https://forums.informationbuilders.com/eve/forums/a/tpc/f/1381057331/m/6147072136

June 04, 2013, 06:23 PM
Phil DeBusk
[SOLVED] How to strip quotes from XML
Given a csv file and using a transform to convert from csv to xml, I'm having difficulty stripping quotes from the new xml output. during the mapping, I have tried to use @TRIM(XML_ELEMENT,'"') which actually works for any elements which have text. For any elements which are empty or ("") the function seems to return a single quote ("). Very frustrating.

example csv FIRST, LAST, MID
"BOB","MOORE",""

The @TRIM function for each xml converted element now looks like this (BOB, MOORE,")

Can anyone help me understand what I'm doing wrong?? Should I use another function? BTW the @TRIM(xml_element,'"',true) used for trimming ALL chars does not appear to work either. When I try this, nothing happens and ALL my quotes come through.

This message has been edited. Last edited by: Phil DeBusk,


WebFOCUS 7.6
Windows, All Outputs
June 06, 2013, 01:32 PM
Tom Flynn
Don't know if this is available in IWAY/Data Migrator, but, have you tried STRREP?


Tom Flynn
WebFOCUS 8.1.05 - PROD/QA
DB2 - AS400 - Mainframe
June 07, 2013, 07:30 PM
<Kathryn Henning>
Hi Phil,

I've consulted with several people in the iWay group, and @TRIM is the right function to use.

Can you please try “@TRIM(xml_element,",true)” (remove the single quotes from the double quote to be stripped in the second argument)?

If this doesn’t work, please open a case on InfoResponse Online so we can examine your project.

Regards,

Kathryn
June 11, 2013, 02:49 PM
Phil DeBusk
Thanks Kathryn, As it turns out the crux of my problem was in the transform configuration. I needed to set the "Text Qualifier" in the input to parse for double-quotes. This stripped all the messy quotes from my document and allowed all my functions to work as advertised.


WebFOCUS 7.6
Windows, All Outputs