APIs & Integrations

Glittenberg
Member

Rss/xml image tags are not closed

SOLVE

Hi, we are to post HubSpot rss feed on an external web site. Image tags in the rss xml are not closed, so the xsl wont compile the xml.

Any suggestions to fix this, or is there an option in HubSpot I have missed?

0 Upvotes
1 Accepted solution
cbarley
Solution
HubSpot Alumni
HubSpot Alumni

Rss/xml image tags are not closed

SOLVE

This is currently working as designed - we only include featured images in the RSS Listing Module when the RSS feed being included is that of a HubSpot hosted blog. This is because the concept of a featured image isn't part of the RSS feed standard (see http://www.rssboard.org/rss-profile for documentation of the standard), so when the feed is external, there's no universal way to identify the featured image for each post in an RSS feed. There seem to be some common ways people include featured images in the content:encoded element in their Wordpress (or other CMS') blog RSS feeds, but it can vary from blog to blog.

View solution in original post

0 Upvotes
11 Replies 11
cbarley
HubSpot Alumni
HubSpot Alumni

Rss/xml image tags are not closed

SOLVE

Thats okay @rolvskjaerpe! You didn't waste my time - I learned a bit more about XML/RSS in the process :smile:

0 Upvotes
CPCSupport
Participant

Rss/xml image tags are not closed

SOLVE

Just jumping in late to this conversation.

 

From what I can read is it possible to display the feature images from Hubspot Blog RSS feeds when you render them in WordPress or elsewhere?

 

I've been trying to work this out and so far have only found plugins that will output a list of blog posts as blog title and link.

 

What I need to do is to display the featured image and the blog title as a minimum (ideally the excerpt too or some of the content) AND then be able to filter this list on a page based on hubspot tags/categories.

 

Is this wishful thinking or is possible?

 

I've gone to hubspot support and they don't really have much more advice than to point me to some posts about creating an API but the posts aren't very detailed.

0 Upvotes
Not applicable

Rss/xml image tags are not closed

SOLVE

Would love to help, but I am not exactly clear on the issue :slight_smile:

0 Upvotes
cbarley
HubSpot Alumni
HubSpot Alumni

Rss/xml image tags are not closed

SOLVE

Hi @rolvskjaerpe, can you link the blog in HubSpot that you're looking to embed onto your external site as well as the page you're trying to place it on? Happy to help here.

0 Upvotes
Glittenberg
Member

Rss/xml image tags are not closed

SOLVE

Hi Connor. Here is link to the external site:
https://papirflyweb.test.papirfly.no/com/home/your-business/employer-branding

Iit is this page in hubspot we are receiving as rss/xml:
https://retail.papirfly.com/?__hstc=156772004.61385b281747dcf3911406a6dbabdec0.1525276335312.1540882...

The xml we receive looks is this:
https://retail.papirfly.com/topic/local-marketing/rss.xml
This feed renders like you kan see in my first link.

However, if I close the image tags, like in the link below, all the feed renders like i should.
https://papirflyweb.test.papirfly.no/web2015/blogg.xml

Thanks
Rolv

0 Upvotes
cbarley
HubSpot Alumni
HubSpot Alumni

Rss/xml image tags are not closed

SOLVE

Hi @rolvskjaerpe, Thanks for the extra information. This seems like an issue with the way your CMS is processing the HubSpot RSS feed. I'm able to use a HubSpot RSS module and print out the contents of your feed here: https://www.playtimepottery.net/api-test. HubSpot uses encoded content tags in our XML files to display data. Since image tags are implicitly closed, closing the image tags might have been a red herring.

This stackoverflow thread's last reply goes over the fact that there have been changes to the way that RSS feeds can be rendered (and thus, processed). When I use the URL option in this RSS viewer here: https://codebeautify.org/rssviewer, I'm able to load in the feed and see all data.

You can also try using an RSS converting tool to input your blog and generate an RSS feed that is more compatible with your current CMS's RSS feed module.

Glittenberg
Member

Rss/xml image tags are not closed

SOLVE

Hi again Connor. I see that you are not displaying images in the example. I'm still not able to compile the xml because the "unclosed" image tags. The xml are being red flagget in Visual Studio.

Came across this when googeling the problem:

The <img> tag represents what is known as a void element (see HTML5 spec), so called because it can't have any contents (unlike, say <a> or <div> ). Therefore there is no syntactic reason why it should need to be closed in HTML.

XHTML, however, is based on XML, where every tag needs to be closed.

0 Upvotes
cbarley
Solution
HubSpot Alumni
HubSpot Alumni

Rss/xml image tags are not closed

SOLVE

This is currently working as designed - we only include featured images in the RSS Listing Module when the RSS feed being included is that of a HubSpot hosted blog. This is because the concept of a featured image isn't part of the RSS feed standard (see http://www.rssboard.org/rss-profile for documentation of the standard), so when the feed is external, there's no universal way to identify the featured image for each post in an RSS feed. There seem to be some common ways people include featured images in the content:encoded element in their Wordpress (or other CMS') blog RSS feeds, but it can vary from blog to blog.

0 Upvotes
Joe_list
Participant

Rss/xml image tags are not closed

SOLVE

Hello @cbarley -- is it possible to add a particular tag to my rss feed to get the funcationality? Although it's not part of the RSS standard, it's not technically out of the question to extend RSS with custom tags. For example, Apple has custom tags available that their devices are able to read.

0 Upvotes
Glittenberg
Member

Rss/xml image tags are not closed

SOLVE

Hi Connor. I owe you an apology. The rss/xml from HubSpot is impeccable. I, as a rss/xml noob, clearly haven't a clue of what I'm doing. Turns out that it was a matter of decoding the content in the xml. All the nagging about unclosed image tag was a result of me using the xml url, rendered in Chrome, as xml source.

Sorry for taking your time.

Regards
Rolv :face_with_hand_over_mouth:

0 Upvotes
Glittenberg
Member

Rss/xml image tags are not closed

SOLVE

Thanks Connor. :slight_smile:

0 Upvotes