diff --git a/pmd-xml/src/main/resources/category/xml/errorprone.xml b/pmd-xml/src/main/resources/category/xml/errorprone.xml index c868b036f0..46f598d8e4 100644 --- a/pmd-xml/src/main/resources/category/xml/errorprone.xml +++ b/pmd-xml/src/main/resources/category/xml/errorprone.xml @@ -30,7 +30,18 @@ An XML CDATA section begins with a <![CDATA[ marker, which has only one [, an + + - this cdata section is valid, but it contains an + additional square bracket at the beginning. + It should probably be just . + + + - this cdata section is valid, but it contains an + additional square bracket in the end. + It should probably be just . + + ]]> diff --git a/pmd-xml/src/test/resources/net/sourceforge/pmd/lang/xml/rule/errorprone/xml/MistypedCDATASection.xml b/pmd-xml/src/test/resources/net/sourceforge/pmd/lang/xml/rule/errorprone/xml/MistypedCDATASection.xml index 45388522ab..c748e2e5e4 100644 --- a/pmd-xml/src/test/resources/net/sourceforge/pmd/lang/xml/rule/errorprone/xml/MistypedCDATASection.xml +++ b/pmd-xml/src/test/resources/net/sourceforge/pmd/lang/xml/rule/errorprone/xml/MistypedCDATASection.xml @@ -70,4 +70,34 @@ ]]> xml + + Example code + 2 + 3,8 + + + - this cdata section is valid, but it contains an + additional square bracket in the end. + It should probably be just . + + + - this cdata section is valid, but it contains an + additional square bracket at the beginning. + It should probably be just . + + + ]]> + + + Square bracket at end separate by space is ok + 0 + + + + + + ]]> +