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="<?xml * ?>" />
<substitution expression="" />
</replaceregexp>
Try this instead:
<replaceregexp file="${cppUnit.file}" match="<\?xml.*\?>"
replace="" byline="true"/>