0

I have an XML document composed of several other XML documents appended to it. As a result, there are several XML declarations within the document which prevent my XSLT from parsing it correctly. I am trying to remove the declarations from the document using the ant replace and replaceregexp tasks, but they do nothing to the file. This is what I have so far.

<replaceregexp file="${cppUnit.file}" >
    <regexp pattern="&lt;?xml * ?&gt;" />
    <substitution expression="" />
</replaceregexp>
zalpha314
  • 1,444
  • 4
  • 19
  • 34

2 Answers2

2

Try this instead:

<replaceregexp file="${cppUnit.file}" match="&lt;\?xml.*\?&gt;"
     replace="" byline="true"/>
ewan.chalmers
  • 16,145
  • 43
  • 60
0

ok. This worked.

<regexp pattern="..?xml version=.1.0. encoding='ISO-8859-1' standalone='yes' ?..." />
zalpha314
  • 1,444
  • 4
  • 19
  • 34