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

MBS FileMaker Plugin Example Databases

Saxon XPath

All examples are included with download of MBS FileMaker Plugin.

Saxon XPath.fmp12

Overview
Tables 1
Relationships 0
Layouts 1
Scripts 4
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 XSLT
10 fields defined, 3 records
Saxon XSLT

Fields

Table Name: Saxon XSLT - 10 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
                                          XML Normal, Text Auto-Enter:
                                          • Allow editing
                                          • Context table: Saxon XSLT
                                            Calculation: Let ( [ xmlFormatted = MBS("XML.Format"; Self); xmlFormatFailed = MBS("IsError"); xmlText = If(xmlFormatFailed; Self; xmlFormatted); result = MBS("XML.Colorize"; xmlText) ]; result ) // put this calculation into a field, so the field gets formated and colorized whenever the field is changed and the record gets commited.
                                          Validation:
                                          • Only during data entry
                                          Storage:
                                          • Repetitions: 1
                                          • Indexing: None
                                          • Automatically create indexes as needed
                                          • Index Language: German
                                              Query Normal, Text Auto-Enter:
                                              • Allow editing
                                              Validation:
                                              • Only during data entry
                                              Storage:
                                              • Repetitions: 1
                                              • Indexing: None
                                              • Automatically create indexes as needed
                                              • Index Language: German
                                                  Result Normal, Text Auto-Enter:
                                                  • Allow editing
                                                  • Context table: Saxon XSLT
                                                    Calculation: Let ( [ xmlFormatted = If( Left(Self; 1) = "<"; MBS("XML.Format"; Self); Self); xmlFormatFailed = MBS("IsError"); xmlText = If(xmlFormatFailed; Self; xmlFormatted); result = MBS("XML.Colorize"; xmlText) ]; result ) // put this calculation into a field, so the field gets formated and colorized whenever the field is changed and the record gets commited.
                                                  Validation:
                                                  • Only during data entry
                                                  Storage:
                                                  • Repetitions: 1
                                                  • Indexing: None
                                                  • Automatically create indexes as needed
                                                  • Index Language: German
                                                      Description Normal, Text Auto-Enter:
                                                      • Allow editing
                                                      Validation:
                                                      • Only during data entry
                                                      Storage:
                                                      • Repetitions: 1
                                                      • Indexing: None
                                                      • Automatically create indexes as needed
                                                      • Index Language: German
                                                            XSL Messages 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 XSLT

                                                                    Regular Fields

                                                                    Field Name: Saxon XSLT::XML
                                                                    Field Properties Coordinates Field Format Field Behavior Quick Find
                                                                    • Top: 192 pt
                                                                    • Left: 96 pt
                                                                    • Bottom: 399 pt
                                                                    • Right: 546 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 XSLT::Query
                                                                    Field Properties Coordinates Field Format Field Behavior Quick Find
                                                                    • Top: 406 pt
                                                                    • Left: 96 pt
                                                                    • Bottom: 612 pt
                                                                    • Right: 546 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 XSLT::Result
                                                                    Field Properties Coordinates Field Format Field Behavior Quick Find
                                                                    • Top: 193 pt
                                                                    • Left: 680 pt
                                                                    • Bottom: 399 pt
                                                                    • Right: 1128 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 XSLT::Description
                                                                    Field Properties Coordinates Field Format Field Behavior Quick Find
                                                                    • Top: 117 pt
                                                                    • Left: 98 pt
                                                                    • Bottom: 187 pt
                                                                    • Right: 546 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

                                                                    Buttons

                                                                    Button Properties Coordinates Script/Script Step
                                                                      Type:
                                                                    • Text: Run XPath Query
                                                                      Additional Properties:
                                                                    • Change to hand cursor over button
                                                                    • Top: 619 pt
                                                                    • Left: 96 pt
                                                                    • Bottom: 665 pt
                                                                    • Right: 254 pt
                                                                    • Anchoring: Left, Top
                                                                    Perform Script [ “Run XQuery” ]

                                                                    Scripts:


                                                                    Script Hierarchy

                                                                    Load Saxon
                                                                    Run XQuery
                                                                    Run XQuery with variable
                                                                    Clear

                                                                    Next Script: [Run XQuery]
                                                                    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” ]
                                                                      • Else [ ]
                                                                      • Show Custom Dialog [ Title: "saxon loaded"; Message: MBS("Saxon.Version"); Default Button: “OK”, Commit: “Yes” ]
                                                                      • 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] Next Script: [Run XQuery with variable]
                                                                                    Script Name Run XQuery
                                                                                    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
                                                                                      • If [ MBS("Saxon.IsLoaded") = 0 ]
                                                                                      • Perform Script [ “Load Saxon” ]
                                                                                      • End If
                                                                                      • Set Variable [ $r; Value:MBS( "Saxon.XPathQuery"; Saxon XSLT::XML; Saxon XSLT::Query ) ]
                                                                                      • Set Field [ Saxon XSLT::Result; $r ]
                                                                                      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 XQuery] Next Script: [Clear]
                                                                                            Script Name Run XQuery with variable
                                                                                            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
                                                                                                • If [ MBS("Saxon.IsLoaded") = 0 ]
                                                                                                • Perform Script [ “Load Saxon” ]
                                                                                                • End If
                                                                                                • #We try a query with variable
                                                                                                • Set Variable [ $r; Value:MBS( "Saxon.Clear") ]
                                                                                                • #put in the value for the variable
                                                                                                • Set Variable [ $r; Value:MBS( "Saxon.SetParameter"; "param"; "1"; "integer") ]
                                                                                                • Set Variable [ $r; Value:MBS( "Saxon.SetParameter"; "other"; "2.4"; "json") ]
                                                                                                • #now run a query and pass list of variables
                                                                                                • Set Variable [ $query; Value:"$param+$other" ]
                                                                                                • Set Variable [ $VariableList; Value:"param¶other" ]
                                                                                                • Set Variable [ $r; Value:MBS( "Saxon.XPathQuery"; "<test/>"; $Query; $VariableList ) ]
                                                                                                • Set Field [ Saxon XSLT::Result; $r ]
                                                                                                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 XQuery with variable]
                                                                                                      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 XSLT::Result; 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

                                                                                                                  Download example: Saxon XPath

                                                                                                                  Used functions: