ID: 24474 Updated by: [EMAIL PROTECTED] -Summary: get_element_by_id doesn`t work Reported By: grest at interia dot pl -Status: Feedback +Status: Suspended Bug Type: DOM XML related Operating System: WinXp PHP Version: 4.3.2 New Comment:
Changed summary as this is just a symptom of threading issues. When running in a multi-threaded environment AND libxml is using threads, the extensions behavior can not be predicted when using functions involving libxml globals. This includes functions not working as expected, inconsistent function behavior and possible crashes. Workaround: Run under CGI mode or use libxml without thread support. Suspending this for now Previous Comments: ------------------------------------------------------------------------ [2003-07-10 06:09:04] [EMAIL PROTECTED] can you provide the output from phpinfo either as a link to it or via email. Make sure it is run under apache and run from the same directory as your example is. ------------------------------------------------------------------------ [2003-07-09 18:19:52] grest at interia dot pl When I use in XSL file(filmy.xsl) just <xsl:variable name="out" select="document('today.xml')"/> it works fine. I needn`t to insert a full path('d:\www\grugar\today.xml') In XML it doesn`t work. I use: <!DOCTYPE LIST SYSTEM "filmy.dtd"> or <!DOCTYPE LIST SYSTEM "d:/www/grugar/filmy.dtd"> and always when I use get_element_by_id, I get a NULL! I`m sure that XML is not validated with filmy.dtd. I tested XML with two identical id (without error while loading!) or insert a mistakes into filmy.dtd and the domxml_open_file($fileName, DOMXML_LOAD_VALIDATING)does NOT return any errors or warnings. Conclusion: "filmy.dtd" is not loaded. Earlier, in similar case domxml_open_file returns error. ------------------------------------------------------------------------ [2003-07-09 14:55:10] [EMAIL PROTECTED] Works fine using syntax: "d:/www/grugar/filmy.dtd" or just "filmy.dtd". Looks like some pathing got fixed with apache 2. Unless you give full path for the save location, your output file will end up in Apache root directory. Are you sure that you are getting NULL back from get_element_by_id or is the problem that you just dont get your output file? ------------------------------------------------------------------------ [2003-07-09 14:07:46] grest at interia dot pl Little mistake in line 5. Once again: I try various path in filmy.xml to dtd file, like: <!DOCTYPE LIST SYSTEM "D:\WWW\grugar\filmy.dtd"> <!DOCTYPE LIST SYSTEM "D:/WWW/grugar/filmy.dtd"> <!DOCTYPE LIST SYSTEM "\\Serwer\WWW\grugar\filmy.dtd"> <!DOCTYPE LIST SYSTEM "d:/www/grugar/filmy.dtd"> and none of them works !! How should this path look?! For example the path in XSL file (filmy.xsl) works: filmy.xsl ... <xsl:variable name="out" select="document('d:/www/grugar/today.xml')"/> ... ------------------------------------------------------------------------ [2003-07-09 08:02:02] [EMAIL PROTECTED] Using Apache under windows you must use fullpath names with domxml. All filepaths are handled by libxml (not PHP) which when loaded uses the apache bin directory as the root directory. This includes the path to the DTD within your xml document, which is the reason that get_element_by_id is not working, as the DTD is not being loaded. ------------------------------------------------------------------------ The remainder of the comments for this report are too long. To view the rest of the comments, please view the bug report online at http://bugs.php.net/24474 -- Edit this bug report at http://bugs.php.net/?id=24474&edit=1