xmlquery icon indicating copy to clipboard operation
xmlquery copied to clipboard

Adding new functions to Node

Open suntong opened this issue 3 years ago • 3 comments

Basically, all functions defined in

https://github.com/antchfx/xmlquery/blob/e73954f0f504eaf97f73ad62a4c52419e304b7bd/node_test.go#L11-L69

are necessary for me for my node navigation & checking, and I'd like to move them into node and expose them,

while changing (in node.go alone)

  • testNode to func IsNode(n *Node, expected string) bool
  • testAttr to func HasAttr(n *Node, expected string) bool and
  • testValue to func HasValue(val, expected interface{}) bool

OK?

suntong avatar Mar 17 '21 13:03 suntong

It makes no sense to add IsNode, HasAttr and HasValue to node.go. Node already have InnerText() and SelectAttr() to help finish these logical operation.

zhengchun avatar Mar 18 '21 02:03 zhengchun

OK. I'll leave them alone.

How about the rest of the functions then?

suntong avatar Mar 18 '21 02:03 suntong

Ping

How about the rest of the functions?

suntong avatar Mar 21 '21 22:03 suntong