[prev in list] [next in list] [prev in thread] [next in thread] 

List:       velocity-user
Subject:    RE: Velocity parsing problem
From:       "AFASA Corneil du Plessis" <Corneil () afa ! co ! za>
Date:       2002-01-29 8:58:02
[Download RAW message or body]

Make sure your HTML is XHTML an use a XML parser what you are looking
for is a XSL style sheet that will identify all the attributes/tags that
will be rendered and then replacing them with references to a resource.

Corneil du Plessis
AFA Systems
Direct:+27 11 293-1136
Office: +27 11 886-6938
Fax: +27 11 789-4907
Cell: +27 82 802-5768


-----Original Message-----
From: Geir Magnusson Jr. [mailto:geirm@optonline.net]
Sent: Monday, January 28, 2002 11:49 PM
To: velocity-user@jakarta.apache.org
Subject: Re: Velocity parsing problem


On 1/28/02 4:40 PM, "Cynick Young" <cynick.young@utoronto.ca> wrote:

> Hello,
> 
> Here's the background info on what I'm trying to do.
> At the moment, we are trying to translate our english
> site into french.  We have used Velocity as the template
> engine so that our html designers can do the presentation.
> In translating to french, we make a copy of the english
> and replace all text to french by hand.
> 
> As you can image, this is not a fun job.  What I would
> like to do is have a parser that processes an html or
> velocity .vm file and extract any plain text and put them
> into a separate properties file.  This properties file can
> be translated easily and the language dependent
> resource bundle can provide the text at runtime.
> 
> Does anyone know of a tool that already exists to
> do this process?  It would be silly to keep mulitple
> versions of the same template for internationalization.
> If I need to write the parser myself, where would be
> a good place to start?

I can easily make a tool for you that coughs out any text bits from a
.vm.

There are a couple of parsing tools out there, for example JavaCC which
we
use in Velocity that you might you to take a stab at the HTML problem.

However, there is an HTML parser included in the JDK IIRC, and there are
other tools out there ready made.

(At worst, take apart an open source browser - what about the gekko
engine?)

-- 
Geir Magnusson Jr.
geirm@optonline.net
System and Software Consulting
"Now what do we do?"


--
To unsubscribe, e-mail:
<mailto:velocity-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail:
<mailto:velocity-user-help@jakarta.apache.org>

--
To unsubscribe, e-mail:   <mailto:velocity-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:velocity-user-help@jakarta.apache.org>

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic