Questions tagged [domdocument]

DOMDocument refers to a class encapsulating the DOM (Document Object Model). Various languages and technologies use the name DOMDocument for this purpose, for example PHP, COM, C++, and ActiveX

If you are thinking of using this tag, then you might be looking for the Document Object Model tag:

In PHP, for example, the DOMDocument class represents an entire HTML or XML document and serves as the root of the document tree.

2749 questions
0
votes
3 answers

Get root node from DOM Document class

I am trying to get the root node of a PHP DOM Document. This is usually done by doing something like this: $doc->documentElement; However, trying this on a HTML string that contains a doctype:
Abs
  • 56,052
  • 101
  • 275
  • 409
0
votes
1 answer

Using PHP DOM to achieve the same as this Regular Expression?

I know understand that it's not advised to using regular expressions to parse HTML. I'm using the following regex to get the data inside of a element that comes directly after a element. $string = "Capture This"; $pattern =…
hhwhy
  • 23
  • 2
  • 4
0
votes
1 answer

PHP DOM Document LoadHTMLFile interrupted by parenthesis

I'm working on a PHP parser that parses my school's HTML 'groups' page. These are pages with a unique URL based on the name of the course and several other variables. The page consists of a bunch of HTML 's. Loading the HTML from the url…
Joey
  • 1,664
  • 3
  • 19
  • 35
0
votes
1 answer

Advanced writing to file

I am trying to write to this file here http://corporate.thechamberteam.com/livesearch/questions.htm when I add it keeps going of off the tags and the text ends up under and also to to make the question bold just like on that page, and…
0
votes
1 answer

Strict XHTML with MIME type "application/xhtml+xml": AJAX / PHP's DOMDocument class fails

I have modeled an AJAX search after this example a long time ago. I have changed some things - the whole request process is handled now via jquery. But the PHP file which is requested is basically the same. I have added an header for multibyte…
bekay
  • 1,800
  • 1
  • 12
  • 15
0
votes
1 answer

Array to XML: Howto import HTML as object to DOMDocument?

Possible Duplicate: How to insert HTML to PHP DOMNode? PHP and DOMDocument I am trying to write a Class that converts an array to XML using DOMDocument - and on top of that imports HTML into the DOM document. Problem is that the HTML is not…
Kristoffer Bohmann
  • 3,986
  • 3
  • 28
  • 35
0
votes
1 answer

DOMXPath query error , not working in web server

i am using the following code to grab some data from a site and store them in a database .
Quazi Marufur Rahman
  • 2,603
  • 5
  • 33
  • 51
0
votes
1 answer

my domdocument does not load xml file at all attemp

i have the following sub piece of code related to my given warning . $xml[0]="http://www.kat.ph/search/".$_POST['search']."/?rss=1"; //http://www.kat.ph $xml[1]="http://isohunt.com/js/rss/".$_POST['search']."?iht=";…
0
votes
1 answer

How to remove specific xml node using DOMDocument when multiple childNodes exist?

The standard way to remove a node using PHP's DOMDocument is: $dom = dom_import_simplexml($node); $dom->parentNode->removeChild($dom); The problem arises when there are multiple child nodes, as this method will simply delete the first child. For…
Fred Stevens-Smith
  • 468
  • 1
  • 4
  • 18
0
votes
1 answer

Counting the total item in an ATOM feed

I have a problem in counting the total items in this feed, $xml = ('http://www.huffingtonpost.com/author/index.php?author=simon-cohen'); $xmlDoc = new DOMDocument(); $xmlDoc -> load($xml); # Get and output "" elements. $x = $xmlDoc ->…
Run
  • 54,938
  • 169
  • 450
  • 748
0
votes
1 answer

PHP and DOMDocument

I have a question regarding the use of the DOMDocument and creating XML. I have a PHP program that loads in an XML file processes each node (row) of XML; sends it off to another process which then returns an XML element I get the string…
Rob
  • 173
  • 1
  • 5
  • 15
0
votes
2 answers

PHP DOMDocument : loadHTMLFile choking on a mysterious character: RS

Using php's DOMDocument->LoadHTMLFile('test.html'); keeps on returning an error to me, reporting for an error in the content at line 36. Deleting character after character, it turns out it's an apparently empty space that was the…
pixeline
  • 17,669
  • 12
  • 84
  • 109
0
votes
1 answer

edit text from/to an XML file : it works in localhost but not on internet? (php, xml)

i try to edit the text of an XML file from my page edit.php. It works fine if i test it in "localhost", the xml file is updated as expected. But, when i put the files on internet, and i try to edit the text from there, it seems to be ok, but then i…
Paul
  • 6,108
  • 14
  • 72
  • 128
0
votes
1 answer

VB6 DomDocument Update Node/Create new node

I am trying to put a username and password child into an XML element. I want it so that when the user enters their information, it will check to see if the elements exist. If it does, it will check to see if it is different. if it is different, it…
gberg927
  • 1,636
  • 9
  • 38
  • 51
0
votes
1 answer

PHP XML DOMDocument Remove Child by Attribute Value?

I am generating an XML File on the fly and want to remove certain childs by their attribute name. For example: Data.xml some text etc. some different…
Mike
  • 2,686
  • 7
  • 44
  • 61