Components All New MacOS Windows Linux iOS
Examples Mac & Win Server Client Guides Statistic FMM Blog Deprecated Old

MBS FileMaker Plugin Example Databases

Saxon Visualize electronic Invoices

All examples are included with download of MBS FileMaker Plugin.

Saxon Visualize electronic Invoices.fmp12

Overview
Tables 1
Relationships 0
Layouts 1
Scripts 6
Value Lists 0
Custom Functions 0
Custom Menus 24
File Options
Default custom menu set [Standard FileMaker Menus]
Default theme Apex Blue
When opening file
Minimum allowed version 12.0
Login using Account Name; Account= Admin
Allow user to save password On
Require iOS passcode Off
Show Sign-in fields On
Switch to layout Off
Hide all toolbars Off
Script triggers
OnFirstWindowOpen Off
OnLastWindowClose Off
OnWindowOpen Off
OnWindowClose Off
OnFileAVPlayerChange Off
OnWindowTransaction Off
Thumbnail Settings
Generate Thumbnails On; Temporary

 

Tables

Table Name
Statistics
Comments
Occurrences in Relationship Graph
Saxon Visualize electronic Invoices
9 fields defined, 2 records
Saxon Visualize electronic Invoices

Fields

Table Name: Saxon Visualize electronic Invoices - 9 Fields
Field Name Type Options Comments On Layouts In Relationships In Scripts In Value Lists
PrimaryKey Normal, Text Auto-Enter: Validation:
  • Only during data entry
  • Not empty
  • Unique
  • Strict validation
Storage:
  • Repetitions: 1
  • Indexing: Minimal
  • Automatically create indexes as needed
  • Index Language: Unicode Raw
