Movatterモバイル変換


[0]ホーム

URL:


 
» Error Prone Edit on GitHub

Error Prone

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,'[')orends-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:

<ruleref="category/xml/errorprone.xml/MistypedCDATASection"/>

This documentation is written in markdown.
If there is something missing or can be improved, edit this page on github and create a PR: Edit on GitHub

©2026 PMD Open Source Project. All rights reserved.
Site last generated: Jan 30, 2026

PMD                logo


[8]ページ先頭

©2009-2026 Movatter.jp