Change XML output file structure (remove space around "

Hello everyone,

I am working on some government reporting and I have to send them XML files that contains our clients infos etc… The demand is very well defined and there are very strict controls on both the data and the format it’s being sent.

My problem :
DataServices generates my XML files with attributes written as followed

<paysNais lLPaysNais = “France” >

When I upload the file to their test platform, it is being rejected because there are spaces around the equal sign. It is the same in my while file, for every attribute.
When I change it to
<paysNais lLPaysNais=“France” >
the file is being accepted.

My question :
Is there any way to change the formatting of the XML so there’s no space around the = ? Otherwise I have to write a shell script called by DS that removes it all from my result file, with the risks that it replaces more caracters etc…
I looked in file format in DS and couldn’t see anything related to that.

Thanks in advance for your help.

Guillaume


dnyyy (BOB member since 2017-12-27)

Hi,

Can you please share the XSD used for Defining this XML structure??

Regards,
Jay


Jay_mKumar :india: (BOB member since 2016-03-24)

Hey Jay,
Thanks for your answer. Your question brought me to thinking maybe there’s spaces in the .xsd that define my spaces in the result but I checked and there’s none. It would also be silly for them to define it in a way that doesn’t match their specifications.

I guess the .xsd is not confidential so here’s the monster in attachments (in txt) :slight_smile:

Hopefully you get a trick to solve this, but for now I created a script that replaces " = " by “=” that I call in dataservices

Here’s the script for anyone that would need it (you need to pass as an argument the relative path of the file in BODS):

file_sans_extension=`basename $1|awk '{print substr($1,1,index($1,".")-1) }'`
echo $file_sans_extension
cp $1 `dirname $1`/$file_sans_extension".bkp"
cat `dirname $1`/$file_sans_extension".bkp" | sed 's? = ?=?g' > $1

Thanks again !
Guillaume
ficovie-V2.0.0.xsd.txt (32.0 KB)


dnyyy (BOB member since 2017-12-27)