A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://docs.pmd-code.org/latest/pmd_rules_xml_errorprone.html below:

Error Prone | PMD Source Code Analyzer

Rules to detect constructs that are either broken, extremely confusing or prone to runtime errors.

Table of Contents MistypedCDATASection

Since: PMD 5.0

Priority: Medium (3)

An XML CDATA section begins with a <![CDATA[ marker, which has only one [, and ends with a ]]> marker, which has two ].

This rule is defined by the following XPath expression:

//cdata-section[starts-with(@Text,'[') or ends-with(@Text,']')]

Example(s):

<root>
    <child>
        <![CDATA[[ character data ]]> - this cdata section is valid, but it contains an
        additional square bracket at the beginning.
        It should probably be just <![CDATA[ character data ]]>.
    </child>
    <child>
        <![CDATA[ character data ]]]> - this cdata section is valid, but it contains an
        additional square bracket in the end.
        It should probably be just <![CDATA[ character data ]]>.
    </child>
</root>

Use this rule by referencing it:

<rule ref="category/xml/errorprone.xml/MistypedCDATASection" />

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4