We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
I have an issue when trying to extract element via getElementFragmentNs.
Here sample test:
@Test public void shouldNotShadowNamespaceAndAddSiblingNamespaces() throws Exception { byte[] bytes = ("<ns2:Response xmlns=\"urn://message\" xmlns:ns2=\"urn://ns2\">\n" + " <ns2:Data Id=\"SIGNED_BY_CONSUMER\">\n" + " <Content>\n" + " <tns:Response\n" + " xmlns:tns=\"urn://tns\"\n" + " xmlns=\"urn://shadow\">\n" + " <tns:test/>\n" + " </tns:Response>\n" + " </Content>\n" + " <AttachmentHeaderList>\n" + " <AttachmentHeader/>\n" + " </AttachmentHeaderList>\n" + " </ns2:Data>\n" + "</ns2:Response>").getBytes("UTF-8"); VTDGen vg = new VTDGen(); vg.setDoc(bytes); vg.parse(true); // set namespace awareness to true VTDNav vn = vg.getNav(); AutoPilot ap = new AutoPilot(vn); ap.selectElement("AttachmentHeader"); ap.iterate(); ElementFragmentNs efn = vn.getElementFragmentNs(); byte[] result = efn.toBytes(); assertThat(new String(result, "UTF-8"), is("<AttachmentHeader xmlns=\"urn://message/\"/>")); }
The actual result is:
<AttachmentHeader xmlns:tns="urn://tns" xmlns="urn://shadow" xmlns:ns2="urn://ns2"/>
But I expect:
<AttachmentHeader xmlns="urn://message/"/>
Why it shadows default namespace with default namespace from sibling subelement? And why it adds unnecessary namespaces from it?
The text was updated successfully, but these errors were encountered:
No branches or pull requests
I have an issue when trying to extract element via getElementFragmentNs.
Here sample test:
The actual result is:
<AttachmentHeader xmlns:tns="urn://tns" xmlns="urn://shadow" xmlns:ns2="urn://ns2"/>
But I expect:
<AttachmentHeader xmlns="urn://message/"/>
Why it shadows default namespace with default namespace from sibling subelement? And why it adds unnecessary namespaces from it?
The text was updated successfully, but these errors were encountered: