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

MBS FileMaker Plugin Example Databases

Saxon XQuery MrWatsons Examples

All examples are included with download of MBS FileMaker Plugin.

Saxon XQuery MrWatsons Examples.fmp12

Overview
Tables 1
Relationships 0
Layouts 1
Scripts 3
Value Lists 3
Custom Functions 1
Custom Menus 24
File Options
Default custom menu set [Standard FileMaker Menus]
Default theme <Missing Layout>
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
14 fields defined, 31 records
Saxon XSLT

Fields

Table Name: Saxon XSLT - 14 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: All
                                          • Index Language: German
                                              Query Normal, Text Auto-Enter:
                                              • Allow editing
                                              • Context table: Saxon XSLT
                                                Calculation: TextFormatRemove ( Self )
                                              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: All
                                                      • 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
                                                                ResultTidy Normal, Text Auto-Enter:
                                                                • Allow editing
                                                                • Context table: Saxon XSLT
                                                                  Calculation: Let ( [ vSelf = Saxon XSLT::Result ; resultFormatted = If( Left(vSelf; 1) = "<"; MBS("XML.Format"; vSelf); vSelf); resultFormatFailed = MBS("IsError"); resultText = If(resultFormatFailed; vSelf; resultFormatted); result = MBS("XML.Colorize"; resultText) ]; 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
                                                                    Params Normal, Text Auto-Enter:
                                                                    • Allow editing
                                                                    Validation:
                                                                    • Only during data entry
                                                                    Storage:
                                                                    • Repetitions: 1
                                                                    • Indexing: None
                                                                    • Automatically create indexes as needed
                                                                    • Index Language: German
                                                                          Keywords Normal, Text Auto-Enter:
                                                                          • Allow editing
                                                                          Validation:
                                                                          • Only during data entry
                                                                          Storage:
                                                                          • Repetitions: 1
                                                                          • Indexing: All
                                                                          • Index Language: German
                                                                                Sort Normal, Number Auto-Enter:
                                                                                • Allow editing
                                                                                • Serial: Generate: On creation, Next value: 330, Increment: 10
                                                                                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
                                                                                        Hide Condition:
                                                                                      • 1
                                                                                      • Top: 172 pt
                                                                                      • Left: 69 pt
                                                                                      • Bottom: 193 pt
                                                                                      • Right: 90 pt
                                                                                      • Anchoring: Left, Top
                                                                                      Field Format:
                                                                                      • Checkbox Set
                                                                                      • Display values from: \<xml/\>
                                                                                      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::XML
                                                                                      Field Properties Coordinates Field Format Field Behavior Quick Find
                                                                                      • Top: 197 pt
                                                                                      • Left: 96 pt
                                                                                      • Bottom: 439 pt
                                                                                      • Right: 657 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: 468 pt
                                                                                      • Left: 96 pt
                                                                                      • Bottom: 710 pt
                                                                                      • Right: 657 pt
                                                                                      • Anchoring: Left, Top and 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
                                                                                      Yes

                                                                                      Field Name: Saxon XSLT::Description
                                                                                      Field Properties Coordinates Field Format Field Behavior Quick Find
                                                                                      • Top: 67 pt
                                                                                      • Left: 98 pt
                                                                                      • Bottom: 168 pt
                                                                                      • Right: 657 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: 101 pt
                                                                                      • Left: 682 pt
                                                                                      • Bottom: 754 pt
                                                                                      • Right: 1232 pt
                                                                                      • Anchoring: Left and Right, Top and 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
                                                                                      Yes

                                                                                      Field Name: Saxon XSLT::ResultTidy
                                                                                      Field Properties Coordinates Field Format Field Behavior Quick Find
                                                                                      • Top: 101 pt
                                                                                      • Left: 682 pt
                                                                                      • Bottom: 754 pt
                                                                                      • Right: 1232 pt
                                                                                      • Anchoring: Left and Right, Top and 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
                                                                                      Yes

                                                                                      Field Name: Saxon XSLT::XSL Messages
                                                                                      Field Properties Coordinates Field Format Field Behavior Quick Find
                                                                                      • Top: 101 pt
                                                                                      • Left: 682 pt
                                                                                      • Bottom: 754 pt
                                                                                      • Right: 1232 pt
                                                                                      • Anchoring: Left and Right, Top and 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
                                                                                      Yes

                                                                                      Field Name: Saxon XSLT::XML
                                                                                      Field Properties Coordinates Field Format Field Behavior Quick Find
                                                                                      • Top: 100 pt
                                                                                      • Left: 682 pt
                                                                                      • Bottom: 753 pt
                                                                                      • Right: 1232 pt
                                                                                      • Anchoring: Left and Right, Top and 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
                                                                                      Yes

                                                                                      Field Name: Saxon XSLT::Query
                                                                                      Field Properties Coordinates Field Format Field Behavior Quick Find
                                                                                      • Top: 100 pt
                                                                                      • Left: 682 pt
                                                                                      • Bottom: 753 pt
                                                                                      • Right: 1232 pt
                                                                                      • Anchoring: Left and Right, Top and 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
                                                                                      Yes

                                                                                      Field Name: Saxon XSLT::Params
                                                                                      Field Properties Coordinates Field Format Field Behavior Quick Find
                                                                                      • Top: 721 pt
                                                                                      • Left: 330 pt
                                                                                      • Bottom: 767 pt
                                                                                      • Right: 657 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
                                                                                      Yes

                                                                                      Field Name: Saxon XSLT::Sort
                                                                                      Field Properties Coordinates Field Format Field Behavior Quick Find
                                                                                      • Top: 67 pt
                                                                                      • Left: 5 pt
                                                                                      • Bottom: 88 pt
                                                                                      • Right: 90 pt
                                                                                      • Anchoring: Left, Top
                                                                                      Field Format:
                                                                                      • Edit Box
                                                                                      • Auto-complete using previously entered values
                                                                                      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::Keywords
                                                                                      Field Properties Coordinates Field Format Field Behavior Quick Find
                                                                                      • Top: 215 pt
                                                                                      • Left: 5 pt
                                                                                      • Bottom: 710 pt
                                                                                      • Right: 90 pt
                                                                                      • Anchoring: Left, Top
                                                                                      Field Format:
                                                                                      • Edit Box
                                                                                      • Auto-complete using previously entered values
                                                                                      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::XML
                                                                                      Field Properties Coordinates Field Format Field Behavior Quick Find
                                                                                      • Top: 172 pt
                                                                                      • Left: 69 pt
                                                                                      • Bottom: 193 pt
                                                                                      • Right: 90 pt
                                                                                      • Anchoring: Left, Top
                                                                                      Field Format:
                                                                                      • Checkbox Set
                                                                                      • Display values from: <xml/>
                                                                                      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 XQuery
                                                                                      • Top: 721 pt
                                                                                      • Left: 96 pt
                                                                                      • Bottom: 767 pt
                                                                                      • Right: 254 pt
                                                                                      • Anchoring: Left, Bottom
                                                                                      Perform Script [ “Run XQuery” ]

                                                                                      Scripts:


                                                                                      Tab Controls

                                                                                      Tab Control Properties Coordinates
                                                                                        Justification:
                                                                                      • Left
                                                                                        Tab Width:
                                                                                        Default Front Tab:
                                                                                      • Tab 0
                                                                                      • Top: 67 pt
                                                                                      • Left: 669 pt
                                                                                      • Bottom: 767 pt
                                                                                      • Right: 1246 pt
                                                                                      • Anchoring: Left and Right, Top and Bottom
                                                                                      Tabs
                                                                                      Tab Properties Tab Controls Slide Controls Fields Buttons Portals Web Viewer Controls Charts
                                                                                        Tab 0:
                                                                                      • "Raw Result"
                                                                                          Field Objects
                                                                                            Tab 1:
                                                                                          • "Tidy Result"
                                                                                              Field Objects
                                                                                                Tab 2:
                                                                                              • "WebPreview"
                                                                                                  1 Web Viewer Controls
                                                                                                    Tab 3:
                                                                                                  • "XSL-Messages"
                                                                                                      Field Objects
                                                                                                        Tab 4:
                                                                                                      • "XML"
                                                                                                          Field Objects
                                                                                                            Tab 5:
                                                                                                          • "Query"
                                                                                                              Field Objects

                                                                                                              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: 101 pt
                                                                                                              • Left: 682 pt
                                                                                                              • Bottom: 754 pt
                                                                                                              • Right: 1232 pt
                                                                                                              • Anchoring: Left and Right, Top and Bottom
                                                                                                              If ( IsEmpty ( Saxon XSLT::Result ) ; "about:blank"; "data:text/html;charset=utf-8;base64," & Base64Encode ( Saxon XSLT::Result ) )

                                                                                                              Value Lists

                                                                                                              Value List Name Source Values On Layouts
                                                                                                              1 Custom
                                                                                                              • 1
                                                                                                                <xml/> Custom
                                                                                                                • <xml/>
                                                                                                                \<xml/\> Custom
                                                                                                                • \<xml/\>

                                                                                                                Script Hierarchy

                                                                                                                Load Saxon
                                                                                                                Run XQuery
                                                                                                                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: [Clear]
                                                                                                                                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.XQuery"; Saxon XSLT::XML; Saxon XSLT::Query ) ]
                                                                                                                                  • Set Field [ Saxon XSLT::Result; $r ]
                                                                                                                                  • Set Variable [ $Messages; Value:MBS( "Saxon.XSLMessages") ]
                                                                                                                                  • Set Field [ Saxon XSLT::XSL Messages; $Messages ]
                                                                                                                                  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]
                                                                                                                                        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 ]
                                                                                                                                            • Replace Field Contents [ Saxon XSLT::XSL Messages; Replace with calculation: "" ] [ No dialog ]
                                                                                                                                            • Replace Field Contents [ Saxon XSLT::ResultTidy; 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

                                                                                                                                                    Custom Functions

                                                                                                                                                    Function Name Parameters Availability Definition In Field Definitions In Scripts
                                                                                                                                                    G_IS_FindMode All accounts Get( WindowMode ) = 1

                                                                                                                                                      Custom Menu Sets

                                                                                                                                                      Menu Sets Menus In Scripts In Layouts Comments
                                                                                                                                                      [Standard FileMaker Menus]
                                                                                                                                                      • All Standard Menus

                                                                                                                                                      Download example: Saxon XQuery MrWatsons Examples

                                                                                                                                                      Used functions: