My favorites | Sign in
Project Logo
                
Details: Show all Hide all

Last 30 days

  • Dec 20, 2009
    issue 141 (E_NOTICE error when parsing file without <head> tag) reported by johnkary   -   What steps will reproduce the problem? 1. Load template with <html> tag, but no <head> tag: <!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"> <body> <div class="mydiv"> <strong>Hi</strong> </div> </body> </html> 2. Try to fetch class="mydiv" node. $document = phpQuery::newDocumentFile('/path/to/file.html'); foreach ($document['.mydiv'] as $line) { exit; } 3. xdebug stack trace generated: ( ! ) Notice: Undefined variable: hltml in /Applications/MAMP/htdocs/noah/lib/phpQuery/phpQuery/phpQuery/DOMDocumentWrapper.p hp on line 389 Call Stack # Time Memory Function Location 1 0.0007 75316 {main}( ) ../index.php:0 2 0.0245 1549648 phpQuery::newDocumentFile( ) ../index.php:41 3 0.0246 1550236 phpQuery::createDocumentWrapper( ) ../phpQuery.php:408 4 0.0247 1552016 DOMDocumentWrapper->__construct( ) ../phpQuery.php:497 5 0.0247 1552380 DOMDocumentWrapper->load( ) ../DOMDocumentWrapper.php:49 6 0.0247 1553088 DOMDocumentWrapper->loadMarkup( ) ../DOMDocumentWrapper.php:63 7 0.0248 1554656 DOMDocumentWrapper->loadMarkupHTML( ) ../DOMDocumentWrapper.php:116 8 0.0250 1557976 DOMDocumentWrapper->charsetAppendToHTML( ) ../DOMDocumentWrapper.php:193 What is the expected output? What do you see instead? Please use labels and text to provide additional information. Caused by a misspelled variable. Easy fix. Patch attached.
    What steps will reproduce the problem? 1. Load template with <html> tag, but no <head> tag: <!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"> <body> <div class="mydiv"> <strong>Hi</strong> </div> </body> </html> 2. Try to fetch class="mydiv" node. $document = phpQuery::newDocumentFile('/path/to/file.html'); foreach ($document['.mydiv'] as $line) { exit; } 3. xdebug stack trace generated: ( ! ) Notice: Undefined variable: hltml in /Applications/MAMP/htdocs/noah/lib/phpQuery/phpQuery/phpQuery/DOMDocumentWrapper.p hp on line 389 Call Stack # Time Memory Function Location 1 0.0007 75316 {main}( ) ../index.php:0 2 0.0245 1549648 phpQuery::newDocumentFile( ) ../index.php:41 3 0.0246 1550236 phpQuery::createDocumentWrapper( ) ../phpQuery.php:408 4 0.0247 1552016 DOMDocumentWrapper->__construct( ) ../phpQuery.php:497 5 0.0247 1552380 DOMDocumentWrapper->load( ) ../DOMDocumentWrapper.php:49 6 0.0247 1553088 DOMDocumentWrapper->loadMarkup( ) ../DOMDocumentWrapper.php:63 7 0.0248 1554656 DOMDocumentWrapper->loadMarkupHTML( ) ../DOMDocumentWrapper.php:116 8 0.0250 1557976 DOMDocumentWrapper->charsetAppendToHTML( ) ../DOMDocumentWrapper.php:193 What is the expected output? What do you see instead? Please use labels and text to provide additional information. Caused by a misspelled variable. Easy fix. Patch attached.
  • Dec 19, 2009
    issue 140 (Importance - Cannot load XHTML if the content has been the c...) reported by TaoThanhVan   -   i cantnot create object with phpQuery::newDocumentFileXHTML($template) or phpQuery::newDocumentXHTML($template) if the content have been the character "&" the code: <?php require('lib/phpQuery/phpQuery/phpQuery.php'); echo "<pre>"; $template1 = "<a href='?a=5&b=6'>ss&66</a>"; $a = phpQuery::newDocumentXHTML($template1); ?> the error: Fatal error: Uncaught exception 'Exception' with message 'Error loading XML markup' in F:\Install\xampp\htdocs\cms\lib\phpQuery\phpQuery\phpQuery\DOMDocumentWrapper.php:296 Stack trace: #0 F:\Install\xampp\htdocs\cms\lib\phpQuery\phpQuery\phpQuery\DOMDocumentWrapper.php(522): DOMDocumentWrapper->loadMarkupXML('<?xml version="...') #1 F:\Install\xampp\htdocs\cms\lib\phpQuery\phpQuery\phpQuery\DOMDocumentWrapper.php(255): DOMDocumentWrapper->documentFragmentLoadMarkup(Object(DOMDocumentWrapper), 'UTF-8', '???<div id="men...') #2 F:\Install\xampp\htdocs\cms\lib\phpQuery\phpQuery\phpQuery\DOMDocumentWrapper.php(95): DOMDocumentWrapper->loadMarkupXML('???<div id="men...', NULL) #3 F:\Install\xampp\htdocs\cms\lib\phpQuery\phpQuery\phpQuery\DOMDocumentWrapper.php(63): DOMDocumentWrapper->loadMarkup('???<div id="men...') #4 F:\Install\xampp\htdocs\cms\lib\phpQuery\phpQuery\phpQuery\DOMDocumentWrapper.php(49): DOMDocumentWrapper->load('???<div id="men...', 'application/xht...', NULL) #5 F:\Install\xampp\htdocs\cms\lib\phpQuery\php in F:\Install\xampp\htdocs\cms\lib\phpQuery\phpQuery\phpQuery\DOMDocumentWrapper.php on line 296
    i cantnot create object with phpQuery::newDocumentFileXHTML($template) or phpQuery::newDocumentXHTML($template) if the content have been the character "&" the code: <?php require('lib/phpQuery/phpQuery/phpQuery.php'); echo "<pre>"; $template1 = "<a href='?a=5&b=6'>ss&66</a>"; $a = phpQuery::newDocumentXHTML($template1); ?> the error: Fatal error: Uncaught exception 'Exception' with message 'Error loading XML markup' in F:\Install\xampp\htdocs\cms\lib\phpQuery\phpQuery\phpQuery\DOMDocumentWrapper.php:296 Stack trace: #0 F:\Install\xampp\htdocs\cms\lib\phpQuery\phpQuery\phpQuery\DOMDocumentWrapper.php(522): DOMDocumentWrapper->loadMarkupXML('<?xml version="...') #1 F:\Install\xampp\htdocs\cms\lib\phpQuery\phpQuery\phpQuery\DOMDocumentWrapper.php(255): DOMDocumentWrapper->documentFragmentLoadMarkup(Object(DOMDocumentWrapper), 'UTF-8', '???<div id="men...') #2 F:\Install\xampp\htdocs\cms\lib\phpQuery\phpQuery\phpQuery\DOMDocumentWrapper.php(95): DOMDocumentWrapper->loadMarkupXML('???<div id="men...', NULL) #3 F:\Install\xampp\htdocs\cms\lib\phpQuery\phpQuery\phpQuery\DOMDocumentWrapper.php(63): DOMDocumentWrapper->loadMarkup('???<div id="men...') #4 F:\Install\xampp\htdocs\cms\lib\phpQuery\phpQuery\phpQuery\DOMDocumentWrapper.php(49): DOMDocumentWrapper->load('???<div id="men...', 'application/xht...', NULL) #5 F:\Install\xampp\htdocs\cms\lib\phpQuery\php in F:\Install\xampp\htdocs\cms\lib\phpQuery\phpQuery\phpQuery\DOMDocumentWrapper.php on line 296
  • Dec 09, 2009
    WebBrowser Wiki page commented on by Bannistered   -   When trying "Example 2" I receive the error: "Fatal error: Uncaught exception 'Exception' with message 'Request not permitted, host 'www.google.com' not present in phpQuery::$ajaxAllowedHosts'"
    When trying "Example 2" I receive the error: "Fatal error: Uncaught exception 'Exception' with message 'Request not permitted, host 'www.google.com' not present in phpQuery::$ajaxAllowedHosts'"
  • Dec 07, 2009
    CommandLineInterface Wiki page commented on by pou...@163.com   -   Great thanks for your phpquery.Really useful for a jquery user under php.
    Great thanks for your phpquery.Really useful for a jquery user under php.
  • Dec 03, 2009
    Basics Wiki page commented on by kadir.korkmaz   -   you need to put actual working demo and cut down dependencies to only php5.2
    you need to put actual working demo and cut down dependencies to only php5.2

