• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

convert from one text format to other

 
Ranch Hand
Posts: 620
1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Helllo all
i have some project that i need convert from one text format say html page to xml page
it will run on allot of pages ( 600...) and it need to be flex for me to add more pre defines tag
that is open file go line by line and parse every html tag to xml tag the formats will be
predefined. now i dont want to invade the wheel , im sure there is some patterns and ideas
that are agreed for task like this , can you the experts give me some links or ideas? how can
i approce to this kind of task?
 
(instanceof Sidekick)
Posts: 8791
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
If your HTML is also well formed XML (it could happen!) you could use XSL for a rapid conversion. Or maybe you wouldn't need conversion in the first place.

I use the Quiotix HTML Parser to parse HTML into a DOM. It does a neat job of fixing up the oddities of HTML. The DOM supports a Visitor interface that might be real slick for generating XML. They have a sample visitor that generates HTML again that would probably be a good inspiration. It might even generate that well formed XML version of HTML.
 
ben josh
Ranch Hand
Posts: 620
1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
i was thinking about more general tool , the html to xml is just an
example .. in fact i need it for internal use for converting one format to other , i need some Algorithms , ideas and such like this example :
http://www.cs.wlu.edu/~levy/courses/cs112-03/lectures/07_FEB_2003.pdf
 
Bartender
Posts: 9626
16
Mac OS X Linux Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I use Open Office for doing .DOC to HTML and HTML to PDF.
 
Stan James
(instanceof Sidekick)
Posts: 8791
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Frank's Friki Wiki has a pretty general purpose string transformer thing going on. I'll pretend I just didn't give it enough time, but I couldn't figger it out well enough to apply it to a new problem.
 
Then YOU must do the pig's work! Read this tiny ad. READ IT!
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic