In article <dkcirv$8l5$>,
"Raghavendra Mahuli" <> wrote:
>Hello,
>
>I have a text file in which records are stored in a particular format. For
>ex:
>
>Node1( att1, att2, node2(attx))
>
>I need to convert it to xml. I know xsl can be used to convert *xml to* some
>other format. But i need the reverse operation.
>Same thing in xml has to be transformed to something like(need not be
>exactly):
>
><n name="Node1">
> <a> att1</a>
> <a> att2</a>
> <n name="node2">
> <a>attx</a>
> </n>
></n>
Take a look at :
http://www.idealliance.org/proceedin...-paper.html#S2
..
if you have access to XSLT 2.0 (e.g. via Michael Kays saxon 8.x.x) then
you can 'upconvert' plaintext to xml using an xslt. I had a similar
task, but i have to admit I ended up using a lot of "tokenize" followed
by "for-each" structures rather than the "analyze-string" as advocated
in the article. My regex wasn't up to scratch, probably.
cheers
shaun