dbTalk Databases Forums  

XSL Style Sheet Calculation

comp.databases.filemaker comp.databases.filemaker


Discuss XSL Style Sheet Calculation in the comp.databases.filemaker forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Al Hatch
 
Posts: n/a

Default XSL Style Sheet Calculation - 02-04-2007 , 03:35 AM






Is there a way to import data from an XML file, but using an XSLT sheet that
is imbedded in the FileMaker solution?
The normal way to write such a script step is to specify a file containing
the XML data, then to specify a separate XSL file that tells FM how to
interpret the XML.
I would like to avoid using a text file separate from the solution, so that
the whole solution, including the XSL, is in one file.
-
In the Script step Import Records using XML, the ³Specify XML and XSL
Options² dialog gives you the option of specifying a file path or a
Calculation. What would be nice is to make the calculation reference a
container field that contains the text of the Style Sheet.
-
ScriptMaker lets me specify such a field, but it returns a runtime error. Has
anyone done this?


Reply With Quote
  #2  
Old   
Jeroen
 
Posts: n/a

Default Re: XSL Style Sheet Calculation - 02-05-2007 , 03:08 AM






What I have done in the past to resolve a similar problems, in a
Windows environment

- Create a container field and store your XSLT stylesheet in the
container
- Export Field contents of the container field with the XSLT
stylesheet on demand (when an import/export of FileMaker data need to
be performed). Export for example to the desktop. Use a path variable
to point to the XSLT stylesheet in your Import or Export script steps.
- You could write a VBScript/Applescript to delete the exported XSLT
stylesheet

HTH

Jeroen

On Feb 4, 10:35 am, Al Hatch <h... (AT) waywewill (DOT) com> wrote:
Quote:
Is there a way to import data from an XML file, but using an XSLT sheet that
is imbedded in the FileMaker solution?
The normal way to write such a script step is to specify a file containing
the XML data, then to specify a separate XSL file that tells FM how to
interpret the XML.
I would like to avoid using a text file separate from the solution, so that
the whole solution, including the XSL, is in one file.
-
In the Script step Import Records using XML, the ³Specify XML and XSL
Options² dialog gives you the option of specifying a file path or a
Calculation. What would be nice is to make the calculation reference a
container field that contains the text of the Style Sheet.
-
ScriptMaker lets me specify such a field, but it returns a runtime error.Has
anyone done this?



Reply With Quote
  #3  
Old   
Al Hatch
 
Posts: n/a

Default Re: XSL Style Sheet Calculation - 02-05-2007 , 04:08 AM



On Sun, 4 Feb 2007 01:35:32 -0800, Al Hatch wrote
(in article <0001HW.C1EAE8E400CC93D4F0203648 (AT) news (DOT) covad.net>):

Quote:
Is there a way to import data from an XML file, but using an XSLT sheet that
is imbedded in the FileMaker solution?
The normal way to write such a script step is to specify a file containing
the XML data, then to specify a separate XSL file that tells FM how to
interpret the XML.
I would like to avoid using a text file separate from the solution, so that
the whole solution, including the XSL, is in one file.
-
In the Script step Import Records using XML, the ³Specify XML and XSL
Options² dialog gives you the option of specifying a file path or a
Calculation. What would be nice is to make the calculation reference a
container field that contains the text of the Style Sheet.
-
ScriptMaker lets me specify such a field, but it returns a runtime error. Has

anyone done this?
There is no way the "Import XML" step can use an embedded style sheet.
However, you can export an embedded style sheet, use the resulting file, then
delete that file before exiting your script.





Reply With Quote
  #4  
Old   
NScheffey
 
Posts: n/a

Default Re: XSL Style Sheet Calculation - 02-05-2007 , 07:53 AM



Quote:
- You could write a VBScript/Applescript to delete the exported XSLT
stylesheet
You could also delete the file using the Export Records script step.
First empty your found set, by omitting all records for example. Then
call Export Records with the file you want deleted as the destination
and the Perform Without Dialog box checked. This will delete the file.
Kind of a hack, but an interesting technique.

Nate



Reply With Quote
  #5  
Old   
Al Hatch
 
Posts: n/a

Default Re: XSL Style Sheet Calculation - 02-07-2007 , 01:13 AM



On Mon, 5 Feb 2007 05:53:10 -0800, NScheffey wrote
(in article <1170683590.411081.207360 (AT) a75g2000cwd (DOT) googlegroups.com>):

Quote:
- You could write a VBScript/Applescript to delete the exported XSLT
stylesheet

You could also delete the file using the Export Records script step.
First empty your found set, by omitting all records for example. Then
call Export Records with the file you want deleted as the destination
and the Perform Without Dialog box checked. This will delete the file.
Kind of a hack, but an interesting technique.
Actually, I've refined your suggestions a little. As long as you're going to
delete the file anyway (or overwrite it), why not replace it with a short log
of what your script just did (number of records created, data and time,
etc.)? Using the same filename, of course.
That's my new method, and I'm sticking to it.



Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.