Closed GoogleCodeExporter closed 8 years ago
Try this one:
- $content = phpQuery::newDocument('<br/>');
+ $content = phpQuery::newDocumentXML('<br/>');
http://www.google.com/codesearch?q=newdocumentxml+package%3Ahttp%3A%2F%2Fphpquer
y\.googlecode\.com&origq=newdocumentxml&btnG=Search+Trunk
Original comment by tobiasz....@gmail.com
on 19 Sep 2009 at 6:06
Ah. Thanks. Not sure that will solve my problem, but at least that explains
what's
going on.
Original comment by adamp...@gmail.com
on 20 Sep 2009 at 4:00
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.
Original comment by tobiasz....@gmail.com
on 10 Oct 2009 at 9:01
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.
Original comment by bigbluehat
on 11 Nov 2009 at 3:52
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.
Original comment by tobiasz....@gmail.com
on 11 Nov 2009 at 4:33
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.
Original comment by bigbluehat
on 13 Nov 2009 at 3:05
Attachments:
Original issue reported on code.google.com by
adamp...@gmail.com
on 19 Sep 2009 at 6:12