That’s the worst XML I’ve seen in a long time! ;o)
You need 1 root tag (that encapsulates all other elements) and a repeating row/element would have the same XML node name - such as <row>.
You could have <row id=“1”></row> or something but not unique element names like you’ve shown (row1, row2, etc).
If you are saddled with using that XML, then here’s something that you may be able to do:
Using REGEX or regular expressions, you can pass the entire XML string into the replace function and using the regex /^<row/>. Do this twice, once for <row_x> and then again for the closing tag </row_x>.
Of course, change the search pattern for closing bracket /^</\row/
It’s kinda crazy, but it may work.
The best thing to do of course is to generate proper xml.
This is not an XML file…It is a user defined flat file that looks like XML. If you can not get them to create a proper XML then defining the structure as a FF might be much easier.
Satyen - Alphan is onto something. This doesn’t seem to be XML at all - you can’t have tags defined on the fly like that. If your partner insists it is XML, ask them for the DTD or schema – tell them you require it to import the DTD as an WM record structure (which is true).
Rays’ advice seems to be the best – use widlcards and pub.string:replace to transform the problem tags: <rownn> to plain old XML tags: <row>. If you want to preserve or extract the ‘NN’ number information, you could use the EDI adapter.