Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.os.linux.development.apps > #716
| From | Rainer Weikusat <rweikusat@mobileactivedefense.com> |
|---|---|
| Newsgroups | comp.os.linux.development.apps |
| Subject | Re: Failure to extract information using mini-XML v2.8 |
| Date | 2014-04-24 19:04 +0100 |
| Message-ID | <87lhuu8uyu.fsf@sable.mobileactivedefense.com> (permalink) |
| References | <Sl86v.121102$nm4.66014@fx27.iad> |
Lew Pitcher <lew.pitcher@digitalfreehold.ca> writes:
> While using miniXML v2.8 (http://www.msweet.org/projects.php?Z3) to read and
> process an XML document in a small C program, I came across a problem that
> I cannot surmount.
[...]
> For my demo, I have a dead simple XML document:
> <?xml version="1.0" encoding="utf-8"?><document>Hello, World</document>
[...]
> #include <stdio.h>
> #include <stdlib.h>
>
> #include <mxml.h>
>
> int main(void)
> {
> int rc = EXIT_FAILURE;
>
> mxml_node_t *xml, *doc;
> const char *text;
>
> xml = mxmlLoadFile(NULL,stdin,MXML_TEXT_CALLBACK);
> doc = mxmlFindElement(xml,xml,"document",NULL,NULL,MXML_DESCEND_FIRST);
> text = mxmlGetText(doc,NULL);
>
> if (text)
> {
> printf("Success: \"%s\"\n",text);
> rc = EXIT_SUCCESS;
> }
> else puts("Fail");
>
> return rc;
> }
As determined by examining the mini-XML (2.8) code and testing,
mxmlLoadFile (or, more correctly, the corresponding backend routine)
will only create 'interior value nodes' when the first argument to
mxmlLoadFile is not null.
Back to comp.os.linux.development.apps | Previous | Next — Previous in thread | Next in thread | Find similar
Failure to extract information using mini-XML v2.8 Lew Pitcher <lew.pitcher@digitalfreehold.ca> - 2014-04-24 09:30 -0400
Re: Failure to extract information using mini-XML v2.8 Rainer Weikusat <rweikusat@mobileactivedefense.com> - 2014-04-24 19:04 +0100
Re: Failure to extract information using mini-XML v2.8 Lew Pitcher <lew.pitcher@digitalfreehold.ca> - 2014-04-24 15:16 -0400
Re: Failure to extract information using mini-XML v2.8 Rainer Weikusat <rweikusat@mobileactivedefense.com> - 2014-04-24 20:45 +0100
Re: Failure to extract information using mini-XML v2.8 Lew Pitcher <lew.pitcher@digitalfreehold.ca> - 2014-04-24 16:02 -0400
csiph-web