on 02-08-2007 7:27 PM
Hi folks,
I have this inbound structure example:
<?xml version="1.0" encoding="UTF-8"?>
<ns0:MT_ObrasAdjud_Out xmlns:ns0="http://pt.edp/r3/obrasadjudicadas">
<codforn>123543</codforn>
<numdoc>000003</numdoc>
<tipodoc>CAO</tipodoc>
<encoding_scheme>UTF-8</encoding_scheme>
<filetype>pdf</filetype>
<filedata>01010101001001</filedata>
</ns0:MT_ObrasAdjud_Out>
Using File Conversion with my Receiver File Adapter I want to convert this xml file to a flat file, but only using the element <b><filedata></b> and ignore the others. However, I also need the others elements to use as variable substitution.
Anybody knows how to do it?
Thanks in Advance,
Ricardo.
Hi,
>>>>Anybody knows how to do it?
stop using variable substitution and create the filename inside your mapping -
adapter specific attributes
(much easier and you can have a real structure as a target...)
it's that easy
Regards,
michal
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Michal,
Thanks for the advice!
Using adapter specific attributes I can use the elements of source message to do it? If so, I can do a map excluding all the others elements for target message, my target message will be one element <filedata>.
But using variable substitution, I cant ignore those fields with file conversion?
Thanks again,
Ricardo.
Hi Ricardo,
>>>>Using adapter specific attributes I can use the elements of source message to do it?
or course!!! that's the idea and you do it all in message mapping
(very small advanced function as shown in many blogs)
>>>>But using variable substitution, I cant ignore those fields with file conversion?
don't know I stopped working with variable substitution
as soon as I learned about adapter specific attributes
as they are sooo much better
>>>>I can do a map excluding all the others elements for target message, my target message will be one element <filedata>.
that's the main idea
Regards,
michal
Ricardo,
Not sure about ur requirement. But if you dont want the file name then what for you are using variable substitution.
Anyway you can do onething. You prepare your target structure such that first column is your data. Then this followed by other elements. Then in file content conversion give only the first column. Also specify the parameter
NameA.absoluteRowWidth=<noOfColumns>
If the separators do not contain any line breaks, the text document is generated as a single line of text. To restrict the width of the text, use this parameter. <noOfColumns> represents the maximum number of columns in this case. This parameter also functions together with the specification of a line break for xml.endSeparator.
This value requires NameA.addHeaderLine=0 to be specified.
Then you can have your data and variable substitution also.
---Satish
Hi Satish
Following your suggestion, I have the "filedata" as my first column. In the file conversion using the parameter filedata.absoluteRowWidth=<noOfColumns> I get an error in adapter monitor "Invalid 'absoluteRowWidth' value '' found". Without this parameter I still get the other elements into my file
Flat file -> <b>01010001110000010000011</b>,000003,CAO,UTF-8,pdf,20070209,123543
I only want the value on bold. Do I did something wrong?
Regards,
Ricardo.
HI,
You can always specify fieldFixedLengths of zero for the fields you do not want to appear on the file and specify a fixedLengthTooShortHandling value of cut so you do not get an error, or have I mis-understood your problem?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
I had the same problem and i sort it out in doing that:
<?xml version="1.0" encoding="UTF-8"?>
<ns0:MT_ObrasAdjud_Out xmlns:ns0="http://pt.edp/r3/obrasadjudicadas">
<b> <config> </b>
<codforn>123543</codforn>
<numdoc>000003</numdoc>
<tipodoc>CAO</tipodoc>
<encoding_scheme>UTF-8</encoding_scheme>
<filetype>pdf</filetype>
<b> </config>
<data></b>
<filedata>01010101001001</filedata>
<b></data></b>
</ns0:MT_ObrasAdjud_Out>
Creating two more nodes as in the example, you will be able to write the flat file just with the filedata field.
Then, in the content conversion parameters you only have to write the data.
cheers
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Eduardo,
In recordset name I have only the name of the structure that I want = Data and the parameter Data.fieldSeparator = , because is mandatory.
I still getting both structures!
123543,000003,CAO,UTF-8,pdf,20070209
<b>01010101001000000000000000000000000000110101010101</b>
How can specify one of them to be writen?
Regards,
Ricardo.
I reopen the thread trying to get the answer about how can I ignore fields on receiver file adapter.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
86 | |
10 | |
10 | |
9 | |
7 | |
7 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.