Code Monkey home page Code Monkey logo

Comments (5)

technosophos avatar technosophos commented on August 16, 2024

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.

roooriii avatar roooriii commented on August 16, 2024

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.

technosophos avatar technosophos commented on August 16, 2024

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.

roooriii avatar roooriii commented on August 16, 2024

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.

technosophos avatar technosophos commented on August 16, 2024

Marking this as closed, and working on the new issue.

Thanks!

from querypath.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.