0
<?xml version="1.0" encoding="UTF-8"?>
 <!DOCTYPE hibernate-mapping PUBLIC
    "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
    "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd" >

...

Ant スクリプトを使用して、すべての Doctype を削除したい

<!DOCTYPE hibernate-mapping PUBLIC
    "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
    "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd" >

私は以下を使用してのみ削除に成功しました<!DOCTYPE:

<

replaceregexp >
      <regexp pattern="&lt;DOCTYPE hibernate-mapping PUBLIC
        &quot;-//Hibernate/Hibernate Mapping DTD 3.0//EN&quot;
        &quot;http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd&quot; &gt;"/>
      <substitution expression=""/>
      <fileset  file="${subproject.build.pre-dist.dir}/WEB-INF/struts-config.xml">

      </fileset>
    </replaceregexp>

全部消すにはどうしたらいいですか?

4

1 に答える 1

0

私はこの解決策を試しました:

<target name="test" depends ="init">
    <loadfile 
        srcfile="${subproject.build.pre-dist.dir}/WEB-INF/struts-config.xml" 
        property="src.file.head1">
    <filterchain>
        <headfilter lines="-1" skip="3"/>
    </filterchain>
    </loadfile>


    <echo  file ="${subproject.build.pre-dist.dir}/WEB-INF/struts-config.xml"
    message="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;
        ${src.file.head1}"/>
</target>
于 2013-03-28T16:40:19.910 に答える