Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Perl adequacy for textfile converting

Status
Not open for further replies.

Dncan

Programmer
Feb 24, 2003
4
FR
Hello,

I don't really know Perl... yet.
I'm wanting to write a parser which will have to convert a textfile document from one format (GML/PC) to another one (XML). Both are languages using tags, but they don't follow the same structure construction.
I've been told perl could probably be the best language to use in order to achieve this kind of goal.

Would anyone here have some piece of advice about this ? Is it worth taking some time learning it instead of using straight C ?

Thanx,
Thomas Lajeunesse
 
Yes, I made the C to Perl transition a year and a half or two years ago, and it is completely worth it, especially for projects like that. Perl's string handling capability is worlds easier than C's.

You can look through search.cpan.org for modules that help with whatever the task at hand is. XML::parser might be helpful for what you mentioned. ----------------------------------------------------------------------------------
...but I'm just a C man trying to see the light
 
No, GML/PC is not a XML format. For instance, tags don't always have a closing counterpart.

My idea is to define a DTD as close as possible to GML/PC grammar, and then write a parser which will have to fill in the differences (adding closing tags, and a few other similar tasks). The closer the DTD will be from actual GML/PC, the simpler the parser will have to be.
That's for this parser that I plan to use perl.
Then I'll have to use XSLT to transform the XML document in XSL-FO in order to generate the PDF documentation which is the final goal, using FOP. ----------------------------------------
Don't dream it, be it.

Thomas Lajeunesse
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top