[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: library for parsing RTF

Subject: Re: library for parsing RTF
From: Andriy Gerasika <andriy.gerasika@xxxxxxxxx>
Date: Mon, 28 Jun 2010 02:07:26 +0300
Re:  library for parsing RTF
For a language as rich as RTF, regular expressions are not going to get
you all that far: they are probably only suitable for writing the
lexical analyzer (or tokenizer).


RTF syntax is not that complex for requiring BNF parser.


assuming the following RTF:
{\rtf1\ansi{\fonttbl\f0\fswiss Helvetica;}\f0\pard
This is some {\b bold} text.\par
}

it can be easily converted w/ regular expressions to something like:
<g><rtf>1</rtf><ansi/><g><fonttbl/><f>0</f><fswiss/>Helvetica<sc/></g><f>0</f><pard/>
This is some <g><b/>bold</g> text.<par/>
</g>

where "g" equals to RTF's curly braces(group) and "sc" to semicolon in RTF.

not sure if BNF parser will produce something better...

Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.