Comments (5)
Load the XML extension (QPXML) and use the cdata() QueryPath function:
http://api.querypath.org/docs/QueryPath/Extension/QPXML.html
There are examples of this in the unit tests:
http://github.com/technosophos/querypath/blob/master/test/Tests/QueryPath/Extensions/QPXMLTest.php
from querypath.
The cdata() function works, but i have another issue.
When i use qp() to load the string generated by cdata(), all the characters get messed up.
The string contains utf8 characters.
My guess is qp() can't handle utf8 string without a proper html or xml header?
from querypath.
There are lots of ways to work with character sets. This is probably easiest:
Get the CDATA section out, and then use one of the iconv or mb_convert_* functions to either work with the string as UTF-8 or transform it to another character set.
from querypath.
I find a bug in the cdata() method which may be the reason for the messed output
I have opened a new issue for that.
from querypath.
Marking this as closed, and working on the new issue.
Thanks!
from querypath.
Related Issues (20)
- Return DOM manipulated into a var ? HOT 1
- html5qp does not use stream contexts properly HOT 1
- When a document uses the same ID value multiple times, find() only finds the first instance.
- Drupal Module with version 3.0.5
- DOMNode::cloneNode(): ID Title3 already defined
- Entity 'nbsp' Not Defined when Parsing HTML HOT 1
- HTML5QP append() uses XML parsing HOT 1
- What is the oldest and newest versions of PHP that querypath works with? HOT 1
- DOMQuery::is() returns wrong results HOT 1
- I'm not seeing emoji characters after the html is processed by querypath. HOT 1
- ZeroWidth character with UTF8 encoding causes weird output
- xpath not work with tag
- bug: on getElementsByTagName returning null in case there is no element, attachNodeList ends up with Fatal error
- Using querypath library in php I am facing problem with hindi characters
- not working: ->find() method with direct child selector HOT 1
- Unicode Character utf-8 issues HOT 1
- DOMDocumentFragment::appendXML(): Entity: line 39: parser error : Entity 'nbsp' not defined
- Incorrect PHP version requirement documentation
- PHP 8.1 deprecated notice
- PHP 8.1: Deprecated function: trim()
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from querypath.