-
Notifications
You must be signed in to change notification settings - Fork 89
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
updated: output xml with comment node. #9
Conversation
Thanks for your commit, test is passed. But i have a question, when or under what case should we output comment node? At most of the time, comment node doesn't make sense in the XML document, we don't care about it. |
belowing document output is incorrect. <?xml version="1.0" encoding="UTF-8"?>
<!-- comment here-->
<AAA>
<BBB>
<DDD>
<CCC>
<DDD/>
<!-- DDD -->
<!-- DDD -->
<!-- DDD -->
<EEE/>
</CCC>
<!-- CCC -->
<!-- CCC -->
</DDD>
</BBB>
<!-- CCC -->
<!-- CCC -->
<CCC>
<DDD>
<!-- EEE -->
<!-- EEE -->
<!-- EEE -->
<!-- EEE -->
<EEE>
<DDD>
<!-- FFF -->
<FFF/>
</DDD>
<!-- FFF -->
<!-- FFF -->
<!-- FFF -->
</EEE>
</DDD>
</CCC>
</AAA> should add following code to confirm its level. for i := prev.level - level; i > 1; i-- {
prev = prev.Parent
}
addSibling(prev.Parent, node) |
Thanks for your advice, In my api proxy case, I parse xml-rpc, record some raw xml node value, then convert to other type. The OutputXML() should distinguish between text and comment. comment should been ignored, not as text. |
Thanks, merged. |
The comment node should output as a block of comment text