Skip to content

Add XML 1.1 tags and EL functions to both taglibs - #168

Merged
jmanico merged 3 commits into
OWASP:mainfrom
VolodymyrLinuxovich:feature/xml11-tags
Sep 26, 2026
Merged

jmanico merged 3 commits into
OWASP:mainfrom
VolodymyrLinuxovich:feature/xml11-tags

Conversation

@VolodymyrLinuxovich

@VolodymyrLinuxovich VolodymyrLinuxovich commented Sep 26, 2026 •

Copy link
Copy Markdown
Contributor

Reviewed 2026-09-25 (America/Los_Angeles) against main at bd249f5. Execution order and cross-issue ownership: #169. Batch 03.

This scope replaces the dated implementation prescriptions in the original report and earlier comments; linked historical evidence remains useful but must be rechecked before implementation.

Organization review

Implements #131; keep its Closes #131 link. Reviewed head: 7bfa00f3242c8918b7d201c8e55bbd7b1b31e00e against main bd249f5.

The body below is the contributor's original implementation description, retained for review.


Closes #131.

Now that #167 has merged, this is rebased onto main and is a single commit. It shrinks #167's TaglibDescriptorTest exclusion list and relies on its parameterized TagEncodingTest.

Change

  • ForXml11Tag, ForXml11ContentTag and ForXml11AttributeTag in jsp/ and jakarta/. They mirror ForXmlTag, ForXmlContentTag and ForXmlAttributeTag, delegate to the Encode.forXml11* Writer methods, and the two trees are identical apart from the javax/jakarta imports (scripts/check-taglib-parity.py passes, 33 files).
  • All three are declared as a <tag> and a <function> in both java-encoder-advanced.tld files, next to their XML 1.0 counterparts. forXml11 is added to both basic java-encoder.tld files next to forXml.
  • The TLD descriptions follow the Encode Javadoc. They note that the control-character references are XML 1.1 only (XML 1.0 does not allow them), and that forXml11Content does not escape quotes.

Tests

  • TaglibDescriptorTest (both modules): the exclusion list is now exactly {forJava}, and the pinned basic set includes forXml11. Without the new advanced TLD entries it fails, naming the three missing contexts.
  • TagEncodingTest picks up the new tags from the advanced TLD: 30 new cases per module (null, empty, plain, hostile Unicode, and 1,023 to 2,049 buffer boundaries), each compared with the Encode facade.
  • mvn clean verify passes for all modules on current main, including Guard facade mappings and JSP/Jakarta parity #167's invocation-contract checks.

Docs

  • README TagLib section: every Encode.forX(String) context has a tag and EL function in the advanced taglib except forJava, because Java source generation is not a JSP output context.
  • README News entry under Unreleased 1.5.0.

@VolodymyrLinuxovich

VolodymyrLinuxovich commented Sep 26, 2026 •

Copy link
Copy Markdown
Contributor Author

Thanks for the triage. Here's what changed since the reviewed head 7bfa00f:

  1. Rebased onto main at 98608dd after Propagate the forUri deprecation to Encoders, tags and TLDs #170 merged. The only conflict was README: Propagate the forUri deprecation to Encoders, tags and TLDs #170 added the "Migrating from forUri" section and a News line next to this PR's. I kept both. The forJava note stays in the TagLib section, directly above the migration section. The code and TLD content of 806d000 is unchanged from 7bfa00f.
  2. 2ed487b addresses the wording note: "Control characters are encoded as for forXml11" now reads "Encodes control characters the same way as forXml11" in the forXml11Content and forXml11Attribute tag and function descriptions, in both advanced TLDs.

Locally, mvn clean verify passes on the rebased branch, and scripts/check-taglib-parity.py passes (34 files). I'll coordinate the OSGi import ranges with #137 when that work starts.

Update: the "Packaged consumer compatibility" run on 2ed487b failed before any code ran. Its runner couldn't download javax.servlet-api from Maven Central ("Temporary failure in name resolution"); all 1,729 core tests had passed. Fork contributors can't re-run upstream jobs, and #172 had just changed the same TLDs, so I rebased onto main at fe5e0ad. The rebase was clean, and it re-runs CI. The heads are now 4804ab0 (tags) and 59edee2 (wording). mvn clean verify passes locally on the new base.

The XML 1.1 encoders added in 1.4.0 were not reachable from either
taglib. Add ForXml11Tag, ForXml11ContentTag and ForXml11AttributeTag
to jsp and jakarta, mirroring the XML 1.0 tags and identical apart
from the javax/jakarta imports. Declare all three as tags and EL
functions in both advanced TLDs, next to their XML 1.0 counterparts,
and add forXml11 to both basic TLDs next to forXml.

TaglibDescriptorTest's exclusion list is now exactly {forJava}, and
the pinned basic set includes forXml11. TagEncodingTest picks up the
new tags from the advanced TLD, covering null, hostile Unicode and
buffer-boundary inputs against the Encode facade. The README states
why forJava has no tag and adds a News entry.
Replace "Control characters are encoded as for forXml11" with "Encodes
control characters the same way as forXml11" in the forXml11Content and
forXml11Attribute tag and function descriptions, as noted in triage.

@jmanico jmanico left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed at ece754c after integration with main and the merged OSGi ranges from #174. The six tag classes delegate directly to the matching Writer facades; both packaged descriptor surfaces declare the matching functions and preserve the intentional forJava omission. XML 1.1 context restrictions are documented. Local reactor verification and focused final-head tag/API/signature/module verification pass; JSP/Jakarta parity passes across 34 source files. Existing parameterized contracts exercise the new tags, including null, Unicode and buffer boundaries. No core algorithms or shipped dependency baselines change. Required CI must pass before merge; real JSP compiler coverage follows under #120.

@jmanico
jmanico merged commit 2b8e7b3 into OWASP:main Sep 26, 2026
26 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: compatibility JSP/Jakarta/ESAPI consumers, OSGi and integration fixtures. priority: P2 Planned maintenance; follow the ordered batch and documented dependencies. triage: review-needed Implementation PR exists and awaits normal independent maintainer review.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add XML 1.1 tags and EL functions to both taglibs

2 participants