Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Provide an API compatible abstraction to use node-xml as node-expat #44

Open
dhruvbird opened this issue Jul 20, 2012 · 6 comments
Open

Comments

@dhruvbird
Copy link
Collaborator

https://github.com/robrighter/node-xml

This allows anyone to use it (independent of platform) since node-xml is pure javascript (no C-bindings to libexpat1).

However, this comes at a cost:

This mode would be discouraged, but hopefully supported some time in the future.

@sonnyp
Copy link
Contributor

sonnyp commented Oct 2, 2013

I don't know if it helps but ltx support different backends
https://github.com/astro/ltx/tree/master/lib

node-xml is one of them

@dhruvbird
Copy link
Collaborator Author

ltx support different backends

Didn't know this - thanks for the info!

We use the SAX interface of node-expat, so this is of limited use for now :-/

@sonnyp
Copy link
Contributor

sonnyp commented Oct 2, 2013

What about switching to ltx?

@dhruvbird
Copy link
Collaborator Author

ltx doesn't have a sax parser - and it's used heavily to do the xml parsing since it's much more efficient to do that than dom parsing. Besides, it isn't easy to locate xml message boundaries when data is received over a socket from the xmpp server.

@sonnyp
Copy link
Contributor

sonnyp commented Oct 8, 2013

https://github.com/astro/ltx/tree/master/lib

Please see sax_node-xml.js

@dhruvbird
Copy link
Collaborator Author

@sonnyp That's an interesting starting point!
nxb uses methods specific to node-expat (such as getCurrentByteIndex) which are used to limit the buffer size and prevent buffer-build-up attacks against the bosh proxy.
It would be possible to build a failure mode that doesn't support these features and lacks these functions, but I don't see too many people asking for a windows build.
While it would be super to have something that works, it feels that having something that works and is performant and has all the required features might be a stretch in the near term :-/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants