Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×

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

Recommended Posts

  • Newbies
Posted

I have an rss feed that returns data like this: 

2009 LLCs, Corporations, & Business Legal Updates
2009 Personal Finance Legal Updates
2010 LLCs, Corporations, & Business Legal Updates
2010 Personal Finance Legal Updates
2011 Personal Finance Legal Updates
2012 Wills, Trusts, and Estates Legal Updates 

If I click on one of the links I can see the XML.  I need to import all of the XML into my database.  I have done XML/XSL imports before, but it is throwing me off because of the RSS List.  How do I go about this?  Right now I do a copy/paste on view source, put all of that into Notepad++ and then scrub the data.  I use that for an import into a Filemaker table to get the URL.  Then I do an insert by URL to get the XML into the table.  This seems like a lot, I am hoping there is an easier way.... 

Posted

Try the following XSLT stylesheet:

<xsl:stylesheet version="1.0" 
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:atom="http://www.w3.org/2005/Atom"
exclude-result-prefixes="atom">
<xsl:output method="xml" version="1.0" encoding="utf-8" indent="yes"/>

<xsl:template match="/atom:feed">
	<FMPXMLRESULT xmlns="http://www.filemaker.com/fmpxmlresult">
		<!-- FIELDS -->
		<METADATA>
			<FIELD NAME="title"/>
			<FIELD NAME="link"/>
			<FIELD NAME="id"/>
			<FIELD NAME="published"/>
			<FIELD NAME="updated"/>
			<FIELD NAME="summary"/>
			<FIELD NAME="author_name"/>
			<FIELD NAME="author_uri"/>
			<FIELD NAME="category"/>
			<FIELD NAME="content"/>
		</METADATA>
		<!-- DATA -->
		<RESULTSET>
			<xsl:for-each select="atom:entry">
				<ROW>
					<COL><DATA><xsl:value-of select="atom:title"/></DATA></COL>
					<COL><DATA><xsl:value-of select="atom:link/@href"/></DATA></COL>
					<COL><DATA><xsl:value-of select="atom:id"/></DATA></COL>
					<COL><DATA><xsl:value-of select="atom:published"/></DATA></COL>
					<COL><DATA><xsl:value-of select="atom:updated"/></DATA></COL>
					<COL><DATA><xsl:value-of select="atom:summary"/></DATA></COL>
					<COL><DATA><xsl:value-of select="atom:author/atom:name"/></DATA></COL>
					<COL><DATA><xsl:value-of select="atom:author/atom:uri"/></DATA></COL>
					<COL><DATA><xsl:value-of select="atom:category/@term"/></DATA></COL>
					<COL><DATA><xsl:value-of select="atom:content"/></DATA></COL>
				</ROW>
			</xsl:for-each>
		</RESULTSET>
	</FMPXMLRESULT>
</xsl:template>

</xsl:stylesheet>

 

  • Like 1
  • Newbies
Posted

worked perfectly!! Thanks!!!

So, I guess what I am wondering... do I have to go through so many steps to bring in the RSS and create a field for the XML or is there a way to directly import from the RSS feed?

This topic is 2106 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
×
×
  • Create New...

Important Information

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