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

xsl to convert rdf to fmpxmlresult


Tombstone0

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

Recommended Posts

I'm attempting to write a xsl style sheet to import rdf files into filemaker.

I'm trying to import from http://www.macslash.org/macslash.rdf.

my stylesheet looks like (modified version of rss2fmp):

<?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" encoding="utf-8" indent="yes" />

<xsl:template match="/">

<FMPXMLRESULT xmlns="http://www.filemaker.com/fmpxmlresult">

<ERRORCODE>0</ERRORCODE>

<PRODUCT BUILD="" NAME="FileMaker Pro XML Import" VERSION="6.0v1" />

<DATABASE DATEFORMAT="yyyy.MM.dd" LAYOUT="" NAME="" RECORDS="" TIMEFORMAT="k:mm:ss" />

<METADATA>

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

<FIELD EMPTYOK="YES" MAXREPEAT="1" NAME="URL" TYPE="TEXT" />

</METADATA>

<RESULTSET FOUND="10">

<xsl:for-each select="item">

<xsl:variable name="c">

<xsl:value-of select="position()" />

</xsl:variable>

<ROW MODID="$c" RECORDID="$c" >

<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>

My result looks like:

<?xml version="1.0" encoding="utf-8"?>

<FMPXMLRESULT xmlns="http://www.filemaker.com/fmpxmlresult">

<ERRORCODE>0</ERRORCODE>

<PRODUCT VERSION="6.0v1" NAME="FileMaker Pro XML Import" BUILD=""/>

<DATABASE TIMEFORMAT="k:mm:ss" RECORDS="" NAME="" LAYOUT="" DATEFORMAT="yyyy.MM.dd"/>

<METADATA>

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

<FIELD TYPE="TEXT" NAME="URL" MAXREPEAT="1" EMPTYOK="YES"/>

</METADATA>

<RESULTSET FOUND="10"/>

</FMPXMLRESULT>

I seem to be lacking any story information.

I think it might be this line:

<xsl:for-each select="item">

and I've tried "/" "/item" "item/rdf" "item/rdf:RDF" and some other variations.

Most give this result but the rdf:RDF gives a namespace violation.

Does anyone know how to fix this.

Thanks

Link to comment
Share on other sites

This topic is 7867 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.