FAQ
I try to use domxml to work with xhtml documents.
I load a file domxml_open_file($filePath) and then use xpath to get
content from certain elements out of this document.

It works fina as long as there are no special chars in the xhtml file,
html entities like   ü etc.

searching the web I came across this article from the list
http://www.zend.com/lists/php-dev/200206/msg00552.html

so I changed my code to use
domxml_open_file($filePath,DOMXML_LOAD_VALIDATING,$error)

but this seems not to work for xhtml files with the regular html dtd

my documents start like
<?xml version="1.0" encoding="ISO-8859-1" ?>
<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">

So what happens?
When I turn on the validating Apache takes about 2 minutes to load the
page (it tries to load the dtd?) and then I get the $error

Array ( [0] => Array ( [line] => 3 [col] => 26 [directory] => . [file]
=> ./content.html [errormessage] => Validation failed: no DTD found ! )
[1] => Array ( [errormessage] => Entity 'uuml' not defined [nodename] =>
h2 [line] => 9 [col] => 72 [directory] => . [file] => ./content.html ) )

"no DTD found"


So, question: does this work for xhtml at all? What yould I need to
change to make it work?


thanks
Jens

--
Jens Ansorg <liste@ja-web.de>

Search Discussions

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupphp-internals @
categoriesphp
postedJan 5, '04 at 11:35a
activeJan 5, '04 at 11:35a
posts1
users1
websitephp.net

1 user in discussion

Jens Ansorg: 1 post

People

Translate

site design / logo © 2022 Grokbase