Unique identifier of each record in this table
          CreationTimestamp Normal, Timestamp Auto-Enter:
          • Creation timestamp
          Validation:
          • Only during data entry
          • Strict data type: 4 digit year
          • Not empty
          • Strict validation
          Storage:
          • Repetitions: 1
          • Indexing: None
          • Automatically create indexes as needed
          • Index Language: German
          Date and time each record was created
                  CreatedBy Normal, Text Auto-Enter:
                  • Creation account name
                  Validation:
                  • Only during data entry
                  • Not empty
                  • Strict validation
                  Storage:
                  • Repetitions: 1
                  • Indexing: None
                  • Automatically create indexes as needed
                  • Index Language: German
                  Account name of the user who created each record
                          ModificationTimestamp Normal, Timestamp Auto-Enter:
                          • Modification timestamp
                          Validation:
                          • Only during data entry
                          • Strict data type: 4 digit year
                          • Not empty
                          • Strict validation
                          Storage:
                          • Repetitions: 1
                          • Indexing: None
                          • Automatically create indexes as needed
                          • Index Language: German
                          Date and time each record was last modified
                                  ModifiedBy Normal, Text Auto-Enter:
                                  • Modification account name
                                  Validation:
                                  • Only during data entry
                                  • Not empty
                                  • Strict validation
                                  Storage:
                                  • Repetitions: 1
                                  • Indexing: None
                                  • Automatically create indexes as needed
                                  • Index Language: German
                                  Account name of the user who last modified each record
                                          XSLFolder Normal, Text Auto-Enter:
                                          • Allow editing
                                          Validation:
                                          • Only during data entry
                                          Storage:
                                          • Global
                                          • Repetitions: 1
                                          • Index Language: German
                                              Invoice XML Normal, Text Auto-Enter:
                                              • Allow editing
                                              Validation:
                                              • Only during data entry
                                              Storage:
                                              • Repetitions: 1
                                              • Indexing: None
                                              • Automatically create indexes as needed
                                              • Index Language: German
                                                  Intermediate XML Normal, Text Auto-Enter:
                                                  • Allow editing
                                                  Validation:
                                                  • Only during data entry
                                                  Storage:
                                                  • Repetitions: 1
                                                  • Indexing: None
                                                  • Automatically create indexes as needed
                                                  • Index Language: German
                                                      HTML Normal, Text Auto-Enter:
                                                      • Allow editing
                                                      Validation:
                                                      • Only during data entry
                                                      Storage:
                                                      • Repetitions: 1
                                                      • Indexing: None
                                                      • Automatically create indexes as needed
                                                      • Index Language: German

                                                          Layout Objects: Saxon Visualize electronic Invoices

                                                          Regular Fields

                                                          Field Name: Saxon Visualize electronic Invoices::XSLFolder
                                                          Field Properties Coordinates Field Format Field Behavior Quick Find
                                                          • Top: 691 pt
                                                          • Left: 123 pt
                                                          • Bottom: 722 pt
                                                          • Right: 442 pt
                                                          • Anchoring: Left, Bottom
                                                          Field Format:
                                                          • Edit Box
                                                          Field Behavior:
                                                          • Allow field to be entered: In Find mode, In Browse mode
                                                          • Touch keyboard type: Default for Data Type
                                                          • Go to next field using: Tab key
                                                          No

                                                          Field Name: Saxon Visualize electronic Invoices::Invoice XML
                                                          Field Properties Coordinates Field Format Field Behavior Quick Find
                                                          • Top: 87 pt
                                                          • Left: 138 pt
                                                          • Bottom: 206 pt
                                                          • Right: 467 pt
                                                          • Anchoring: Left, Top
                                                          Field Format:
                                                          • Edit Box
                                                          Field Behavior:
                                                          • Allow field to be entered: In Find mode, In Browse mode
                                                          • Touch keyboard type: Default for Data Type
                                                          • Go to next field using: Tab key
                                                          Yes

                                                          Field Name: Saxon Visualize electronic Invoices::Intermediate XML
                                                          Field Properties Coordinates Field Format Field Behavior Quick Find
                                                          • Top: 88 pt
                                                          • Left: 631 pt
                                                          • Bottom: 119 pt
                                                          • Right: 1012 pt
                                                          • Anchoring: Left, Top
                                                          Field Format:
                                                          • Edit Box
                                                          Field Behavior:
                                                          • Allow field to be entered: In Find mode, In Browse mode
                                                          • Touch keyboard type: Default for Data Type
                                                          • Go to next field using: Tab key
                                                          Yes

                                                          Field Name: Saxon Visualize electronic Invoices::HTML
                                                          Field Properties Coordinates Field Format Field Behavior Quick Find
                                                          • Top: 131 pt
                                                          • Left: 631 pt
                                                          • Bottom: 206 pt
                                                          • Right: 1012 pt
                                                          • Anchoring: Left, Top
                                                          Field Format:
                                                          • Edit Box
                                                          Field Behavior:
                                                          • Allow field to be entered: In Find mode, In Browse mode
                                                          • Touch keyboard type: Default for Data Type
                                                          • Go to next field using: Tab key
                                                          Yes

                                                          Group Buttons

                                                          Button Properties Coordinates Script/Script Step
                                                            Type:
                                                          • Text: Download xrechnung-visualization and point to XSL folder there.
                                                            Additional Properties:
                                                          • Rectangular
                                                          • Top: 692 pt
                                                          • Left: 454 pt
                                                          • Bottom: 723 pt
                                                          • Right: 927 pt
                                                          • Anchoring: Left, Bottom
                                                          Perform Script [ “Open Website” ]

                                                          Scripts:


                                                          Buttons

                                                          Button Properties Coordinates Script/Script Step
                                                            Type:
                                                          • Text: Website
                                                          • Top: 693 pt
                                                          • Left: 936 pt
                                                          • Bottom: 724 pt
                                                          • Right: 1012 pt
                                                          • Anchoring: Left, Bottom
                                                          Perform Script [ “Open Website” ]

                                                          Scripts:


                                                          Button Properties Coordinates Script/Script Step
                                                            Type:
                                                          • Text: Show Invoice
                                                            Additional Properties:
                                                          • Change to hand cursor over button
                                                          • Top: 178 pt
                                                          • Left: 489 pt
                                                          • Bottom: 206 pt
                                                          • Right: 608 pt
                                                          • Anchoring: Left, Top
                                                          Perform Script [ “Run” ]

                                                          Scripts:


                                                          Web Viewer Controls

                                                          Web Viewer Control Properties Coordinates Web Address
                                                            Additional Properties:
                                                          • Allow interaction with web viewer content
                                                          • Display progress bar
                                                          • Display status messages
                                                          • Automatically encode URL
                                                          • Top: 222 pt
                                                          • Left: 9 pt
                                                          • Bottom: 675 pt
                                                          • Right: 1014 pt
                                                          • Anchoring: Left and Right, Top and Bottom
                                                          If( IsEmpty( Saxon Visualize electronic Invoices::HTML ); "about:blank"; "data:text/html;charset=utf-8;base64," & Base64Encode( Saxon Visualize electronic Invoices::HTML ) )

                                                          Script Hierarchy

                                                          Run
                                                          Run XSLT
                                                          Clear
                                                          -
                                                          Load Saxon
                                                          Open Website

                                                          Next Script: [Run XSLT]
                                                          Script Name Run
                                                          Run script with full access privileges Off
                                                          Siri Shortcut Visible Off
                                                          Include In Menu Yes
                                                          Layouts that use this script
                                                          Scripts that use this script
                                                            Script Definition
                                                            Script Steps
                                                            • #Load Saxon once if not yet loaded
                                                            • If [ MBS("Saxon.IsLoaded") = 0 ]
                                                            • Perform Script [ “Load Saxon” ]
                                                            • End If
                                                            • If [ IsEmpty ( Saxon Visualize electronic Invoices::XSLFolder ) ]
                                                            • Show Custom Dialog [ Title: "You need to specify the folder with stylesheets."; Message: "Please download from github and put the path to XSL folder path into the field."; Default Button: “OK”, Commit: “Yes” ]
                                                            • Open URL [ "https://github.com/itplr-kosit/xrechnung-visualization/releases" ] [ No dialog ]
                                                            • Exit Script [ ]
                                                            • End If
                                                            • #We can do UBL invoices and Cross Industry Invoices (XRechnung)
                                                            • If [ Position ( Saxon Visualize electronic Invoices::Invoice XML ; "urn:oasis:names:specification:ubl:schema:xsd:Invoice" ; 1 ; 1 ) > 1 ]
                                                            • Perform Script [ “Run XSLT”; Parameter: "ubl-invoice-xr.xsl" ]
                                                            • Else If [ Position ( Saxon Visualize electronic Invoices::Invoice XML ; "unece:uncefact:data:standard:CrossIndustryInvoice" ; 1 ; 1 ) ]
                                                            • Perform Script [ “Run XSLT”; Parameter: "cii-xr.xsl" ]
                                                            • End If
                                                            Fields used in this script
                                                            Scripts used in this script
                                                            Layouts used in this script
                                                              Tables used in this script
                                                              Table occurrences used by this script
                                                              Custom Functions used by this script
                                                                Custom menu set used by this script

                                                                  Previous Script: [Run] Next Script: [Clear]
                                                                  Script Name Run XSLT
                                                                  Run script with full access privileges Off
                                                                  Siri Shortcut Visible Off
                                                                  Include In Menu No
                                                                  Layouts that use this script
                                                                    Scripts that use this script
                                                                    Script Definition
                                                                    Script Steps
                                                                    • Set Variable [ $XSLTName; Value:Get(ScriptParameter) ]
                                                                    • #Set the folder to find related files
                                                                    • Set Variable [ $r; Value:MBS( "Saxon.SetCurrentWorkingDirectory"; Saxon Visualize electronic Invoices::XSLFolder) ]
                                                                    • #we read invoice XML into variable
                                                                    • Set Variable [ $invoiceXML; Value:Saxon Visualize electronic Invoices::Invoice XML ]
                                                                    • #read the XSLT to convert
                                                                    • Set Variable [ $path; Value:MBS("Path.AddPathComponent"; Saxon Visualize electronic Invoices::XSLFolder; $XSLTName) ]
                                                                    • Set Variable [ $InvoiceXSLT; Value:MBS("Text.ReadTextFile"; $path; "utf-8") ]
                                                                    • If [ MBS("IsError") = 1 ]
                                                                    • Show Custom Dialog [ Title: "Failed to read XSLT. Please check path!"; Message: $InvoiceXSLT; Default Button: “OK”, Commit: “Yes” ]
                                                                    • Exit Script [ ]
                                                                    • End If
                                                                    • #Apply the XSLT
                                                                    • Set Variable [ $IntermediateXML; Value:MBS( "Saxon.XSLT"; $invoiceXML; $InvoiceXSLT ) ]
                                                                    • Set Field [ Saxon Visualize electronic Invoices::Intermediate XML; $IntermediateXML ]
                                                                    • If [ MBS("IsError") = 0 ]
                                                                    • #now get second XSLT to convert to HTML
                                                                    • Set Variable [ $path; Value:MBS("Path.AddPathComponent"; Saxon Visualize electronic Invoices::XSLFolder; "xrechnung-html.xsl") ]
                                                                    • Set Variable [ $HTMLXSLT; Value:MBS("Text.ReadTextFile"; $path; "utf-8") ]
                                                                    • #Generate the HTML
                                                                    • Set Variable [ $InvoiceHTML; Value:MBS( "Saxon.XSLT"; $IntermediateXML; $HTMLXSLT ) ]
                                                                    • #Store in the field
                                                                    • Set Field [ Saxon Visualize electronic Invoices::HTML; $InvoiceHTML ]
                                                                    • End If
                                                                    Fields used in this script
                                                                    Scripts used in this script
                                                                      Layouts used in this script
                                                                        Tables used in this script
                                                                        Table occurrences used by this script
                                                                        Custom Functions used by this script
                                                                          Custom menu set used by this script

                                                                            Previous Script: [Run XSLT] Next Script: [-]
                                                                            Script Name Clear
                                                                            Run script with full access privileges Off
                                                                            Siri Shortcut Visible Off
                                                                            Include In Menu Yes
                                                                            Layouts that use this script
                                                                              Scripts that use this script
                                                                                Script Definition
                                                                                Script Steps
                                                                                • Replace Field Contents [ Saxon Visualize electronic Invoices::HTML; Replace with calculation: "" ] [ No dialog ]
                                                                                • Replace Field Contents [ Saxon Visualize electronic Invoices::Intermediate XML; Replace with calculation: "" ] [ No dialog ]
                                                                                Fields used in this script
                                                                                Scripts used in this script
                                                                                  Layouts used in this script
                                                                                    Tables used in this script
                                                                                    Table occurrences used by this script
                                                                                    Custom Functions used by this script
                                                                                      Custom menu set used by this script

                                                                                        Previous Script: [Clear] Next Script: [Load Saxon]
                                                                                        Script Name -
                                                                                        Run script with full access privileges Off
                                                                                        Siri Shortcut Visible Off
                                                                                        Include In Menu Yes
                                                                                        Layouts that use this script
                                                                                          Scripts that use this script
                                                                                            Script Definition
                                                                                            Script Steps
                                                                                              Fields used in this script
                                                                                                Scripts used in this script
                                                                                                  Layouts used in this script
                                                                                                    Tables used in this script
                                                                                                      Table occurrences used by this script
                                                                                                        Custom Functions used by this script
                                                                                                          Custom menu set used by this script

                                                                                                            Previous Script: [-] Next Script: [Open Website]
                                                                                                            Script Name Load Saxon
                                                                                                            Run script with full access privileges Off
                                                                                                            Siri Shortcut Visible Off
                                                                                                            Include In Menu Yes
                                                                                                            Layouts that use this script
                                                                                                              Scripts that use this script
                                                                                                              Script Definition
                                                                                                              Script Steps
                                                                                                              • Set Variable [ $path; Value:"" ]
                                                                                                              • #you may need to put in your path or have the libraries in the folder for the plugin
                                                                                                              • If [ MBS("IsMacOS") ]
                                                                                                              • Set Variable [ $path; Value:"libsaxonc-core-ee.12.6.0.dylib" ]
                                                                                                              • Else If [ MBS("IsWindows") ]
                                                                                                              • Set Variable [ $path; Value:"saxonc-core-ee.dll" ]
                                                                                                              • Else If [ MBS("IsLinux") ]
                                                                                                              • Set Variable [ $path; Value:"libsaxonc-core-ee.so.12.6.0" ]
                                                                                                              • End If
                                                                                                              • Set Variable [ $r; Value:MBS( "Saxon.Load"; $Path ) ]
                                                                                                              • If [ MBS("IsError") ]
                                                                                                              • Show Custom Dialog [ Title: "Failed to load saxon library."; Message: $r; Default Button: “OK”, Commit: “Yes” ]
                                                                                                              • Halt Script
                                                                                                              • End If
                                                                                                              Fields used in this script
                                                                                                                Scripts used in this script
                                                                                                                  Layouts used in this script
                                                                                                                    Tables used in this script
                                                                                                                      Table occurrences used by this script
                                                                                                                        Custom Functions used by this script
                                                                                                                          Custom menu set used by this script

                                                                                                                            Previous Script: [Load Saxon]
                                                                                                                            Script Name Open Website
                                                                                                                            Run script with full access privileges Off
                                                                                                                            Siri Shortcut Visible Off
                                                                                                                            Include In Menu Yes
                                                                                                                            Layouts that use this script
                                                                                                                            Scripts that use this script
                                                                                                                              Script Definition
                                                                                                                              Script Steps
                                                                                                                              • #download the archive there and point us to xsl folder
                                                                                                                              • Open URL [ "https://github.com/itplr-kosit/xrechnung-visualization/releases" ] [ No dialog ]
                                                                                                                              Fields used in this script
                                                                                                                                Scripts used in this script
                                                                                                                                  Layouts used in this script
                                                                                                                                    Tables used in this script
                                                                                                                                      Table occurrences used by this script
                                                                                                                                        Custom Functions used by this script
                                                                                                                                          Custom menu set used by this script

                                                                                                                                            Download example: Saxon Visualize electronic Invoices

                                                                                                                                            Used functions: