Transformation:XML to Flat file

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

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

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

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

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

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

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,

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