We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
I'm trying to parse a simple rss feed:
const osmosis = require('osmosis'); const xml = `<?xml version="1.0" encoding="UTF-8"?> <rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/"> <channel> <title><![CDATA[Test]]></title> <link>http://www.example.com</link> <description><![CDATA[Lorem ipsum]]></description> <item> <title><![CDATA[Lorem ipsum]]></title> <link>http://www.example.com/</link> <description><![CDATA[Lorem ipsum dolor]]></description> <pubDate><![CDATA[Thu, 08 Mar 2018 00:09:56 -0300]]></pubDate> </item> <item> <title><![CDATA[Lorem ipsum]]></title> <link>http://www.example.com/</link> <description><![CDATA[Lorem ipsum dolor]]></description> <pubDate><![CDATA[Thu, 08 Mar 2018 00:09:56 -0300]]></pubDate> </item> </channel> </rss>`; osmosis .parse(xml) .find('item') .set({ title: 'title', link: 'link', }) .data(console.log);
But the output is always:
{ title: '', link: '' } { title: '', link: '' }
If I remove all the <![CDATA[ and ]]>, I get this output:
<![CDATA[
]]>
{ title: 'Lorem ipsum', link: '' } { title: 'Lorem ipsum', link: '' }
Which is still wrong :c This happens in both .parse(xml) and .get(url)... Looks like it happens to some (or all?) RSS feeds. Osmosis 1.1.6
.parse(xml)
.get(url)
Am I missing something?
The text was updated successfully, but these errors were encountered:
Successfully merging a pull request may close this issue.
I'm trying to parse a simple rss feed:
But the output is always:
If I remove all the
<![CDATA[
and]]>
, I get this output:Which is still wrong :c
This happens in both
.parse(xml)
and.get(url)
...Looks like it happens to some (or all?) RSS feeds. Osmosis 1.1.6
Am I missing something?
The text was updated successfully, but these errors were encountered: