XML Output converts " to &quote;

Post questions here relative to DataStage Enterprise/PX Edition for such areas as Parallel job design, Parallel datasets, BuildOps, Wrappers, etc.

Moderators: chulett, rschirm, roy

Post Reply
roy
Participant
Posts: 2598
Joined: Wed Jul 30, 2003 2:05 am
Location: Israel

XML Output converts " to &quote;

Post by roy »

Hi All,
I'm extracting a string from Oracle to a XML output stage using UTF-8
A string of

Code: Select all

abc"d
is being translated to

Code: Select all

abc&quote;d
in the output file.
viewing this output via a browser shows the data as

Code: Select all

abc"d
but a validation process is expecting the original string and fails validation.

Is there a way to retain the original string in the xml output file?
Thanks in advance for your time...
Roy R.
Time is money but when you don't have money time is all you can afford.

Search before posting:)

Join the DataStagers team effort at:
http://www.worldcommunitygrid.org
Image
eostic
Premium Member
Premium Member
Posts: 3838
Joined: Mon Oct 17, 2005 9:34 am

Post by eostic »

Correct the vendor who is receiving the document. Quotes and other special characters need to be escaped. That is proper handling of the xml and working by design within the xmlOutput Stage.

As a solution, though dangerous (what "other" escape possibilities is this application ignoring?) is to send the xmlOutput content to a single column (create a large column on your output link, like "myXMLcontent" with varchar and length of 99999 or similar) and put a single slash "/" in the Description. Send that into a Transformer and just use something like ereplace() to zap all of the items you don't want back into whatever you need...

Ernie
Ernie Ostic

blogit!
<a href="https://dsrealtime.wordpress.com/2015/0 ... ere/">Open IGC is Here!</a>
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Sorry but what "validation process is expecting the original"? As noted by Ernie that is completely correct and perfectly valid XML.
-craig

"You can never have too many knives" -- Logan Nine Fingers
roy
Participant
Posts: 2598
Joined: Wed Jul 30, 2003 2:05 am
Location: Israel

Post by roy »

Thanks for the replies guys!

Eventually I ended up using the new(er) XML stage which got me to the desired non escaped context and with no line breaks between tags and data.
Roy R.
Time is money but when you don't have money time is all you can afford.

Search before posting:)

Join the DataStagers team effort at:
http://www.worldcommunitygrid.org
Image
eostic
Premium Member
Premium Member
Posts: 3838
Joined: Mon Oct 17, 2005 9:34 am

Post by eostic »

Thanks. In some contexts, that could be considered a bug. Proper behavior is to perform the escape. I haven't checked in awhile....the hierarchical stage may only do it when validation on input is used.

Ernie
Ernie Ostic

blogit!
<a href="https://dsrealtime.wordpress.com/2015/0 ... ere/">Open IGC is Here!</a>
Post Reply