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

react native using xmldoc to parser xml #38

Closed
leechance opened this issue Oct 13, 2016 · 3 comments
Closed

react native using xmldoc to parser xml #38

leechance opened this issue Oct 13, 2016 · 3 comments

Comments

@leechance
Copy link

i want to use xmldoc to parse an in-memory XML string in my React-Native Project
in addtion,i have to 'npm install xmldoc' an the directory of my project.

in this case
`import React, { Component } from 'react';
import { AppRegistry, Text, View } from 'react-native';
class AwesomeProject extends Component {
render() {
this.testXml();
return (
<View style={{alignItems: 'center'}}>
浪费时间

);
}

testXml(){
// Demonstrate parsing an in-memory XML string
var xmldoc = require('xmldoc');
var xmlString = '';
}
}
AppRegistry.registerComponent('AwesomeProject', () => AwesomeProject);`

but caused an error

*Unable to resolve module stream from /Volumes/MAC/ReactNative/AwesomeProject/node_modules/sax/lib/sax.js: Unable to find this module in its module map or any of the node_modules directories under /Volumes/node_modules/stream and its parent directories
*

how to solve the issue ,can you help me?

@nfarina
Copy link
Owner

nfarina commented Oct 13, 2016

Hm, it looks like React Native is not pulling in the sax dependency. I'll try to repro this and investigate.

@leechance
Copy link
Author

thanks!!!
i have soloved the problem
if i want to use xmldoc to parse an in-memory XML , 'nmp install buffer' and 'npm install stream ' must be done first;

@i8wu
Copy link

i8wu commented Mar 29, 2017

omg thanks @leechance ...weird that it was complaining about sax and not buffer/stream.

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

No branches or pull requests

3 participants