GithubHelp home page GithubHelp logo

ParseFromString does not work about jsdav HOT 8 CLOSED

drahgon55 avatar drahgon55 commented on July 18, 2024
ParseFromString does not work

from jsdav.

Comments (8)

mikedeboer avatar mikedeboer commented on July 18, 2024

thank you for the report! I will check it out as soon as I can/ have time!
What kind of system do you use lighttpd on?

from jsdav.

drahgon55 avatar drahgon55 commented on July 18, 2024

I use lighttpd on the Palm Pre running webos 1.4.5. It is a linux based smartphone. I cannot remember the kernal version . It is 2.6.something. I'm using your server on webos 2.0. Which has is also linux based. So far uploads work since my webdav client library does not use xml for uploads and I se all my files through firefox since it uses a GET command and also does rely on xml. I'm going to try for now to use a get command to get a list of all files as a short term work around. I tried to fix the error but my node.js skills are pretty bad. So thanks for looking into this and great program! Please let me know your progress on this and if I can do any testing for you.

from jsdav.

mikedeboer avatar mikedeboer commented on July 18, 2024

I'm sorry for the questions, but I have to ask: which client library are you using? I could also be a bug in there... I'd like to take a look at its source or download the binary and try with that.
Thank you!

from jsdav.

drahgon55 avatar drahgon55 commented on July 18, 2024

its no problem. Here is the link to the original client library. I have made some modifications but mainly just exception handling so the functionality should remain the same as my version. I am using it without any authentication at the moment.

http://kvdb.net/projects/webdav/

from jsdav.

drahgon55 avatar drahgon55 commented on July 18, 2024

OK so I think I understand what is going on with this issue. I have been using jsDAV on webOS, which does not allow the use of node binary packages. o3 is a binary package therefore it does not load it. The latest version of jsDAV uses libxml which is based still off of o3 so I ran into the same issue.

I was however able to get the xml parsing working using the jsdom package. Since jsdom using creates a document object, it is compatible with the existing libxml implementation used in jsDAV. getting this to work only required changing three lines of code in Util.js.

I had to modify it to work without the Contextify package dependency, since Contextify contains binary dependencies, but I am able to parse xml now. This allows jsDAV to work completely using only javascript packages which makes it more versatile and cross-platform.

from jsdav.

mikedeboer avatar mikedeboer commented on July 18, 2024

hi @drahgon55 ! I would like to know how you changed to jsdom? It's probably obvious, but I'd still like to know!
Many thanks in advance...

from jsdav.

drahgon55 avatar drahgon55 commented on July 18, 2024

I had first quickly modified jsdom to work without the contextify package since it is a native binary package. This step is optional, but for me webOS does not allow native binaries so it was necessary. Then I added in these line in util.js

var jsdom = require("./jsdom/lib/jsdom").jsdom;

and on line 534(in the loadDOMDocument function) I added
document = jsdom(exports.convertDAVNamespace(xml)),
root = exports.xmlParseError(document);

removed from the same line
root = exports.xmlParseError(Xml.parseFromString(exports.convertDAVNamespace(xml)).documentElement);

and from there everything should work as expected. Let me know if you have any more questions or I can attempt to push my changes, if you need me to.

from jsdav.

mikedeboer avatar mikedeboer commented on July 18, 2024

jsDAV has changed A LOT in two years. Current release is v0.3.0. Closing this issue, because it cannot be reproduced.

If you find this decision to be in error, please reopen the issue.

from jsdav.

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.