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

fix: when node is root, not output unnecessary string #72

Merged
merged 1 commit into from
Oct 25, 2021
Merged

fix: when node is root, not output unnecessary string #72

merged 1 commit into from
Oct 25, 2021

Conversation

leavesster
Copy link
Contributor

When I use OutputXML to copy a xml document I found When the node is root , this function will print unnecessary <> and <>

s := `<?xml version="1.0" encoding="utf-8"?><rss version="2.0"></rss>`
doc, err := xmlquery.Parse(strings.NewReader(s))

log.Printf(doc.OutputXML(true))
// will print this:
//`<><?xml version="1.0" encoding="utf-8"?><rss version="2.0"></rss></>`

I not sure, if this is run as you expected. I think this may be not right behavior, so I create this pr.

@zhengchun zhengchun closed this in eca2fa0 Oct 25, 2021
@zhengchun zhengchun merged commit cd0be21 into antchfx:master Oct 25, 2021
zhengchun added a commit that referenced this pull request Oct 25, 2021
@zhengchun
Copy link
Contributor

Merged. thanks!

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