Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Namespaces are removed in 1.18.2 #2236

Closed
JaneHuang1234 opened this issue Nov 28, 2024 · 1 comment
Closed

Namespaces are removed in 1.18.2 #2236

JaneHuang1234 opened this issue Nov 28, 2024 · 1 comment
Labels
duplicate This is a duplicate issue or root-cause of another issue fixed

Comments

@JaneHuang1234
Copy link

JaneHuang1234 commented Nov 28, 2024

Hi,

We recently upgraded from 1.18.1 to 1.18.2 and namespaces in xml are removed during parse.

Document doc = Jsoup.parse(new ByteArrayInputStream("<?xml version=\"1.0\" encoding=\"UTF-8\"?><test1><test xmlns:p1=\"test-namespace\"> </test></test1>".getBytes("UTF-8")),
        "UTF-8", "", Parser.xmlParser());
    doc.outputSettings().charset("UTF-8");
    doc.outputSettings().escapeMode(Entities.EscapeMode.xhtml);
    System.out.println(doc.toString());

The result was

<?xml version="1.0" encoding="UTF-8"?><test1><test xmlns:p1="test-namespace">&#xa0;</test></test1>

in 1.18.1

But with 1.18.2:

<?xml version="1.0" encoding="UTF-8"?><test1><test>&#xa0;</test></test1>

Is there any configuration to keep the namespaces?

@jhy jhy closed this as completed in bf13b49 Nov 29, 2024
@jhy
Copy link
Owner

jhy commented Nov 29, 2024

Thanks for reporting, and sorry about the issue! This is the same as #2235, hitting the digit case.

@jhy jhy added duplicate This is a duplicate issue or root-cause of another issue fixed labels Nov 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
duplicate This is a duplicate issue or root-cause of another issue fixed
Projects
None yet
Development

No branches or pull requests

2 participants