How can I debug xmlFileSet?

Answered

Comments

2 comments

  • Avatar
    juanjo

    The problem is that the action does not work well with namespaces. As a workaround, you can use the below code:

    <substitute>
        <files>${installdir}${platform_path_separator}pmdfile.xml</files>
        <type>regexp</type>
        <substitutionList>
            <substitution>
                <pattern>xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"\s*xsi:noNamespaceSchemaLocation=</pattern>
                <value>xsi:noNamespaceSchemaLocation=</value>
            </substitution>
        </substitutionList>
    </substitute>
        <xmlFileSet>
            <attribute>xsi:noNamespaceSchemaLocation</attribute>
            <element>/PMD[@SchemaVersion="1.0"]</element>
            <file>${installdir}${platform_path_separator}pmdfile.xml</file>
            <value>${installdir}${platform_path_separator}etc${platform_path_separator}PMD.xsd</value>
        </xmlFileSet>
    <substitute>
        <files>${installdir}${platform_path_separator}pmdfile.xml</files>
        <type>regexp</type>
        <substitutionList>
            <substitution>
                <pattern>xsi:noNamespaceSchemaLocation=</pattern>
                <value>xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation=</value>
            </substitution>
        </substitutionList>
    </substitute>
    
  • Avatar
    juanjo

    Sorry, I meant to use the <substitute> actions to disable (remove) and re-enable the namespace so the <xmlFileSet> action work but as the setting you tried to set is so simple you can just use the substitute for that as you mention.

Please sign in to leave a comment.