+ // Sort node attributes (this is a compiler used for on-demand representation, this sorting is not permanent in the object which uses it):
+ if(flags & Mode::Sort) {
+ Node *nc_node = const_cast<Node*>(node);
+ std::sort(nc_node->attribute_begin(), nc_node->attribute_end(),
+ [](Attribute *a, Attribute *b) { return (std::strcmp(a->getName(), b->getName()) < 0); }); // sort alphabetically by attribute name
+ }
+