Altova Mailing List Archives>Archive Index >comp.text.xml Archive Home >Recent entries >Thread Prev - conversion from one *format in a text file* -> to xml [Thread Next] Re: conversion from one *format in a text file* -> to xmlTo: NULL Date: 11/3/2005 1:50:00 PM In article <dkcirv$8l5$1@n...>, "Raghavendra Mahuli" <raghavendra.ma@i...> 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/proceedings/xml04/papers/111/mhk-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 | ||||||
| Company | Legal | Press | Partners | Careers | Sitemap | Contact Us | Altova Blog | Mobile | Full Site | |||
|
