diff options
Diffstat (limited to 'libpiano/src/xml.c')
-rw-r--r-- | libpiano/src/xml.c | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/libpiano/src/xml.c b/libpiano/src/xml.c index c0d388f..6d4dad8 100644 --- a/libpiano/src/xml.c +++ b/libpiano/src/xml.c @@ -744,3 +744,20 @@ PianoReturn_t PianoXmlParseTranformStation (const char *searchXml) { return PIANO_RET_OK; } + +PianoReturn_t PianoXmlParseNarrative (const char *xml, char **retNarrative) { + xmlNode *docRoot; + xmlDocPtr doc; + PianoReturn_t ret; + + if ((ret = PianoXmlInitDoc (xml, &doc, &docRoot)) != PIANO_RET_OK) { + return ret; + } + + xmlNode *val = docRoot->children->children->children->children; + *retNarrative = strdup ((char *) val->content); + + xmlFreeDoc (doc); + + return ret; +} |