How to simply parse and print the XML with dxml?

Ferhat Kurtulmuş aferust at gmail.com
Thu Sep 9 17:34:33 UTC 2021


On Thursday, 9 September 2021 at 17:17:23 UTC, tastyminerals 
wrote:
> Maybe I missed something obvious in the docs but how can I just 
> parse the XML and print its content?
>
> ```
> import dxml.parser;
>
> auto xml = parseXML!simpleXML(layout);
> xml.map!(e => e.text).join.writeln;
> ```
>
> throws 
> `core.exception.AssertError at ../../../.dub/packages/dxml-0.4.3/dxml/source/dxml/parser.d(1457): text cannot be called with elementStart`.

I am not fully experienced with it, but once I used it for 
reading glade files [1]. I used dxml.dom. Hope it helps.

1: 
https://github.com/aferust/makegtkdclass/blob/master/source/gladeparser.d#L43


More information about the Digitalmars-d-learn mailing list