Earlier this year

  • Nov 25, 2009
    issue 85 (XML and HTML conversions) commented on by bigbluehat   -   I'm afraid this is really hacky, but it does the trick: // $t is the (X)HTML phpQuery object of the processed template $final = phpQuery::newDocumentXML('<root/>'); $really_final = phpQuery::newDocumentXHTML($final['root']->append($t)->html()); print $really_final; Basically, re-running it through phpQuery a third time got things into the destination format (XHTML). Not ideal from a speed perspective, but the page displays correctly. :) If you can point me in the right direction phpQuery code wise, I'd be happy to help fix this bug. phpQuery's increasingly part of my set of tools. Thanks.
    I'm afraid this is really hacky, but it does the trick: // $t is the (X)HTML phpQuery object of the processed template $final = phpQuery::newDocumentXML('<root/>'); $really_final = phpQuery::newDocumentXHTML($final['root']->append($t)->html()); print $really_final; Basically, re-running it through phpQuery a third time got things into the destination format (XHTML). Not ideal from a speed perspective, but the page displays correctly. :) If you can point me in the right direction phpQuery code wise, I'd be happy to help fix this bug. phpQuery's increasingly part of my set of tools. Thanks.
  • Nov 25, 2009
    issue 85 (XML and HTML conversions) commented on by bigbluehat   -   Another issue related to this hack is that textarea fields end up being "open" if they're empty. Meaning, if code is added to the HTML that contains something like this: <textarea id="comments"></textarea><div class="button"><input....</div> That gets turned into: <textarea id="comments"><div class="button"><input....</div> Which, of course, means the rest of the document is loaded into the textarea rather than as normal HTML. I'm still hunting down a work around.
    Another issue related to this hack is that textarea fields end up being "open" if they're empty. Meaning, if code is added to the HTML that contains something like this: <textarea id="comments"></textarea><div class="button"><input....</div> That gets turned into: <textarea id="comments"><div class="button"><input....</div> Which, of course, means the rest of the document is loaded into the textarea rather than as normal HTML. I'm still hunting down a work around.
  • Nov 25, 2009
    issue 132 (Line 517 change $hltml to $html as it's causing errors) commented on by tobiasz.cudnik   -   Issue 139 has been merged into this issue.
    Issue 139 has been merged into this issue.
  • Nov 25, 2009
    issue 139 (Notice: Undefined variable: hltml in [cut]/phpQuery.php on l...) changed by tobiasz.cudnik   -   Duplicate of Issue 132 .
    Status: Duplicate
    Duplicate of Issue 132 .
    Status: Duplicate
  • Nov 24, 2009
    issue 139 (Notice: Undefined variable: hltml in [cut]/phpQuery.php on l...) reported by bancaf   -   What steps will reproduce the problem? 1. downloaded phpQuery-0.9.5.386-onefile.zip 2. included in mproject 3. executed phpQuery::newDocument($some_ripped_html_from_www); What is the expected output? What do you see instead? - the Notice appears, saying hltml is not defined. What version of the product are you using? On what operating system? - 0.9.5.386 Please provide any additional information below. - it's a typo, fixed myself putting html in place of hltml on the line 517: :: if (strpos($hltml, '<html') === false) { -> :: if (strpos($html, '<html') === false) {
    What steps will reproduce the problem? 1. downloaded phpQuery-0.9.5.386-onefile.zip 2. included in mproject 3. executed phpQuery::newDocument($some_ripped_html_from_www); What is the expected output? What do you see instead? - the Notice appears, saying hltml is not defined. What version of the product are you using? On what operating system? - 0.9.5.386 Please provide any additional information below. - it's a typo, fixed myself putting html in place of hltml on the line 517: :: if (strpos($hltml, '<html') === false) { -> :: if (strpos($html, '<html') === false) {
  • Nov 18, 2009
    issue 138 (XML file not being parsed) Status changed by tobiasz.cudnik   -   Hi, newDocument reads string markup, use newDocumentFile for files. - $query = phpQuery::newDocument('enrolment.xml'); + $query = phpQuery::newDocumentFile('enrolment.xml');
    Status: Invalid
    Hi, newDocument reads string markup, use newDocumentFile for files. - $query = phpQuery::newDocument('enrolment.xml'); + $query = phpQuery::newDocumentFile('enrolment.xml');
    Status: Invalid
  • Nov 18, 2009
    issue 138 (XML file not being parsed) reported by ibnormedia   -   What steps will reproduce the problem? 1. Load attached well-formed XML file 2. Attempt to read/modify using phpQuery $query = phpQuery::newDocument('enrolment.xml'); print_r('<pre>'); foreach(pq('report ranges range') as $range) { print_r(pq($range)->text()); } print_r($query); What is the expected output? TodayThis WeekLast Week(... etc) (Output of print_ring a phpQuery object) What do you see instead? (Output of print_ring an uninitialised phpQuery object) What version of the product are you using? On what operating system? 0.9.5
    What steps will reproduce the problem? 1. Load attached well-formed XML file 2. Attempt to read/modify using phpQuery $query = phpQuery::newDocument('enrolment.xml'); print_r('<pre>'); foreach(pq('report ranges range') as $range) { print_r(pq($range)->text()); } print_r($query); What is the expected output? TodayThis WeekLast Week(... etc) (Output of print_ring a phpQuery object) What do you see instead? (Output of print_ring an uninitialised phpQuery object) What version of the product are you using? On what operating system? 0.9.5
  • Nov 17, 2009
    issue 85 (XML and HTML conversions) commented on by bigbluehat   -   Issue 137 has some sample code and a little more test result info.
    Issue 137 has some sample code and a little more test result info.
  • Nov 17, 2009
    issue 137 (Enteties rewritten as characters in XML output) reported by bigbluehat   -   What steps will reproduce the problem? 1. Load XML with entities in it into phpQuery via newDocumentXML 2. Output the phpQueried XML What is the expected output? What do you see instead? The same XML that went in. What version of the product are you using? On what operating system? 0.9.5 RC1 on Mac OS X 10.6.1 Please provide any additional information below. A test script is attached.
    What steps will reproduce the problem? 1. Load XML with entities in it into phpQuery via newDocumentXML 2. Output the phpQueried XML What is the expected output? What do you see instead? The same XML that went in. What version of the product are you using? On what operating system? 0.9.5 RC1 on Mac OS X 10.6.1 Please provide any additional information below. A test script is attached.
  • Nov 17, 2009
    issue 85 (XML and HTML conversions) commented on by bigbluehat   -   New issue (which I'll file), but it's related to this fix. Numeric entities (and maybe others) are being translated into their character equivalents and output as characters--which breaks validation. Renders fine, though.
    New issue (which I'll file), but it's related to this fix. Numeric entities (and maybe others) are being translated into their character equivalents and output as characters--which breaks validation. Renders fine, though.
  • Nov 17, 2009
    issue 85 (XML and HTML conversions) commented on by bigbluehat   -   Thanks so much for the quick reply. Here's what I've implemented from your recommendation and it works like a charm: $t = phpQuery::newDocument($template_html); // ... manipulation code .. $final = phpQuery::newDocumentXML('<root/>'); print $final['root']->append($t)->html(); This worked perfectly. It output just the contents of <root/> and allowed the page to validate. I've not done speed tests at this point, but I'd assume it's quite a bit faster as there's a good bit less parsing going on. Thanks for the tip. I'd think (while maybe a hack) this it'd be easy enough to implement somewhere within phpQuery. If I can help, please let me know. I really enjoy phpQuery and look forward to using it more. Thanks, again for the quick help.
    Thanks so much for the quick reply. Here's what I've implemented from your recommendation and it works like a charm: $t = phpQuery::newDocument($template_html); // ... manipulation code .. $final = phpQuery::newDocumentXML('<root/>'); print $final['root']->append($t)->html(); This worked perfectly. It output just the contents of <root/> and allowed the page to validate. I've not done speed tests at this point, but I'd assume it's quite a bit faster as there's a good bit less parsing going on. Thanks for the tip. I'd think (while maybe a hack) this it'd be easy enough to implement somewhere within phpQuery. If I can help, please let me know. I really enjoy phpQuery and look forward to using it more. Thanks, again for the quick help.
  • Nov 13, 2009
    issue 85 (XML and HTML conversions) commented on by tobiasz.cudnik   -   Continuing discussion from issue 133 , consider following code: $pq1 = phpQuery::newDocumentHTML("<p><br><a href='/?foo=1&bar=2'>href</a></p>"); $pq2 = phpQuery::newDocumentXML("<root/>"); $pq2['root']->append($pq1); print $pq2; It means that node level conversion is perfectly possible using already implemented injection methods. New methods should probably be implemented using this approach also. You're very welcome to give yourself a try with them if you want. Only important factor to have on mind here is leaving the possibility of easy charset conversion to be implemented in the future. If you have any questions, feel free to mail me directly or on google group.
    Continuing discussion from issue 133 , consider following code: $pq1 = phpQuery::newDocumentHTML("<p><br><a href='/?foo=1&bar=2'>href</a></p>"); $pq2 = phpQuery::newDocumentXML("<root/>"); $pq2['root']->append($pq1); print $pq2; It means that node level conversion is perfectly possible using already implemented injection methods. New methods should probably be implemented using this approach also. You're very welcome to give yourself a try with them if you want. Only important factor to have on mind here is leaving the possibility of easy charset conversion to be implemented in the future. If you have any questions, feel free to mail me directly or on google group.
  • Nov 13, 2009
    issue 85 (XML and HTML conversions) commented on by bigbluehat   -   I'd be happy to do some in depth testing and bug reporting on this issue as it's a prime concern for my use of phpQuery (which I intend to continue for some time to come :) ). Please let me know if there are specific things I can do to help test/develop this issue.
    I'd be happy to do some in depth testing and bug reporting on this issue as it's a prime concern for my use of phpQuery (which I intend to continue for some time to come :) ). Please let me know if there are specific things I can do to help test/develop this issue.
  • Nov 13, 2009
    issue 133 (xhtml tags getting converted to html) commented on by bigbluehat   -   Here's the XML markup I'm currently fighting. After looking through the attached code again, it may be the &'s and named entities that are causing the issue. Sorry I missed issue 85 earlier. That's exactly what I need, I think.
    Here's the XML markup I'm currently fighting. After looking through the attached code again, it may be the &'s and named entities that are causing the issue. Sorry I missed issue 85 earlier. That's exactly what I need, I think.
  • Nov 11, 2009
    issue 133 (xhtml tags getting converted to html) commented on by tobiasz.cudnik   -   Please provide XML markup that causes the problem for the reference. I suppose what you need is customizable output covered by issue 85. Performance overhead there could be (probably) reduced by making the copy on nodes level, instead of string markup. In this issue please report valid XML code that's not handled properly.
    Please provide XML markup that causes the problem for the reference. I suppose what you need is customizable output covered by issue 85. Performance overhead there could be (probably) reduced by making the copy on nodes level, instead of string markup. In this issue please report valid XML code that's not handled properly.
  • Nov 11, 2009
    issue 133 (xhtml tags getting converted to html) commented on by bigbluehat   -   I'm experiencing this same issue. I'm using phpQuery to load partial XHTML chunks (template markup--just what's in the body, navigation lists, other chunks of markup). I then combine them all into a single document that's output inside a standard html/head wrapper that has an XHTML doctype. phpQuery wouldn't let me load the template markup as XML or XHTML. Both said they were invalid. There is a wrapping div, but that didn't seem to be the problem. What I've done for now is use the tidy extension to cleanup the markup...which is another processing hit, so not ideal. Here's the code ($t is a phpQuery object with the combined template markup): <code> $tidy_config = array('output-xhtml' => true); $tidy = new tidy; $tidy->parseString($t->htmlOuter(), $tidy_config, 'utf8'); $tidy->cleanRepair(); // Output $final = phpQuery::newDocumentXHTML($tidy); print $final['body']->html(); </code> Not ideal, but we're validating now. I'd love to see a configuration option or a method that would output any markup as XHTML. I often get markup from various sources, but I always want them out as XHTML. Thanks, Tobiasz.
    I'm experiencing this same issue. I'm using phpQuery to load partial XHTML chunks (template markup--just what's in the body, navigation lists, other chunks of markup). I then combine them all into a single document that's output inside a standard html/head wrapper that has an XHTML doctype. phpQuery wouldn't let me load the template markup as XML or XHTML. Both said they were invalid. There is a wrapping div, but that didn't seem to be the problem. What I've done for now is use the tidy extension to cleanup the markup...which is another processing hit, so not ideal. Here's the code ($t is a phpQuery object with the combined template markup): <code> $tidy_config = array('output-xhtml' => true); $tidy = new tidy; $tidy->parseString($t->htmlOuter(), $tidy_config, 'utf8'); $tidy->cleanRepair(); // Output $final = phpQuery::newDocumentXHTML($tidy); print $final['body']->html(); </code> Not ideal, but we're validating now. I'd love to see a configuration option or a method that would output any markup as XHTML. I often get markup from various sources, but I always want them out as XHTML. Thanks, Tobiasz.
  • Nov 09, 2009
    issue 136 (Notice: Undefined variable: hltml) changed by tobiasz.cudnik   -   Duplicate of Issue 132 .
    Status: Duplicate
    Duplicate of Issue 132 .
    Status: Duplicate
  • Nov 09, 2009
    issue 127 (Invalid variable name in single file version) commented on by tobiasz.cudnik   -   Issue 136 has been merged into this issue.
    Issue 136 has been merged into this issue.
  • Nov 09, 2009
    issue 132 (Line 517 change $hltml to $html as it's causing errors) commented on by tobiasz.cudnik   -   Issue 127 has been merged into this issue.
    Issue 127 has been merged into this issue.
  • Nov 09, 2009
    issue 127 (Invalid variable name in single file version) changed by tobiasz.cudnik   -   Duplicate of Issue 132 .
    Status: Duplicate
    Duplicate of Issue 132 .
    Status: Duplicate
  • Nov 09, 2009
    issue 136 (Notice: Undefined variable: hltml) reported by jaceju   -   Code: $doc = phpQuery::newDocumentFileHTML('test.html'); Error: Notice: Undefined variable: hltml in .....\phpQuery\phpQuery\DOMDocumentWrapper.php on line 389 Version: phpQuery-0.9.5.386
    Code: $doc = phpQuery::newDocumentFileHTML('test.html'); Error: Notice: Undefined variable: hltml in .....\phpQuery\phpQuery\DOMDocumentWrapper.php on line 389 Version: phpQuery-0.9.5.386
  • Nov 07, 2009
    issue 135 (DOMDocumentWrapper) changed by tobiasz.cudnik   -   Thank you for the the report and the solution.
    Status: Started
    Labels: Milestone-Release0.9.x Has-Patch
    Thank you for the the report and the solution.
    Status: Started
    Labels: Milestone-Release0.9.x Has-Patch
  • Nov 06, 2009
    issue 135 (DOMDocumentWrapper) reported by msd.shsk   -   I'm japanese. I do not understand an English grammar. Therefore,Only the code is written. ---contentTypeFromHTML----- > @<meta[^>]+http-equiv\\s*=\\s*(["|\'])Content-Type\\1([^>]+?)>@i This code can not match <META content="text/html;charset=Shift_JIS" http-equiv=Content-Type> change @<meta[^>]+http-equiv\\s*=\\s*(["|\']*)Content-Type\\1([^>]*?)>@i and > @content\\s*=\\s*(["|\'])(.+?)\\1@ change @content\\s*=\\s*(["|\'])(.+?)\\1@i ---charsetFixHTML----- > @\s*<meta[^>]+http-equiv\\s*=\\s*(["|\'])Content-Type\\1([^>]+?)>@i change @\s*<meta[^>]+http-equiv\\s*=\\s*(["|\']*)Content-Type\\1([^>]*?)>@i and > $headStart = stripos($markup, '<head>'); > $markup = substr($markup, 0, $headStart+6).$metaContentType > .substr($markup, $headStart+6); This code can not match <head profile="http://example.com"> etc... change preg_match('@<head[^>]*>@i', $markup, $matches, PREG_OFFSET_CAPTURE); if(!isset($matches[0])) return $markup; $headStart = $matches[0][1]; $headEnd = strlen($matches[0][0]); $markup = substr($markup, 0, $headStart+$headEnd).$metaContentType .substr($markup, $headStart+$headEnd);
    I'm japanese. I do not understand an English grammar. Therefore,Only the code is written. ---contentTypeFromHTML----- > @<meta[^>]+http-equiv\\s*=\\s*(["|\'])Content-Type\\1([^>]+?)>@i This code can not match <META content="text/html;charset=Shift_JIS" http-equiv=Content-Type> change @<meta[^>]+http-equiv\\s*=\\s*(["|\']*)Content-Type\\1([^>]*?)>@i and > @content\\s*=\\s*(["|\'])(.+?)\\1@ change @content\\s*=\\s*(["|\'])(.+?)\\1@i ---charsetFixHTML----- > @\s*<meta[^>]+http-equiv\\s*=\\s*(["|\'])Content-Type\\1([^>]+?)>@i change @\s*<meta[^>]+http-equiv\\s*=\\s*(["|\']*)Content-Type\\1([^>]*?)>@i and > $headStart = stripos($markup, '<head>'); > $markup = substr($markup, 0, $headStart+6).$metaContentType > .substr($markup, $headStart+6); This code can not match <head profile="http://example.com"> etc... change preg_match('@<head[^>]*>@i', $markup, $matches, PREG_OFFSET_CAPTURE); if(!isset($matches[0])) return $markup; $headStart = $matches[0][1]; $headEnd = strlen($matches[0][0]); $markup = substr($markup, 0, $headStart+$headEnd).$metaContentType .substr($markup, $headStart+$headEnd);
  • Oct 30, 2009
    jQueryServer Wiki page commented on by leestew...@randomoddness.com   -   $.server({url: 'http://c0.dymer.de/schedule.xhtml'}) .find('tr.DancingwiththeStars') .client(function(response){ $('.destination').html(response); });
    $.server({url: 'http://c0.dymer.de/schedule.xhtml'}) .find('tr.DancingwiththeStars') .client(function(response){ $('.destination').html(response); });
  • Oct 29, 2009
    WebBrowser Wiki page commented on by MarkStoddart   -   Yes, but you need to emulate the Javascript yourself.
    Yes, but you need to emulate the Javascript yourself.
  • Oct 10, 2009
    issue 130 (Ajax returns with <p> tags?) Labels changed by tobiasz.cudnik   -   I'm sorry but i cant reproduce it in any way. I've added new test case for this issue with r392. I've also checked this with ->load() and against trunk (i'm working on dev branch). Indeed there's <fake> root support and quite more other things in DOMDocumentWrapper to make everything works fine (mostly for XML documents). Only place where text nodes aren't supported on beginning of the string is pq() function, which threats them as selectors. Please check code from new TC, and post one which allows you to reproduce this issue.
    Labels: Milestone-Release0.9.x
    I'm sorry but i cant reproduce it in any way. I've added new test case for this issue with r392. I've also checked this with ->load() and against trunk (i'm working on dev branch). Indeed there's <fake> root support and quite more other things in DOMDocumentWrapper to make everything works fine (mostly for XML documents). Only place where text nodes aren't supported on beginning of the string is pq() function, which threats them as selectors. Please check code from new TC, and post one which allows you to reproduce this issue.
    Labels: Milestone-Release0.9.x
  • Oct 10, 2009
    issue 133 (xhtml tags getting converted to html) Status changed by tobiasz.cudnik   -   Expired. Please reopen if proposed solution doesn't work. In future it's possible to implement dirty XML-autodetection by strpos of "/>". But for now dedicated methods, XML declaration checking and MIME type dispatching should be enough.
    Status: Invalid
    Expired. Please reopen if proposed solution doesn't work. In future it's possible to implement dirty XML-autodetection by strpos of "/>". But for now dedicated methods, XML declaration checking and MIME type dispatching should be enough.
    Status: Invalid
  • Oct 10, 2009
    issue 132 (Line 517 change $hltml to $html as it's causing errors) changed by tobiasz.cudnik   -   Fixed with r392. Thank you for the report.
    Status: Fixed
    Labels: Milestone-Release0.9.x
    Fixed with r392. Thank you for the report.
    Status: Fixed
    Labels: Milestone-Release0.9.x
  • Oct 10, 2009
    r392 (- fixed ajax() notices - fixed #132 DOMDocumentWrapper typo ...) committed by tobiasz.cudnik   -   - fixed ajax() notices - fixed #132 DOMDocumentWrapper typo - fixed load() when no mb_string extension - added new ajax test case for #130
    - fixed ajax() notices - fixed #132 DOMDocumentWrapper typo - fixed load() when no mb_string extension - added new ajax test case for #130
  • Oct 10, 2009
    issue 134 (Loading markup with <html> tag containing attribute looses a...) reported by tobiasz.cudnik   -   Loading markup with <html> tag containing attribute looses attribute. Covered by test name "Attributes in HTML element" in test-cases/test_2.php.
    Loading markup with <html> tag containing attribute looses attribute. Covered by test name "Attributes in HTML element" in test-cases/test_2.php.
  • Oct 08, 2009
    issue 130 (Ajax returns with <p> tags?) commented on by tobiasz.cudnik   -   Will try to check it this weekend.
    Will try to check it this weekend.
  • Oct 08, 2009
    issue 130 (Ajax returns with <p> tags?) commented on by robinson.luke   -   There is some code within PHPQuery itself that adds in '<fake></fake>' elements, perhaps this is something similar that just isn't completed? Tobiasz, any chance of a reply?? How can we use PHPQuery without it wrapping <p> tags around things?
    There is some code within PHPQuery itself that adds in '<fake></fake>' elements, perhaps this is something similar that just isn't completed? Tobiasz, any chance of a reply?? How can we use PHPQuery without it wrapping <p> tags around things?
  • Oct 04, 2009
    issue 130 (Ajax returns with <p> tags?) commented on by Joseph.Ryan.Glover   -   Just a confirmation, the solution I proposed in comment 6 does work. Wrapping the html fragment in a dummy tag and then string replacing the output of pq works just fine.
    Just a confirmation, the solution I proposed in comment 6 does work. Wrapping the html fragment in a dummy tag and then string replacing the output of pq works just fine.
  • Oct 02, 2009
    issue 130 (Ajax returns with <p> tags?) commented on by Joseph.Ryan.Glover   -   I'm still trying to figure that out. I think the problem is more fundamental than phpQuery as the pq()->html() function ultimately uses php dom to do the work and it is the php dom function that is adding the <p> tags. From the perspective of the dom I can understand why it doesn't like fragments without a root level element. The fragment is illegal xml and the dom does what it can to conform it. I have an idea that I am exploring: insert the fragment with a dummy tag, say <pqfix>, save the whole dom to html, find and replace the dummy tag with an empty string, and then save the html again. This is a hacky kludge but the result is exactly what I want. How this helps ajax returns, I'm not sure. Maybe save the html fragment to a string as the final step in the php, do a find/replace for the dummy tag, and then send the string back as the ajax response?
    I'm still trying to figure that out. I think the problem is more fundamental than phpQuery as the pq()->html() function ultimately uses php dom to do the work and it is the php dom function that is adding the <p> tags. From the perspective of the dom I can understand why it doesn't like fragments without a root level element. The fragment is illegal xml and the dom does what it can to conform it. I have an idea that I am exploring: insert the fragment with a dummy tag, say <pqfix>, save the whole dom to html, find and replace the dummy tag with an empty string, and then save the html again. This is a hacky kludge but the result is exactly what I want. How this helps ajax returns, I'm not sure. Maybe save the html fragment to a string as the final step in the php, do a find/replace for the dummy tag, and then send the string back as the ajax response?
  • Oct 02, 2009
    issue 130 (Ajax returns with <p> tags?) commented on by robinson.luke   -   So how do we handle HTML fragments? Is it possible to create a new document and manipulate some HTML without altering it's conent / adding charsets / wrapping <p>'s ??
    So how do we handle HTML fragments? Is it possible to create a new document and manipulate some HTML without altering it's conent / adding charsets / wrapping <p>'s ??
  • Oct 02, 2009
    issue 130 (Ajax returns with <p> tags?) commented on by Joseph.Ryan.Glover   -   In my case, I was working with some html fragments such as "hello <b>world</b>" and trying to insert them into the dom under an <h1> tag. After investigating I think the php dom needs a top level element in the fragment in order to insert it into the dom and it uses <p> in the absence of anything else. If I try to insert the fragment "<span>hello <b>world</b></span>" it doesn't add the <p> tags.
    In my case, I was working with some html fragments such as "hello <b>world</b>" and trying to insert them into the dom under an <h1> tag. After investigating I think the php dom needs a top level element in the fragment in order to insert it into the dom and it uses <p> in the absence of anything else. If I try to insert the fragment "<span>hello <b>world</b></span>" it doesn't add the <p> tags.
  • Oct 02, 2009
    issue 130 (Ajax returns with <p> tags?) commented on by robinson.luke   -   Yeah, I've also seen this same problem - surely we must be doing something wrong???
    Yeah, I've also seen this same problem - surely we must be doing something wrong???
  • Oct 02, 2009
    issue 130 (Ajax returns with <p> tags?) commented on by rejuvenateproductions11   -   Yeah, I've also seen this same problem - surely we must be doing something wrong???
    Yeah, I've also seen this same problem - surely we must be doing something wrong???
  • Oct 01, 2009
    issue 130 (Ajax returns with <p> tags?) commented on by Joseph.Ryan.Glover   -   I'm experiencing something like this as well. I have some new text that I am sticking into an H1 node with pq($item)->html("Hello World"); but the node returns as <h1><p>Hello World</p></h1>.
    I'm experiencing something like this as well. I have some new text that I am sticking into an H1 node with pq($item)->html("Hello World"); but the node returns as <h1><p>Hello World</p></h1>.
  • Sep 27, 2009
    Selectors Wiki page commented on by evgenius   -   see source of web page and think what u need
    see source of web page and think what u need
  • Sep 19, 2009
    issue 133 (xhtml tags getting converted to html) commented on by adampasz   -   Ah. Thanks. Not sure that will solve my problem, but at least that explains what's going on.
    Ah. Thanks. Not sure that will solve my problem, but at least that explains what's going on.
  • Sep 19, 2009
    issue 133 (xhtml tags getting converted to html) commented on by tobiasz.cudnik   -   Try this one: - $content = phpQuery::newDocument('<br/>'); + $content = phpQuery::newDocumentXML('<br/>'); http://www.google.com/codesearch?q=newdocumentxml+package%3Ahttp%3A%2F%2Fphpquery\.googlecode\.com&origq=newdocumentxml&btnG=Search+Trunk
    Try this one: - $content = phpQuery::newDocument('<br/>'); + $content = phpQuery::newDocumentXML('<br/>'); http://www.google.com/codesearch?q=newdocumentxml+package%3Ahttp%3A%2F%2Fphpquery\.googlecode\.com&origq=newdocumentxml&btnG=Search+Trunk
  • Sep 18, 2009
    issue 133 (xhtml tags getting converted to html) reported by adampasz   -   What steps will reproduce the problem? 1. Create a pq object from '<br/>'. 2. Print the object. SAMPLE CODE $content = phpQuery::newDocument('<br/>'); print $content; What is the expected output? What do you see instead? expected: <br/> actual: <br> For full XHTML pages, this causes serious formatting problems. What version of the product are you using? On what operating system? 0.9.5.386
    What steps will reproduce the problem? 1. Create a pq object from '<br/>'. 2. Print the object. SAMPLE CODE $content = phpQuery::newDocument('<br/>'); print $content; What is the expected output? What do you see instead? expected: <br/> actual: <br> For full XHTML pages, this causes serious formatting problems. What version of the product are you using? On what operating system? 0.9.5.386
  • Sep 13, 2009
    issue 132 (Line 517 change $hltml to $html as it's causing errors) reported by manilodisan   -   Line 517 change $hltml to $html as it's causing errors
    Line 517 change $hltml to $html as it's causing errors
  • Sep 09, 2009
    Selectors Wiki page commented on by bala_ran...@yahoo.co.in   -   Hi, I want to put a plugin called wp-web-scraper, which uses these selectors. Can you tell me what selectors can I use to display google's latest news on my website at http://speedywap.com
    Hi, I want to put a plugin called wp-web-scraper, which uses these selectors. Can you tell me what selectors can I use to display google's latest news on my website at http://speedywap.com
 
Hosted by Google Code