Open puppetsquid opened 9 years ago
Came up with a rough potential implementation for this: https://github.com/kartoFlane/Slipstream-Mod-Manager/commit/a55226c2e30806457036108d784bb72a79896b9a It's functional, but kinda unwieldy and far from the perfect solution. The message in the linked commit goes into more detail on this.
Examples:
<mod:findComposite>
<mod:par op="AND">
<mod:findLike /> <!-- first, match all top-level tags... -->
<mod-not:findLike type="img" /> <!-- ...next, remove all <img> tags -->
</mod:par>
...
</mod:findComposite>
<mod:findComposite>
<mod:par op="AND">
<mod:findLike type="shipBlueprint" />
<mod-not:findWithChildLike child-type="droneList" />
</mod:par>
...
</mod:findComposite>
<mod:findComposite>
<mod:par op="AND">
<mod:findLike type="weaponBlueprint" />
<mod-not:findWithChildLike child-type="type">
<mod:selector>LASER</mod:selector>
</mod-not:findWithChildLike>
</mod:par>
...
</mod:findComposite>
I don't know if you're still updating this, but the Advanced XML could benefit from being able to search for tags based on attributes or children they do not have.
Personally I would most appreciate a findWithoutChildLike tag. e.g.
<mod:findWithoutChildLike type="abc" child-type="xyz">
(searches for 'abc' tags that do not contain an 'xyz' child)Alternatively, adding NOT/NOR/NAND to findComposites' tag may be more useful, if not as elegant.
e.g.
(searches for 'abc' tags and searches for tags which are not 'abc' with the child 'xyz' - outputs only 'abc' tags without the child 'xyz')