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

Parser drops prefix #78

Open
sshikaree opened this issue Jan 14, 2022 · 0 comments
Open

Parser drops prefix #78

sshikaree opened this issue Jan 14, 2022 · 0 comments
Labels

Comments

@sshikaree
Copy link

If previous sibling contains same xmlns as current prefix does, the prefix will be dropped.

<omx xmlns:ct="automation.control">
	<parameter xmlns="automation.control"/>
	<ct:socket name="Info" />
</omx>
nodes, _ := xmlquery.QueryAll(root, "//*")
for _, node := range nodes {
		fmt.Println("Data:", node.Data, "Prefix:", node.Prefix, "Namespace:", node.NamespaceURI)
}

gives
Data: socket Prefix: Namespace: automation.control
If I change to <parameter xmlns="automation.control_2"> everything is fine:
Data: socket Prefix: ct Namespace: automation.control

sshikaree added a commit to sshikaree/xmlquery that referenced this issue Jan 18, 2022
@zhengchun zhengchun added the bug label Jan 19, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants