open All Channels
seplocked EVE Technology Lab
blankseplocked XSLT
 
This thread is older than 90 days and has been locked due to inactivity.


 
Author Topic

Karyn S'jet
Posted - 2011.03.21 02:22:00 - [1]
 

I was hoping I could find some help here. I am having a ghastly time trying to get an XSLT to work with the development platform I use called FileMaker. I am trying to import character data into the system I have written via the api but for the life of me I cant get the XSL to work. The format used is:

<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<!--
File: msdso_elem.xslt

Transforms data in an ELEMENT based MSDSO grammar
into the FMPXMLRESULT grammar, suitable for import.

===============================================================

<xsl:template match="/*">
<FMPXMLRESULT xmlns="http://www.filemaker.com/fmpxmlresult">
<ERRORCODE>0</ERRORCODE>
<PRODUCT BUILD="" NAME="" VERSION=""/>
<DATABASE DATEFORMAT="M/d/yyyy" LAYOUT="" NAME="" RECORDS="{count(/*/*)}" TIMEFORMAT="h:mm:ss a"/>
<METADATA>
<xsl:for-each select="/*/*[position()=1]/*">
<FIELD>
<xsl:attribute name="EMPTYOK">YES</xsl:attribute>
<xsl:attribute name="MAXREPEAT">1</xsl:attribute>
<xsl:attribute name="NAME"><xsl:value-of select="name()"/></xsl:attribute>
<xsl:attribute name="TYPE">TEXT</xsl:attribute>
</FIELD>
</xsl:for-each>
</METADATA>
<RESULTSET>
<xsl:attribute name="FOUND"><xsl:value-of select="count(child::*)"/></xsl:attribute>
<xsl:for-each select="child::*">
<ROW>
<xsl:attribute name="MODID">0</xsl:attribute>
<xsl:attribute name="RECORDID">0</xsl:attribute>
<xsl:for-each select="child::*">
<COL>
<DATA>
<xsl:value-of select="."/>
</DATA>
</COL>
</xsl:for-each>
</ROW>
</xsl:for-each>
</RESULTSET>
</FMPXMLRESULT>
</xsl:template>
</xsl:stylesheet>


All I need is an example of a transform and I can run from there.

dexington
Caldari
Baconoration
Posted - 2011.03.22 21:39:00 - [2]
 

Here is a simple example of a xslt transformation, that transform a xml doc into a html table.

character.xml
---
<?xml version="1.0" encoding="ISO-8859-1"?>
<?xml-stylesheet type="text/xsl" href="character.xsl"?>
<account>
<character>
<name>Name of char 1</name>
<skillpoints>1000000</skillpoints>
<race>gallente</race>
<skilltraining>gunnery lvl 5</skilltraining>
</character>
<character>
<name>Name of char 2</name>
<skillpoints>2000000</skillpoints>
<race>caldari</race>
<skilltraining>drones lvl 3</skilltraining>
</character>
<character>
<name>Name of char 3</name>
<skillpoints>3000000</skillpoints>
<race>amarr</race>
<skilltraining>trade lvl 2</skilltraining>
</character>
</account>


character.xsl
---
<?xml version="1.0" encoding="ISO-8859-1"?>

<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">

<xsl:template match="/">
<html>
<body>
<h2>Character Display</h2>
<table border="1">
<tr>
<th>Name</th>
<th>Skillpoints</th>
<th>Race</th>
<th>Traning</th>
</tr>
<xsl:for-each select="account/character">
<tr>
<td><xsl:value-of select="name"/></td>
<td><xsl:value-of select="skillpoints"/></td>
<td><xsl:value-of select="race"/></td>
<td><xsl:value-of select="skilltraining"/></td>
</tr>
</xsl:for-each>
</table>
</body>
</html>
</xsl:template>
</xsl:stylesheet>


 

This thread is older than 90 days and has been locked due to inactivity.


 


The new forums are live

Please adjust your bookmarks to https://forums.eveonline.com

These forums are archived and read-only