()
| 42 | } |
| 43 | |
| 44 | func ExamplePath() { |
| 45 | xml := ` |
| 46 | <bookstore> |
| 47 | <book> |
| 48 | <title>Great Expectations</title> |
| 49 | <author>Charles Dickens</author> |
| 50 | </book> |
| 51 | <book> |
| 52 | <title>Ulysses</title> |
| 53 | <author>James Joyce</author> |
| 54 | </book> |
| 55 | </bookstore>` |
| 56 | |
| 57 | doc := NewDocument() |
| 58 | doc.ReadFromString(xml) |
| 59 | for _, e := range doc.FindElements(".//book[author='Charles Dickens']") { |
| 60 | doc := NewDocumentWithRoot(e.Copy()) |
| 61 | doc.Indent(2) |
| 62 | doc.WriteTo(os.Stdout) |
| 63 | } |
| 64 | // Output: |
| 65 | // <book> |
| 66 | // <title>Great Expectations</title> |
| 67 | // <author>Charles Dickens</author> |
| 68 | // </book> |
| 69 | } |
nothing calls this directly
no test coverage detected