DOMDocument: Ignore Duplicate Element IDs

后端 未结 3 2195
广开言路
广开言路 2020-12-17 23:51

I\'m putting some page content (which has been run through Tidy, but doesn\'t need to be if this is a source of problems) into DOMDocument using DOMDocume

3条回答
  •  情深已故
    2020-12-18 00:17

    By definition, IDs are unique. If they are not, you should use classes instead (nor names, where it applies).
    I doubt you can force XML tools to ignore duplicate IDs, that will make them handle an invalid XML document.

提交回复
热议问题