Suppose there is such an xml, this can be not fixed {code ...} I first get an ID cut-off point through DOMDocument, as shown below: {code ...} excuse me, how can I quickly locate this cut point based on the DOMElement object, instead of getting it from the root directory Level 1 down, such as: {code ...} suppose there is such an xml file, which is not fixed.
test.1
test.2
test.3
test.4
test.5
...
I first get an ID cut point through DOMDocument, as shown below:
$ Dom = new DOMDocument; $ s1 = $ dom-> getElementByID ('s1'); // return a DOMElement object .. perform some column operations, for example, $ xpath = new \ DOMXpath; // obtain the cut-off point with the uv name attribute l1 under the ID cut-off point
Excuse me, how can IQuickly locate this cut point based on the DOMElement objectInstead of getting from the root directory Level 1, such:
(new DOMXpath)->query('/root/home/sea/uv[name=l1]');
Reply content:
Suppose there is such an xml file, which is not fixed.
test.1
test.2
test.3
test.4
test.5
...
I first get an ID cut point through DOMDocument, as shown below:
$ Dom = new DOMDocument; $ s1 = $ dom-> getElementByID ('s1'); // return a DOMElement object .. perform some column operations, for example, $ xpath = new \ DOMXpath; // obtain the cut-off point with the uv name attribute l1 under the ID cut-off point
Excuse me, how can IQuickly locate this cut point based on the DOMElement objectInstead of getting from the root directory Level 1, such:
(new DOMXpath)->query('/root/home/sea/uv[name=l1]');