This is the mail archive of the xsl-list@mulberrytech.com mailing list .


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

RE: Transforming XML to fixed format file


> I have a requirement to transform an incoming XML file
> containing Purchase
> Orders into a fixed format file (specifically an SAP IDOC). This will
> involve things such as, placing the text value of the node
> <accountnumber>,
> into positions 10-19 of the output file. Is this something I
> can do easily
> with XSLT or is this an instance of the situation where I'd
> be better off
> writing my own parser by extending XMLReader.

While I am sure you can do it in XSLT, this sounds like it might be easier
to do with SAX (or maybe even Perl).  I certainly wouldn't write my own
parser, I would just respond to SAX events and build up the IDOC that way.
I am assuming that the XML PO stream is nested much like the SAP IDOC
format.  Also, if you need to do any ancillary database queries, you can
easily make JDBC calls in your Java program.  You can use SAX to go the
opposite direction too.  You can create SAX events for segments in the IDOC
and create XML from there.

Cheers,

Mark Wonsil


 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]