domdocument Questions
5
Solved
Using PHP I'm attempting to take an HTML string passed from a WYSIWYG editor and replace the children of an element inside of a preloaded HTML document with the new HTML.
So far I'm loading the do...
Christogram asked 10/2, 2010 at 0:54
3
Solved
I'm trying to use the DOMDocument in PHP to add/parse things in an HTML document. From what I could read, setting the formOutput to true and preserveWhiteSpace to false should keep the tabs and new...
Shah asked 20/10, 2011 at 16:11
9
Solved
I recently re-opened an old (1 year) Symfony project and I am having an error on every page (I don't remember having this issue a year ago) :
[exception] 500 | Internal Server Error | Symfony\Comp...
Recurve asked 14/3, 2017 at 11:42
8
Solved
I'm trying to detect when my document height changes. Once it does, I need to run a few functions to help organize my page layout.
I'm not looking for window.onresize. I need the entire document, ...
Bangtail asked 14/2, 2013 at 2:16
2
Solved
I want to use XPath to get the href attribute from an a-tag, but it has two occurrences within the same file. How am I getting along?
I need to check IF there is an href attribute with value $stree...
Lubra asked 30/1, 2014 at 11:34
2
I'm using the following code to create a DOMDocument and validate it against an external xsd file.
<?php
$xmlPath = "/xml/some/file.xml";
$xsdPath = "/xsd/some/schema.xsd";
...
Procrastinate asked 24/9, 2019 at 11:27
4
Solved
How can I take all the attribute of an element? Like on my example below I can only get one at a time, I want to pull out all of the anchor tag's attribute.
$dom = new DOMDocument();
@$dom->loa...
Righthander asked 24/2, 2010 at 16:2
9
Solved
I have the following code
DocumentBuilderFactory dbFactory_ = DocumentBuilderFactory.newInstance();
Document doc_;
DocumentBuilder dBuilder = dbFactory_.newDocumentBuilder();
StringReader reader =...
Lobster asked 11/1, 2011 at 18:22
2
Solved
Sorry if this is reposted, but I can't wrap my mind around it and I've tried all the available documentation and examples I could find.
I am trying to get the first img element of a string contain...
Geniegenii asked 20/7, 2012 at 0:27
5
Solved
I am retreiving some html strings from my database and I would like to parse these strings into my DOMDocument. The problem is, that the DOMDocument gives warnings at special characters.
Warning...
Butyrate asked 10/1, 2011 at 10:25
2
Solved
How do I get the value of an input field like the one below where it does not have an ID attribute using PHP's DOMDocument?
<input type="text" name="make" value="Toyota">
Ventriloquy asked 21/11, 2011 at 20:14
5
I'm manipulating a short HTML snippet with XPath; when I output the changed snippet back with $doc->saveHTML(), DOCTYPE gets added, and HTML / BODY tags wrap the output. I want to remove those, but...
Repetend asked 2/5, 2012 at 15:20
4
For a legacy app we are rewriting parts of web app with React piece by piece. Because of this can't remove junks of document listeners completely. There are lots of different components all over th...
Cascabel asked 23/12, 2018 at 21:32
2
I am trying to get the plaintext from the given html. But, it is not possible for me.
for this, what I had done is
My html is in $content variable
Now, I am passing $content variable to php DomDo...
Ozuna asked 29/1, 2014 at 9:59
2
I've written a script in php to scrape a title visible as hair fall shamboo from a webpage. When I execute my below script, I get the following error:
Notice: Trying to get property 'nodeValue' ...
Saddlebow asked 6/10, 2018 at 18:33
4
I am using DOMDocument to manipulate / modify HTML before it gets output to the page. This is only a html fragment, not a complete page. My initial problem was that all french character got messed ...
Diacetylmorphine asked 19/8, 2010 at 15:31
3
Solved
If I use saveHTML() without the optional DOMnode parameter it works as expected:
$html = '<html><body><div>123</div><div>456</div></body></html>';
$...
Maintain asked 13/11, 2018 at 19:19
3
Solved
I want to read an SVG file and get the SVG tag from this file (because I want to show svg in html e.g. <div><svg>...</svg></div> without the xml header).
And show this svg...
Hamartia asked 1/5, 2015 at 16:52
3
Solved
Here is what I am trying to achieve : retrieve all products on a page and put them into an array. Here is the code I am using :
$page2 = curl_exec($ch);
$doc = new DOMDocument();
@$doc->loadHTM...
Nemertean asked 22/12, 2013 at 11:24
4
Solved
I need to parse some HTML files, however, they are not well-formed and PHP prints out warnings to. I want to avoid such debugging/warning behavior programatically. Please advise. Thank you!
Code:
...
Disrespectable asked 19/7, 2009 at 0:9
2
Solved
I have this sub that gets weather information from a weather API. It works on Windows 7 computers but not Windows 10. I get a "User-defined type not defined" error and it highlights the Dim Req As ...
Cuddy asked 18/4, 2017 at 14:15
3
Solved
I have a OFX file downloaded from Citibank, this file has a DTD defined at http://www.ofx.net/DownloadPage/Files/ofx102spec.zip (file OFXBANK.DTD), the OFX file appear to be SGML valid.
I'm trying ...
Grammarian asked 31/3, 2013 at 22:31
2
Solved
I have a DomElement which unfortunately does not have the saveXML() method that DomDocument has.
I am trying to get the raw XML string representation of the of the DomElement.
How can I do it?
Tong asked 15/12, 2015 at 18:7
3
Solved
I am parsing and fetching html documents to DOMDocument. Those documents are child forms that will be displayed inside another page. While saving parsed DOMDocuments, it automatically adds doctype,...
Nola asked 29/3, 2012 at 11:16
10
How to change the inner HTML of a PHP DOMElement?
For example, given the following HTML:
<div><p class="foo">Some <i>text</i></p></div>
How can I repl...
Socha asked 6/5, 2010 at 2:47
© 2022 - 2025 — McMap. All rights reserved.