MCPcopy Create free account
hub / github.com/antchfx/xpath / Value

Method Value

xpath_test.go:372–389  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

370}
371
372func (n *TNode) Value() string {
373 if n.Type == TextNode {
374 return n.Data
375 }
376
377 var buff bytes.Buffer
378 var output func(*TNode)
379 output = func(node *TNode) {
380 if node.Type == TextNode {
381 buff.WriteString(node.Data)
382 }
383 for child := node.FirstChild; child != nil; child = child.NextSibling {
384 output(child)
385 }
386 }
387 output(n)
388 return buff.String()
389}
390
391// TNodeNavigator is for navigating TNode.
392type TNodeNavigator struct {

Callers

nothing calls this directly

Calls 2

WriteStringMethod · 0.80
StringMethod · 0.65

Tested by

no test coverage detected