Jump to content

I would like to import an rss feed into filemaker


AndrewDavis
 Share

This topic is 2951 days old. Please don't post here. Open a new topic instead.

Recommended Posts

  • Newbies

Would it be possible to for me to piggyback on this post? I’m new and I don’t know all the forum etiquette. Please let me know if I should post this elsewhere.

 

I would like to import an rss feed into filemaker. I understand that I need a xslt file to transform the data into something that filemaker understands. And I found some xslt templates online, but I’m not very knowledgeable about xslt, and I can’t figure out how to make them work for my situation. Would anyone be able to help me with this? Thanks so much in advance.

 

This is an example of the source rss: http://www.sierranevada.com/downloads/formstack-test-rssfeed.xml

This is my attempt at xslt. As you can see, not very good: http://www.sierranevada.com/downloads/formstack-rss-transform-test.xslt

 

-Andrew

Link to comment
Share on other sites

It would have been better to open up a new thread, as these two problems are unrelated. Perhaps one of the moderators will take care of that for you.

 

You also need to clarify what exactly do you want to import from the feed (what are your target Filemaker fields). If all you want to import is the two fields shown in your attempt (title and link), then this is easy - try:

<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="xml" version="1.0" encoding="utf-8" indent="yes"/>

<xsl:template match="/">

<FMPXMLRESULT xmlns="http://www.filemaker.com/fmpxmlresult">
<ERRORCODE>0</ERRORCODE>
<PRODUCT BUILD="" NAME="" VERSION=""/>
<DATABASE DATEFORMAT="" LAYOUT="" NAME="" RECORDS="" TIMEFORMAT=""/>

<METADATA>
    <FIELD NAME="Title" TYPE="TEXT" EMPTYOK="YES" MAXREPEAT="1"/>
    <FIELD NAME="Link" TYPE="TEXT" EMPTYOK="YES" MAXREPEAT="1"/>
</METADATA>

<RESULTSET FOUND="">

<xsl:for-each select="rss/channel/item">
<ROW MODID="" RECORDID="">
    <COL><DATA><xsl:value-of select="title"/></DATA></COL>
    <COL><DATA><xsl:value-of select="link"/></DATA></COL>
</ROW>
</xsl:for-each>

</RESULTSET>
</FMPXMLRESULT>

</xsl:template>
</xsl:stylesheet>

If, OTOH, you plan on importing anything from the <content:encoded> section, that won't be easy at all  because the feed providers have chosen (most unwisely!) to embed the payload as CDATA, thus making it unparsable as XML - leaving parsing as text as the only option.

Edited by comment
Link to comment
Share on other sites

This topic is 2951 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.