Skip to content

Conversation

chiranSachintha
Copy link
Member

@chiranSachintha chiranSachintha commented Oct 15, 2025

Purpose

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

Fixes #https://github.com/wso2-enterprise/wso2-integration-internal/issues/2231

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 chiranSachintha changed the title Remove root element wrapper when parsing XML string Add helper function to preserve XML declaration as processing instruction Oct 15, 2025
@codecov
Copy link

codecov bot commented Oct 20, 2025

Codecov Report

❌ Patch coverage is 77.27273% with 5 lines in your changes missing coverage. Please review.
✅ Project coverage is 75.08%. Comparing base (de0729a) to head (cfb0331).
⚠️ Report is 12 commits behind head on master.

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              @@
##             master   #44358      +/-   ##
============================================
- Coverage     75.09%   75.08%   -0.01%     
- Complexity    58585    58590       +5     
============================================
  Files          3599     3599              
  Lines        226340   226383      +43     
  Branches      29441    29453      +12     
============================================
+ Hits         169975   169988      +13     
- Misses        46923    46947      +24     
- Partials       9442     9448       +6     

☔ 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.

BXml item = XmlUtils.parse("<root>" + value + "</root>");
return item.children();
String xml = value.trim();
if (xml.startsWith(XML_DECLARATION)) {
Copy link

@VimukthiRajapaksha VimukthiRajapaksha Oct 20, 2025

Choose a reason for hiding this comment

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

Couldn't an XML file also start with processing instructions like <?php or <?mso-application instead?

if (version != null) {
piData.append("version=\"").append(version).append("\"");
}

Copy link
Contributor

Choose a reason for hiding this comment

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

Shall we remove these new lines after each if

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.

3 participants