ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Beims Bob-RWBC70" <>
Subject RE: ReplaceRegExp installation / invocation help
Date Tue, 07 Nov 2006 18:33:46 GMT
I've done a bit more sleuthing, and perhaps I spoke too soon regarding
my installation.  I was naively expecting *some* logfile output from
ReplaceRegExp even if it didn't find any pattern matches, but I was
wrong... I invoked the ant build with the -debug option and see the
following in my log file:

  [replaceregexp] Replacing pattern '(<img
src=\")([^\\.]+\\.svg)(\"/?>)' with '<embed src="\2"
type="image/svg+xml"></embed>' in
'D:\ditaot_out\xhtml\blocks\RS08ADC8\Block_Diagram.html' with flags:
  [replaceregexp] No change made

Hmmm... here's a snippet from Block_Diagram.html:

<div class="fignone" id="id-Block_Diagram__id-43093">
  <a name="id-Block_Diagram__id-43093"><!-- --></a>
  <span class="figcap">Figure 1. ADC Block Diagram</span>
  <br/><img src="ADC_Block_Diagramp112.svg"/><br/>

So the string I'm trying to match is there, the replacement pattern
seems to have transitioned from XML in the Ant build file into the
appropriate string by the time the Java class got it. I guess the
pattern isn't correct; but it certainly isn't apparent to me why not.

Any regexp gurus out there see my problem?


-----Original Message-----
From: Beims Bob-RWBC70 
Sent: Tuesday, November 07, 2006 8:58 AM
To: ''
Subject: ReplaceRegExp installation / invocation help

Sorry for the newbie question ... I didn't find a search option @ and 30+ minutes with
Google couldn't help me find what I'm looking for ...

I'm trying to use the ReplaceRegExp ant task in a build file with the
DITA Open Toolkit ( That should tell
you that I'm *not* a Java developer; I know just enough about Ant to be

I can't figure out what I'm doing wrong in my installation ... here's
what I've done to try and get ReplaceRegExp to work:

   1. read the info @
   2. downloaded the jakarta-oro-2.0.8.jar and jakarta-regexp-1.4.jar
   3. placed the class packages in my /ant/lib directory
   4. included the code below at the end of my dita2xhtml target

<property name="ant.regexp.regexpimpl"
<replaceregexp flags="g">
  <regexp pattern="(&lt;img
  <substitution expression="&lt;embed src=\&quot;$2\&quot;
p_name}" includes="**/*.html"/> </replaceregexp>

(What I'm attempting to do is wrap SVG files in embed tags rather than
an img tags ... I've tested the regular expression with a GREP utility
and it does what I want.)

When I execute the target, the XHTML transform executes as expected (it
produces a working set of .html files), but there is absolutely no
effect from the replaceregexp task ... nothing in the log file, no
changes to output files ... zilch.

Any clues?

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message