Having an xpointer() function, be on DOMXPath or DOMXPointer, may enable having an userland XInclude 1.1 XPointer implementation, line the XInclude by xml:id one. In other worlds, maybe it will possible to get rid of Random removing duplicated xml:id fixup
This come as an surprise for me. Nowhere in w3c recomendations, XPointer are callable, beyond XInclude stuff?
@nielsdos Maybe a new Dom\XPointer, sibling of Dom\XPath? $xp = new XPointer( $dom ); as usual, and then $xp->query( string );
It would be not spec-compliant, though, and may stand out as sore thumb in new namespace. So maybe creating an old style DOMXPointer, or merely an xpointer() method on DOMXPath maybe be better (some docs says XPointer is an extension on XPath, so it would be not so crazy).
@AndréLFSBacci our xpath API is also unique to php and not something defined by whatwg, so I don't worry about the spec compliance aspect. Xpath and Xpointer have overlap so I would need to check whether this is better done on its own class or as a method on xpath.
@nielsdos Yes... As libxml2 has no concrete plans for XInclude 1.1, and manuals nearing libxml2 hard coded limits, it may be would be necessary to piercewise load each file and painfully run each XPointer, so to circumvent these limits.
@AndréLFSBacci I see you tagged me on GitHub about one of those limits. I will have a look at github when I get home. It's probably possible to raise the limit from within PHP using FFI
No rush. Yet, it would be very reassuring if both limits can be changed. From my work on file-entities.php.in, I think manuals are nearing tripping one limit, and already need workarounds for the other.
@AndréLFSBacci I thought about this more. I think an xpointer() method would be awkward to have on XPath because we already have a "query" and "evaluate" method that work on XPath itself. xpointer() would be out of place...
Do the design you think is the best. Simply by having xpointer() funcionality enables an alternative for if/when manuals become to large to be loaded. Although I can imagine a more immediate use. Live testing XPointers, without rebuilding .manual.xml from scratch, every time.
Thank you. And again, no rush. I think it's much more important that you do what you had already planned than this. But once it's done, make sure to show the whole world that it can be done in PHP, which apparently isn't impossible elsewhere =D
heh. so I wanted to dynamically cast an unknown int backed enum from its string class name, and I thought it would be Forbidden™, but I'm quite happy that $someArbitraryString::tryFrom(123) actually works.