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

Function createBookExample

xpath_test.go:623–739  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

621}
622
623func createBookExample() *TNode {
624 /*
625 <?xml version="1.0" encoding="UTF-8"?>
626 <bookstore>
627 <book category="cooking">
628 <title lang="en">Everyday Italian</title>
629 <author>Giada De Laurentiis</author>
630 <year>2005</year>
631 <price>30.00</price>
632 </book>
633 <book category="children">
634 <title lang="en">Harry Potter</title>
635 <author>J K. Rowling</author>
636 <year>2005</year>
637 <price>29.99</price>
638 </book>
639 <book category="web">
640 <title lang="en">XQuery Kick Start</title>
641 <author>James McGovern</author>
642 <author>Per Bothner</author>
643 <author>Kurt Cagle</author>
644 <author>James Linn</author>
645 <author>Vaidyanathan Nagarajan</author>
646 <year>2003</year>
647 <price>49.99</price>
648 </book>
649 <book category="web">
650 <title lang="en">Learning XML</title>
651 <author>Erik T. Ray</author>
652 <year>2003</year>
653 <price>39.95</price>
654 </book>
655 </bookstore>
656 */
657 type Element struct {
658 Data string
659 Attributes map[string]string
660 }
661 books := []struct {
662 category string
663 title Element
664 year int
665 price float64
666 authors []string
667 }{
668 {
669 category: "cooking",
670 title: Element{"Everyday Italian", map[string]string{"lang": "en"}},
671 year: 2005,
672 price: 30.00,
673 authors: []string{"Giada De Laurentiis"},
674 },
675 {
676 category: "children",
677 title: Element{"Harry Potter", map[string]string{"lang": "en"}},
678 year: 2005,
679 price: 29.99,
680 authors: []string{"J K. Rowling"},

Callers 1

xpath_test.goFile · 0.85

Calls 3

createNodeFunction · 0.85
createChildNodeMethod · 0.80
addAttributeMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…