RE: [xsl] Transforming XML to fixed format file

Subject: RE: [xsl] Transforming XML to fixed format file
From: "Mark Wonsil" <wonsil@xxxxxxxxxx>
Date: Fri, 24 May 2002 08:52:51 -0400
> 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.


Mark Wonsil

 XSL-List info and archive:

Current Thread