func XMLGetNodeValue(xmlString string, path string) string {
(params ...any)
| 103 | |
| 104 | // func XMLGetNodeValue(xmlString string, path string) string { |
| 105 | func XMLGetNodeValue(params ...any) (any, error) { |
| 106 | xmlString := params[0].(string) |
| 107 | path := params[1].(string) |
| 108 | |
| 109 | compiledPath, err := compileOrGetPath(path) |
| 110 | if err != nil { |
| 111 | log.Errorf("Could not compile path %s: %s", path, err) |
| 112 | return "", nil |
| 113 | } |
| 114 | |
| 115 | doc, err := getXMLDocumentFromCache(xmlString) |
| 116 | if err != nil { |
| 117 | log.Tracef("Could not parse XML: %s", err) |
| 118 | return "", nil |
| 119 | } |
| 120 | |
| 121 | elem := doc.FindElementPath(compiledPath) |
| 122 | if elem == nil { |
| 123 | log.Debugf("Could not find element %s", path) |
| 124 | return "", nil |
| 125 | } |
| 126 | |
| 127 | return elem.Text(), nil |
| 128 | } |
searching dependent graphs…