Newbies Messo Posted April 7, 2005 Newbies Posted April 7, 2005 Hi all and thx previously 4 your answers and sorry 4 my bad english... i have a problem with exporting XML with FMP6. I had create an XSLT stylesheet that i attached to this post: <?xml version="1.0" encoding="UTF-8"?> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:fmp="http://www.filemaker.com/fmpxmlresult" exclude-result-prefixes="fmp"> <xsl:variable name="righe" select="count(/FMPDSORESULT/ROW)" /> <xsl:template match="FMPDSORESULT"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"/> <link href="css/print.css" rel="stylesheet" type="text/css" media="print"/> <link href="css/display.css" rel="stylesheet" type="text/css" media="screen"/> <title>Aramini strumenti musicali</title> <script> <![CDATA[function txtA(obj){ var obj = document.getElementById(obj); var arSp = obj.value.split(' '); var c = arSp.length; obj.style.pixelHeight = (obj.value.length+c)/25; //alert©; //alert(obj.style.pixelHeight); //if((obj.style.pixelHeight*10) < 100) obj.style.pixelHeight = 100; else obj.style.pixelHeight = obj.style.pixelHeight*11; if((obj.style.pixelHeight*10) < 100) obj.style.pixelHeight = obj.style.pixelHeight*10; else obj.style.pixelHeight = obj.style.pixelHeight*10; //alert(obj.style.pixelHeight); }]]> </script> </head> <body> <script language="javascript" type="text/javascript" src="JS/wz_dragdrop.js"></script> <table cellpadding="0" cellspacing="0" border="0"> <thead> <tr> <td id="header"> <div id="logo_aramini"> <img src="img/logo_aramini.gif" width="209" height="65"/> </div> <div id="titolo"> Listino al pubblico ivato<br/> <input id="data" type="text" value="inserisci la data" onClick="this.value=''"/> </div> </td> </tr> </thead> <tbody> <tr> <td id="main_td"> <div id="content"> <xsl:apply-templates select="ROW"> <xsl:sort select="Marca_Logo" order="ascending"/> </xsl:apply-templates> </div> <xsl:call-template name="content"> <xsl:with-param name="r" select="count(ROW)"/> <xsl:with-param name="d" select="ceiling(count(ROW) div 4)"/> <xsl:with-param name="m" select="count(ROW) mod 4"/> </xsl:call-template> </td> </tr> </tbody> </table> <script language="javascript" type="text/javascript"> <xsl:text>SET_DHTML(CURSOR_HAND, RESIZABLE, NO_ALT, SCROLL,TRANSPARENT</xsl:text> <xsl:call-template name="js"> <xsl:with-param name="counter"> <xsl:value-of select="$righe"/> </xsl:with-param> </xsl:call-template> <xsl:text>);</xsl:text> </script> </body> </html> </xsl:template> <xsl:template match="ROW"> <xsl:variable name="inc"> <xsl:number count="ROW"/> </xsl:variable> <xsl:variable name="img_path"> <xsl:value-of select="Id_foto" /> </xsl:variable> <xsl:variable name="logo_path"> <xsl:value-of select="Id_Logo" /> </xsl:variable> <xsl:variable name="code"> <xsl:value-of select="Codice" /> </xsl:variable> <xsl:variable name="prz"> <xsl:value-of select="PrezzoPubCI" /> </xsl:variable> <xsl:variable name="marca"> <xsl:value-of select="Marca_Logo" /> </xsl:variable> <xsl:variable name="serie"> <xsl:value-of select="Serie" /> </xsl:variable> <div id="div_{$inc}" class="main" style="z-index:{$inc}"> <div id="codice" class="codice"> <input type="text" value="{$code}" class="bg_black"/> </div> <div id="articolo_{$inc}" class="articolo"> <textarea class="art" id="art_{$inc}" onBlur="txtA('art_{$inc}');"><xsl:value-of select="Articolo" /></textarea> </div> <div id="descrizione_{$inc}" class="descrizione"> <textarea class="desc" id="desc_{$inc}" onBlur="txtA('desc_{$inc}');"><xsl:value-of select="Descrizione_estesa" /></textarea> </div> <div id="marca_{$inc}" class="marca"> <input type="text" value="{$marca}"/> </div> <div id="famiglia_{$inc}" class="famiglia"> <textarea class="txt_fam" id="fam_{$inc}" onBlur="txtA('fam_{$inc}');"><xsl:value-of select="Famiglia" /></textarea> </div> <div id="sott_fam_{$inc}" class="sottofamiglia"> <textarea class="txt_sott_fam" id="sot_{$inc}" onBlur="txtA('sot_{$inc}');"><xsl:value-of select="Sottofamiglia" /></textarea> </div> <div id="serie_{$inc}" class="serie"> <input type="text" value="{$serie}"/> </div> <div id="prz_pub_{$inc}" class="prz_pub"> <input type="text" value="
Fenton Posted April 7, 2005 Posted April 7, 2005 Right at the top there is a mismatch of the FileMaker xml format. <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:fmp="http://www.filemaker.com/fmpxmlresult" exclude-result-prefixes="fmp"> <!-- you reference fmpxmlresult --> <xsl:variable name="righe" select="count(/FMPDSORESULT/ROW)" /> <!-- you use FMPDSORESULT, different; use one or the other, not both --> Also, you define the prefix "fmp" in the FileMaker namespace, but you don't use it. Should be: <xsl:variable name="righe" select="count(/fmp:FMPDSORESULT/fmp:ROW)" /> All FileMaker objects should use it. You've excluded it from the results, so it won't show. Otherwise I don't know whether it works. The xsl is properly formatted, as xsl. That doesn't mean it works however. The "xml" you posted is just the data, not really the xml. You could export it as xml (1 record will do), with no stylesheet selected. Then we'd have something to work with. You'd do better to have an dedicated xml/xsl editor, which would let you load the raw FileMaker xml export file (above) and the xsl file, then show you the result, with decent error messages. It's pretty hard (and tedious) to get it all right by exporting from FileMaker over and over. I don't know about PC editors, but there are a few. xmlSpy There's also Beverly Voth's book: FileMaker Pro 6 Developer's Guide to XML/XSL http://www.amazon.com/exec/obidos/tg/det...ks&n=507846
Newbies Messo Posted April 8, 2005 Author Newbies Posted April 8, 2005 Thx a lot Fenton, the XML file is like the follow: <?xml version="1.0" encoding="UTF-8" ?><FMPDSORESULT xmlns="http://www.filemaker.com/fmpdsoresult"><ERRORCODE>0</ERRORCODE><DATABASE>Aramini.fp5</DATABASE><LAYOUT>Scheda</LAYOUT><ROW MODID="2" RECORDID="41607"><Codice>CMX-16A</Codice><Articolo>- 16 Canali (8 canali mono bilanciati + 8 canali configurati in 4 stereo) - Master Left e Right + 2 Subgruppi - 2 Aux Send/Return (stereo) - Controlli di Gain, Pan-pot, - Mandata e ritorno effetti.</Articolo><Descrizione_estesa></Descrizione_estesa><PrezzoPubCI>641,00</PrezzoPubCI><Marca_Logo>NADY</Marca_Logo><Famiglia>AUDIO</Famiglia><Sottofamiglia>Mixer</Sottofamiglia><Serie>CMX</Serie><Id_foto>../image/Nady - CMX16A.jpg</Id_foto><Id_Logo>../logo/Logo_Nady.jpg</Id_Logo></ROW></FMPDSORESULT> The XSL i'd write works correctly only if I link it in the XML file directly, not with the FMP export. It happen because i'd mismatch the declaration? Or 4 any other reason? Thx a lot Fenton.
Newbies Messo Posted April 8, 2005 Author Newbies Posted April 8, 2005 I solved my problems in exportation. The wrong initial declaration didn't allow export to FMP correctly. Thx a lot Fenton
Recommended Posts
This topic is 7170 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 accountSign in
Already have an account? Sign in here.
Sign In Now