WordPress.org

Forums

using DOM in plugins (3 posts)

  1. SloBros
    Member
    Posted 4 years ago #

    I have trouble understanding how some things are related.

    For a plugin, I would like to use HTML DOM on content from wp_remote_open to find a string.

    In order to use DOM, does it have to be enabled by my webhost? or do I include a DOM parsing script with the plugin?

    I was thinking that if it needs to be enabled by the webhosting company, I would rather use a regular expression to find the string because then it would be compatible for everyone's installation.

  2. s_ha_dum
    Member
    Posted 4 years ago #

    Do you mean "Document Object Model"? That isn't really something that is installed or enabled, so no, you don't need anything special on the server.

  3. jackone2011
    Member
    Posted 4 years ago #

    The document object model is a part of the browser. You don't need to worry about it.

    If you want to use methods to traverse the DOM tree you need to look at methods in PHP or Javascript.

    As a rule of thumb never use regular expressions to replace DOM traversing. It's very slow in comparison.

Topic Closed

This topic has been closed to new replies.

About this Topic