What's dxml DOMEntity(R) type ?
Ferhat Kurtulmuş
aferust at gmail.com
Mon Jun 5 10:43:27 UTC 2023
On Monday, 5 June 2023 at 10:01:01 UTC, John Xu wrote:
> The parseDOM returns a DOMEntity(R) type, how do I write a
> xmlRoot as global variable?
> I need its detailed type (auto / Variant doesn't work).
>
>
> import dxml.dom;
> ?? xmlRoot;
> int main() {
> string xml = readText("a.xml");
> auto dom = parseDOM(xml);
> xmlRoot = dom.children[0];
> }
```d
import dxml.dom;
import std.stdio;
DOMEntity!string xmlRoot;
int main()
{
string xml = "<some></some>";
auto dom = parseDOM(xml);
writeln(typeof(dom.children[0]).stringof); // yields
"DOMEntity!string"
xmlRoot = dom.children[0];
return 0;
}
```
More information about the Digitalmars-d-learn
mailing list