PDA

View Full Version : Transformation:XML to Flat file


vasanth
04-11-2006, 07:02
hi all,

i want to convert xml file to flat file.
can anybody tell me the steps.
i know some of the steps.
1:getFile
2:XMLStringToXMLNode
3:XMLNodeToDocument

after that i don't know what to do..
please let me know the remaining steps

Thanks in advance
Vasanth

puneetsaxena
04-11-2006, 07:36
Hi vasanth,

Make a flat file schema in developer based on xml file.
once you get document by using pub:XMLNodetoDocument, invoke "pub.flatfile:convertToString" service, map document ---->ffValues
you can set value for ffSchema, means the namespace where you have made flat file schema.
Rest other inputs are optional, for more refer "FlatFileSchemaDevGuide.pdf"

the output of "pub.flatfile:convertToString" , contains the parsed flatfile, which you got from directory.

Regards,
Puneet Saxena

jeevanrego
04-11-2006, 07:39
Hi Vasanth

U could use the built in services provided by in pub folder for flat files (i.e pub.flatfile) they provide u services to convert a doc to flat file

Cheers
Jeevan

rmg
04-11-2006, 07:49
Vasanth,

Either of the replies will help you moving forward.But make sure you create flatfile schema based on your flatfile layout how it should be.

Reading ISFlatFileSchemaDevguide will explain about FF schema procedure.

HTH,
RMG

vasanth
04-11-2006, 08:27
hi all,
thanks for u r positive response..
till now i am getting only root tag..
my flow service contains the below services...
1:getFile
2.bytesToString
3:XMLStringToXMLNode
4:XMLNodeToDocument
5:convertToString
i only get root node..
i created flat file schema also

i don,t what mistake done by me...
can u pleae tell me the changes..
Thanks
Vasanth

rmg
04-11-2006, 08:56
Tell us about your flatfile schema defiinition? Is it fixedlength or delimiter based? How about RecordDefinitions,field definitions.

Are you getting any errors?

HTH,
RMG

muneer0072000
04-22-2006, 03:00
Hi vasanth,

Make isXML variable in xmlStringToNode service as true. It will solve your problem. Dont forget to replay back the status to WmUser.

Thanks,

vasanth
04-24-2006, 01:40
hi friends,
finally i got results...
actually i forogt one mapping, in the step xmlNodeToDocument..
change: that is service out document is mapped to xml document (earlier i mapped to flat file document directly).

Thanks
Vasanth