Skip to content

Conversation

@chiranSachintha
Copy link
Member

Purpose

Describe the problems, issues, or needs driving this feature/fix and include links to related issues.

Fixes #

Approach

Describe how you are implementing the solutions along with the design details.

Samples

Provide high-level details about the samples related to this feature.

Remarks

List any other known issues, related PRs, TODO items, or any other notes related to the PR.

Check List

  • Read the Contributing Guide
  • Updated Change Log
  • Checked Tooling Support (#)
  • Added necessary tests
    • Unit Tests
    • Spec Conformance Tests
    • Integration Tests
    • Ballerina By Example Tests
  • Increased Test Coverage
  • Added necessary documentation
    • API documentation
    • Module documentation in Module.md files
    • Ballerina By Examples

@chiranSachintha
Copy link
Member Author

xml body = xml `<?xml version="1.1" encoding="UTF-8"?><A><B>123</B></A>`;

Here, we treated <?xml version="1.1" encoding="UTF-8"?> as a processing instruction. That’s why I created a processing instruction for it when parsing the XML stream. <?xml version="1.1" encoding="UTF-8"?> is actually a special type of processing instruction, it is XML declaration. We should create a separate type for this in the runtime. This can be considered as an improvement.

@gimantha
Copy link
Contributor

This is a breaking change.

@gimantha gimantha changed the title Add helper function to preserve XML declaration as processing instruction [Dont merge - Breaking Change] Add helper function to preserve XML declaration as processing instruction Oct 16, 2025
@codecov
Copy link

codecov bot commented Oct 17, 2025

Codecov Report

❌ Patch coverage is 77.27273% with 5 lines in your changes missing coverage. Please review.
✅ Project coverage is 77.28%. Comparing base (50805a9) to head (0bef29d).
⚠️ Report is 3 commits behind head on 2201.12.x.

Files with missing lines Patch % Lines
...ballerina/runtime/internal/xml/XmlTreeBuilder.java 72.22% 3 Missing and 2 partials ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##             2201.12.x   #44359   +/-   ##
============================================
  Coverage        77.28%   77.28%           
- Complexity       59163    59171    +8     
============================================
  Files             3541     3541           
  Lines           222660   222680   +20     
  Branches         28872    28879    +7     
============================================
+ Hits            172083   172106   +23     
+ Misses           40853    40850    -3     
  Partials          9724     9724           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants