SlideShare a Scribd company logo
Filemaker Pro 6 Developers Guide To Xml Xsl
Beverly Voth download
https://ebookbell.com/product/filemaker-pro-6-developers-guide-
to-xml-xsl-beverly-voth-2108404
Explore and download more ebooks at ebookbell.com
Here are some recommended products that we believe you will be
interested in. You can click the link to download.
Filemaker Pro 6 For The Mac Fast Easy 1st Edition Lisa A Bucki
https://ebookbell.com/product/filemaker-pro-6-for-the-mac-fast-
easy-1st-edition-lisa-a-bucki-2421922
Advanced Filemaker Pro 6 Web Development 1st Bob Bowers Moyer
https://ebookbell.com/product/advanced-filemaker-pro-6-web-
development-1st-bob-bowers-moyer-2101510
Filemaker Pro 10 In Depth 1st Edition Safari An Oreilly Media Company
Feiler
https://ebookbell.com/product/filemaker-pro-10-in-depth-1st-edition-
safari-an-oreilly-media-company-feiler-22028252
Filemaker Pro 11 The Missing Manual Susan Prosser Stuart Gripman
https://ebookbell.com/product/filemaker-pro-11-the-missing-manual-
susan-prosser-stuart-gripman-2310112
Filemaker Pro 7 Bible
https://ebookbell.com/product/filemaker-pro-7-bible-4112814
Filemaker Pro 13 The Missing Manual 1st Edition Susan Prosser
https://ebookbell.com/product/filemaker-pro-13-the-missing-manual-1st-
edition-susan-prosser-4964994
Filemaker Pro 8 The Missing Manual 1st Edition Geoff Coffey
https://ebookbell.com/product/filemaker-pro-8-the-missing-manual-1st-
edition-geoff-coffey-5216852
Filemaker Pro 14 The Missing Manual 1st Edition Gripman Stuart Prosser
https://ebookbell.com/product/filemaker-pro-14-the-missing-manual-1st-
edition-gripman-stuart-prosser-5268942
Filemaker Pro 10 Bible Ray Cologon
https://ebookbell.com/product/filemaker-pro-10-bible-ray-
cologon-5470356
Filemaker Pro 6 Developers Guide To Xml Xsl Beverly Voth
Filemaker Pro 6 Developers Guide To Xml Xsl Beverly Voth
FileMaker®
Pro 6
Developer’s Guide
to XML/XSL
Beverly Voth
Wordware Publishing, Inc.
Library of Congress Cataloging-in-Publication Data
Voth, Beverly.
FileMaker Pro 6 developer’s guide to XML/XSL / Beverly Voth.
p. cm.
ISBN 1-55622-043-X (paperback)
1. FileMaker pro. 2. Database management. 3. XML (Document markup language)
4. XSL (Document markup language). I. Title.
QA76.9.D3V685 2003
005.75'65--dc21 2003002416
CIP
© 2003, Wordware Publishing, Inc.
All Rights Reserved
2320 Los Rios Boulevard
Plano, Texas 75074
No part of this book may be reproduced in any form or by any means
without permission in writing from Wordware Publishing, Inc.
Printed in the United States of America
ISBN 1-55622-043-X
10 9 8 7 6 5 4 3 2 1
0303
FileMaker is a registered trademark of FileMaker, Inc.
All brand names and product names mentioned in this book are trademarks or service marks of their
respective companies. Any omission or misuse (of any kind) of service marks or trademarks should not
be regarded as intent to infringe on the property of others. The publisher recognizes and respects all
marks used by companies, manufacturers, and developers as a means to distinguish their products.
All inquiries for volume purchases of this book should be addressed to Wordware
Publishing, Inc., at the above address. Telephone inquiries may be made by
calling:
(972) 423-0090
Contents
Acknowledgments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xi
Introduction. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xiii
Chapter 1 The Basics of XML . . . . . . . . . . . . . . . . . . . 1
1.1 A Brief History of XML . . . . . . . . . . . . . . . . . . . . . . . . 1
1.11 Markup Simplified . . . . . . . . . . . . . . . . . . . . . . . 2
Example 1: Text Containing Bold Formatting. . . . . . . . . . 2
Example 2: Revealing the Markup in Some Text Editors . . . . 3
Example 3: PostScript Printer Commands for the
Document. . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
Example 4: Rules-based Nested Structure Used for
Document Markup . . . . . . . . . . . . . . . . . . . . . . . 4
1.12 The Standard in SGML . . . . . . . . . . . . . . . . . . . . . 5
1.13 SGML Used as Basis for HTML and XML . . . . . . . . . . . . 6
1.14 HTML Can Become XHTML. . . . . . . . . . . . . . . . . . . 7
1.15 XML as a Standard . . . . . . . . . . . . . . . . . . . . . . . 7
1.2 XML Advantages . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
1.21 Why XML Data Exchange is Extensible . . . . . . . . . . . . . 8
Text Formats in FileMaker Pro . . . . . . . . . . . . . . . . . 9
Text Formats in XML . . . . . . . . . . . . . . . . . . . . . . 9
1.22 Saving Information for the Future . . . . . . . . . . . . . . 11
1.3 XML Document Examples and Terms . . . . . . . . . . . . . . . . 11
1.31 Well-formed and Valid XML Documents. . . . . . . . . . . . 12
1.32 Data Validation in FileMaker Pro . . . . . . . . . . . . . . . 13
Exercise 1.1 Validate Field Data Entry. . . . . . . . . . . . . 13
1.33 XML Document Structure . . . . . . . . . . . . . . . . . . . 15
FileMaker Pro and UTF-8 . . . . . . . . . . . . . . . . . . . 16
Standalone Documents . . . . . . . . . . . . . . . . . . . . 17
1.34 Document Type Declarations (DOCTYPE). . . . . . . . . . . 17
1.35 Processing Instructions . . . . . . . . . . . . . . . . . . . . 20
1.36 Comments . . . . . . . . . . . . . . . . . . . . . . . . . . . 21
Using Comments to Test HTML Documents . . . . . . . . . . 21
Comments for Future Reference. . . . . . . . . . . . . . . . 22
1.37 Elements and Attributes . . . . . . . . . . . . . . . . . . . . 22
Tag Names. . . . . . . . . . . . . . . . . . . . . . . . . . . 23
Attributes . . . . . . . . . . . . . . . . . . . . . . . . . . . 24
1.38 Element Content. . . . . . . . . . . . . . . . . . . . . . . . 24
1.39 The Element Tree Completed . . . . . . . . . . . . . . . . . 26
1.4 XML Character Conventions . . . . . . . . . . . . . . . . . . . . 27
1.41 White Space and End-of-Line Characters . . . . . . . . . . . 27
iii
Where Do We Get These End-of-Line Characters?. . . . . . . 29
Using the End-of-Line Characters . . . . . . . . . . . . . . . 29
1.42 Unicode vs. ASCII . . . . . . . . . . . . . . . . . . . . . . . 30
Exercise 1.2 Create Your Own ASCII Table . . . . . . . . . . 30
1.43 Names Using Alphanumeric Characters . . . . . . . . . . . . 32
1.5 Beyond Basic XML—Other Standards. . . . . . . . . . . . . . . . 33
1.51 URI, URL, and URN (The Uniform Resource Standards) . . . 33
Mailto Is a Special URL . . . . . . . . . . . . . . . . . . . . 35
1.52 XPath . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36
XPath String-Values . . . . . . . . . . . . . . . . . . . . . . 39
XPath Functions . . . . . . . . . . . . . . . . . . . . . . . . 40
XPointer Related to XPath . . . . . . . . . . . . . . . . . . . 40
1.6 Reading More about XML . . . . . . . . . . . . . . . . . . . . . . 41
Conclusion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41
Chapter 2 XML Import and Export with FileMaker Pro 6 . . . . 43
2.1 XML Export . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 44
2.11 Setting Up XML Export . . . . . . . . . . . . . . . . . . . . 44
2.12 FMPDSORESULT Export. . . . . . . . . . . . . . . . . . . . 46
2.13 FMPXMLRESULT Export. . . . . . . . . . . . . . . . . . . . 47
2.14 FMPDSORESULT vs. FMPXMLRESULT . . . . . . . . . . . . 49
2.2 Special Export Considerations . . . . . . . . . . . . . . . . . . . 50
2.21 Character Encoding . . . . . . . . . . . . . . . . . . . . . . 50
Exercise 2.1 Export Double-byte Characters . . . . . . . . . 50
2.22 XML from FileMaker Pro Related Fields. . . . . . . . . . . . 52
Exercise 2.2 Create Related Data XML Results . . . . . . . . 52
Exercise 2.3 Create Related XML Exports . . . . . . . . . . . 54
2.23 Repeating Field Data . . . . . . . . . . . . . . . . . . . . . 57
Tab-Separated Export of Repeating Fields. . . . . . . . . . . 58
Exercise 2.4 XML Export of Repeating Fields . . . . . . . . . 58
2.24 Number, Date, and Time Field Formats . . . . . . . . . . . . 61
2.25 Formatted Text and XML Export . . . . . . . . . . . . . . . 63
2.26 Container Fields and Value Lists . . . . . . . . . . . . . . . 64
2.27 Global Fields, Calculated Fields, and Summary Fields . . . . 64
2.28 Final Thoughts on XML Export with Filemaker Pro 6. . . . . 65
2.3 Scripted XML Exports . . . . . . . . . . . . . . . . . . . . . . . . 66
2.31 Setting Up Scripted XML Exports . . . . . . . . . . . . . . . 66
2.32 Export to RTF with EZxslt . . . . . . . . . . . . . . . . . . . 67
2.33 Exchange Data between FileMaker Pro and QuickBooks
Using XML . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 68
2.4 XML Import . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 68
2.41 Setting Up for XML Import . . . . . . . . . . . . . . . . . . 68
2.42 FMPXMLRESULT Import . . . . . . . . . . . . . . . . . . . 70
Exercise 2.5 Manual Transformations with FileMaker Pro . . 71
Example 1: Export, Edit the FIELD Elements, and Import . . 71
Contents
iv
Example 2: Transform with a Simple Stylesheet . . . . . . . 72
Example 3: Create a Stylesheet with FileMaker Pro. . . . . . 75
2.43 Scripted XML Import . . . . . . . . . . . . . . . . . . . . . 76
2.44 FileMaker Pro XML Import and Other XML Schemas . . . . . 77
2.5 Calculated Export of XML. . . . . . . . . . . . . . . . . . . . . . 79
2.6 Calculated Import of XML. . . . . . . . . . . . . . . . . . . . . . 82
2.61 Troi-Text Plug-in. . . . . . . . . . . . . . . . . . . . . . . . 83
2.62 Calculated Parsing of XML . . . . . . . . . . . . . . . . . . 83
2.7 Debugging XML Export and XML Import . . . . . . . . . . . . . . 86
2.8 Encrypting Your Data . . . . . . . . . . . . . . . . . . . . . . . . 86
Where to Go From Here.... . . . . . . . . . . . . . . . . . . . . . . . 88
Chapter 3 Document Type Definitions (DTDs) . . . . . . . . . . 89
3.1 Creating a Basic XML Document Containing a DTD . . . . . . . . 91
3.11 The Relationship between DTD Element Names and
FileMaker Pro Field Names . . . . . . . . . . . . . . . . . . . . . 91
Exercise 3.1 Check Your Field Names . . . . . . . . . . . . . 92
3.2 Elements in the DTD . . . . . . . . . . . . . . . . . . . . . . . . 92
3.3 Attributes in the DTD . . . . . . . . . . . . . . . . . . . . . . . . 95
3.4 A DTD for FileMaker Pro Themes. . . . . . . . . . . . . . . . . . 97
3.41 Every Layout Must Have at Least One Part . . . . . . . . . . 98
3.42 Creating a New Layout . . . . . . . . . . . . . . . . . . . . 98
Create a Document Type Definition (DTD) for Themes . . . 101
Exercise 3.2 Create a Document Type Definition for
FileMaker Pro Theme Files. . . . . . . . . . . . . . . . . . 101
3.5 Entities in the DTD . . . . . . . . . . . . . . . . . . . . . . . . 109
3.6 Document Type Definitions (DTDs) vs. Schema/XSD . . . . . . . 110
3.61 DTD for FileMaker Pro Plug-ins . . . . . . . . . . . . . . . 110
3.7 More about Document Type Definitions . . . . . . . . . . . . . . 111
Chapter 4 FileMaker Pro XML Schema or Grammar
Formats (DTDs). . . . . . . . . . . . . . . . . . . . 113
4.1 FMPXMLLAYOUT Schema/Grammar . . . . . . . . . . . . . . . 114
4.11 Layout Information . . . . . . . . . . . . . . . . . . . . . 116
4.12 Field Information . . . . . . . . . . . . . . . . . . . . . . 117
4.13 Merge Fields . . . . . . . . . . . . . . . . . . . . . . . . . 119
Exercise 4.1 Create Merge Fields for FMPXMLLAYOUT . . . 119
4.14 Value List Information . . . . . . . . . . . . . . . . . . . . 120
4.15 Completing the FMPXMLLAYOUT DTD . . . . . . . . . . . 120
4.16 FileMaker Pro Report/Layout Information. . . . . . . . . . 121
4.2 FMPXMLRESULT Schema/Grammar . . . . . . . . . . . . . . . 122
4.21 Database Information . . . . . . . . . . . . . . . . . . . . 123
4.22 Metadata Information . . . . . . . . . . . . . . . . . . . . 124
4.23 The Resultset (Contents of the Fields). . . . . . . . . . . . 125
4.24 Completing the FMPXMLRESULT DTD . . . . . . . . . . . 126
4.3 FMPDSORESULT Schema/Grammar . . . . . . . . . . . . . . . 127
Contents
v
4.31 Records (ROWS) and Fields . . . . . . . . . . . . . . . . . 128
4.32 Related and Repeating Fields . . . . . . . . . . . . . . . . 129
4.33 Completing the FMPDSORESULT DTD . . . . . . . . . . . 129
4.4 A Document Type Definition for Database Design Reports . . . . 130
4.41 Database Design Report with XML and XSL . . . . . . . . . 133
4.42 XML Output Grammar for Database Design Report . . . . . 136
Database Design Report in the Browser . . . . . . . . . . . 140
4.43 Database Design Report File Grammar . . . . . . . . . . . 141
4.44 Details of the XML Database Design Report . . . . . . . . . 143
Field Details . . . . . . . . . . . . . . . . . . . . . . . . . 143
Reference Elements . . . . . . . . . . . . . . . . . . . . . 146
Relationship Details . . . . . . . . . . . . . . . . . . . . . 148
Value List Details. . . . . . . . . . . . . . . . . . . . . . . 149
Layout Details . . . . . . . . . . . . . . . . . . . . . . . . 149
Script Details. . . . . . . . . . . . . . . . . . . . . . . . . 151
Password Details . . . . . . . . . . . . . . . . . . . . . . . 154
4.45 FileMaker Pro Document Definitions . . . . . . . . . . . . 155
Chapter 5 XML and FileMaker Pro Web Publishing . . . . . . 157
Browser Requirements . . . . . . . . . . . . . . . . . . . . 158
5.1 Setting Up Web Companion for XML Requests . . . . . . . . . . 158
5.11 Web Companion as a Web Server . . . . . . . . . . . . . . 159
5.12 Web Companion as CGI . . . . . . . . . . . . . . . . . . . 160
Overview of the Processing Steps for a Web Server
and CGI . . . . . . . . . . . . . . . . . . . . . . . . . . . 160
5.13 Static or Persistent Server Address. . . . . . . . . . . . . . 162
5.14 FileMaker Pro Products for XML Publishing . . . . . . . . . 163
Using Middleware with FileMaker Pro Unlimited . . . . . . 164
5.15 Standalone Considerations for Testing. . . . . . . . . . . . 167
Macintosh OS 8.x, 9.x Open Transport TCP/IP
Configuration . . . . . . . . . . . . . . . . . . . . . . . . 167
Setting TCP/IP on Windows 95, 98, NT, Me, and 2000 . . . 169
Setting TCP/IP on Macintosh OS X . . . . . . . . . . . . . 170
Finish TCP/IP Setup for All Systems . . . . . . . . . . . . . 170
5.16 Web Companion Setup. . . . . . . . . . . . . . . . . . . . 171
5.17 Sharing Databases for Web Companion . . . . . . . . . . . 175
Databases . . . . . . . . . . . . . . . . . . . . . . . . . . 175
Text Pages . . . . . . . . . . . . . . . . . . . . . . . . . . 177
Images . . . . . . . . . . . . . . . . . . . . . . . . . . . . 177
Other Files . . . . . . . . . . . . . . . . . . . . . . . . . . 178
5.18 FileMaker Pro Unlimited . . . . . . . . . . . . . . . . . . . 178
5.2 XML Request Commands for Web Companion . . . . . . . . . . 181
5.21 Database and Layout. . . . . . . . . . . . . . . . . . . . . 181
Naming Suggestions . . . . . . . . . . . . . . . . . . . . . 182
5.22 Actions . . . . . . . . . . . . . . . . . . . . . . . . . . . . 182
Contents
vi
Create New Records . . . . . . . . . . . . . . . . . . . . . 183
Duplicate Records . . . . . . . . . . . . . . . . . . . . . . 183
Edit Records . . . . . . . . . . . . . . . . . . . . . . . . . 184
Delete Records . . . . . . . . . . . . . . . . . . . . . . . . 184
Find Records . . . . . . . . . . . . . . . . . . . . . . . . . 185
Layout Request. . . . . . . . . . . . . . . . . . . . . . . . 186
Database Names Request . . . . . . . . . . . . . . . . . . 187
Layout Names Request . . . . . . . . . . . . . . . . . . . . 188
Script Names Request . . . . . . . . . . . . . . . . . . . . 189
Open or Close Databases Command . . . . . . . . . . . . . 190
Request for Image in a Container Field . . . . . . . . . . . 190
5.23 Parameters . . . . . . . . . . . . . . . . . . . . . . . . . . 191
Database Parameter . . . . . . . . . . . . . . . . . . . . . 191
Layout Parameter . . . . . . . . . . . . . . . . . . . . . . 191
XML Format Parameter. . . . . . . . . . . . . . . . . . . . 192
RecordID Parameter . . . . . . . . . . . . . . . . . . . . . 195
Record Modification Count Parameter . . . . . . . . . . . . 196
Parameters for Using Stylesheets . . . . . . . . . . . . . . 196
Password Parameter for -dbopen Request . . . . . . . . . . 197
Find Request Parameters. . . . . . . . . . . . . . . . . . . 197
5.24 Creating the XML Requests . . . . . . . . . . . . . . . . . 203
Exercise 5.1 Creating XML Requests . . . . . . . . . . . . . 204
Instructions . . . . . . . . . . . . . . . . . . . . . . . . . 206
5.25 Creating or Editing Related Records . . . . . . . . . . . . . 208
Deleting Related Records . . . . . . . . . . . . . . . . . . 210
5.26 Repeating Field Data. . . . . . . . . . . . . . . . . . . . . 210
5.3 Performing Scripts on Web-Published Databases . . . . . . . . . 211
5.31 Script Steps to Avoid in Web Publishing . . . . . . . . . . . 215
5.4 Security on the Web . . . . . . . . . . . . . . . . . . . . . . . . 215
5.41 Security with Web Companion. . . . . . . . . . . . . . . . 216
5.42 Security vs. Security Blanket. . . . . . . . . . . . . . . . . 217
Security Blankets. . . . . . . . . . . . . . . . . . . . . . . 217
Security . . . . . . . . . . . . . . . . . . . . . . . . . . . 221
5.43 Script Security . . . . . . . . . . . . . . . . . . . . . . . . 232
5.44 Final XML Web Publishing Thought . . . . . . . . . . . . . 233
5.5 Error Codes for XML . . . . . . . . . . . . . . . . . . . . . . . . 233
5.51 JavaScript Errors . . . . . . . . . . . . . . . . . . . . 235
Chapter 6 Using HTML and XHTML to Format Web Pages . . . 237
6.1 HTML Document Structure . . . . . . . . . . . . . . . . . . . . 238
6.2 The HEAD Element . . . . . . . . . . . . . . . . . . . . . . . . 240
6.21 The TITLE Element. . . . . . . . . . . . . . . . . . . . . . 240
6.22 The META Element. . . . . . . . . . . . . . . . . . . . . . 240
6.23 The LINK Element Can Replace STYLE and SCRIPT. . . . . 241
6.24 The BASE Element . . . . . . . . . . . . . . . . . . . . . . 243
Contents
vii
6.3 The Main BODY of the HTML Document . . . . . . . . . . . . . 243
6.31 Text. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 244
Headings . . . . . . . . . . . . . . . . . . . . . . . . . . . 247
Addresses . . . . . . . . . . . . . . . . . . . . . . . . . . 248
Quotations . . . . . . . . . . . . . . . . . . . . . . . . . . 248
Structured Text. . . . . . . . . . . . . . . . . . . . . . . . 249
Preformatted Text . . . . . . . . . . . . . . . . . . . . . . 250
6.32 Listed Items in HTML . . . . . . . . . . . . . . . . . . . . 250
6.33 Presentation of the Web Page with the TABLE Element . . . 253
TABLE Attributes . . . . . . . . . . . . . . . . . . . . . . . 254
TABLE Rows . . . . . . . . . . . . . . . . . . . . . . . . . 257
The Table Cell . . . . . . . . . . . . . . . . . . . . . . . . 258
Table Within a Table . . . . . . . . . . . . . . . . . . . . . 259
6.34 Hyperlinks and Anchors . . . . . . . . . . . . . . . . . . . 261
Attributes for Script Calls . . . . . . . . . . . . . . . . . . 262
6.35 Images and Objects . . . . . . . . . . . . . . . . . . . . . 263
Image Maps . . . . . . . . . . . . . . . . . . . . . . . . . 264
Objects . . . . . . . . . . . . . . . . . . . . . . . . . . . . 265
6.36 FRAME Your Web Pages . . . . . . . . . . . . . . . . . . . 266
Frames Using Frameset Pages . . . . . . . . . . . . . . . . 268
6.4 Deprecated HTML Elements . . . . . . . . . . . . . . . . . . . . 273
6.5 Using the FORM Element to Make HTTP Requests . . . . . . . . 274
6.51 Input Text . . . . . . . . . . . . . . . . . . . . . . . . . . 275
Select Menus . . . . . . . . . . . . . . . . . . . . . . . . . 277
Hidden Text . . . . . . . . . . . . . . . . . . . . . . . . . 278
6.52 Submitting the Form . . . . . . . . . . . . . . . . . . . . . 279
6.53 Using Forms for XML Requests. . . . . . . . . . . . . . . . 280
6.54 Fields in Your Database and FORM Elements . . . . . . . . 281
6.55 Actions . . . . . . . . . . . . . . . . . . . . . . . . . . . . 282
6.56 Parameters in Forms . . . . . . . . . . . . . . . . . . . . . 284
6.6 Claris Dynamic Markup Language. . . . . . . . . . . . . . . . . 286
6.61 Languages Related to HTML . . . . . . . . . . . . . . . . . 287
i-mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . 287
Compact HTML (cHTML) and XHTML Basic. . . . . . . . . 288
Back to Basics . . . . . . . . . . . . . . . . . . . . . . . . 289
Chapter 7 Extensible Stylesheet Language (XSL) and
FileMaker Pro . . . . . . . . . . . . . . . . . . . . 291
7.1 XSL is XML. . . . . . . . . . . . . . . . . . . . . . . . . . . . . 292
7.11 Namespace Declarations . . . . . . . . . . . . . . . . . . . 293
7.12 Namespaces in FileMaker Pro 6 . . . . . . . . . . . . . . . 295
Database Design Reports and Namespaces . . . . . . . . . 295
Example XML Files in FileMaker Pro. . . . . . . . . . . . . 296
7.13 Stylesheet Instruction in XML Documents . . . . . . . . . . 296
7.14 Stylesheet Processing Instruction from HTTP Requests . . . 297
Contents
viii
7.2 Top-level Elements in XSL . . . . . . . . . . . . . . . . . . . . . 298
7.21 XSL Templates . . . . . . . . . . . . . . . . . . . . . . . . 302
7.3 Other XSL/XSLT Elements . . . . . . . . . . . . . . . . . . . . . 306
7.31 Repeating Elements . . . . . . . . . . . . . . . . . . . . . 306
7.32 Sorting the Source Document . . . . . . . . . . . . . . . . 306
7.33 XSLT Elements for Text . . . . . . . . . . . . . . . . . . . 307
7.34 Conditional Tests. . . . . . . . . . . . . . . . . . . . . . . 309
7.35 Add Elements and Attributes. . . . . . . . . . . . . . . . . 310
7.4 XPath Functions . . . . . . . . . . . . . . . . . . . . . . . . . . 312
7.41 Additional XSL Functions . . . . . . . . . . . . . . . . . . 317
7.5 XSL and HTML. . . . . . . . . . . . . . . . . . . . . . . . . . . 318
7.6 FileMaker Pro Value Lists and XSL . . . . . . . . . . . . . . . . 319
7.7 Browsers and XSL . . . . . . . . . . . . . . . . . . . . . . . . . 321
7.8 Cascading Style Sheets (CSS) and XML . . . . . . . . . . . . . . 321
7.81 A Simple Rollover Effect . . . . . . . . . . . . . . . . . . . 322
7.82 Common CSS Terms . . . . . . . . . . . . . . . . . . . . . 323
Chapter 8 XSLT Examples for FileMaker Pro XML . . . . . . . 325
8.1 Creating Databases from XML Sources . . . . . . . . . . . . . . 325
8.11 Create a Database with FMPXMLRESULT . . . . . . . . . . 325
8.12 Create a Database with FMPDSORESULT . . . . . . . . . . 326
8.2 Transform FMPDSORESULT into FMPXMLRESULT . . . . . . . . 327
8.21 Example 1: Find the Rows/Records and Display
Some Text . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 327
8.22 Example 2: Display Something for the Fields . . . . . . . . 329
8.23 Example 3: Return an XML Result and Display
Elements Instead of Text . . . . . . . . . . . . . . . . . . . . . 330
8.24 Example 4: Transformation from FMPDSORESULT to
FMPXMLRESULT Without the Fields . . . . . . . . . . . . . . . 331
8.25 Example 5: Get the Field Names for the Transformation . . 333
8.3 XML to HTML . . . . . . . . . . . . . . . . . . . . . . . . . . . 336
8.31 FMPXMLRESULT to HTML. . . . . . . . . . . . . . . . . . 336
8.32 FMPDSORESULT to HTML . . . . . . . . . . . . . . . . . . 337
Example 1: Create a Simple HTML Table from
FMPDSORESULT. . . . . . . . . . . . . . . . . . . . . . . 337
Example 2: Create an HTML Table with Column
Names from Field Names . . . . . . . . . . . . . . . . . . 339
8.33 Subsummaries with FMPDSORESULT . . . . . . . . . . . . 341
8.4 Fixed-width Text Export . . . . . . . . . . . . . . . . . . . . . . 341
8.41 Getting the Column Widths . . . . . . . . . . . . . . . . . 341
8.42 Setting Up Default Values . . . . . . . . . . . . . . . . . . 342
8.43 Passing Parameters. . . . . . . . . . . . . . . . . . . . . . 343
8.44 Testing Data Length . . . . . . . . . . . . . . . . . . . . . 344
8.45 Looping to Add Padding Characters . . . . . . . . . . . . . 346
8.46 The Complete Variable Fixed-Width Stylesheet . . . . . . . 347
Contents
ix
8.5 Export XML from Related Databases . . . . . . . . . . . . . . . 350
8.51 Export as FMPDSORESULT . . . . . . . . . . . . . . . . . 350
Step 1: Simple Export . . . . . . . . . . . . . . . . . . . . 350
Step 2: Export with Related Fields. . . . . . . . . . . . . . 351
Step 3: Adding Other Related Fields . . . . . . . . . . . . . 353
8.52 Export as FMPXMLRESULT . . . . . . . . . . . . . . . . . 355
8.53 Export to HTML . . . . . . . . . . . . . . . . . . . . . . . 356
8.6 Import XML into Related Databases . . . . . . . . . . . . . . . . 358
8.61 The XML Source . . . . . . . . . . . . . . . . . . . . . . . 358
8.62 The Databases . . . . . . . . . . . . . . . . . . . . . . . . 360
8.63 The XSLT Stylesheets. . . . . . . . . . . . . . . . . . . . . 361
8.7 XSLT and Web Publishing . . . . . . . . . . . . . . . . . . . . . 364
8.8 More XSLT Examples . . . . . . . . . . . . . . . . . . . . . . . 364
Appendix A Glossary of Acronyms and Terms . . . . . . . . . . 365
Appendix B Resources . . . . . . . . . . . . . . . . . . . . . . 369
Index . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 381
Contents
x
Acknowledgments
First, I must thank Rich Coulombre for recommending that I write this
book. Yes, I thank him even though he knows the time and effort
needed for such an undertaking! Mostly, I thank Rich for reminding me
to put everything in perspective, as life seems to happen while you’re
writing a book.
The Friday night FileMaker chat group chimed in with so much
support to get me going and to keep me going. Among them I found
my first technical editor, Chad Gard. Our initial focus was XML in web
publishing and Chad’s help was invaluable! When XML became
another format for import and export in FileMaker Pro, my current
technical editor, Doug Rowe, another chat buddy, took on the chal-
lenge. Both of these wonderful people are great at taking the
“technical” and making it “human.” They are busy being great
FileMaker Pro developers and you’ll find examples from both of them
on the companion web sites. Another great FileMaker Pro developer,
Jon Rosen, has been helpful in my quest for a publisher.
I could not have written this book without some terrific people at
FileMaker, Inc. I have been working with web publishing and data-
bases for a very long time. When FileMaker, Inc. moved in the same
direction, I was extremely delighted. They also saw the oncoming
freight train, XML, and integrated that technology in many ways. Now
you have the chance to understand why we all think this is exciting.
Kevin Mallon has been my main contact and extremely helpful by
getting information for me on the products. I think he’s more than a
public relations person at FileMaker, Inc. I think he’s a “believer”!
Jimmy Jones, Dave McKee, Marcel De Maria, and Dave Dumas are
among my heros at FileMaker, Inc. They give freely to the FileMaker
community, through the mail lists, and support the developers’ quest
for the ultimate database.
Rick Kalman, technical liaison at FileMaker, Inc., is an “XML devo-
tee,” too. Rick and Jay Welshofer have been instrumental in pushing
the rest of us into preparing for the journey. You’ll find them on the
XML-talk list at http://www.filemaker.com/xml/xml_talk.html, and in
some of the XSLT examples, http://www.filemaker.com/xml/xslt_
library.html.
Wordware Publishing has been so wonderful at taking a chance on
me. I could not have finished without Jim Hill, Wes Beckwith, Beth
xi
Kohler, and Paula Price! I just knew that this book would fit in with
their other FileMaker Pro titles.
The most understanding bunch of people, my coworkers, family,
and friends, have supported me in more ways than one! The
Moondudes Extraordinaire, Fred Smith and Herman Adams, let me
work on this project when my talents were needed elsewhere at
Moonbow Software. But I hear the pride in their voices when they tell
clients that “we are writing a book!” It’s definitely “we,” because I
couldn’t have done it without their support.
My parents, Duane and Lynne Rabbitt, and sister, Kathy Branch,
always knew I could do something like this! They wouldn’t let me give
up when I had the rest of my life to contend with. My fiance, Jesse
Lockard, and his parents, TJ and Carole, also supported me, even
though I should have been spending time getting a new life!
Finally, I thank you for taking the time to read FileMaker Pro 6
Developer’s Guide to XML/XSL. That tells me that you are as interested
as I am about XML and how we can achieve something wonderful with
it and FileMaker Pro.
Acknowledgments
xii
Introduction
XML (Extensible Markup Language) is a standardized way of format-
ting text to facilitate data exchange for machines and humans.
Documents are composed of tags, or markup, surrounding the data
content. The markup can describe the content or be a generic text or
binary data holder:
<descriptor>data content</descriptor>
<COL><DATA>field content</DATA></COL>
That is all you really need to know about XML and FileMaker Pro 6,
unless, of course, you also need some hints as to what to do with that
knowledge! This book will help you understand what XML is and how
to create XML documents with Filemaker Pro 6 export and web pub-
lishing. You will learn how FileMaker Pro XML can be transformed
with Extensible Stylesheet Language (XSL) into text, Hypertext
Markup Language (HTML), or other XML formats. Other XML formats
can be transformed for importing data into FileMaker Pro 6 databases,
so you will appreciate why XML is useful to you as a means of data
exchanges.
The Design of This Book
Throughout the book, you will find examples of XML and XSL and cor-
responding FileMaker Pro 6 scripts and functions, if relevant.
Chapter 1 contains a brief history of XML, including samples of
markup formatting and how SGML (Standard Generalized Markup
Language), HTML, and XML are related. You will learn about the
advantages of XML with some examples and definitions of XML terms.
Character encoding, Unicode, and how it is used in XML and
FileMaker Pro 6 is presented here. XPath, the process for determining
the location of data within a XML documents, is also introduced.
Chapter 2 is about exporting and importing XML with FileMaker
Pro 6. The first examples of the XML grammars, FMPXMLRESULT and
FMPDSORESULT, are discussed here. You will learn how to create
manual, calculated, and scripted exports of XML documents. How
FileMaker Pro produces related fields, repeating fields, and other field
formats in XML exports, imports, and web publishing is discussed. An
xiii
introduction to XSL is also presented here, along with calculated and
scripted imports of XML data into FileMaker Pro 6.
Chapter 3 teaches you about the Document Type Definition (DTD)
and how it relates to XML. Many XML formats use a DTD to describe
how the document should be formatted. Understanding DTDs is most
useful if you are importing and exporting data between FileMaker Pro
6 and other systems. An exercise for creating Document Type Defini-
tions uses FileMaker Pro 6 layout theme files and is included in this
chapter.
Chapter 4 explores the DTD further by drilling down into the
FileMaker Pro 6 grammars for XML import, export, and web publish-
ing. The FMPXMLLAYOUT grammar is introduced along with more
details about the FMPXMLRESULT and the FMPDSORESULT gram-
mars. The Database Design Report found in FileMaker Developer 6 has
its own grammar and the discussion of how XML and XSL is used for
the report may help you understand these two technologies.
Chapter 5 explains how FileMaker Pro web publishes XML. You
will be given suggestions and hints for designing your databases for
optimum web publishing. How to make a Hypertext Transfer Protocol
(HTTP) request to FileMaker Pro 6 is discussed. You will learn about
the use of scripts with web-published databases. Some security hints
and tips to add to recommendations by FileMaker, Inc., can be found
in this chapter.
Chapter 6 discusses Hypertext Markup Language (HTML) and
XHTML. This format for web pages or text pages displayed by brows-
ers is a common method of displaying text, images, and hyperlinks to
other documents. XML can be transformed into HTML, thus, detailed
information about the HTML elements is presented here. To make
HTML documents compliant with XML, XHTML recommendations are
also considered. Form requests can be made to web-published
FileMaker Pro 6 databases, so the similarities with hyperlink requests
can be found in this chapter. The difference for using HTML on smaller
browsers, such as mobile telephones, is discussed in this chapter.
Chapters 7 and 8 define the terms for stylesheet transformation of
XML with XSL. XPath is explored further here for use with XSL. How
browsers handle XSL and how FileMaker Pro uses XSL are also dis-
cussed here.
Introduction
xiv
To Be or Not
No attempt is made to assist you in creating databases with FileMaker
Pro, but your thoughts will be guided toward designing databases for
optimal data exchange with XML. All efforts will be made to explain
these design considerations and to help you use XML within your cur-
rent files. There are excellent resources for working with FileMaker
Pro that are beyond the scope of this book. The FileMaker, Inc. web
site has example files, a special XML section at http://www.file-
maker.com/xml/, and a list of books.
All XML and XSL definitions are taken from the standards and rec-
ommendations presented by the World Wide Web Consortium (W3C),
http://www.w3.org/. Rather than repeating these documents, you will
find simplified examples intended to help you understand how you can
use the standards with a minimum of effort. Consult those abstracts
and specifications on the W3C web site for the latest changes.
Introduction
xv
This page intentionally left blank
C h a p t e r 1
The Basics of XML
This chapter is intended for the FileMaker Pro database designer. You
will be presented with examples of markup languages and a brief his-
tory of XML. You will begin to understand why XML can be important
to you and how XML documents are structured. You will learn about
some of the other standards based on XML for document presentation.
If examples of similar usage in FileMaker Pro are helpful, you will find
them here next to the XML examples.
1.1 A Brief History of XML
Extensible Markup Language (XML) is based upon SGML (Standard
Generalized Markup Language). The simplest explanation of SGML is
that it is a method of writing documents with special formatting
instructions, or markup, included. A publishing editor makes notations
in the margin of a document to alert an author of changes needed to a
document. The notations are markup of the document and, indeed,
this is where the term “markup” originated. Markup allows the SGML
or XML document to be distributed electronically while preserving the
format or style of the text. An SGML document contains the content
and the markup. The emphasis is placed on the formatting rather than
the content, otherwise you would simply have an ordinary document.
SGML can be used to facilitate the publishing of documents as
electronic or printed copy. Some programs that read the markup may
also translate the styles, for example, to Braille readers and printers.
The same document might be viewed on a smaller screen such as those
on personal digital assistants (PDAs) or pagers and cellular telephones.
The markup can mean something completely different based upon the
final destination of the document and the translation to another
1
format. Using stylesheets or transformation methods, a single docu-
ment with content and markup can be changed upon output.
1.11 Markup Simplified
To help you understand markup, four examples are given in this sec-
tion. They are based on the same results but have very different means
of getting there. The first example illustrates that “there may be more
than you see” on a monitor or printed page. The second example uses
Rich Text Format (RTF) to show a way to embed formatting in a docu-
ment for transportability. The third example shows the PostScript file
(commands) to produce the desired results consistently on a laser
printer. The fourth example uses the nested tag style found in SGML,
HTML, and XML documents. You will begin to see how this final
markup method can provide the formatting that you don’t see, the
transportability and the consistency of methods two and three, along
with additional information about the document and document
contents.
Example 1: Text Containing Bold Formatting
This has bold words in a sentence.
Using a word processor or electronic text editor, you may simply click
on the word or phrase and apply the text style with special keystrokes
(such as Control+B or Command+B) or choose Bold from a menu. On
the word processor or computer screen, you can easily read the text,
but you do not see the machine description, or code, describing how
this text is to be displayed. You may not care how or why that hap-
pens, but the computer needs the instructions to comply with your
wishes for a format change.
If you save the document and display or print it later, you want the
computer to reproduce the document exactly as you designed it. Your
computer knows what the stored code (or character markup) means
for that text. A problem may arise if you place that code on another
operating system or have a different word processor. There may be a
different interpretation of the code that produces undesired results.
This markup is consistent only if all other variables are equal. The next
example uses a text encoding method to change the machine or appli-
cation code into something more standard and portable.
2 Chapter 1: The Basics of XML
Example 2: Revealing the Markup in Some Text
Editors
{rtf
{This has }{b bold words}{ in a sentence.
par }}
The above sentence shows Rich Text Format (RTF) markup inter-
spersed and surrounding the words of a document. The characters “{”,
“}”, and “” all mean something in this document but have nothing to
do with the content. Rich Text Format markup is used by many word
processors to change the visual format of the displayed text. As each
new style is encountered, the formatting changes without changing the
content of the document. A document becomes easily transportable to
other word processors by using Rich Text Format. Each application that
knows how to interpret Rich Text Format can show the intent of the
author. This book was composed on a word processor, saved as RTF,
and electronically submitted to the publisher. Regardless of the appli-
cation, electronic device, or operating system used to create the
document, the styling is preserved.
Rich Text Format markup adds no other information about the
text. We may not know who wrote the sentence or when it was writ-
ten. This information can be included as part of the content of the
document but may be difficult to extract easily. We may have no con-
trol over the formatting or be allowed to change it for use with other
devices. Using a translation application, we can convert it to the next
example, the commands our printer understands.
Example 3: PostScript Printer Commands for the
Document
%!PS-Adobe-3.0
%%Title: ()
%%Creator: ()
%%CreationDate: (10:29 AM Saturday, May 26, 2001)
%%For: ()
%%Pages: 1
%%DocumentFonts: Times-Roman Times-Bold
%%DocumentData: Clean7Bit
%%PageOrder: Ascend
%%Orientation: Portrait
// more code here has been snipped for brevity //
%%EndPageSetup
gS 0 0 2300 3033 rC
250 216 :M
Chapter 1: The Basics of XML 3
f57 sf
(This has )S
431 216 :M
f84 sf
.032 .003(bold words)J
669 216 :M
f57 sf
( in a sentence.)S
endp
showpage
%%PageTrailer
%%Trailer
end
%%EOF
The third example, above, is the same text used in the previous two
examples and printed to a file as a PostScript document. It uses a dif-
ferent markup even though it is the same text and same document.
PostScript is a language, developed by Adobe in 1985, that describes
the document for printers, imagesetters, and screen displays. These
files can also be converted to Adobe Portable Document Format (.pdf).
The markup retains the document or image style so that it can be
printed exactly the same way every time. It is a language that is spe-
cific to these PostScript devices. An application can translate this
document to make it portable, too.
Example 4: Rules-based Nested Structure Used for
Document Markup
<? Command: use stylesheet1 for external rules ?>
<document author="Beverly" creationDate="06 AUG 2001">
<paragraph importance="highest">
<sentence>This has <b>bold words</b> in a sentence.</sentence>
</paragraph>
<paragraph importance="optional">
<sentence>The styling may be lost.</sentence>
</paragraph>
</document>
Unlike the Rich Text Format, nested markup may also contain a
description of the text contents. The markup is often called a tag and
may define various rules for the document. Sometimes the rules are
internal such as “<b>” and “</b>” or external such as a stylesheet
(set of rules) to apply to the whole document or portions of a
document.
4 Chapter 1: The Basics of XML
There can be rules for characters, words, sentences, paragraphs,
and the entire document. Characters inherit the rules of the word they
are in. Words inherit the rules of the sentence, and sentences inherit
the rules of the paragraph. The rules may not be just the formatting or
style of the text but may also allow for flexibility in display.
<sentence color="blue">Some markup allows for a
<text color="red">change</text> in the document.</sentence>
Some formatting rules may also be different and change the inherited
rules. All of the characters and words in the sentence above have a
rule telling them to be blue. The text color can change to red without
changing the sentence’s blue color. In this nested markup, only the
inner tags make the rule change.
Whether you use Rich Text Format or the nested structure found in
SGML, HTML, and XML, changing the content of the words and
phrases in the document does not change the style, the format, or the
rules. Documents created with markup can be consistent. As the con-
tent changes, the style, formatting, and rules remain the same. The
portability of documents containing markup to various applications
and systems makes them very attractive. Standards have been recom-
mended to ensure that every document that uses these standards will
maintain portability.
1.12 The Standard in SGML
Charles Goldfarb, Ed Mosher, and Ray Lorie created General Markup
Language (GML) in 1969. These authors wanted to adapt documents
to make them readable by various applications and operating systems.
They also saw the need to make the markup standard to industries
with diverse requirements. Two or more companies could agree on the
markup used in order to facilitate the exchange of information. Differ-
ent standards could be designed for each industry yet could have
elements common to them all.
Another requirement for GML was to have rules for documents. To
maintain an industry standard, rules could be created to define a docu-
ment. One rule could define the type of content allowed within the
document. Another rule could define the structure of the document.
You might say these rules could be the map of the document. If you
had the map, you could go to any place on the map. Using this kind of
markup, you could locate and extract portions of the document more
easily.
Chapter 1: The Basics of XML 5
GML evolved and was renamed Standard Generalized Markup
Language. In 1986 the International Organization for Standardization
(ISO) designated SGML as standard ISO-8879. SGML is now used
worldwide for the exchange of information.
1.13 SGML Used as Basis for HTML and XML
When the World Wide Web was developed in 1989, Tim Berners-Lee
used SGML as a basis for Hypertext Markup Language (HTML). HTML
is a document standard for the Internet. Although the set of rules for
HTML is limited, HTML still fulfills many of the SGML goals. The
HTML markup includes text formatting for the display of content to
web browsers and hyperlinks to connect separate documents. An
example of this markup for web browsers is shown in Listing 1.1.
HTML is application independent, and documents using HTML can be
viewed with various operating systems.
Listing 1.1 Example of Hypertext Markup Language
<HMTL>
<HEAD>
<TITLE>My Document in HTML</TITLE>
</HEAD>
<BODY>
<H1>This Is The Top Level Heading</H1>
Here is content<BR>
followed by another line.
<HR>
I can include images <IMG SRC="mygraphic.gif"> in a line
of text!<BR>
Good-bye for now.<BR>
<A HREF="anotherPage.html">Go to another page with this
link.</A>
</BODY>
</HTML>
Unlike SGML, HTML was not originally designed to be open to the cre-
ation of new markup. However, custom HTML markup was designed
for separate applications, and documents lost some of their ability to
be easily portable to other applications and systems. One application
had defined a rule one way, and another had defined it differently or
could not understand all the rules. Hypertext Markup Language
became nonstandard.
6 Chapter 1: The Basics of XML
1.14 HTML Can Become XHTML
XHTML is a standard for revising HTML to make Hypertext Markup
Language documents more compatible with XML. You will learn more
about HTML and XHTML in Chapter 6, “Using HTML and XHTML to
Format Web Pages.” You can also read more about XHTML for the
World Wide Web Consortium at the Hypertext Markup Language home
page, http://www.w3.org/Markup/. The example of XHTML in Listing
1.2, below, is very similar to Listing 1.1. XHTML is HTML with minor
revisions to some of the tags.
Listing 1.2 Example of XHTML
<html>
<head>
<title>My Document in XHTML</title>
</head>
<body>
<h1>This Is The Top Level Heading</h1>
Here is content<br />
followed by another line.
<hr />
I can include images <img src="mygraphic.gif" /> in a
line of text!<br />
Good-bye for now.
<a href="anotherPage.html">Links to another page are the
same in XHTML</a>
</body>
</html>
1.15 XML as a Standard
The World Wide Web Consortium (W3C) set up a task force for recom-
mending a language more useful to electronic transmission and display
of documents. They wanted this language to be based on SGML but
not as complex. They wanted the language to be more flexible than
HTML but maintain standards. The first version of the Extensible
Markup Language (XML) specification was presented in 1997 as the
“Document Object Model (DOM) Activity Statement,”
http://www.w3.org/DOM/Activity.
You may see many similarities between HTML and XML. A Hyper-
text Markup Language document contains a nested structure. With
minor adjustments, an HTML document could be an XHTML document
and usable as an XML document. However, HTML is used more for dis-
play and formatting of the data, while Extensible Markup Language
Chapter 1: The Basics of XML 7
generally separates the data descriptions from the text styles. XML
allows the data to be transformed more easily for display on different
devices.
1.2 XML Advantages
This section expands upon the goals for XML data exchange and how
they can help you as a FileMaker Pro developer. The recommendations
for the design of the Extensible Markup Language show some of the
advantages this format offers. These XML design goals can be found in
the document “Extensible Markup Language (XML) 1.0 (Second Edi-
tion), W3C Recommendation 6 October 2000,” http://www.w3.org/
TR/REC-xml.
n XML shall be straightforwardly usable over the Internet.
n XML shall support a variety of applications.
n XML shall be compatible with SGML.
n It shall be easy to write programs that process XML documents.
n The number of optional features in XML is to be kept to the abso-
lute minimum, ideally zero.
n XML documents should be human-legible and reasonably clear.
n The XML design should be prepared quickly.
n The design of XML shall be formal and concise.
n XML documents shall be easy to create.
n Terseness in XML markup is of minimal importance.
1.21 Why XML Data Exchange is Extensible
Common formats currently exist for exchanging data among applica-
tions and systems. Text formats may use fixed-length fields or a
delimiter such as a comma, tab, or other character between data types.
These formats are wonderfully compact, but they were designed for
the days when storage was at more of a premium. These formats rarely
offer the description of the type of data. Unless a map is included with
the data, you will likely have difficulty extracting specific data. For
example, one piece of data as a series of numbers could be an identifi-
cation key, a telephone number, an account number, or several
concurrent number data types. These older formats are often limited in
what information can be exchanged.
8 Chapter 1: The Basics of XML
Text Formats in FileMaker Pro
FileMaker Pro can import and export comma-separated values (.csv),
tab-delimited text (.tab or .txt), and other formats. If the first row (or
record) of the data contains the field names and the data is comma-
separated, the format is of merge (.mer) type. ODBC, JDBC, Web Pub-
lishing, and XML use the field names for data exchange. You may think
of XML publishing in FileMaker Pro as extending the data exchange
already available! You can read “About file formats” in FileMaker Pro
Help for more information on the formats available for import and
export.
With FileMaker Pro 6, data can be exported as XML in one of two
formats. The FMPXMLRESULT grammar uses a metadata format to
describe the field names. This is somewhat similar to the merge for-
mat, which includes the field or column names as the first record. The
actual data is placed in repeating row elements with a column element
for each field in the export. The other grammar for FileMaker Pro 6
export, FMPDSORESULT, has less information about the fields but uses
the field names as the element names. You can read more about these
two grammars in Chapters 2 and 4.
Text Formats in XML
XML documents include the description along with the data. Remem-
ber that XML is a markup language for creating markup, so you can
create whatever descriptions you want. The goal is to create markup
that is “sensible” as well as extensible. The document becomes more
human readable by including the description. The document also
becomes more machine extractable when the description of the con-
tent is included. With XML, the map is included with the document.
A typical XML document may have hundreds of markup tags yet
can be quickly searched for a particular one. Imagine looking in a doc-
ument for a customer whose first name is John. A text editor or word
processor can perform a fast search, but how would you know that you
have found the correct piece of information? Look at the example in
Listing 1.3 for the markup for people, then find all the people who are
customers. Finally, search for a customer with the first name of John.
You have just narrowed down your search in a hierarchical manner.
Listing 1.3 people.xml
<people>
<vendor>
<firstname>John</firstname>
Chapter 1: The Basics of XML 9
<company>Paper Cutters</company>
</vendor>
<customer>
<firstname>Jane</firstname>
<lastname>Doe</lastname>
</customer>
<customer>
<firstname>John</firstname>
<lastname>Doe</lastname>
</customer>
</people>
The example in Listing 1.3 shows you another advantage of XML: You
can extract only the data you need and ignore extraneous data. If all
you want is the customer data, the <customer>...</customer> ele-
ments are used in a search. Another need may be for vendor
information and only those elements are used in the search results.
This enables many people who need different information to use the
same XML document.
Extensible also means “flexible” when using XML. An XML docu-
ment may provide alternate versions of text. Listing 1.4, greeting.xml,
contains explicit text in a variety of languages (xml:lang). Providing
alternate content in the same document can make a document flexible
for multiple uses. XML is an international standard and provides for
the use of non-English text in the documents.
Listing 1.4 greeting.xml
<greetings>
<!-- English -->
<greeting xml:lang="en">Hello World!</greeting>
<!-- French -->
<greeting xml:lang="fr">Bonjour Monde!</greeting>
<!-- Spanish -->
<greeting xml:lang="es">Buenos dias, Mundo!</greeting>
<!-- German -->
<greeting xml:lang="de">Guten tag, die Welt!</greeting>
</greetings>
XML is also flexible in the way document contents can be transformed
for multiple uses. Regardless of platform or application (personal com-
puter, portable digital assistant, or Braille printers and readers, for
example), the document can be processed for the proper device. Each
application can read the same document and interpret the markup dif-
ferently. Some of these devices and applications can also write XML.
This flexibility opens up much greater communication among many
applications and devices. The exchange of information is the key!
10 Chapter 1: The Basics of XML
1.22 Saving Information for the Future
One of the greatest advantages of documents formatted with XML is
that these documents will be accessible long after the devices or meth-
ods used to create them are gone. Historical creation and storage of
data often relies upon proprietary applications and systems to write
and read the documents. The meaning of a document may be lost if
that system becomes unavailable. Because XML documents can provide
descriptions along with the data, these documents will be easier to
interpret later.
The XML standards also provide a partial description of how com-
puter applications should process the XML. This process is called
parsing. Some processing is done on a server, and some processing is
done within an application on a client machine. Adhering to these
standards ensures that in the future documents will be just as useful as
they are now.
1.3 XML Document Examples and Terms
XML documents are composed of entities. These entities are storage
units for pieces of the document structure. Each entity has a name and
can be referenced by its name. The document entities can be parsed or
unparsed. Parsed entities are all of the character content of the docu-
ment and the markup tags. Parsed entities are also called replacement
text and are processed like mail merge documents in a word processor.
Unparsed entities are all of the non-content and may be text other
than XML, graphics, and sound, according to the World Wide Web
Consortium, http://www.w3.org/TR/REC-xml#sec-physical-struct.
This section discusses XML document terms and gives you examples of
these terms.
Note:
Note: You will see references to DTDs, Document Type Definitions,
throughout this chapter. FileMaker Pro has provided these for you for use
with XML publishing on the web or for imports and exports with XML.
FileMaker Pro DTDs will be discussed in Chapters 2 and 4. If you wish to
write your own Document Type Definitions, see Chapter 3.
Chapter 1: The Basics of XML 11
1.31 Well-formed and Valid XML Documents
To meet the goals of the XML standard, all documents should be well
formed. This means:
1. The document contains at least one entity.
2. The document begins with a root or document element, which is
the starting point for XML processors.
3. XML processors build a tree-like nested structure from the text of
the well-formed document.
4. All parsed entities are also well formed.
5. All markup is composed of start tags, end tags, or empty tags that
are properly nested.
The nested markup in many of the listings in this book is indented for
reader convenience, but this is not a requirement for a well-formed
XML document. In some cases the tab and return characters are con-
sidered viable to the XML document, and extraneous indentation can
invalidate the document. Study the needs for your data exchange and
don’t introduce extra data.
The well-formed XML document has one or more elements: root
element, parent elements, and child elements. The XML document in
Listing 1.5 starts and ends with a root element, but the name of the
element can be anything. All the elements are properly formatted with
a start and end tag or empty tag. The child elements are nested within
the parent elements, and all elements are within the root element.
Listing 1.5 Properly nested markup tags in a document
<root>
<parent>
<child>
<grandchild />
</child>
</parent>
</root>
The same document could be compacted with no white space and still
follow the rules for well-formedness:
<root><parent><child><grandchild /></child></parent></root>
Conforming XML parsers and processors should verify that a document
is well formed. If not, they stop processing and produce a report as
soon as any errors are encountered. Improper nesting of elements
causes a typical error.
12 Chapter 1: The Basics of XML
XML parsers can be validating or nonvalidating. A valid XML docu-
ment has an associated Document Type Definition (DTD), but not all
XML documents require a DTD. An XML formatted document can be
well formed and not valid. However, a valid XML document must be
well formed.
A Document Type Definition is a list of the “fields” that are allow-
able in a particular XML document type. However, in XML they are not
called fields but entities. The DTD contains the entities with element
names, attributes of those elements, and the rules governing the enti-
ties and the document. For data exchange in a business-to-business
situation, the DTD can be the map of the entities of a document. Cre-
ating well-formed and valid documents increases the accuracy of the
data in those documents. Creating well-formed and valid XML docu-
ments also helps standardize the data to assist the exchange of
information. There are many DTDs, schemas, XML grammars, and
other XML standards such as MathML (Mathematical Markup Lan-
guage), SMIL (Synchronized Multimedia Integration Language), and
XBRL (Extensible Business Reporting Language).
1.32 Data Validation in FileMaker Pro
You have a similar way to assist with data integrity (validity) in
FileMaker Pro. When you create a FileMaker Pro database file, you add
fields in the Define Fields dialog. You define a field by naming the field
and setting it to one of these data types: text, number, date, time, con-
tainer, calculation, summary, or global. To further define the field, you
can specify options to automatically enter specific data, to validate the
data entered, and to store the field’s index or recalculation as needed.
Figure 1.1 shows the Define Fields options dialog for setting validation
in FileMaker Pro. The following exercise restricts a number field to
only allow number values.
Exercise 1.1 Validate Field Data Entry
1. Open the Define Fields dialog by choosing File, Define Fields...
or using the keyboard shortcut Command+Shift+D on
Macintosh, or Control+Shift+D on Windows.
2. Type Age in the Field Name box and select the Number radio
button. Click the Create button to define the field. Now click the
Options... button and select the Validation tab.
Chapter 1: The Basics of XML 13
3. Check Strict data type and select Numeric Only from the
pop-up. Close the Options dialog box by selecting OK or pressing
Enter on your keyboard, and close the Define Fields dialog by
selecting the Done button.
4. Enter Layout mode by choosing View, Layout Mode or using the
keyboard shortcut Control+L on Windows or Command+L on
Macintosh.
5. Place the new field on the layout if it is not already there by
choosing the menu item Insert, Field.
6. Choose View, Browse Mode or use the shortcut Control+B on
Windows or Command+B on Macintosh.
7. Enter the Age field by pressing the Tab key or by clicking into the
field. Enter any number and tab out of the field or click anywhere
else on the layout. You should not get a warning message.
8. Create a new record by choosing Records, New Record or the
shortcut Command+N on Macintosh or Control+N on
Windows.
9. Enter abc into the Age field. After you leave the field, you will be
presented with the warning: “This field is defined to contain
numeric values only. Allow this non-numeric value?” and the but-
tons: “Revert field,” “No,” and “Yes.” This dialog will allow you to
override the warning if you select Yes. This override feature can be
valuable at times but not if you want to have a valid number field.
14 Chapter 1: The Basics of XML
Figure 1.1: FileMaker Pro Define
Fields Options dialog
10. Open the Define Fields dialog again and select the Age field. Click
on the Options button and change the validation to provide a
custom warning message. Check Strict: Do not allow user to
override data validation and Display custom message if
validation fails, then type Please enter a number in the
field.
11. When you enter abc in the Age field, you get your custom mes-
sage and the validation cannot be overridden. Figure 1.2 shows
this custom message.
Using a DTD to validate an XML document or setting the validation on
fields for FileMaker Pro data entry provides for reliability of the infor-
mation exchanged. Your XML documents should be well formed and
valid. You will see in Chapter 2 how FileMaker Pro exports your data
in a well-formed and valid XML document. Examples of the terms in
DTDs will be discussed in Chapter 3, “Document Type Definitions
(DTDs).” Document Type Definitions for the three XML document
types published by FileMaker Pro will be discussed in Chapter 4,
“FileMaker Pro XML Schema or Grammar Formats (DTDs).”
1.33 XML Document Structure
An application that opens or reads files needs to know the type of doc-
ument to process. Few applications are capable of processing all file
types. Often the file type is determined by the file extension (.txt, .sit,
.exe, .csv, .jpeg, .FP5, or .html) or the Creator Code and File Type on
the Macintosh operating system. Sometimes the file type will also be
embedded in the document itself. For example, you will find “%PDF”
at the beginning of a Portable Document Format file created by Adobe
Acrobat or “GIF89a” at the beginning of a Graphics Interchange
Format (.gif) file.
Well-formed XML documents begin with a prolog. This opening
statement tells the XML parser the type of file it will be processing.
The XML document prolog contains an optional XML declaration, one
or more miscellaneous entities (comments and processing instruc-
tions), and optional Document Type Declarations. An HTML
Chapter 1: The Basics of XML 15
Figure 1.2: FileMaker Pro
invalid entry alert dialog
document, for example, can be a well-formed XML document with
minor corrections to the standard HTML markup. The well-formed
HTML document includes the XML declaration in the prolog. You can
read more about the other optional elements of the prolog in section
2.8 of the XML specification, “Prolog and Document Type Declaration,”
http://www.w3.org/TR/REC-xml#sec-prolog-dtd. Examples of XML
declarations are listed below.
<?xml version="1.0" encoding="encoding type" standalone="yes" ?>
<?xml version='1.0'?>
<?xml version="1.0" encoding="ISO 8859-1" ?>
The version attribute is required in all XML declarations. When you
include the version attribute, the document contains the information
used should there be future versions of the XML specifications. The
current version number is 1.0 and is based on the W3C Recommenda-
tion as of October 6, 2000, http://www.w3.org/TR/REC-xml.
The encoding attribute, optional in the XML declaration statement,
specifies the character sets used to compose the document. This encod-
ing attribute uses Unicode Transformation Formats (UTF-8) as the
default. The 256 letters, digits, and other characters we commonly use
for transmitting text are called ASCII (American Standard Code for
Information Interchange) characters and are a subset of UTF-8. ASCII
may also be called ISO 8859-1 or Latin-1, although only the first 128
characters of all these formats may be the same depending upon plat-
form and font faces.
XML processors must be able to read both UTF-8 and UTF-16
encoding. UTF-16 allows for more characters, such as would be used to
compose ideographical alphabets. Graphical alphabets could be sym-
bols, icons, or Asian characters. You may specify other UTF or
encoding types. See “Unicode vs. ASCII” in section 1.42 of this chapter,
for further explanation and examples of encoding types. Three com-
mon encoding types are listed below.
encoding="UTF-8"
encoding="UTF-16"
encoding="ISO-8859-1"
FileMaker Pro and UTF-8
According to the FileMaker Pro Developer’s Guide, p. 7-8, “About UTF-8
encoded data”: All XML data generated by the Web Companion is
encoded in UTF-8 (Unicode Transformation 8 Bit) format... UTF-8
encoded data is compressed almost in half (lower ASCII characters are
compressed from 2 bytes to 1 byte), which helps data download faster.
16 Chapter 1: The Basics of XML
Note: Because your XML data is UTF-8 encoded, some upper ASCII
characters will be represented by two or three characters in the text
editor—they will appear as single characters only in the XML parser or
browser. An example of this type of encoding is shown in Listing 2.4.
The new XML parser in FileMaker Pro 6 uses a larger set of
encodings. The FileMaker Pro Help topic “Importing XML data” states:
“FileMaker uses the Xerces-C++ XML parser which supports ASCII,
UTF-8, UTF-16 (Big/Small Endian), UCS4 (Big/Small Endian), EBCDIC
code pages IBM037 and IBM1140 encodings, ISO-8859-1 ("Latin1"),
and Windows-1252.” You can find additional information FileMaker
Pro supports for encodings by typing “UTF” in FileMaker Pro Help
under the Find tab.
Standalone Documents
Standalone is also optional in the XML declaration statement. If
standalone="yes," there are no external markup declarations associ-
ated with this document. The XML processor needs to know whether
to process or skip these. If standalone="no," then you will need to
specify the location of the external declarations. A document can have
both embedded markup declarations and external markup declara-
tions. Documents that might have external calls could contain
references to stylesheets or graphics and sounds. The following prolog
tells the processors to look for external definitions and where to find
them.
<?xml version="1.0" standalone="no"?>
<!ENTITY % image1 SYSTEM "http://www.mydomain.com/images/image1.gif">
%image1;
1.34 Document Type Declarations (DOCTYPE)
You may have seen Document Type Declarations in web pages. The
Document Type Declaration (DOCTYPE) should be one of the first
statements in an HTML document, because it is part of the prolog of
the document. The DOCTYPE tells more about the document and
where the definition for this type of format can be found. A common
declaration for an HTML 4.0 document follows.
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"
"http://www.w3.org/TR/1998/REC-html40-19980424/loose.dtd">
They may sound similar, but Document Type Declaration (DOCTYPE)
should not be confused with Document Type Definition (DTD).
Chapter 1: The Basics of XML 17
However, the declaration (DOCTYPE) can point to the location of any
definition (DTD) to which a particular document should conform.
Tip:
Tip: While using an HTML editor, you may have the option or prefer-
ence to check the syntax of your document as you edit. You can specify
how strict (precise) the document should be if you insert the DOCTYPE
statement first. When you check the document, the editor should warn
you if you have not followed the rules according to the specified
DOCTYPE. Good HTML editors will tell you what the error is and where it
is located in your document.
Let’s analyze the parts of the DOCTYPE declaration. Only the
topElement is required. Each of the other parts may be optional but
occur in the declaration as follows:
<!DOCTYPE topElement availability "registration//organization//type label
definition//language" "URL">
topElement is the root element (first significant markup) found in
the document; “HTML
” is the default for web pages. Remember that
the DOCTYPE is part of the prolog and is placed above the root ele-
ment in the document. Valid documents must have this element match
the root element.
availability is a “PUBLIC” or a “SYSTEM” resource. Documents used
internally or references to documents related to this one would have
“SYSTEM” availability.
registration is “ISO” (an approved ISO standard), “+” (registered
but not approved by the ISO), or “–” (not registered by the ISO). The
International Organization for Standardization might not register XML
or HTML DOCTYPEs.
organization is a unique label of the owner ID or entity that created
the DTD. Common organizations are “IETF” (Internet Engineering Task
Force) and “W3C” (World Wide Web Consortium).
type is the type of object being referenced. “DTD” is the default.
label is a unique description for the text being referenced. “HTML
4.0,” for example, refers to the version of these recommendations.
definition is the type of document. “Frameset,” “Strict,” or “Transi-
tional” are common definitions for HTML documents. Strict documents
have more limited markup but can be used across a broader set of
devices.
18 Chapter 1: The Basics of XML
language is the two-character code of the language used to create
the document. “EN” is English and “ES” is Spanish. The ISO 639 stan-
dard is used for this code, which are the same codes used for the
“xml:lang” attribute. Here, language is used for the entire document,
although specific elements in the document can still be redefined by
using “xml:lang.”
URL (Uniform Resource Locator) is the location of the DTD.
You can name your own document type. This is the only required ele-
ment of the DOCTYPE statement. You should remember this naming
suggestion: Stick with alphanumeric characters and the underscore
character and you cannot go wrong! Also avoid any combination of the
letters “X” or “x,” “M” or “m,” and “L
” or “l,” in that order, when nam-
ing your document type, as these are reserved.
DOCTYPES can contain internal Document Type Definitions
(DTDs) or external DTDs. Internal DTDs stay with the document and
can only be used with that document. You are making the definition of
the document in itself. External DTDs can be used for multiple docu-
ments and are referenced by the PUBLIC location, or if used internally,
by the SYSTEM location as relative path to the document. Listing 1.6
shows some examples of XML documents with external DTD refer-
ences. Compare them to the code below, which is complete with
internal DTD:
<?xml version="1.0" standalone="yes" ?>
<!DOCTYPE myDoc [<!ELEMENT myDoc (#PCDATA)>]>
<mydoc>Here's the text!</mydoc>
Listing 1.6 XML documents with external DTD references
Example 1:
<?xml version="1.0" standalone="no" ?>
<!DOCTYPE myDoc SYSTEM "myDoc.dtd">
<myDoc>
<head>This is the first element of my document</head>
<main>
<para>Now I can add content.</para>
<para>Each line is another child of the main element</para>
</main>
</mydoc>
Example 2:
<?xml version="1.0" standalone="no" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/2000/REC-xhtml1-20000126/DTD/
xhtml1-strict.dtd">
Chapter 1: The Basics of XML 19
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="content-type" content="text/html;
charset=utf-8" />
<title>New Document</title>
</head>
<body>
<div>
Because this is strict XHTML, every tag needs
&quot;closure&quot;<br />
Including the break just inserted before this line
and the meta tag in the head.
</div>
<div>
Also note the way the quote mark is encoded around
the word closure.<br />
You will see this later as a predefined entity in
Element Content.
</div>
</body>
</html>
1.35 Processing Instructions
You can include processing instructions in your document prolog. Pro-
cessing instructions begin with “<?” and end with “?>.” Although the
XML declaration in the prolog has similar markup, it is not used as a
processing instruction. You may find processing instructions used to
reference an XSL (XML Stylesheet Language) document. Use process-
ing instructions rather than comments if you wish the XML processor
to see them.
<? target ?>
The target is the name of the application to receive the instruction.
Because the end of this special markup is “?>,” do not use these char-
acters in your target declaration. The code below shows examples of
the processing instructions that FileMaker Pro produces if you use a
stylesheet. In section 5.2, “XML Request Commands for Web Compan-
ion,” you will see the request for stylesheets.
<? xml-stylesheet href="headlines.css" type="text/css" ?>
<? xml-stylesheet href="headlines.xsl" type="text/xsl" ?>
20 Chapter 1: The Basics of XML
1.36 Comments
When you create documents, you may wish to add comments near any
statements that need further clarification. Comments should not con-
tain any important part of the document as any processing may ignore
them. However, some processors may use comments or they may be
helpful to humans reading the document. Comments may be anywhere
in the document; they are not only for inclusion in the prolog of the
document.
Comments are placed outside any other markup. Comments are
simply created using “<!--” at the start of the comment and “-->” at
the end. These characters are reserved, so they should not be used
anywhere else in a document. Additional “--” or “-” should not be used
within any comment. Any white space is ignored, so you may have
spaces and returns in a comment. Example comments can be found in
Listing 1.7.
Listing 1.7 Example comments
<!-- THIS IS A COMMENT -->
<!-- THIS IS ALSO
A COMPLETE COMMENT
ALTHOUGH IT SPANS MULTIPLE LINES -->
<!-- While it is permissible to begin and end the comment next to the -->
<!-- markup, it may be easier to read if you include some white space -->
<!-- as well. This is an ILLEGAL comment. Note the additional dash at -->
<-- the end: --->
Using Comments to Test HTML Documents
Comments can be very useful when checking HTML and CDML docu-
ments for accuracy in the markup, including FileMaker Pro
replacement tags, such as “[FMP-Field: myField]”. This can be a valu-
able tool when troubleshooting or debugging a problematic document.
You may place comment tags around a large portion of the document
so a browser will not process this part of the document. If the result is
as you desired, move the comments around a smaller portion and
check again. Errors in HTML and CDML markup can be found easily
this way.
Be careful when commenting out table elements. If you place the
comment tags around complete tables or rows, you will not receive
browser errors. If you need to be more precise, add the comment
around the contents of a particular table cell but not the tags them-
selves. Listings 1.8 and 1.9 show the proper placement of comments
inside of HTML table code.
Chapter 1: The Basics of XML 21
Listing 1.8 Comments around table cell
<table>
<tr>
<td>content here</td>
</tr>
<tr>
<td><!-- a new row --><td>
</tr>
</table>
Listing 1.9 Comment around table row
<table>
<tr>
<td>content here</td>
</tr>
<!-- <tr>
<td><!-- a new row --><td>
</tr> -->
</table>
Comments for Future Reference
Comments may also be valuable if more than one person is helping
create a document. Notes to others can be provided in the comments.
Additional examples of comments are shown in Listing 1.10.
Listing 1.10 Single-line or multiple-line comments
<!-- === NEW RECORD BEGINS HERE === -->
<!-- *** do not revise this section -->
<!-- *** -->
... your static document text here ...
<!-- *** -->
<!-- *** end "do not revise" -->
... free to edit text here ...
<!-- === NEW RECORD ENDS HERE === -->
<!-- *******************************
* make comment highly visible *
******************************* -->
<!-- created by me on 09 MAR 1999 -->
<!-- revised by you on 21 MAR 2000 -->
1.37 Elements and Attributes
Each XML document has one or more elements. These elements are
the entities where the content is declared. The construction of the ele-
ment is simply the type of element as the name of the tag. Elements
22 Chapter 1: The Basics of XML
have a start and end tag. The tag name is the same for the start tag
with “/” added to the end tag:
<elementName>content</elementName>
An empty element contains no content but may have attributes:
<elementName />
<elementName></elementName>
<elementName attrName="attrValue"/>
<elementName attrName="attrValue" attr2="too!" />
The question arises whether to place a space before the “/>” in the
standalone empty element. Should you use “<emptyElement/>,”
“<emptyElement />,” or simply make all elements paired
(“<empty></empty>”)? Section 3.1, “Start-Tags, End-Tags, and
Empty-Element Tags,” of the XML specification http://www.w3.org/
TR/REC-xml, states that the empty element tag is composed of “<”
followed by the name of the element, zero or more occurrences of
spaces and attribute name/value pairs, ending with an optional space
and “/>”. For human readability, the space before the final characters
in the empty element may be preferable. Another suggestion is made
by the XHTML 1.0 recommendation: section C.2, “Empty Elements,”
http://www.w3.org/TR/xhtml1/, to always include the space for com-
patibility with browsers and other applications that may read or write
HTML and XHTML.
Tag Names
Tag names may contain one or more of the following (in any combina-
tion): letter, number, period (.), dash (-), underscore (_), and colon
(:). These tag names should begin with a letter, underscore, or colon.
You should avoid the use of these reserved words (in any combination
of upper- and lowercase): “XML
” or “xml”. Section 2.3, “Common Syn-
tactic Constructs,” of the XML specification http://www.w3.org/TR/
REC-xml#sec-common-syn, gives some ideas of how names are to be
constructed for elements and attributes in an XML document. The
World Wide Web Consortium suggestions allow for more than alpha-
numeric characters and the underscore in element and attribute
names. However, you may have discovered that different systems use
the period, dash, and colon to signify something special on each sys-
tem. To maintain the portability of your documents, you should
carefully consider the names you choose. For example, you may use
lowerUppercase notation for element and attribute names, such as
<myElement myPositive="yes" myNegative="no" />.
Chapter 1: The Basics of XML 23
Attributes
Attributes are found in the start tag or empty tag for elements and are
composed of name and value pairs. Attributes are used to refine the
definition of the element. You do not want to name your attributes the
same within a single element, but the same attribute name may be
used for different elements. Generally, one piece of information is
included in each attribute, although an element may have one or more
attributes.
Attributes should always be quoted in element start tags and in
empty elements. Attributes can use double or single quotes, but the
quotes surrounding any single element must match (for example,
<element myAttribute="bad quotes' /> is incorrect). Try to avoid
“smart quotes” (also called curly quotes), as they may be interpreted
incorrectly in documents that need to be read by different applications
and systems. Listing 1.11 shows proper element attributes.
Listing 1.11 Examples of elements with attributes
<elementName attributeName="attributeValue" />
<child firstborn="yes" />
<child firstborn='yes' />
<child firstborn="yes">
<firstName>Dawn</firstName>
</child>
<pen color="#EEEEEE" pattern="1" size="2" />
<fill color="#FF00FF" pattern="" />
1.38 Element Content
The content of most elements is your information. The content is the
text or character data that you want to pass along from one applica-
tion or system to another. Any text that is not considered markup is
character data. You could think of this character data as the leaves on
a tree. In the family tree metaphor, any branch can have multiple
branches. Therefore, elements can also contain other elements. When
an element contains character data and other elements, that element
has mixed content. Listing 1.12 mixes content with other elements
inside the root element element1.
Elements used for XML export or XML web publishing in
FileMaker Pro do not contain mixed content. You may encounter XML
documents using this format for the elements and need to understand
the structure if you are importing XML into FileMaker Pro.
24 Chapter 1: The Basics of XML
Listing 1.12 Example of mixed content
<element1>
<element2>Some text here</element2>
Some content to element1
<emptyElement3/>
<emptyElement4></emptyElement4>
</element1>
Character data can be composed of any letters, numbers, or symbols.
The XML processors need to know if you are using characters as
markup or as a part of your text content. The comparison symbols
greater than (>) and less than (<) might be interpreted incorrectly if
used in a computation statement. You might also be writing an XML
document about markup that contains text that you do not want to be
processed as markup. There is unique markup used to tell the proces-
sor to not parse the literal contents. You can see this unique markup in
Listing 1.13. The only special character sequence is the “]]>” pattern,
so you must not use this pattern anywhere in your content. You may,
however, use the “<![CDATA[” beginning pattern within the content.
The XML processors are looking for the end of the character data
(“]]>” ) after encountering the beginning pattern.
Listing 1.13 Markup for raw or unparsed data
<![CDATA[your data goes here]]>
<![CDATA[This text contains less than and greater than in a calculation,
so must be treated in a special way. Is 1 > 2 (one greater than two)?
No, 1 < 2 (one is less than two).]]>
<![CDATA[In your HTML document if you want to hide data in an input form,
use this: <input type="hidden" name="myField" value="">.]]>
<![CDATA[
The text can be many lines & contain
values that might otherwise be converted.
]]>
<![CDATA[An example of an XML prolog statement is: <?xml version="1.0"
encoding="encoding type" standalone="yes" ?>.]]>
Another way to include data that might otherwise get translated is to
use predefined entities. The characters are encoded so that they will be
passed through the XML parser but can be converted by the displaying
application. The encoding uses the reserved character “&” (amper-
sand) followed by the entity name and “;” (semicolon). These entities
are found in Table 1.1 and are used in the examples in Listing 1.14.
Chapter 1: The Basics of XML 25
Table 1.1 Some predefined entities
Character Entity Name
& &amp; ampersand
< &lt; less than
> &gt; greater than
' &apos; apostrophe or single quote
" &quot; double quote
Listing 1.14 Character data using predefined entities
<element1>This has a greater than symbol in the function:
if(a &gt; b).</element1>
<company>Brown &amp; Jones Excavating</company>
<title>&quot;Gone With the Wind&quot;</title>
1.39 The Element Tree Completed
Putting all of the element information together, you
can build a well-formed XML document. You can
have empty elements or elements containing data
and other elements. You can have comments to fur-
ther describe your tree, but they are not crucial to
the structure of the tree. The image of the tree
(Figure 1.3) follows the rules for the XML document
in Listing 1.15.
Listing 1.15 The complete tree
<?xml version="1.0" standalone="yes" ?>
<!DOCTYPE tree [
<!ELEMENT tree (BRANCH)>
<!ELEMENT BRANCH (branchlet, twig)>
<!ELEMENT branchlet (#PCDATA)>
<!ELEMENT twig (#PCDATA)>
]>
<tree>
<!-- the root or trunk of the tree has some main branches -->
<BRANCH>
<!-- a BRANCH can have branchlets and twigs -->
<branchlet>
<twig>leaves</twig>
<!-- empty element (no leaves) -->
<twig/>
<twig>leaves</twig>
</branchlet>
26 Chapter 1: The Basics of XML
Figure 1.3
<branchlet>
<twig>leaves</twig>
<twig>leaves</twig>
</branchlet>
<twig>leaves</twig>
</BRANCH>
<BRANCH>
<branchlet>
<twig>leaves</twig>
</branchlet>
<branchlet>
<twig>leaves</twig>
<twig>leaves</twig>
</branchlet>
</BRANCH>
</tree>
1.4 XML Character Conventions
To keep XML documents well formed, you should remember the
requirements and recommendations for naming elements, attributes,
and documents. While the recommendations are not requirements,
you may find later that they facilitate the exchange of data. Here you
will learn about white space and end-of-line characters, and how
Unicode and ASCII, the standards for character representation, are
used in XML documents. More about the name of entities, such as
links, can be found in section 1.51, “URI, URL, and URN.”
1.41 White Space and End-of-Line Characters
White space is not just the space character between words. White
space is a set of invisible characters that perform visual spacing of the
words and lines of text. These characters are introduced in Table 1.2.
White space is important if you are displaying or printing text. The
beginning of this paragraph, for example, would be difficult to read if
there were no spaces between the words or if a new line began at the
wrong place. Below is an example of improper white space.
Whitespaceisnot justthespac
echaracter betweenwords.
White space in an XML document is important if the character is
retained within your content where you intended, but it is ignored oth-
erwise. White space in an HTML document is compressed down to one
Chapter 1: The Basics of XML 27
character, even in the content. Multiple spaces become one space in
HTML but are ignored in the markup in the XML document. Using
white space to make a document more human readable is permissible
(and advisable) because the XML processor does not attach signifi-
cance to it. Since white space is ignored in the markup by the XML
processors, you will want to avoid using white space in any element or
attribute name. You and the XML processors would have difficulty
determining the element name in the example below because of the
use of improper white space.
<!-- incorrect element -->
<an element name attribute="here you go" />
<!-- should be: -->
<anElementName attribute="here you go" />
Table 1.2 White space characters
Character ASCII Unicode
space 32 #x0020
horizontal tab 9 #x0009
carriage return 13 #x000D
line feed 10 #x000A
The end-of-line character is the special white space that we rarely see
as we type a new line or a new paragraph of text. You press the Return
or Enter key and magically you can begin typing to the left and one
line down in the document. You do not actually see any “character”
there, although one or more exists in the electronic document. Your
word processor or text editor may have a utility to toggle the display of
white space on and off. The paragraph symbol (¶) may be shown at
the end of a line or paragraph if the toggle is on.
28 Chapter 1: The Basics of XML
Figure 1.4: Showing invisibles
Where Do We Get These End-of-Line Characters?
If you have ever typed on an old manual (non-electric) typewriter, you
probably pulled a lever to return the carriage (the type head) to the
left margin and you made the roller feed the paper up one line (or
more for multiple spacing). When the process for document composi-
tion is automated, printers and teletype machines have to be given
precise instructions for everything they do. The two instructions for
the location of the print head are carriage return and line feed. The
return to the beginning of a line does not necessarily mean that you
want the line to feed down at the same time. Separating these two
instructions allows for printing text on top of text in the same line and
creating unique symbols or simulated graphics from a limited set of
characters.
Using the End-of-Line Characters
Electronic typewriters and computers include a Return or Enter key for
the end-of-line action. A single keystroke sends a signal to the system
processor, which takes the return to the left margin and moves down a
line when the text is displayed on a monitor or as a printed document.
A new line is created when the instruction for end of line is received.
We also may see the text flow to the next line if the screen is a particu-
lar width. This is not a new line but is called text wrap and is the
continuation of the same line. End-of-line or new line instructions may
be called a hard return or end of paragraph. Hard returns occur only
where you specifically press the Return or Enter key.
The end-of-line character is different on various systems. On
Macintosh, the end-of-line character is the carriage return. The UNIX
operating system uses line feed for the end-of-line character. Carriage
return and line feed are both utilized on the Windows operating sys-
tem. The document is stored with these invisible characters wherever
there is an end of line. Sometimes they are not interpreted correctly by
applications if the document is written on one system and read on
another. You may have seen text appear incorrectly or contain a box
character to replace the invisible character it cannot interpret.
XML documents can be processed on any operating system. If the
document contains carriage returns, line feeds, or any combination of
these two characters, an XML processor may convert the end of line to
the line feed character (Unicode #x00010) after processing. This
keeps the document consistent for further processing.
Chapter 1: The Basics of XML 29
1.42 Unicode vs. ASCII
There are so many ways to say the same thing and so little time! We
have graphical representations for many of our spoken languages.
These are our written languages. Machines need a way to transmit a
representation of our spoken and written languages. Just like typing
white space characters, other characters on a computer keyboard send
a signal for each key or combination of keys. This signal is a numerical
representation of the key pressed. Most keyboards use the standard
ASCII 256-character set, and often a sort will use the ASCII numerical
value. Some of the ASCII characters can be found in Listing 1.16. An
exercise to create the ASCII character set in HTML is also included in
this section.
Listing 1.16 Sample ASCII codes and character representation
65 A
66 B
67 C
97 a
98 b
99 c
191 ø
59 ;
49 1
50 2
51 3
184 p
60 <
163 £
This representation can be used to translate text from one written lan-
guage to another representation of the same language. Note these
special symbols: the Greek pi (p), Scandinavian o-slash (ø), and
British pound symbol (£). However, the American Standard Code for
Information Interchange (ASCII) is quite limited for use internation-
ally. ASCII omits a way to represent Japanese, Chinese, symbols, and
other highly ideographical languages. ASCII can also be limiting if dif-
ferent applications and systems do not translate the numerical
representations identically.
Exercise 1.2 Create Your Own ASCII Table
1. Open FileMaker Pro.
2. Create a database called ASCII.FP5 and define these four fields:
n ASCII (number)
30 Chapter 1: The Basics of XML
n Character (calculated, text result, = "&#" & ASCII & ";")
n HTML (text)
n gCounter (global number)
3. Create the script Create ASCII Table:
Set Error Capture [ On ]
Show All Records
Delete All Records [ No dialog ]
# Comment: Set the counter to zero
Set Field [ “gCounter”, “0” ]
Loop
New Record/Request
Set Field [ “ASCII”, “gCounter” ]
Set Field [ “HTML”, “If(ASCII = 0, "<html><head><title>ASCII
TABLE</title></head>
<body><table border=0>¶
<tr><th>ASCII</th>
<th>Character</th></tr>¶", "") &
"<tr><td>" &ASCII & "</td><td>" & Character & "</td></tr>¶" &
If(ASCII = 255, "</table></body></html>", "")” ]
Set Field [ “gCounter”, “gCounter + 1” ]
Exit Loop If [ “gCounter = 256” ]
End Loop
Export Records [ Filename: “ASCII.html”; Export Order: HTML (Text) ]
[ Restore export order, No dialog ]
After you perform the script and export this table, you can open the
document in a text editor to see the results. You can also open the doc-
ument in your browser to see the characters created. You may get
different results from the same document if you change the font type
or size in your browser preferences. Viewing the same document on
different systems may also produce different results as the character
mapping may be different.
A standard (ISO/IEC 10646) has been devised for representing
characters used for electronic transmission. Information about the
International Organization for Standardization can be found at
http://www.iso.ch/iso/en/ISOOnline.frontpage. This representation of
characters is called Unicode. If you tested the above exercise, you may
have seen how the same character may not be precisely rendered the
same by changing your browser default font. The Unicode standard
was created to avoid these problems. Unicode attempts to include
characters such as those used for scientific symbols and non-English
text characters, thus making it a UNIversal CODE set. Only the first
128 characters are the same in Unicode and the ASCII table.
Chapter 1: The Basics of XML 31
1.43 Names Using Alphanumeric Characters
The use of white space can cause problems when naming your XML
elements. Other characters not in the ASCII and Unicode tables might
also be a problem for all systems to process. Even within those first
128 characters, you will have control characters that may not be visi-
ble. If you follow the recommendation of only using alphanumeric
characters for naming entities, you will be assured of compatibility
with most systems and applications. The common letters and numbers
have ASCII and Unicode equivalents. These ranges can be found in
Table 1.3.
Table 1.3 Alphanumeric, ASCII, and Unicode equivalents
Characters ASCII UTC Unicode
0-9 48-57 #x0030-#X0039
A-Z 65-90 #x0041-#x005A
a-z 97-122 #x0061-#x007A
FileMaker Pro Help makes recommendations for naming fields. Figure
1.5 is a screen shot of this information. The same recommendations
might apply to all object names, such as file names, value list names,
relationship names, layout names, and script names. Your preference
may work well for single databases or complete sets of databases, but
for XML or any web publishing, you may need to reconsider current
choices.
32 Chapter 1: The Basics of XML
Figure 1.5:
Naming
fields in
FileMaker
Pro
1.5 Beyond Basic XML—Other Standards
So far we have studied well-formed and valid documents containing
data and other elements. XML is a language that allows other stan-
dards to be built upon it. Included in the list of additions to the XML
family is XSL (XML Stylesheet Language). You will read more about
XSL and how it can be used to transform XML data into neatly format-
ted output in Chapter 7.
The World Wide Web Consortium has also recommended addi-
tional standards for interconnecting documents and addressing precise
locations within XML documents. Among these other XML standards
are XPointer and XPath, which extend XML. This section gives an over-
view of each of these and the URI (Uniform Resource Identifier)
standard for identifying and locating resources used by XML docu-
ments. These recommendations have been grouped together here, as
they often work together. However, they can also work independently.
Keep in mind that this section is a very basic overview to help you
understand these additions to XML, parsing of XML with FileMaker
Pro, and how these standards work with XML and FileMaker Pro.
Remember, too, that the specifications and recommendations may
change, although it is unlikely that these changes will affect the cur-
rent technology. The changes may enhance the current specifications
just as XPath and XPointer have added to the functionality of XML. You
may consult the World Wide Web Consortium for the latest informa-
tion, http://www.w3.org/.
1.51 URI, URL, and URN (The Uniform
Resource Standards)
Uniform Resource Identifiers (URIs) encompass all references to web
files: text, images, mailboxes, and other resources. URIs include URLs
(Uniform Resource Locators): ftp, gopher, http, mailto, file, news,
https, and telnet, common protocols for accessing information on the
Internet. Some examples of these are found in Listing 1.18. Remember
that the World Wide Web is only a part of the Internet. URIs may be
used in XPaths and XPointers if they refer to an address on the
Internet.
Another URI type is the URN (Uniform Resource Name). The URN
has globally persistent significance; only the name of the resource
need be known, not the location of it as in the URL. The Uniform
Chapter 1: The Basics of XML 33
Other documents randomly have
different content
the tourist chiefly from its university, and its castle, which is one of
the last creations of the old castle-builders, and seems in its style to
be something between a stronghold and a chateau, a palace and a
fortification. It certainly is a most imposing and magnificent ruin,
with its lofty turrets, great round towers, terraces, arched gateways,
and still splendid court-yards and grounds; the splendor of the
building and beauty of its situation induce one enthusiastic guide-
book to style it "the Alhambra of the Germans."
A good, comfortable night's rest at the Eagle Hotel prepared us
for the ascent next morning by the steep pathway and steps that led
up to it from the Corn Market; up we go, and after an ascent of
about fifteen minutes, we pass through a massive arch-way, known
as Frederic IV.'s building, and stand in the great court-yard of the
castle.
The portion of the buildings fronting on this grand enclosure are
elegantly carved and decorated with arcades and life-size sculptures;
here is one known as Rudolf's building, the oldest part of the castle,
a Gothic structure, then Rupprecht's building, founded in the year
1400, by Rupprecht III., with beautiful Gothic windows, over which
are the architect's arms, three small shields upon an escutcheon.
This carving is taken by many to be some sort of a masonic mark,
but is nothing of the kind, but according to a little local guide, a coat
of arms common to all German artists; and an interesting legend as
to its origin is told, which is to the effect that one day the Emperor
Charles V. visited Holbein, the artist, and found him busy painting at
the top of a high scaffolding; the emperor signed to the artist not to
disturb himself, and at the same time motioned to one of his suite to
steady the tottering ladder; the young noble, however, thinking it
beneath his dignity to render such menial service to an artist,
pretended not to understand the emperor, who thereupon advanced
and steadied it himself, and commanded that from that time the
German artists should be reckoned among the nobility of the empire,
and their coat of arms should be such as Holbein decided upon. The
artist then made choice of three small uniform silver shields on a
blue field.
Then we have other beautiful buildings fronting on the great
court-yard, and named after their builders, who at different periods
made their contributions of architectural ornament to this romantic
old pile. One of the most gorgeous is that known as Otto Heinrich's
building, finished in 1559, restored twice,—the last time in 1659, and
finally destroyed in 1764,—but the splendid front remains standing,
and even now, in its partially ruined condition, excites admiration,
with its splendid façade, rich to prodigality with statues, carvings,
and decorations. Ludwig's building is another, into which we can go
and see the great kitchen, with its huge fireplace and great hearth in
the middle, where, on festal occasions, whole oxen were roasted.
Near here is the castle well, fifty-four feet deep, with four pillars
taken from Charlemagne's palace, to support its canopy, the pillars
being those sent to Charlemagne by Rome for his royal edifice. Then
comes Frederick's building, founded by Frederick IV. in 1601, rich in
statues and sculpture, and under it a chapel, over the portal of
which is inscribed, in Latin, the words of the Psalmist,—
"This is the gate of the Lord;
The righteous shall enter into it."
But we are bewildered with the different façades, towers, fronts,
and buildings that succeed each other in this, what we now find to
be a sort of agglomeration of castles, and so pass out to the great
stone terrace or platform that looks down upon the town and the
valley below.
These old castle-builders did have an eye for the beautiful; and a
grand point for observation is this great terrace. Only fancy a broad
stone platform, seventy or eighty feet long by thirty feet wide,
midway up the front wall of an elegant castle, rich in architectural
beauty, the terrace itself with heavy cut stone rails, vases, seats, and
ornamental stone bowers at the corners, while spread out far below
and before the spectator lies one of the loveliest landscape views
that can be imagined. We can look right into the streets of the town
directly below us; beyond is the winding River Neckar, with its
beautiful arched bridge, and beyond that a vine-clad height known
as the Holy Mountain; on one side is the lovely valley of the Neckar,
romantically and luxuriously beautiful as it stretches away in the
distance. The town of Heidelberg itself is squeezed in between the
castle hill and the River Neckar, which widens out below the town,
and finally unites with the Rhine, which we see in the distance, and
beyond it blue mountains, binding in the distant horizon, frame in
the charming picture.
I cannot, of course, describe, in the limits of a sketch, the
massiveness, vast extent, and splendor of this castle, the production
of three centuries,—commenced when the crusades were at their
height, and not finished till long after cannon were in use; so that
we mark the progress and changes of architecture in each century,
and cannot but feel that, in some respects, the builders of old times
were in advance of those of the present day. One might stay here
weeks, and enjoy the romantic scenery of the vicinity and the never-
ending new discoveries which he makes in this picturesque old ruin.
In 1689 the French captured the place and undertook to blow up the
principal round tower; it was so solidly and compactly built, however,
that the enormous mass of powder they placed under it, instead of
lifting the great cylinder into the air to fall back a heap of ruins, only
broke off a third part of it, which toppled over entire in one solid
chunk, and it lies as it fell, broken off from the main body as if by
the stroke of a gigantic mallet, and exposes the wall of close-knit
masonry twenty feet in thickness.
We wander through halls, court-yards, vaulted passages, deep
dungeons, and lofty banquet halls, into round and square towers;
cross a regular broad old drawbridge wide enough for a troop of
mail-clad knights to ride out from the great arched entrance, which
stands in good preservation, with its turrets and posts for warders
and guards, and there is the huge, deep castle moat and all, just as
we have read about them, or seen them illustrated in poetic fictions.
We pass out upon a sort of long spur or outwork from the castle
—a kind of outer battery, which is styled the great terrace, and was
built in 1615—a charming promenade, upon which is a mall, shaded
by trees, and from which we get another picturesque view of the
scene below, and of the castle itself.
But we must not leave Heidelberg Castle without seeing the
Great Tun; and so we pay our kreutzers to the little maid who acts
as guide, and descend below, to the cellars of the famous wine-
bibbers of old. We came to a cellar in which there was a big barrel
indeed, as it held two hundred hogsheads of wine; but this not
coming up to the expectations of some of the party, there were
expressions of dissatisfaction, until our guide informed us that this
was only the front cellar, where they used to keep twelve little
barrels of this size, and pointed out the raised platforms upon which
they used to stand; but the great barrel was in the back cellar. So
we followed in, and found a big barrel indeed, large as a two-story
house, thirty-two feet long and twenty-six feet high. It holds eight
hundred hogsheads of the vinous fluid, and its contents fill two
hundred and thirty-six thousand bottles. The diameter of the heads
of this big barrel is twenty-two feet, and the circumference of the
centre two hundred and thirty-one feet. The bung-hole of this great
cask, however, seems more out of proportion than an elephant's
eye, for it measured scarcely four inches in diameter. Steps lead
around the tun, and up to its top, upon which is laid a platform, on
which a cotillon has been danced by enthusiastic visitors. Remember,
this is down cellar. If they keep barrels of this kind down cellar, the
reader may imagine the size of the house above, and, perhaps, the
drinking capacities of those who used to inhabit it.
A beautiful carriage road, passing the ruined walls, and leaving
them below, leads up to a pretty chalet, three hundred feet above
the castle; and here, one day, we halted on the rocky platform, and
gladdened the heart of the landlord by an order for lunch for the
party, which was spread for us in the garden, from which we could
look down into the ruins of the old castle, upon the town below, and
the winding river. We were not permitted to enjoy our al fresco
repast, for a thunder storm came rolling up the valley, and we were
hustled in doors, where, however, we found the host was prepared
for such emergencies, as our viands were spread out in an
apartment with a glass side, looking towards the valley, so that we
sat there, and watched the great gusts sweep up the river, and the
rain come swirling down in sheets of rattling drops, amid the peals
of thunder that echoed and reverberated between the hills, and
finally swept past with the shower, angrily muttering in the distance,
as though the spirits of the Hartz Mountains and Black Forest were
retiring before the fairies of the valley, who went sweeping after
them in great clouds of shining mist, overarched by a gorgeous
rainbow.
We enjoyed the prospect from this place, which was the site of
the ancient castle, traces of which still remain, and then took
carriage for the Königsstuhl, or King's Seat, a round tower far above
us. A ride of about an hour through the dripping woods, with the
vegetation bright and fresh from the recent shower, brought us to
this elevation, which is eight hundred and fifty feet higher than the
castle, and seventeen hundred and fifty feet above the level of the
sea.
Upon the summit of the King's Seat, a round stone tower, ninety
feet in height, is erected, which we ascended, and were rewarded
with a still more extensive view than any we had previously had of
the surrounding country. In one direction is the dark and sombre
foliage of the Black Forest; in another, the picturesque mountains
and valleys of the Odenwald; in another, we look down upon the old
castle and town far beneath, and see the River Rhine winding away
off through the landscape, like a crinkled ribbon of steel; there are
the Hartz Mountains, of which we have read so many old German
legends, in which wehr wolves, and mysterious huntsmen, who
wound magic horns, figured. Far in the distance, beyond the dark-
green forests, we descry, with our field-glass, the cathedral spire of
Strasburg. Turn whichever way we may, the view is superb, and the
hill is indeed a kingly seat, for it commands as magnificent a
prospect as king could wish to look upon.
Heidelberg is a paradise of pipes—so I thought till I reached
Vienna; but meerschaums of splendid carving and quality are sold
here at prices so low, in comparison with what they cost in America,
that the temptation to smokers to lay in a stock is almost irresistible.
Malacca joint canes, with elegantly carved pure ivory handles, are
another article that is marvellously cheap here, twenty francs (four
dollars, gold) purchasing the best and most elaborate patterns, the
grips or handles of which were wrought into figures of fruit, flowers,
wreaths, and heads of birds and animals. The shop windows held
many pictures of students' clubs,—some clubs famed for the number
of glasses of beer their members could guzzle, he being elected
president who could hold the most of that liquid—in fact, who made
the biggest beer barrel of himself. In other windows were displayed
huge horns, with a silver cup, and a tall mug, of huge capacity, said
to represent the draught of the presidents of two rival clubs,—
supposed to be what they could swill at a single pull.
The beer halls frequented by the students are similar to the
great lager beer saloons in this country; and, in the evening, the
tables are thronged with students, talking, discussing questions,
playing dominoes, smoking, and drinking. There is a tremendous
clatter of voices, and the smoke is so thick—well, none but Germans
and Spaniards could live in such a dense cloud.
The University of Heidelberg, which is the oldest in Germany, I
think was founded in 1386. The university buildings—which are very
old, some of them erected in 1693—are plain and unpretending in
their appearance. The great library here contains over two hundred
thousand volumes, and many curious manuscripts, which we did not
inspect, as they are of interest chiefly to scientific scholars, and only
accessible between the hours of ten and twelve in the forenoon.
There is but little in the town of Heidelberg itself to interest the
tourist. The great attraction is the noble old castle, and the romantic
highlands about it.
A three hours' ride from Heidelberg, and we are at Baden-
Baden, that gayest of the gay watering-places on the continent. We
are driven to our hotel, the Hotel de l'Europe, a most charming
house, large, clean, and splendidly kept by hosts who thoroughly
know their business, and entirely free from any of the extortions,
swindles, and sharp practices which disgrace our Saratoga and
Newport hotels. Indeed, everything in the hotels in Baden-Baden is
so comfortable to the tourist, so pleasant, and even luxurious, and
at such comparatively moderate cost, that one is half inclined to
think the proprietors of them may be interested in the gambling
bank, and have an object in making their houses too agreeable to
leave with a short visit. There are three proprietors to this hotel; and
always one, and generally two, are in constant attendance in the
lower halls and at the table d'hote, to attend personally to their
guests, to answer all questions, and, in fact, to serve them in every
way possible, which, it is but justice to say, is done in the most
unexceptionable manner.
The Hotel de l'Europe is wide, deep, and cool; the broad
staircase in the centre is ornamented with pretty flowers in pots, and
running and trailing plants twining about the balusters, all the way
up to the second story. Directly beneath my window is a beautiful
strip of flower-garden, and the fresh air comes in at the casement
laden with the odors of roses, carnation pinks, honeysuckles, and a
score of other beautiful flowers, which are blooming in profusion.
Beyond this little garden, say twenty or thirty feet from the hotel,
runs the little River Oos, over a smooth-paved, artificial bed of stone
—a swift, clear, sparkling little stream, of scarce three feet deep, and
its width of not more than a score, spanned by little rustic bridges,
connecting the grounds of the different hotels that are strung along
its banks with the opposite shore, which is the broad, high road,
along which the numerous gay equipages which frequent watering-
places are continually passing.
Beyond the road, beneath shady trees, is the Trink Halle, or, as
the English have dubbed the place, the pump-room, probably
because there is no pump there, except the natural one of the
springs, whose mineral waters are conducted into ornamental
fountains, which the drinkers and bathers visit at seven A. M., to the
inspiriting and lively music of an excellent band. This pump-room is
a long, one-story building, two hundred and seventy feet long and
thirty-six wide, the façade resting on sixteen Corinthian pillars.
Beneath the façade, and upon large panels of the building behind
the colonnade of pillars, are fourteen great frescoes, executed by an
artist named Götzenbreger, and representing pictorially some of
those wild legends and weird stories of magic and enchantment for
which Germany is so noted.
Baden, be it remembered, lies at the entrance of the celebrated
Black Forest, popularly inhabited by various powerful enchanters,
gnomes, dwarfs, and sprites. These great pictures were all
handsomely executed, but the weather, to which they are partially
exposed, is rapidly fading away their rich tints. There was one,
representing a beautiful, light-haired, blue-eyed German girl, with
but a light drapery flowing around her shapely limbs as she walked
down to a mountain stream with her arm on the neck of a snow-
white stag: an entranced huntsman knelt upon the opposite bank,
gazing at this lovely vision; and while he gazed, one busy gnome
was twisting a tough bramble about his ankle, another huge-headed
fellow was reaching out from beneath a rock, and severing his bow-
string, while a third, a sturdy, belted and hooded dwarf, was robbing
his quiver of its arrows: all around, the rocks looked out in curious,
wild, and grotesque faces; they leered from the crags, grinned from
pebbles in the water, or frowned awfully from the great crags above
the hunter, who, dazzled by the enchantress, sees nothing of this
frightful scene, which is like the figures of a troubled dream—
thoroughly phantasmagoric and German. Another picture shows a
brave knight just on the point of espousing a weird lady before an
abbot, the satanic glare of whose eyes betrays his infernal origin;
cock-crow has evidently prevented these nuptials, as at one side
chanticleer is represented vigorously sounding his clarion, and in the
foreground lies another figure of the same knight in a deep sleep.
Other scenes represent encounters of shepherds with beautiful
water-sprites or Undines of the mountain lakes and rivers, knights at
enchanted castles, and sprites in ruined churches, each one being
the pictorial representation of some well-known legend of the
vicinity.
We arrived at Baden on Saturday, after dark, and I was roused
Sunday morning to look out upon the scene I have described, by the
music of a magnificent band, which commenced with the grand
hymn of Old Hundred; then a piece from Handel; next came the
grand Wedding March of Mendelssohn; and we looked from our
windows to see throngs of people promenading up and down the
piazza in front of the Trink Halle, to the inspiriting harmony, or
coming in every direction from the different hotels and pensions, or
boarding-houses, for their morning drink of spring-water. Gradually
the music assumed a livelier character, till it wound up with sprightly
quadrilles and a lively polka, played with a spirit that would almost
have set an anchorite in a dancing fever.
A fit illustration was this of the regard for the Sabbath in this
headquarters of the enemy of man, where, at noon, the great doors
of the gambling-house swung open, and the rouge-et-noir and
roulette tables were at once thronged with players, without
intermission, till midnight.
This great gaming-house, which has been so often described, is
styled the Conversation-haus, and is beautifully fitted up with
drawing-rooms, lofty and elegant ball-room, with each end opening
out into magnificent gardens, that are rich in parterres of flowers,
shady alleys, beautiful trees, fountains, and statues. During the
afternoon and evening these gardens are thronged, the magnificent
band plays the choicest of music, elegantly-dressed people saunter
amid the trees and flowers, or sit at little tables and sip light wines,
eat ices, and chat; you hear German, French, English, and Italian
amid the clatter of voices in any momentary lull of the music; you
may order your ice-cream in any of these languages, and a waiter is
at hand to understand and serve you; you may spend the whole day
in this beautiful spot, enjoy music that you gladly pay a concert price
at home to hear, without a penny expense, or even the remotest
hint for remuneration from any servant, except it be for the
refreshments you order—for the proprietor of the gaming
establishment gladly defrays all the expenses, for the privilege he
enjoys exclusively, and he pays besides the sum of sixty thousand
dollars per annum; so we enjoy it somewhat freely, although we
cannot help reflecting, however, that those who really bear the
expense are the victims insnared in the glittering and alluring net
which they themselves help to weave.
From the flutter of passing butterflies of fashion, the clatter of
tongues, the moving throng, and rich strains of music, we pass
through the noiselessly swinging doors that admit us to the almost
hushed inner court of the votaries of chance. Here, as at Wiesbaden,
the only voices above a subdued tone are those of the dealers, with
their regular formula of expression, while ever and anon, following
the rattle of the roulette wheel, comes the clink of the gold and
silver which the presiding high priests of Mammon rake into the
clutches of the bank. People of every grade, nation, and profession
jostle each other at these tables. Here all meet on a common level,
and rank is not recognized. The only rank here is the guinea-stamp,
and that, if the possessor conduct himself in an orderly manner,
insures prince and peasant an equal chance at the tables. The
language used is French.
I have seen beautiful young ladies, scarce turned nineteen,
seated here next their young husbands, with whom they were
making their bridal tour, jostled by the elegant Parisian member of
the demi-monde, whose noble "friend" hands her a thousand francs
to enjoy herself with for a while; young students, trembling, eager
old men; raw Americans, taking a "flyer;" and sometimes astonishing
the group by the magnitude of their bets; old women, Russian
counts, who commence by getting several notes changed into a big
pile of gold, which steadily diminishes beneath the assaults they
make on the bank, with as little effect as raw infantry charging
against a fortified breastwork; nay, I even saw the sallow
countenance of a Turk, looking on from beneath his fez cap, while its
owner fumbled uneasily at his girdle till he had detached his purse,
and gratified his curiosity by losing a few gold pieces; professional
gamblers, sharpers, women of uncertain character; old, young, and
middle-aged, all sacrificing at the same shrine.
"But some win?"
Yes, and the very ones whose success is least expected. Old
habitués will study the combination of figures for weeks, and keep a
record of the numbers, and the order in which they turn up, and
then, having, by mathematical certainty, made sure of lucky
numbers, stake—and lose. The croupiers go on regularly,
mechanically, and, unmoved by success or loss, or whatever takes
place about them, they rake in heavy stakes, and pay out huge
losses, without moving a muscle of their countenances, or betraying
the least emotion, raking in a huge stake while I was watching the
game that made even the old habitués glare at the player, without
even so much as a glance at him, and paying out a big loss with only
the simple dialogue,—
"Billets du banque?"
"Non."
And a dozen rouleaux of twenty-franc pieces were pushed over
to the winner.
I saw one of these unexpected winners, in the person of a
young Heidelberg student, who commenced with a couple of
Napoleons (forty francs). He won; doubled his stake, won again;
doubled, and won again; then he took up the pile of gold, and
placed two double Napoleons (eighty francs) on a single number; it
came up, and the bank paid him the amount won, which was fifteen
or twenty times the amount of his stake; he put this whole heap on
rouge (red), and the ball fell in rouge, and he won, and the amount
was doubled; he moved the increased heap to noir (black), and won
again! He pulled the heap of loose gold, rouleaux, and notes
towards him; players looked up, an obsequious servant brought a
chair for him to sit down, and two or three friends gathered at his
back; he crammed gold and notes—all but five twenty-franc pieces—
promiscuously into his pantaloons pocket, bet those five on the red,
won; moved the ten to the black, won again; the twenty to another
figure, and won thrice his stake.
By this time other players began to follow him in their bets; he
put forty francs on a single number, and half a dozen players
crowded their bets on to the same.
It lost.
Nothing daunted, they followed him, and rained down their
Napoleons upon the black; this time they were rewarded; black won.
The student pocketed his heap of gold again, all except five
pieces, and then with that capital bet again; lost three of the five;
tried a single number with one Napoleon, lost, of course; put the
other on the black, won again; balanced the two pieces on his
fingers for a moment, while half a dozen players were watching him,
and then put one on the black again, which in an instant was almost
obscured by the thick plating of metal that followed the lead of his
stake from other players.
"Rouge, dix-huit."
Down came the croupier's rake, and away rattled the glittering
heap towards the banker, while the student smilingly balanced his
remaining Napoleon in a sort of uncertain manner on his forefinger,
then turned and whispered a word to his friends, rose and tossed
the twenty francs magnificently to the servant who had handed him
a chair, and who was still behind him, and then, with bulging
pockets, walked away.
Baden is beautifully situated, and its scenery and surroundings
charming. A broad, well-kept, and shady avenue commences
opposite our hotel, and affords a splendid drive of over two miles,
and, like the drive at Newport, is frequented by gay equipages
during the fashionable season. Then there are the old and new
castles above the town, reached by winding and romantic roads, and
from the summit of the former a fine view of the valley of the Rhine,
and the beautiful valley of Baden, with its great hotels, elegant
grounds, and pretty villas.
The bazaar, a sort of open-air fair of booths, in a pleasant grove,
not far from the grounds of the Conversation-haus, is another
novelty, and an attractive one to foreigners; for here is a collection
of all those miscellaneous trinkets that tourists load themselves
down with, such as carved wood of Switzerland, garnets from
Prague, worsted work from Berlin, shaded photographs from Munich,
all sorts and kinds of sleeve-buttons, breast-pins, shawl-pins, ivory
carvings, ribbons, crystals from the Alps, leather work from Vienna,
and a thousand and one curious and pretty articles to tempt the
taste of purchasers.
We left the beautiful Hotel de l'Europe, with its pleasant rooms,
elegant table d'hote, and prompt attention, with regret, for two
reasons: one, that it was so agreeable a place of rest; and the other,
that the price, at this most expensive of the hotels, with all its
privileges, was less than two dollars per diem.
Up and away, for we must see the grand old Cathedral of
Strasburg—a two hours' journey; and here we are, at the
magnificent portal of this edifice, founded by old King Clovis, in 510.
The carvings above the portal are magnificent. Here are equestrian
statues of Clovis, Dagobert, and other old worthies, elegantly
wrought, amid a wealth of rich tracery and carving; but as the
spectator looks up, up, up, at the magnificent cathedral tower and
spire, soaring away into the air till it seems to have a needle-like
sharpness, he gets almost dizzy with gazing; and, upon being
informed that the ascent of this highest spire in the world is not
unattended with danger, of coarse all Americans are seized with an
uncontrollable desire to ascend it; and so were we.
So we took a look at the splendid front, with the two great
square towers, something after the style of those of York Minster or
Westminster Abbey, with a huge rose window between them; the
elegant Gothic architecture of arches, pillars, and points; the grand,
arched portal, crowded, every inch of it, with carving and statues;
and finally, up again at the light steeple, which, from one of the
square towers, rose into the air with such grace and boldness.
We enter direct from the street, pay the custodian at the foot of
a flight of stairs of easy ascent, and, ladies and all, begin the climb-
up. We go till we have trodden over three hundred and thirty stairs,
and find ourselves two hundred and thirty feet above the street,
upon a place called the platform. Here are several rooms, and a
custodian lives up here, who acts as a watchman for fires, has
general charge of the place, keeps a visitors' register, and sells
stereoscopic views. The panoramic view from here is superb, and
this point, which is about two thirds of the way up, is as high as
ladies generally ascend; for the remainder of the ascent, which is by
circular staircases on four sides of the tower, requires some nerve
and steadiness of head, the masonry being of open-work, with the
apertures nearly large enough for the body to pass through, while
the staircases, which are winding and narrow, are likely to provoke
an attack of giddiness. I could compare the ascent to nothing but an
ant climbing a corkscrew. Every turn brought us to these great
wrought openings, which, from the ground, appeared like delicate
lacework, and which seemed to give one the feeling, as he went
round and round, as if he were swinging and swaying in the network
between heaven and earth; and the wind, which pipes, whistles,
rushes, roars, and sighs, in every variety of tone, and apparently
from every point of the compass, owing to the innumerable and
different-shaped openings, adds to this illusion.
Breathless, we reach a circular gallery running round outside,
and at the top of the square part of the steeple, and pause, clinging
to the stone-work of the balustrade to look at the fine view, which
takes in Baden, the Black Forest, the Rhine, and the chain of the
Jura, in the distance.
Still higher! Here we are at the base of a pyramid of light,
ornamental turrets, which gradually converge towards a point, and
support the "lantern" above us. The winding staircases in these
turrets were also narrow, and through open stone-work, as before,
till you reach the lantern, an enclosed observatory. Higher up is the
"crown" which, as the steps leading to it are outside, and with no
other protection than the wall to which they were fastened, we did
not care to attempt. The total height of this lofty spire is four
hundred and sixty-eight feet.
The descent through the open-work spire to the platform where
the ladies were left was far more trying to the nerves than the
ascent. In ascending, one is continually looking up, and the open
spaces in the stone-work have the appearance of passages through
which you are to pass, but continually avoid by the winding of the
staircase; but in descending, the gaze being directed downward, you
have the vast height continually before the view; the huge
apertures, which appear at your very feet at every turn, seem like
yawning crevasses, through which to shoot your body into the blue
distance, or on to the Gothic points and pinnacles that are far, far
below. I clung to the rope and iron hand-rails convulsively, and am
not ashamed to mention that, more than once, as I came to the
more elaborate open-work of this stone filigree, which seemed to
dangle between heaven and earth, I closed my eyes, and followed
the rail, feeling the way downwards. The descent was made almost
in silence, and there was a sigh of relief when the platform was
reached, and we joined the ladies again.
The open-work that one encounters in the turrets during the
ascent of the spire, although scarcely large enough to admit the
passage of a man's body, is so frequent, and so directly on the
staircases, which are winding and narrow, as to give the semblance
of great danger and insecurity, though comparatively very little
exists. The only thing to be feared is giddiness, which might render
it difficult for the adventurer to go up or down, after reaching a
certain point; and it is, therefore, not advisable for those liable to be
affected in that manner to attempt the ascent above the gallery,
which really adds very little to the view.
Viewed architecturally, Strasburg Cathedral seems to bring
together all the styles or orders of architecture of the middle ages,
from the simplicity of the Byzantine to the Gothic, with its arches
and excess of superfluous ornament. The façade of the church, and
especially the portal, is so elaborately ornamented with carved work
as to convey the impression of chasing, instead of sculpture. The
figures in bass-relief and carving represent scenes in the life of the
Saviour, the saints, and the apostles, besides statues of kings and
warriors.
A view of the interior is grand and impressive. Fourteen great
cluster pillars uphold the lofty Gothic arched roof, over a hundred
feet above the pavement. Midway, and above arches that unite the
pillars, is a beautiful Gothic gallery on both sides, and many of the
great stained-glass windows, representing scriptural subjects, are of
wondrous beauty.
In the nave is a beautiful pulpit, built in 1486, and covered with
little statues, delicately carved, and not far from it the organ, up
midway between the floor and arched ceiling. The perspective view
in these old cathedrals is grand, and figures hardly give one an idea
of their vastness. This cathedral is five hundred and twenty-five feet
long, one hundred and ninety-five feet in width, and is one of the
finest of those wonderful monuments of religious art that rose
during the middle ages.
The great astronomical clock here is a curious and wonderful
piece of mechanism. Fancy a structure twenty-five or thirty feet in
height, and twelve or fifteen broad at the base, having on either side
two others nearly of equal height, one being the masonic flight of
winding stairs, surmounted by five small emblematical Corinthian
pillars, and the other a Gothic pillar, its panellings enriched with
figures.
Placed directly in front of the base of the clock is a celestial
globe, which, by means of the clock-work, shows the precession of
the equinoxes, solar and lunar equations for calculating geocentric
ascension and declination of the sun and moon at true times and
places. Then in the base itself is an orrery after the Copernican
system, by which the mean tropical revolution of each of the
planets, visible to the naked eye, is shown. Then comes an
ecclesiastical calender, a sort of perpetual almanac, indicating holy,
feast, and fast days; above, and about ten feet from the floor, and
just beneath the clock-dial, is an opening with a platform in front,
upon which come forth figures representing each day of the week,
as Apollo on Tuesday, Diana on Monday, &c. Thus a figure in a
chariot representing the day appeared at the entrance in the
morning, it had reached the centre in full view by noon, and drove
gradually out of sight at the close of day. On either side of the clock-
dial sat two Cupids, the size of a three-years-old child, one holding a
bell and hammer, with which it strikes the hours and quarters, and
the other an hour-glass, which it reverses each hour. Above is
another dial, with the signs of the zodiac; above that a figure of the
moon, showing its different phases, also put in motion by the clock-
work; and, still above this, two sets of automaton figures, which
appear only at twelve o'clock, at which time there is always a crowd
gathered to witness their performance.
We viewed this wondrous piece of mechanism for an hour, and
witnessed the following movements: At quarter past eleven the
Cupid near the dial struck one; then from one of the upper
compartments ran forth the figure of a little child with a wand, and
as he passed he struck one on a bell, and ran away (Childhood, the
first quarter). Round whirl the wheels of time, and the second
quarter chimes; but this time it is Youth that passes, and taps the
bell with his shepherd's staff twined with flowers. Again, we reach
the third quarter, and Manhood strides forth, the mailed warrior, and
smites the sonorous bell, ere he leaves the scene, three sounding
blows with his trenchant weapon—the third quarter. Once more, the
hands tremble on the point of noon; the fourth quarter is here, and
Old Age, a feeble, bent figure, hobbles out, pauses wearily at the
bell, raises a crutch, and taps four strokes, and totters away out of
sight—"last scene of all," when, as a finale, the skeleton figure of
Death, before whom all the four have passed, slowly raises his
baton, which the spectator now discovers to be a human bone, and
solemnly strikes the hour of twelve upon the bell. While he is
engaged in this act, a set of figures above him, representing the
twelve apostles, pass in procession before the Saviour, who blesses
each as they pause before him in turn, and chanticleer, the size of
life, perched upon the pinnacle of one of the side structures, lifts up
his voice in three rousing crows, with outstretched neck and flapping
wings, while the Cupid on one side of the dial reverses the hour-
glass for the sand to flow back, and the other also strikes the hour
with his bell and hammer.
Not far from this clock, in a sort of niched window, there is a
sculptured figure, said to be that of the architect of this cathedral,
represented as looking towards the entrance of the transept, and in
such position as to attract attention and provoke inquiry—a cunning
device for perpetuating one's memory as long as the figure shall
last.
Before leaving this fine cathedral we are reminded of the ancient
order of Masons by an enclosure opening out of one of the chapels,
which is the area of the workhouse of the stone-cutters of the
edifice. These Master Masons down to this day form a particular and
exclusive society, which originated in the days of the great master
mason and architect of this cathedral, Erwin of Steinbach, who
rebuilt the nave in 1275, commenced the façade of the church,
designed its towers, and superintended the work and the carrying
out of the grand designs in its construction through various
vicissitudes till his death in 1318.
The masons of this cathedral were distinct from other operative
masons, did not admit all who presented themselves, and had secret
signs, known only to each other. From the lodge of this cathedral
emanated several others in Germany, and a general meeting of the
masters was held at Ratisbon in 1459, at which they were united
under one government or jurisdiction, and the Grand Masters chosen
on that occasion were the architects of the cathedral at Strasburg, in
which city the Grand Lodge was then established.
The Emperor Maximilian I. confirmed the establishment of this
body October 3, 1498, and it remained here till the early part of the
eighteenth century, when it was removed to Mayence. With this bit
of masonic history we will bid adieu to Strasburg Cathedral.
The Church of St. Thomas looks inferior after it, though its
magnificent monument to Marshal Saxe is one of the sights of the
city. As we ride through the streets we see long-legged storks
soaring far overhead, and perched on a tall old chimney-stack,
behold the brushwood nest of one of these long-billed residents.
We view the bronze statue of Guttenberg, who made his first
experiments in the newly-discovered art preservative of arts in this
city in 1436, and four hundred years afterwards he is remembered in
this bronze memorial.
I don't know what it was in particular that made me wish to see
Basle, except it was, that when a youngster, I read of a curious old
clock which the inhabitants on one side of the river put up to mock
those on the other, which, the story said, it did by sticking out its
tongue and rolling its eyes at every motion of the pendulum; so,
when domiciled at the hotel of the Three Kings in that ancient town,
I looked out on the swift-flowing Rhine, and as I gazed at the
splendid bridge, nearly a thousand feet long, wondered if that was
the one over which the wondrous head had ogled and mocked.
Fancy my disappointment at being shown at the collection of
antiquities a wooden face scarcely twice the size of life, which is said
to be the veritable Lollenkonig, or lolling king, that used to go
through this performance in the clock tower on the bank of the river
till 1839. Here, in this collection, which is in a hall or vestry attached
to the cathedral, we saw many curiosities; among them the arm-
chair of Erasmus; for it was here in Basle that Erasmus, it will be
recollected, waged bitter war with the Church of Rome; here also
was preserved all that remains of the celebrated frescoes, the Dance
of Death, painted in the fifteenth century, and ascribed to Holbein.
The cathedral, a solid old Gothic structure, has some finely
ornamented ancient arched portals, and its two towers are each two
hundred feet in height.
Going through some of the quaint, old-fashioned streets of
Basle, we were struck with the quiet, antique, theatrical-canvas-look
which they had. Here was an old circular stone fountain, at which
horses could drink and the people fill their jars; the pavement was
irregular, and the houses were of odd architecture, which we in
America, who have not been abroad, are more than half inclined to
think exist only in the imagination of artists, or are the fancy of
scene-painters. I came upon one of these very scenes which I have
before referred to, in this old city, and stood alone a quarter of an
hour looking at the curious street that lay silent in the sunshine, with
scarce a feature of it changed since the days of the Reformation,
when Basle held so important a position in the history of
Switzerland, and "Erasmus laid the egg that Luther hatched;" and
had a group of cavaliers in doublet and hose, or a soldier with iron
cap and partisan, sauntered through the street, they would all have
been so much in keeping with the scene as to have scarcely excited
a second glance at them.
In the evening we attended one of those cheap musical
entertainments which are so enjoyable here in the summer season
of the year. It was given in a large building, one side of which
opened on the river bank; and while thirty pieces of music played
grand compositions, sprightly waltzes, or inspiriting marches, we sat
at the little tables, with hundreds of other listeners, who sipped light
wines or beer, enjoyed the evening air, and looked out upon the dark
cathedral towers, the lights of the town reflected in the swift stream
of the Rhine, watched the small boats continually passing and re-
passing, marked "the light drip of the suspended oar," coming
pleasantly to the ear, as they paused to listen to the melody, while
now and then the tall, dark form of some great Dutch lugger-looking
craft of a Rhine boat moved past, like a huge spectre out of the
darkness—a dreamy sort of scene, the realization of old Dutch
paintings, half darkened with age, that I have often gazed at when a
boy. And all this fine music and pleasant lounge for half a franc
(eleven cents).
"Wines extra?"
Yes. We called for a half flask, prime quality; price, a franc and a
half more; total, forty-four cents. But then we were luxurious; for
beer that was "magnifique" could be had in a "gros pot" for three
cents.
We rode from Basle to Zurich in a luxurious, easy, comfortable
drawing-room car, which a party of us—six American tourists—had
all to ourselves, and whirled through long tunnels, and amid lovely
scenery, in striking contrast to our hot, uncomfortable railroad ride
from Strasburg to Basle. The Swiss railway carriages are on the
American plan, and the line of the road itself kept in exquisite order.
The houses of the switchmen were pretty little rustic buildings,
covered with running flowering vines, plats of flowers before them,
and not a bit of rubbish or a speck of dirt to be seen about them.
The little country stations are neatly kept, and have flower gardens
around them; and, as we passed one crossing where two roads met,
a diamond-shaped plat, about twenty feet space, enclosed by the
crossing of three tracks, was brilliant with its array of red, blue, and
yellow flowers. At the stations and stopping-places there seemed to
be special pains taken to keep the rude, unsightly objects, that are
seen at stations in America lying about uncared for, out of sight.
Here, and in Germany, we notice the red poppy scattered in and
growing among the wheat, which one would suppose must injure
the grain; but the people say not, though it imparts, I think, a
slightly perceptible bitter taste to the bread.
We seem now to have got thoroughly into a land where they
know how to treat travellers, that is, properly appreciate the value of
tourist patronage, and treat them accordingly; and well they may,
for a large portion of the Swiss people make their living for the year
off summer tourists.
Notwithstanding this, and notwithstanding the English grumblers
who scold at these better hotels, better railway accommodations,
and better attention than they can get anywhere else,—
notwithstanding the shoddy Americans, whose absurd parade, lavish
expenditure of money, ignorance, and boorish manners make them a
source of mortification to educated men, and have served, in France
and Italy during the past few years, almost to double certain
travelling expenses,—notwithstanding this, the traveller will be more
honorably dealt with, and less liable to be cheated, in Switzerland
than elsewhere in Europe. Efforts are made to induce travellers to
come often, and stay long. Roads, passes, and noted points are
made as accessible as possible, and kept in good order during the
season. No impositions are allowed by guides, post-drivers, &c., and
the hotel-keepers strive in every way to make their houses as
attractive as possible in every respect to the guest, who enjoys the
real luxury of an elegant hotel, in an attractive or celebrated resort,
at a reasonable price, and does not suffer to that extent the same
Welcome to our website – the perfect destination for book lovers and
knowledge seekers. We believe that every book holds a new world,
offering opportunities for learning, discovery, and personal growth.
That’s why we are dedicated to bringing you a diverse collection of
books, ranging from classic literature and specialized publications to
self-development guides and children's books.
More than just a book-buying platform, we strive to be a bridge
connecting you with timeless cultural and intellectual values. With an
elegant, user-friendly interface and a smart search system, you can
quickly find the books that best suit your interests. Additionally,
our special promotions and home delivery services help you save time
and fully enjoy the joy of reading.
Join us on a journey of knowledge exploration, passion nurturing, and
personal growth every day!
ebookbell.com

More Related Content

PPT
Intro toxml
PPT
Ch2 neworder
PPTX
Web Development Course - XML by RSOLUTIONS
PPTX
LECT_TWO.pptx
PPTX
Xml in bio medical field
PPTX
Basics of XML
PPT
Introduction to xml
Intro toxml
Ch2 neworder
Web Development Course - XML by RSOLUTIONS
LECT_TWO.pptx
Xml in bio medical field
Basics of XML
Introduction to xml

Similar to Filemaker Pro 6 Developers Guide To Xml Xsl Beverly Voth (20)

PDF
Web engineering UNIT IV as per RGPV syllabus
PDF
Web engineering notes unit 4
PPTX
PDF
XMLin Web development and Applications.pdf
PDF
M.FLORENCE DAYANA WEB DESIGN -Unit 5 XML
PDF
XML for Web Development Information tech.pdf
PPTX
Unit 5 xml (1)
PPT
XML-Unit 1.ppt
PPT
PPTX
Web programming xml
PDF
Xml Demystified
PPT
PPT
CrashCourse: XML technologies
PPT
Xml Presentation-1
PPT
PPT
PPT
uptu web technology unit 2 Xml2
Web engineering UNIT IV as per RGPV syllabus
Web engineering notes unit 4
XMLin Web development and Applications.pdf
M.FLORENCE DAYANA WEB DESIGN -Unit 5 XML
XML for Web Development Information tech.pdf
Unit 5 xml (1)
XML-Unit 1.ppt
Web programming xml
Xml Demystified
CrashCourse: XML technologies
Xml Presentation-1
uptu web technology unit 2 Xml2
Ad

Recently uploaded (20)

PPTX
1st Inaugural Professorial Lecture held on 19th February 2020 (Governance and...
PDF
Black Hat USA 2025 - Micro ICS Summit - ICS/OT Threat Landscape
PDF
Computing-Curriculum for Schools in Ghana
PDF
2.FourierTransform-ShortQuestionswithAnswers.pdf
PDF
RMMM.pdf make it easy to upload and study
PPTX
IMMUNITY IMMUNITY refers to protection against infection, and the immune syst...
PDF
Classroom Observation Tools for Teachers
PPTX
Cell Types and Its function , kingdom of life
PDF
Module 4: Burden of Disease Tutorial Slides S2 2025
PDF
Pre independence Education in Inndia.pdf
PPTX
Microbial diseases, their pathogenesis and prophylaxis
PDF
102 student loan defaulters named and shamed – Is someone you know on the list?
PPTX
PPH.pptx obstetrics and gynecology in nursing
PDF
FourierSeries-QuestionsWithAnswers(Part-A).pdf
PPTX
PPT- ENG7_QUARTER1_LESSON1_WEEK1. IMAGERY -DESCRIPTIONS pptx.pptx
PPTX
master seminar digital applications in india
PDF
TR - Agricultural Crops Production NC III.pdf
PDF
Complications of Minimal Access Surgery at WLH
PDF
3rd Neelam Sanjeevareddy Memorial Lecture.pdf
PPTX
school management -TNTEU- B.Ed., Semester II Unit 1.pptx
1st Inaugural Professorial Lecture held on 19th February 2020 (Governance and...
Black Hat USA 2025 - Micro ICS Summit - ICS/OT Threat Landscape
Computing-Curriculum for Schools in Ghana
2.FourierTransform-ShortQuestionswithAnswers.pdf
RMMM.pdf make it easy to upload and study
IMMUNITY IMMUNITY refers to protection against infection, and the immune syst...
Classroom Observation Tools for Teachers
Cell Types and Its function , kingdom of life
Module 4: Burden of Disease Tutorial Slides S2 2025
Pre independence Education in Inndia.pdf
Microbial diseases, their pathogenesis and prophylaxis
102 student loan defaulters named and shamed – Is someone you know on the list?
PPH.pptx obstetrics and gynecology in nursing
FourierSeries-QuestionsWithAnswers(Part-A).pdf
PPT- ENG7_QUARTER1_LESSON1_WEEK1. IMAGERY -DESCRIPTIONS pptx.pptx
master seminar digital applications in india
TR - Agricultural Crops Production NC III.pdf
Complications of Minimal Access Surgery at WLH
3rd Neelam Sanjeevareddy Memorial Lecture.pdf
school management -TNTEU- B.Ed., Semester II Unit 1.pptx
Ad

Filemaker Pro 6 Developers Guide To Xml Xsl Beverly Voth

  • 1. Filemaker Pro 6 Developers Guide To Xml Xsl Beverly Voth download https://ebookbell.com/product/filemaker-pro-6-developers-guide- to-xml-xsl-beverly-voth-2108404 Explore and download more ebooks at ebookbell.com
  • 2. Here are some recommended products that we believe you will be interested in. You can click the link to download. Filemaker Pro 6 For The Mac Fast Easy 1st Edition Lisa A Bucki https://ebookbell.com/product/filemaker-pro-6-for-the-mac-fast- easy-1st-edition-lisa-a-bucki-2421922 Advanced Filemaker Pro 6 Web Development 1st Bob Bowers Moyer https://ebookbell.com/product/advanced-filemaker-pro-6-web- development-1st-bob-bowers-moyer-2101510 Filemaker Pro 10 In Depth 1st Edition Safari An Oreilly Media Company Feiler https://ebookbell.com/product/filemaker-pro-10-in-depth-1st-edition- safari-an-oreilly-media-company-feiler-22028252 Filemaker Pro 11 The Missing Manual Susan Prosser Stuart Gripman https://ebookbell.com/product/filemaker-pro-11-the-missing-manual- susan-prosser-stuart-gripman-2310112
  • 3. Filemaker Pro 7 Bible https://ebookbell.com/product/filemaker-pro-7-bible-4112814 Filemaker Pro 13 The Missing Manual 1st Edition Susan Prosser https://ebookbell.com/product/filemaker-pro-13-the-missing-manual-1st- edition-susan-prosser-4964994 Filemaker Pro 8 The Missing Manual 1st Edition Geoff Coffey https://ebookbell.com/product/filemaker-pro-8-the-missing-manual-1st- edition-geoff-coffey-5216852 Filemaker Pro 14 The Missing Manual 1st Edition Gripman Stuart Prosser https://ebookbell.com/product/filemaker-pro-14-the-missing-manual-1st- edition-gripman-stuart-prosser-5268942 Filemaker Pro 10 Bible Ray Cologon https://ebookbell.com/product/filemaker-pro-10-bible-ray- cologon-5470356
  • 6. FileMaker® Pro 6 Developer’s Guide to XML/XSL Beverly Voth Wordware Publishing, Inc.
  • 7. Library of Congress Cataloging-in-Publication Data Voth, Beverly. FileMaker Pro 6 developer’s guide to XML/XSL / Beverly Voth. p. cm. ISBN 1-55622-043-X (paperback) 1. FileMaker pro. 2. Database management. 3. XML (Document markup language) 4. XSL (Document markup language). I. Title. QA76.9.D3V685 2003 005.75'65--dc21 2003002416 CIP © 2003, Wordware Publishing, Inc. All Rights Reserved 2320 Los Rios Boulevard Plano, Texas 75074 No part of this book may be reproduced in any form or by any means without permission in writing from Wordware Publishing, Inc. Printed in the United States of America ISBN 1-55622-043-X 10 9 8 7 6 5 4 3 2 1 0303 FileMaker is a registered trademark of FileMaker, Inc. All brand names and product names mentioned in this book are trademarks or service marks of their respective companies. Any omission or misuse (of any kind) of service marks or trademarks should not be regarded as intent to infringe on the property of others. The publisher recognizes and respects all marks used by companies, manufacturers, and developers as a means to distinguish their products. All inquiries for volume purchases of this book should be addressed to Wordware Publishing, Inc., at the above address. Telephone inquiries may be made by calling: (972) 423-0090
  • 8. Contents Acknowledgments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xi Introduction. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xiii Chapter 1 The Basics of XML . . . . . . . . . . . . . . . . . . . 1 1.1 A Brief History of XML . . . . . . . . . . . . . . . . . . . . . . . . 1 1.11 Markup Simplified . . . . . . . . . . . . . . . . . . . . . . . 2 Example 1: Text Containing Bold Formatting. . . . . . . . . . 2 Example 2: Revealing the Markup in Some Text Editors . . . . 3 Example 3: PostScript Printer Commands for the Document. . . . . . . . . . . . . . . . . . . . . . . . . . . . 3 Example 4: Rules-based Nested Structure Used for Document Markup . . . . . . . . . . . . . . . . . . . . . . . 4 1.12 The Standard in SGML . . . . . . . . . . . . . . . . . . . . . 5 1.13 SGML Used as Basis for HTML and XML . . . . . . . . . . . . 6 1.14 HTML Can Become XHTML. . . . . . . . . . . . . . . . . . . 7 1.15 XML as a Standard . . . . . . . . . . . . . . . . . . . . . . . 7 1.2 XML Advantages . . . . . . . . . . . . . . . . . . . . . . . . . . . 8 1.21 Why XML Data Exchange is Extensible . . . . . . . . . . . . . 8 Text Formats in FileMaker Pro . . . . . . . . . . . . . . . . . 9 Text Formats in XML . . . . . . . . . . . . . . . . . . . . . . 9 1.22 Saving Information for the Future . . . . . . . . . . . . . . 11 1.3 XML Document Examples and Terms . . . . . . . . . . . . . . . . 11 1.31 Well-formed and Valid XML Documents. . . . . . . . . . . . 12 1.32 Data Validation in FileMaker Pro . . . . . . . . . . . . . . . 13 Exercise 1.1 Validate Field Data Entry. . . . . . . . . . . . . 13 1.33 XML Document Structure . . . . . . . . . . . . . . . . . . . 15 FileMaker Pro and UTF-8 . . . . . . . . . . . . . . . . . . . 16 Standalone Documents . . . . . . . . . . . . . . . . . . . . 17 1.34 Document Type Declarations (DOCTYPE). . . . . . . . . . . 17 1.35 Processing Instructions . . . . . . . . . . . . . . . . . . . . 20 1.36 Comments . . . . . . . . . . . . . . . . . . . . . . . . . . . 21 Using Comments to Test HTML Documents . . . . . . . . . . 21 Comments for Future Reference. . . . . . . . . . . . . . . . 22 1.37 Elements and Attributes . . . . . . . . . . . . . . . . . . . . 22 Tag Names. . . . . . . . . . . . . . . . . . . . . . . . . . . 23 Attributes . . . . . . . . . . . . . . . . . . . . . . . . . . . 24 1.38 Element Content. . . . . . . . . . . . . . . . . . . . . . . . 24 1.39 The Element Tree Completed . . . . . . . . . . . . . . . . . 26 1.4 XML Character Conventions . . . . . . . . . . . . . . . . . . . . 27 1.41 White Space and End-of-Line Characters . . . . . . . . . . . 27 iii
  • 9. Where Do We Get These End-of-Line Characters?. . . . . . . 29 Using the End-of-Line Characters . . . . . . . . . . . . . . . 29 1.42 Unicode vs. ASCII . . . . . . . . . . . . . . . . . . . . . . . 30 Exercise 1.2 Create Your Own ASCII Table . . . . . . . . . . 30 1.43 Names Using Alphanumeric Characters . . . . . . . . . . . . 32 1.5 Beyond Basic XML—Other Standards. . . . . . . . . . . . . . . . 33 1.51 URI, URL, and URN (The Uniform Resource Standards) . . . 33 Mailto Is a Special URL . . . . . . . . . . . . . . . . . . . . 35 1.52 XPath . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36 XPath String-Values . . . . . . . . . . . . . . . . . . . . . . 39 XPath Functions . . . . . . . . . . . . . . . . . . . . . . . . 40 XPointer Related to XPath . . . . . . . . . . . . . . . . . . . 40 1.6 Reading More about XML . . . . . . . . . . . . . . . . . . . . . . 41 Conclusion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41 Chapter 2 XML Import and Export with FileMaker Pro 6 . . . . 43 2.1 XML Export . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 44 2.11 Setting Up XML Export . . . . . . . . . . . . . . . . . . . . 44 2.12 FMPDSORESULT Export. . . . . . . . . . . . . . . . . . . . 46 2.13 FMPXMLRESULT Export. . . . . . . . . . . . . . . . . . . . 47 2.14 FMPDSORESULT vs. FMPXMLRESULT . . . . . . . . . . . . 49 2.2 Special Export Considerations . . . . . . . . . . . . . . . . . . . 50 2.21 Character Encoding . . . . . . . . . . . . . . . . . . . . . . 50 Exercise 2.1 Export Double-byte Characters . . . . . . . . . 50 2.22 XML from FileMaker Pro Related Fields. . . . . . . . . . . . 52 Exercise 2.2 Create Related Data XML Results . . . . . . . . 52 Exercise 2.3 Create Related XML Exports . . . . . . . . . . . 54 2.23 Repeating Field Data . . . . . . . . . . . . . . . . . . . . . 57 Tab-Separated Export of Repeating Fields. . . . . . . . . . . 58 Exercise 2.4 XML Export of Repeating Fields . . . . . . . . . 58 2.24 Number, Date, and Time Field Formats . . . . . . . . . . . . 61 2.25 Formatted Text and XML Export . . . . . . . . . . . . . . . 63 2.26 Container Fields and Value Lists . . . . . . . . . . . . . . . 64 2.27 Global Fields, Calculated Fields, and Summary Fields . . . . 64 2.28 Final Thoughts on XML Export with Filemaker Pro 6. . . . . 65 2.3 Scripted XML Exports . . . . . . . . . . . . . . . . . . . . . . . . 66 2.31 Setting Up Scripted XML Exports . . . . . . . . . . . . . . . 66 2.32 Export to RTF with EZxslt . . . . . . . . . . . . . . . . . . . 67 2.33 Exchange Data between FileMaker Pro and QuickBooks Using XML . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 68 2.4 XML Import . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 68 2.41 Setting Up for XML Import . . . . . . . . . . . . . . . . . . 68 2.42 FMPXMLRESULT Import . . . . . . . . . . . . . . . . . . . 70 Exercise 2.5 Manual Transformations with FileMaker Pro . . 71 Example 1: Export, Edit the FIELD Elements, and Import . . 71 Contents iv
  • 10. Example 2: Transform with a Simple Stylesheet . . . . . . . 72 Example 3: Create a Stylesheet with FileMaker Pro. . . . . . 75 2.43 Scripted XML Import . . . . . . . . . . . . . . . . . . . . . 76 2.44 FileMaker Pro XML Import and Other XML Schemas . . . . . 77 2.5 Calculated Export of XML. . . . . . . . . . . . . . . . . . . . . . 79 2.6 Calculated Import of XML. . . . . . . . . . . . . . . . . . . . . . 82 2.61 Troi-Text Plug-in. . . . . . . . . . . . . . . . . . . . . . . . 83 2.62 Calculated Parsing of XML . . . . . . . . . . . . . . . . . . 83 2.7 Debugging XML Export and XML Import . . . . . . . . . . . . . . 86 2.8 Encrypting Your Data . . . . . . . . . . . . . . . . . . . . . . . . 86 Where to Go From Here.... . . . . . . . . . . . . . . . . . . . . . . . 88 Chapter 3 Document Type Definitions (DTDs) . . . . . . . . . . 89 3.1 Creating a Basic XML Document Containing a DTD . . . . . . . . 91 3.11 The Relationship between DTD Element Names and FileMaker Pro Field Names . . . . . . . . . . . . . . . . . . . . . 91 Exercise 3.1 Check Your Field Names . . . . . . . . . . . . . 92 3.2 Elements in the DTD . . . . . . . . . . . . . . . . . . . . . . . . 92 3.3 Attributes in the DTD . . . . . . . . . . . . . . . . . . . . . . . . 95 3.4 A DTD for FileMaker Pro Themes. . . . . . . . . . . . . . . . . . 97 3.41 Every Layout Must Have at Least One Part . . . . . . . . . . 98 3.42 Creating a New Layout . . . . . . . . . . . . . . . . . . . . 98 Create a Document Type Definition (DTD) for Themes . . . 101 Exercise 3.2 Create a Document Type Definition for FileMaker Pro Theme Files. . . . . . . . . . . . . . . . . . 101 3.5 Entities in the DTD . . . . . . . . . . . . . . . . . . . . . . . . 109 3.6 Document Type Definitions (DTDs) vs. Schema/XSD . . . . . . . 110 3.61 DTD for FileMaker Pro Plug-ins . . . . . . . . . . . . . . . 110 3.7 More about Document Type Definitions . . . . . . . . . . . . . . 111 Chapter 4 FileMaker Pro XML Schema or Grammar Formats (DTDs). . . . . . . . . . . . . . . . . . . . 113 4.1 FMPXMLLAYOUT Schema/Grammar . . . . . . . . . . . . . . . 114 4.11 Layout Information . . . . . . . . . . . . . . . . . . . . . 116 4.12 Field Information . . . . . . . . . . . . . . . . . . . . . . 117 4.13 Merge Fields . . . . . . . . . . . . . . . . . . . . . . . . . 119 Exercise 4.1 Create Merge Fields for FMPXMLLAYOUT . . . 119 4.14 Value List Information . . . . . . . . . . . . . . . . . . . . 120 4.15 Completing the FMPXMLLAYOUT DTD . . . . . . . . . . . 120 4.16 FileMaker Pro Report/Layout Information. . . . . . . . . . 121 4.2 FMPXMLRESULT Schema/Grammar . . . . . . . . . . . . . . . 122 4.21 Database Information . . . . . . . . . . . . . . . . . . . . 123 4.22 Metadata Information . . . . . . . . . . . . . . . . . . . . 124 4.23 The Resultset (Contents of the Fields). . . . . . . . . . . . 125 4.24 Completing the FMPXMLRESULT DTD . . . . . . . . . . . 126 4.3 FMPDSORESULT Schema/Grammar . . . . . . . . . . . . . . . 127 Contents v
  • 11. 4.31 Records (ROWS) and Fields . . . . . . . . . . . . . . . . . 128 4.32 Related and Repeating Fields . . . . . . . . . . . . . . . . 129 4.33 Completing the FMPDSORESULT DTD . . . . . . . . . . . 129 4.4 A Document Type Definition for Database Design Reports . . . . 130 4.41 Database Design Report with XML and XSL . . . . . . . . . 133 4.42 XML Output Grammar for Database Design Report . . . . . 136 Database Design Report in the Browser . . . . . . . . . . . 140 4.43 Database Design Report File Grammar . . . . . . . . . . . 141 4.44 Details of the XML Database Design Report . . . . . . . . . 143 Field Details . . . . . . . . . . . . . . . . . . . . . . . . . 143 Reference Elements . . . . . . . . . . . . . . . . . . . . . 146 Relationship Details . . . . . . . . . . . . . . . . . . . . . 148 Value List Details. . . . . . . . . . . . . . . . . . . . . . . 149 Layout Details . . . . . . . . . . . . . . . . . . . . . . . . 149 Script Details. . . . . . . . . . . . . . . . . . . . . . . . . 151 Password Details . . . . . . . . . . . . . . . . . . . . . . . 154 4.45 FileMaker Pro Document Definitions . . . . . . . . . . . . 155 Chapter 5 XML and FileMaker Pro Web Publishing . . . . . . 157 Browser Requirements . . . . . . . . . . . . . . . . . . . . 158 5.1 Setting Up Web Companion for XML Requests . . . . . . . . . . 158 5.11 Web Companion as a Web Server . . . . . . . . . . . . . . 159 5.12 Web Companion as CGI . . . . . . . . . . . . . . . . . . . 160 Overview of the Processing Steps for a Web Server and CGI . . . . . . . . . . . . . . . . . . . . . . . . . . . 160 5.13 Static or Persistent Server Address. . . . . . . . . . . . . . 162 5.14 FileMaker Pro Products for XML Publishing . . . . . . . . . 163 Using Middleware with FileMaker Pro Unlimited . . . . . . 164 5.15 Standalone Considerations for Testing. . . . . . . . . . . . 167 Macintosh OS 8.x, 9.x Open Transport TCP/IP Configuration . . . . . . . . . . . . . . . . . . . . . . . . 167 Setting TCP/IP on Windows 95, 98, NT, Me, and 2000 . . . 169 Setting TCP/IP on Macintosh OS X . . . . . . . . . . . . . 170 Finish TCP/IP Setup for All Systems . . . . . . . . . . . . . 170 5.16 Web Companion Setup. . . . . . . . . . . . . . . . . . . . 171 5.17 Sharing Databases for Web Companion . . . . . . . . . . . 175 Databases . . . . . . . . . . . . . . . . . . . . . . . . . . 175 Text Pages . . . . . . . . . . . . . . . . . . . . . . . . . . 177 Images . . . . . . . . . . . . . . . . . . . . . . . . . . . . 177 Other Files . . . . . . . . . . . . . . . . . . . . . . . . . . 178 5.18 FileMaker Pro Unlimited . . . . . . . . . . . . . . . . . . . 178 5.2 XML Request Commands for Web Companion . . . . . . . . . . 181 5.21 Database and Layout. . . . . . . . . . . . . . . . . . . . . 181 Naming Suggestions . . . . . . . . . . . . . . . . . . . . . 182 5.22 Actions . . . . . . . . . . . . . . . . . . . . . . . . . . . . 182 Contents vi
  • 12. Create New Records . . . . . . . . . . . . . . . . . . . . . 183 Duplicate Records . . . . . . . . . . . . . . . . . . . . . . 183 Edit Records . . . . . . . . . . . . . . . . . . . . . . . . . 184 Delete Records . . . . . . . . . . . . . . . . . . . . . . . . 184 Find Records . . . . . . . . . . . . . . . . . . . . . . . . . 185 Layout Request. . . . . . . . . . . . . . . . . . . . . . . . 186 Database Names Request . . . . . . . . . . . . . . . . . . 187 Layout Names Request . . . . . . . . . . . . . . . . . . . . 188 Script Names Request . . . . . . . . . . . . . . . . . . . . 189 Open or Close Databases Command . . . . . . . . . . . . . 190 Request for Image in a Container Field . . . . . . . . . . . 190 5.23 Parameters . . . . . . . . . . . . . . . . . . . . . . . . . . 191 Database Parameter . . . . . . . . . . . . . . . . . . . . . 191 Layout Parameter . . . . . . . . . . . . . . . . . . . . . . 191 XML Format Parameter. . . . . . . . . . . . . . . . . . . . 192 RecordID Parameter . . . . . . . . . . . . . . . . . . . . . 195 Record Modification Count Parameter . . . . . . . . . . . . 196 Parameters for Using Stylesheets . . . . . . . . . . . . . . 196 Password Parameter for -dbopen Request . . . . . . . . . . 197 Find Request Parameters. . . . . . . . . . . . . . . . . . . 197 5.24 Creating the XML Requests . . . . . . . . . . . . . . . . . 203 Exercise 5.1 Creating XML Requests . . . . . . . . . . . . . 204 Instructions . . . . . . . . . . . . . . . . . . . . . . . . . 206 5.25 Creating or Editing Related Records . . . . . . . . . . . . . 208 Deleting Related Records . . . . . . . . . . . . . . . . . . 210 5.26 Repeating Field Data. . . . . . . . . . . . . . . . . . . . . 210 5.3 Performing Scripts on Web-Published Databases . . . . . . . . . 211 5.31 Script Steps to Avoid in Web Publishing . . . . . . . . . . . 215 5.4 Security on the Web . . . . . . . . . . . . . . . . . . . . . . . . 215 5.41 Security with Web Companion. . . . . . . . . . . . . . . . 216 5.42 Security vs. Security Blanket. . . . . . . . . . . . . . . . . 217 Security Blankets. . . . . . . . . . . . . . . . . . . . . . . 217 Security . . . . . . . . . . . . . . . . . . . . . . . . . . . 221 5.43 Script Security . . . . . . . . . . . . . . . . . . . . . . . . 232 5.44 Final XML Web Publishing Thought . . . . . . . . . . . . . 233 5.5 Error Codes for XML . . . . . . . . . . . . . . . . . . . . . . . . 233 5.51 JavaScript Errors . . . . . . . . . . . . . . . . . . . . 235 Chapter 6 Using HTML and XHTML to Format Web Pages . . . 237 6.1 HTML Document Structure . . . . . . . . . . . . . . . . . . . . 238 6.2 The HEAD Element . . . . . . . . . . . . . . . . . . . . . . . . 240 6.21 The TITLE Element. . . . . . . . . . . . . . . . . . . . . . 240 6.22 The META Element. . . . . . . . . . . . . . . . . . . . . . 240 6.23 The LINK Element Can Replace STYLE and SCRIPT. . . . . 241 6.24 The BASE Element . . . . . . . . . . . . . . . . . . . . . . 243 Contents vii
  • 13. 6.3 The Main BODY of the HTML Document . . . . . . . . . . . . . 243 6.31 Text. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 244 Headings . . . . . . . . . . . . . . . . . . . . . . . . . . . 247 Addresses . . . . . . . . . . . . . . . . . . . . . . . . . . 248 Quotations . . . . . . . . . . . . . . . . . . . . . . . . . . 248 Structured Text. . . . . . . . . . . . . . . . . . . . . . . . 249 Preformatted Text . . . . . . . . . . . . . . . . . . . . . . 250 6.32 Listed Items in HTML . . . . . . . . . . . . . . . . . . . . 250 6.33 Presentation of the Web Page with the TABLE Element . . . 253 TABLE Attributes . . . . . . . . . . . . . . . . . . . . . . . 254 TABLE Rows . . . . . . . . . . . . . . . . . . . . . . . . . 257 The Table Cell . . . . . . . . . . . . . . . . . . . . . . . . 258 Table Within a Table . . . . . . . . . . . . . . . . . . . . . 259 6.34 Hyperlinks and Anchors . . . . . . . . . . . . . . . . . . . 261 Attributes for Script Calls . . . . . . . . . . . . . . . . . . 262 6.35 Images and Objects . . . . . . . . . . . . . . . . . . . . . 263 Image Maps . . . . . . . . . . . . . . . . . . . . . . . . . 264 Objects . . . . . . . . . . . . . . . . . . . . . . . . . . . . 265 6.36 FRAME Your Web Pages . . . . . . . . . . . . . . . . . . . 266 Frames Using Frameset Pages . . . . . . . . . . . . . . . . 268 6.4 Deprecated HTML Elements . . . . . . . . . . . . . . . . . . . . 273 6.5 Using the FORM Element to Make HTTP Requests . . . . . . . . 274 6.51 Input Text . . . . . . . . . . . . . . . . . . . . . . . . . . 275 Select Menus . . . . . . . . . . . . . . . . . . . . . . . . . 277 Hidden Text . . . . . . . . . . . . . . . . . . . . . . . . . 278 6.52 Submitting the Form . . . . . . . . . . . . . . . . . . . . . 279 6.53 Using Forms for XML Requests. . . . . . . . . . . . . . . . 280 6.54 Fields in Your Database and FORM Elements . . . . . . . . 281 6.55 Actions . . . . . . . . . . . . . . . . . . . . . . . . . . . . 282 6.56 Parameters in Forms . . . . . . . . . . . . . . . . . . . . . 284 6.6 Claris Dynamic Markup Language. . . . . . . . . . . . . . . . . 286 6.61 Languages Related to HTML . . . . . . . . . . . . . . . . . 287 i-mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . 287 Compact HTML (cHTML) and XHTML Basic. . . . . . . . . 288 Back to Basics . . . . . . . . . . . . . . . . . . . . . . . . 289 Chapter 7 Extensible Stylesheet Language (XSL) and FileMaker Pro . . . . . . . . . . . . . . . . . . . . 291 7.1 XSL is XML. . . . . . . . . . . . . . . . . . . . . . . . . . . . . 292 7.11 Namespace Declarations . . . . . . . . . . . . . . . . . . . 293 7.12 Namespaces in FileMaker Pro 6 . . . . . . . . . . . . . . . 295 Database Design Reports and Namespaces . . . . . . . . . 295 Example XML Files in FileMaker Pro. . . . . . . . . . . . . 296 7.13 Stylesheet Instruction in XML Documents . . . . . . . . . . 296 7.14 Stylesheet Processing Instruction from HTTP Requests . . . 297 Contents viii
  • 14. 7.2 Top-level Elements in XSL . . . . . . . . . . . . . . . . . . . . . 298 7.21 XSL Templates . . . . . . . . . . . . . . . . . . . . . . . . 302 7.3 Other XSL/XSLT Elements . . . . . . . . . . . . . . . . . . . . . 306 7.31 Repeating Elements . . . . . . . . . . . . . . . . . . . . . 306 7.32 Sorting the Source Document . . . . . . . . . . . . . . . . 306 7.33 XSLT Elements for Text . . . . . . . . . . . . . . . . . . . 307 7.34 Conditional Tests. . . . . . . . . . . . . . . . . . . . . . . 309 7.35 Add Elements and Attributes. . . . . . . . . . . . . . . . . 310 7.4 XPath Functions . . . . . . . . . . . . . . . . . . . . . . . . . . 312 7.41 Additional XSL Functions . . . . . . . . . . . . . . . . . . 317 7.5 XSL and HTML. . . . . . . . . . . . . . . . . . . . . . . . . . . 318 7.6 FileMaker Pro Value Lists and XSL . . . . . . . . . . . . . . . . 319 7.7 Browsers and XSL . . . . . . . . . . . . . . . . . . . . . . . . . 321 7.8 Cascading Style Sheets (CSS) and XML . . . . . . . . . . . . . . 321 7.81 A Simple Rollover Effect . . . . . . . . . . . . . . . . . . . 322 7.82 Common CSS Terms . . . . . . . . . . . . . . . . . . . . . 323 Chapter 8 XSLT Examples for FileMaker Pro XML . . . . . . . 325 8.1 Creating Databases from XML Sources . . . . . . . . . . . . . . 325 8.11 Create a Database with FMPXMLRESULT . . . . . . . . . . 325 8.12 Create a Database with FMPDSORESULT . . . . . . . . . . 326 8.2 Transform FMPDSORESULT into FMPXMLRESULT . . . . . . . . 327 8.21 Example 1: Find the Rows/Records and Display Some Text . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 327 8.22 Example 2: Display Something for the Fields . . . . . . . . 329 8.23 Example 3: Return an XML Result and Display Elements Instead of Text . . . . . . . . . . . . . . . . . . . . . 330 8.24 Example 4: Transformation from FMPDSORESULT to FMPXMLRESULT Without the Fields . . . . . . . . . . . . . . . 331 8.25 Example 5: Get the Field Names for the Transformation . . 333 8.3 XML to HTML . . . . . . . . . . . . . . . . . . . . . . . . . . . 336 8.31 FMPXMLRESULT to HTML. . . . . . . . . . . . . . . . . . 336 8.32 FMPDSORESULT to HTML . . . . . . . . . . . . . . . . . . 337 Example 1: Create a Simple HTML Table from FMPDSORESULT. . . . . . . . . . . . . . . . . . . . . . . 337 Example 2: Create an HTML Table with Column Names from Field Names . . . . . . . . . . . . . . . . . . 339 8.33 Subsummaries with FMPDSORESULT . . . . . . . . . . . . 341 8.4 Fixed-width Text Export . . . . . . . . . . . . . . . . . . . . . . 341 8.41 Getting the Column Widths . . . . . . . . . . . . . . . . . 341 8.42 Setting Up Default Values . . . . . . . . . . . . . . . . . . 342 8.43 Passing Parameters. . . . . . . . . . . . . . . . . . . . . . 343 8.44 Testing Data Length . . . . . . . . . . . . . . . . . . . . . 344 8.45 Looping to Add Padding Characters . . . . . . . . . . . . . 346 8.46 The Complete Variable Fixed-Width Stylesheet . . . . . . . 347 Contents ix
  • 15. 8.5 Export XML from Related Databases . . . . . . . . . . . . . . . 350 8.51 Export as FMPDSORESULT . . . . . . . . . . . . . . . . . 350 Step 1: Simple Export . . . . . . . . . . . . . . . . . . . . 350 Step 2: Export with Related Fields. . . . . . . . . . . . . . 351 Step 3: Adding Other Related Fields . . . . . . . . . . . . . 353 8.52 Export as FMPXMLRESULT . . . . . . . . . . . . . . . . . 355 8.53 Export to HTML . . . . . . . . . . . . . . . . . . . . . . . 356 8.6 Import XML into Related Databases . . . . . . . . . . . . . . . . 358 8.61 The XML Source . . . . . . . . . . . . . . . . . . . . . . . 358 8.62 The Databases . . . . . . . . . . . . . . . . . . . . . . . . 360 8.63 The XSLT Stylesheets. . . . . . . . . . . . . . . . . . . . . 361 8.7 XSLT and Web Publishing . . . . . . . . . . . . . . . . . . . . . 364 8.8 More XSLT Examples . . . . . . . . . . . . . . . . . . . . . . . 364 Appendix A Glossary of Acronyms and Terms . . . . . . . . . . 365 Appendix B Resources . . . . . . . . . . . . . . . . . . . . . . 369 Index . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 381 Contents x
  • 16. Acknowledgments First, I must thank Rich Coulombre for recommending that I write this book. Yes, I thank him even though he knows the time and effort needed for such an undertaking! Mostly, I thank Rich for reminding me to put everything in perspective, as life seems to happen while you’re writing a book. The Friday night FileMaker chat group chimed in with so much support to get me going and to keep me going. Among them I found my first technical editor, Chad Gard. Our initial focus was XML in web publishing and Chad’s help was invaluable! When XML became another format for import and export in FileMaker Pro, my current technical editor, Doug Rowe, another chat buddy, took on the chal- lenge. Both of these wonderful people are great at taking the “technical” and making it “human.” They are busy being great FileMaker Pro developers and you’ll find examples from both of them on the companion web sites. Another great FileMaker Pro developer, Jon Rosen, has been helpful in my quest for a publisher. I could not have written this book without some terrific people at FileMaker, Inc. I have been working with web publishing and data- bases for a very long time. When FileMaker, Inc. moved in the same direction, I was extremely delighted. They also saw the oncoming freight train, XML, and integrated that technology in many ways. Now you have the chance to understand why we all think this is exciting. Kevin Mallon has been my main contact and extremely helpful by getting information for me on the products. I think he’s more than a public relations person at FileMaker, Inc. I think he’s a “believer”! Jimmy Jones, Dave McKee, Marcel De Maria, and Dave Dumas are among my heros at FileMaker, Inc. They give freely to the FileMaker community, through the mail lists, and support the developers’ quest for the ultimate database. Rick Kalman, technical liaison at FileMaker, Inc., is an “XML devo- tee,” too. Rick and Jay Welshofer have been instrumental in pushing the rest of us into preparing for the journey. You’ll find them on the XML-talk list at http://www.filemaker.com/xml/xml_talk.html, and in some of the XSLT examples, http://www.filemaker.com/xml/xslt_ library.html. Wordware Publishing has been so wonderful at taking a chance on me. I could not have finished without Jim Hill, Wes Beckwith, Beth xi
  • 17. Kohler, and Paula Price! I just knew that this book would fit in with their other FileMaker Pro titles. The most understanding bunch of people, my coworkers, family, and friends, have supported me in more ways than one! The Moondudes Extraordinaire, Fred Smith and Herman Adams, let me work on this project when my talents were needed elsewhere at Moonbow Software. But I hear the pride in their voices when they tell clients that “we are writing a book!” It’s definitely “we,” because I couldn’t have done it without their support. My parents, Duane and Lynne Rabbitt, and sister, Kathy Branch, always knew I could do something like this! They wouldn’t let me give up when I had the rest of my life to contend with. My fiance, Jesse Lockard, and his parents, TJ and Carole, also supported me, even though I should have been spending time getting a new life! Finally, I thank you for taking the time to read FileMaker Pro 6 Developer’s Guide to XML/XSL. That tells me that you are as interested as I am about XML and how we can achieve something wonderful with it and FileMaker Pro. Acknowledgments xii
  • 18. Introduction XML (Extensible Markup Language) is a standardized way of format- ting text to facilitate data exchange for machines and humans. Documents are composed of tags, or markup, surrounding the data content. The markup can describe the content or be a generic text or binary data holder: <descriptor>data content</descriptor> <COL><DATA>field content</DATA></COL> That is all you really need to know about XML and FileMaker Pro 6, unless, of course, you also need some hints as to what to do with that knowledge! This book will help you understand what XML is and how to create XML documents with Filemaker Pro 6 export and web pub- lishing. You will learn how FileMaker Pro XML can be transformed with Extensible Stylesheet Language (XSL) into text, Hypertext Markup Language (HTML), or other XML formats. Other XML formats can be transformed for importing data into FileMaker Pro 6 databases, so you will appreciate why XML is useful to you as a means of data exchanges. The Design of This Book Throughout the book, you will find examples of XML and XSL and cor- responding FileMaker Pro 6 scripts and functions, if relevant. Chapter 1 contains a brief history of XML, including samples of markup formatting and how SGML (Standard Generalized Markup Language), HTML, and XML are related. You will learn about the advantages of XML with some examples and definitions of XML terms. Character encoding, Unicode, and how it is used in XML and FileMaker Pro 6 is presented here. XPath, the process for determining the location of data within a XML documents, is also introduced. Chapter 2 is about exporting and importing XML with FileMaker Pro 6. The first examples of the XML grammars, FMPXMLRESULT and FMPDSORESULT, are discussed here. You will learn how to create manual, calculated, and scripted exports of XML documents. How FileMaker Pro produces related fields, repeating fields, and other field formats in XML exports, imports, and web publishing is discussed. An xiii
  • 19. introduction to XSL is also presented here, along with calculated and scripted imports of XML data into FileMaker Pro 6. Chapter 3 teaches you about the Document Type Definition (DTD) and how it relates to XML. Many XML formats use a DTD to describe how the document should be formatted. Understanding DTDs is most useful if you are importing and exporting data between FileMaker Pro 6 and other systems. An exercise for creating Document Type Defini- tions uses FileMaker Pro 6 layout theme files and is included in this chapter. Chapter 4 explores the DTD further by drilling down into the FileMaker Pro 6 grammars for XML import, export, and web publish- ing. The FMPXMLLAYOUT grammar is introduced along with more details about the FMPXMLRESULT and the FMPDSORESULT gram- mars. The Database Design Report found in FileMaker Developer 6 has its own grammar and the discussion of how XML and XSL is used for the report may help you understand these two technologies. Chapter 5 explains how FileMaker Pro web publishes XML. You will be given suggestions and hints for designing your databases for optimum web publishing. How to make a Hypertext Transfer Protocol (HTTP) request to FileMaker Pro 6 is discussed. You will learn about the use of scripts with web-published databases. Some security hints and tips to add to recommendations by FileMaker, Inc., can be found in this chapter. Chapter 6 discusses Hypertext Markup Language (HTML) and XHTML. This format for web pages or text pages displayed by brows- ers is a common method of displaying text, images, and hyperlinks to other documents. XML can be transformed into HTML, thus, detailed information about the HTML elements is presented here. To make HTML documents compliant with XML, XHTML recommendations are also considered. Form requests can be made to web-published FileMaker Pro 6 databases, so the similarities with hyperlink requests can be found in this chapter. The difference for using HTML on smaller browsers, such as mobile telephones, is discussed in this chapter. Chapters 7 and 8 define the terms for stylesheet transformation of XML with XSL. XPath is explored further here for use with XSL. How browsers handle XSL and how FileMaker Pro uses XSL are also dis- cussed here. Introduction xiv
  • 20. To Be or Not No attempt is made to assist you in creating databases with FileMaker Pro, but your thoughts will be guided toward designing databases for optimal data exchange with XML. All efforts will be made to explain these design considerations and to help you use XML within your cur- rent files. There are excellent resources for working with FileMaker Pro that are beyond the scope of this book. The FileMaker, Inc. web site has example files, a special XML section at http://www.file- maker.com/xml/, and a list of books. All XML and XSL definitions are taken from the standards and rec- ommendations presented by the World Wide Web Consortium (W3C), http://www.w3.org/. Rather than repeating these documents, you will find simplified examples intended to help you understand how you can use the standards with a minimum of effort. Consult those abstracts and specifications on the W3C web site for the latest changes. Introduction xv
  • 22. C h a p t e r 1 The Basics of XML This chapter is intended for the FileMaker Pro database designer. You will be presented with examples of markup languages and a brief his- tory of XML. You will begin to understand why XML can be important to you and how XML documents are structured. You will learn about some of the other standards based on XML for document presentation. If examples of similar usage in FileMaker Pro are helpful, you will find them here next to the XML examples. 1.1 A Brief History of XML Extensible Markup Language (XML) is based upon SGML (Standard Generalized Markup Language). The simplest explanation of SGML is that it is a method of writing documents with special formatting instructions, or markup, included. A publishing editor makes notations in the margin of a document to alert an author of changes needed to a document. The notations are markup of the document and, indeed, this is where the term “markup” originated. Markup allows the SGML or XML document to be distributed electronically while preserving the format or style of the text. An SGML document contains the content and the markup. The emphasis is placed on the formatting rather than the content, otherwise you would simply have an ordinary document. SGML can be used to facilitate the publishing of documents as electronic or printed copy. Some programs that read the markup may also translate the styles, for example, to Braille readers and printers. The same document might be viewed on a smaller screen such as those on personal digital assistants (PDAs) or pagers and cellular telephones. The markup can mean something completely different based upon the final destination of the document and the translation to another 1
  • 23. format. Using stylesheets or transformation methods, a single docu- ment with content and markup can be changed upon output. 1.11 Markup Simplified To help you understand markup, four examples are given in this sec- tion. They are based on the same results but have very different means of getting there. The first example illustrates that “there may be more than you see” on a monitor or printed page. The second example uses Rich Text Format (RTF) to show a way to embed formatting in a docu- ment for transportability. The third example shows the PostScript file (commands) to produce the desired results consistently on a laser printer. The fourth example uses the nested tag style found in SGML, HTML, and XML documents. You will begin to see how this final markup method can provide the formatting that you don’t see, the transportability and the consistency of methods two and three, along with additional information about the document and document contents. Example 1: Text Containing Bold Formatting This has bold words in a sentence. Using a word processor or electronic text editor, you may simply click on the word or phrase and apply the text style with special keystrokes (such as Control+B or Command+B) or choose Bold from a menu. On the word processor or computer screen, you can easily read the text, but you do not see the machine description, or code, describing how this text is to be displayed. You may not care how or why that hap- pens, but the computer needs the instructions to comply with your wishes for a format change. If you save the document and display or print it later, you want the computer to reproduce the document exactly as you designed it. Your computer knows what the stored code (or character markup) means for that text. A problem may arise if you place that code on another operating system or have a different word processor. There may be a different interpretation of the code that produces undesired results. This markup is consistent only if all other variables are equal. The next example uses a text encoding method to change the machine or appli- cation code into something more standard and portable. 2 Chapter 1: The Basics of XML
  • 24. Example 2: Revealing the Markup in Some Text Editors {rtf {This has }{b bold words}{ in a sentence. par }} The above sentence shows Rich Text Format (RTF) markup inter- spersed and surrounding the words of a document. The characters “{”, “}”, and “” all mean something in this document but have nothing to do with the content. Rich Text Format markup is used by many word processors to change the visual format of the displayed text. As each new style is encountered, the formatting changes without changing the content of the document. A document becomes easily transportable to other word processors by using Rich Text Format. Each application that knows how to interpret Rich Text Format can show the intent of the author. This book was composed on a word processor, saved as RTF, and electronically submitted to the publisher. Regardless of the appli- cation, electronic device, or operating system used to create the document, the styling is preserved. Rich Text Format markup adds no other information about the text. We may not know who wrote the sentence or when it was writ- ten. This information can be included as part of the content of the document but may be difficult to extract easily. We may have no con- trol over the formatting or be allowed to change it for use with other devices. Using a translation application, we can convert it to the next example, the commands our printer understands. Example 3: PostScript Printer Commands for the Document %!PS-Adobe-3.0 %%Title: () %%Creator: () %%CreationDate: (10:29 AM Saturday, May 26, 2001) %%For: () %%Pages: 1 %%DocumentFonts: Times-Roman Times-Bold %%DocumentData: Clean7Bit %%PageOrder: Ascend %%Orientation: Portrait // more code here has been snipped for brevity // %%EndPageSetup gS 0 0 2300 3033 rC 250 216 :M Chapter 1: The Basics of XML 3
  • 25. f57 sf (This has )S 431 216 :M f84 sf .032 .003(bold words)J 669 216 :M f57 sf ( in a sentence.)S endp showpage %%PageTrailer %%Trailer end %%EOF The third example, above, is the same text used in the previous two examples and printed to a file as a PostScript document. It uses a dif- ferent markup even though it is the same text and same document. PostScript is a language, developed by Adobe in 1985, that describes the document for printers, imagesetters, and screen displays. These files can also be converted to Adobe Portable Document Format (.pdf). The markup retains the document or image style so that it can be printed exactly the same way every time. It is a language that is spe- cific to these PostScript devices. An application can translate this document to make it portable, too. Example 4: Rules-based Nested Structure Used for Document Markup <? Command: use stylesheet1 for external rules ?> <document author="Beverly" creationDate="06 AUG 2001"> <paragraph importance="highest"> <sentence>This has <b>bold words</b> in a sentence.</sentence> </paragraph> <paragraph importance="optional"> <sentence>The styling may be lost.</sentence> </paragraph> </document> Unlike the Rich Text Format, nested markup may also contain a description of the text contents. The markup is often called a tag and may define various rules for the document. Sometimes the rules are internal such as “<b>” and “</b>” or external such as a stylesheet (set of rules) to apply to the whole document or portions of a document. 4 Chapter 1: The Basics of XML
  • 26. There can be rules for characters, words, sentences, paragraphs, and the entire document. Characters inherit the rules of the word they are in. Words inherit the rules of the sentence, and sentences inherit the rules of the paragraph. The rules may not be just the formatting or style of the text but may also allow for flexibility in display. <sentence color="blue">Some markup allows for a <text color="red">change</text> in the document.</sentence> Some formatting rules may also be different and change the inherited rules. All of the characters and words in the sentence above have a rule telling them to be blue. The text color can change to red without changing the sentence’s blue color. In this nested markup, only the inner tags make the rule change. Whether you use Rich Text Format or the nested structure found in SGML, HTML, and XML, changing the content of the words and phrases in the document does not change the style, the format, or the rules. Documents created with markup can be consistent. As the con- tent changes, the style, formatting, and rules remain the same. The portability of documents containing markup to various applications and systems makes them very attractive. Standards have been recom- mended to ensure that every document that uses these standards will maintain portability. 1.12 The Standard in SGML Charles Goldfarb, Ed Mosher, and Ray Lorie created General Markup Language (GML) in 1969. These authors wanted to adapt documents to make them readable by various applications and operating systems. They also saw the need to make the markup standard to industries with diverse requirements. Two or more companies could agree on the markup used in order to facilitate the exchange of information. Differ- ent standards could be designed for each industry yet could have elements common to them all. Another requirement for GML was to have rules for documents. To maintain an industry standard, rules could be created to define a docu- ment. One rule could define the type of content allowed within the document. Another rule could define the structure of the document. You might say these rules could be the map of the document. If you had the map, you could go to any place on the map. Using this kind of markup, you could locate and extract portions of the document more easily. Chapter 1: The Basics of XML 5
  • 27. GML evolved and was renamed Standard Generalized Markup Language. In 1986 the International Organization for Standardization (ISO) designated SGML as standard ISO-8879. SGML is now used worldwide for the exchange of information. 1.13 SGML Used as Basis for HTML and XML When the World Wide Web was developed in 1989, Tim Berners-Lee used SGML as a basis for Hypertext Markup Language (HTML). HTML is a document standard for the Internet. Although the set of rules for HTML is limited, HTML still fulfills many of the SGML goals. The HTML markup includes text formatting for the display of content to web browsers and hyperlinks to connect separate documents. An example of this markup for web browsers is shown in Listing 1.1. HTML is application independent, and documents using HTML can be viewed with various operating systems. Listing 1.1 Example of Hypertext Markup Language <HMTL> <HEAD> <TITLE>My Document in HTML</TITLE> </HEAD> <BODY> <H1>This Is The Top Level Heading</H1> Here is content<BR> followed by another line. <HR> I can include images <IMG SRC="mygraphic.gif"> in a line of text!<BR> Good-bye for now.<BR> <A HREF="anotherPage.html">Go to another page with this link.</A> </BODY> </HTML> Unlike SGML, HTML was not originally designed to be open to the cre- ation of new markup. However, custom HTML markup was designed for separate applications, and documents lost some of their ability to be easily portable to other applications and systems. One application had defined a rule one way, and another had defined it differently or could not understand all the rules. Hypertext Markup Language became nonstandard. 6 Chapter 1: The Basics of XML
  • 28. 1.14 HTML Can Become XHTML XHTML is a standard for revising HTML to make Hypertext Markup Language documents more compatible with XML. You will learn more about HTML and XHTML in Chapter 6, “Using HTML and XHTML to Format Web Pages.” You can also read more about XHTML for the World Wide Web Consortium at the Hypertext Markup Language home page, http://www.w3.org/Markup/. The example of XHTML in Listing 1.2, below, is very similar to Listing 1.1. XHTML is HTML with minor revisions to some of the tags. Listing 1.2 Example of XHTML <html> <head> <title>My Document in XHTML</title> </head> <body> <h1>This Is The Top Level Heading</h1> Here is content<br /> followed by another line. <hr /> I can include images <img src="mygraphic.gif" /> in a line of text!<br /> Good-bye for now. <a href="anotherPage.html">Links to another page are the same in XHTML</a> </body> </html> 1.15 XML as a Standard The World Wide Web Consortium (W3C) set up a task force for recom- mending a language more useful to electronic transmission and display of documents. They wanted this language to be based on SGML but not as complex. They wanted the language to be more flexible than HTML but maintain standards. The first version of the Extensible Markup Language (XML) specification was presented in 1997 as the “Document Object Model (DOM) Activity Statement,” http://www.w3.org/DOM/Activity. You may see many similarities between HTML and XML. A Hyper- text Markup Language document contains a nested structure. With minor adjustments, an HTML document could be an XHTML document and usable as an XML document. However, HTML is used more for dis- play and formatting of the data, while Extensible Markup Language Chapter 1: The Basics of XML 7
  • 29. generally separates the data descriptions from the text styles. XML allows the data to be transformed more easily for display on different devices. 1.2 XML Advantages This section expands upon the goals for XML data exchange and how they can help you as a FileMaker Pro developer. The recommendations for the design of the Extensible Markup Language show some of the advantages this format offers. These XML design goals can be found in the document “Extensible Markup Language (XML) 1.0 (Second Edi- tion), W3C Recommendation 6 October 2000,” http://www.w3.org/ TR/REC-xml. n XML shall be straightforwardly usable over the Internet. n XML shall support a variety of applications. n XML shall be compatible with SGML. n It shall be easy to write programs that process XML documents. n The number of optional features in XML is to be kept to the abso- lute minimum, ideally zero. n XML documents should be human-legible and reasonably clear. n The XML design should be prepared quickly. n The design of XML shall be formal and concise. n XML documents shall be easy to create. n Terseness in XML markup is of minimal importance. 1.21 Why XML Data Exchange is Extensible Common formats currently exist for exchanging data among applica- tions and systems. Text formats may use fixed-length fields or a delimiter such as a comma, tab, or other character between data types. These formats are wonderfully compact, but they were designed for the days when storage was at more of a premium. These formats rarely offer the description of the type of data. Unless a map is included with the data, you will likely have difficulty extracting specific data. For example, one piece of data as a series of numbers could be an identifi- cation key, a telephone number, an account number, or several concurrent number data types. These older formats are often limited in what information can be exchanged. 8 Chapter 1: The Basics of XML
  • 30. Text Formats in FileMaker Pro FileMaker Pro can import and export comma-separated values (.csv), tab-delimited text (.tab or .txt), and other formats. If the first row (or record) of the data contains the field names and the data is comma- separated, the format is of merge (.mer) type. ODBC, JDBC, Web Pub- lishing, and XML use the field names for data exchange. You may think of XML publishing in FileMaker Pro as extending the data exchange already available! You can read “About file formats” in FileMaker Pro Help for more information on the formats available for import and export. With FileMaker Pro 6, data can be exported as XML in one of two formats. The FMPXMLRESULT grammar uses a metadata format to describe the field names. This is somewhat similar to the merge for- mat, which includes the field or column names as the first record. The actual data is placed in repeating row elements with a column element for each field in the export. The other grammar for FileMaker Pro 6 export, FMPDSORESULT, has less information about the fields but uses the field names as the element names. You can read more about these two grammars in Chapters 2 and 4. Text Formats in XML XML documents include the description along with the data. Remem- ber that XML is a markup language for creating markup, so you can create whatever descriptions you want. The goal is to create markup that is “sensible” as well as extensible. The document becomes more human readable by including the description. The document also becomes more machine extractable when the description of the con- tent is included. With XML, the map is included with the document. A typical XML document may have hundreds of markup tags yet can be quickly searched for a particular one. Imagine looking in a doc- ument for a customer whose first name is John. A text editor or word processor can perform a fast search, but how would you know that you have found the correct piece of information? Look at the example in Listing 1.3 for the markup for people, then find all the people who are customers. Finally, search for a customer with the first name of John. You have just narrowed down your search in a hierarchical manner. Listing 1.3 people.xml <people> <vendor> <firstname>John</firstname> Chapter 1: The Basics of XML 9
  • 31. <company>Paper Cutters</company> </vendor> <customer> <firstname>Jane</firstname> <lastname>Doe</lastname> </customer> <customer> <firstname>John</firstname> <lastname>Doe</lastname> </customer> </people> The example in Listing 1.3 shows you another advantage of XML: You can extract only the data you need and ignore extraneous data. If all you want is the customer data, the <customer>...</customer> ele- ments are used in a search. Another need may be for vendor information and only those elements are used in the search results. This enables many people who need different information to use the same XML document. Extensible also means “flexible” when using XML. An XML docu- ment may provide alternate versions of text. Listing 1.4, greeting.xml, contains explicit text in a variety of languages (xml:lang). Providing alternate content in the same document can make a document flexible for multiple uses. XML is an international standard and provides for the use of non-English text in the documents. Listing 1.4 greeting.xml <greetings> <!-- English --> <greeting xml:lang="en">Hello World!</greeting> <!-- French --> <greeting xml:lang="fr">Bonjour Monde!</greeting> <!-- Spanish --> <greeting xml:lang="es">Buenos dias, Mundo!</greeting> <!-- German --> <greeting xml:lang="de">Guten tag, die Welt!</greeting> </greetings> XML is also flexible in the way document contents can be transformed for multiple uses. Regardless of platform or application (personal com- puter, portable digital assistant, or Braille printers and readers, for example), the document can be processed for the proper device. Each application can read the same document and interpret the markup dif- ferently. Some of these devices and applications can also write XML. This flexibility opens up much greater communication among many applications and devices. The exchange of information is the key! 10 Chapter 1: The Basics of XML
  • 32. 1.22 Saving Information for the Future One of the greatest advantages of documents formatted with XML is that these documents will be accessible long after the devices or meth- ods used to create them are gone. Historical creation and storage of data often relies upon proprietary applications and systems to write and read the documents. The meaning of a document may be lost if that system becomes unavailable. Because XML documents can provide descriptions along with the data, these documents will be easier to interpret later. The XML standards also provide a partial description of how com- puter applications should process the XML. This process is called parsing. Some processing is done on a server, and some processing is done within an application on a client machine. Adhering to these standards ensures that in the future documents will be just as useful as they are now. 1.3 XML Document Examples and Terms XML documents are composed of entities. These entities are storage units for pieces of the document structure. Each entity has a name and can be referenced by its name. The document entities can be parsed or unparsed. Parsed entities are all of the character content of the docu- ment and the markup tags. Parsed entities are also called replacement text and are processed like mail merge documents in a word processor. Unparsed entities are all of the non-content and may be text other than XML, graphics, and sound, according to the World Wide Web Consortium, http://www.w3.org/TR/REC-xml#sec-physical-struct. This section discusses XML document terms and gives you examples of these terms. Note: Note: You will see references to DTDs, Document Type Definitions, throughout this chapter. FileMaker Pro has provided these for you for use with XML publishing on the web or for imports and exports with XML. FileMaker Pro DTDs will be discussed in Chapters 2 and 4. If you wish to write your own Document Type Definitions, see Chapter 3. Chapter 1: The Basics of XML 11
  • 33. 1.31 Well-formed and Valid XML Documents To meet the goals of the XML standard, all documents should be well formed. This means: 1. The document contains at least one entity. 2. The document begins with a root or document element, which is the starting point for XML processors. 3. XML processors build a tree-like nested structure from the text of the well-formed document. 4. All parsed entities are also well formed. 5. All markup is composed of start tags, end tags, or empty tags that are properly nested. The nested markup in many of the listings in this book is indented for reader convenience, but this is not a requirement for a well-formed XML document. In some cases the tab and return characters are con- sidered viable to the XML document, and extraneous indentation can invalidate the document. Study the needs for your data exchange and don’t introduce extra data. The well-formed XML document has one or more elements: root element, parent elements, and child elements. The XML document in Listing 1.5 starts and ends with a root element, but the name of the element can be anything. All the elements are properly formatted with a start and end tag or empty tag. The child elements are nested within the parent elements, and all elements are within the root element. Listing 1.5 Properly nested markup tags in a document <root> <parent> <child> <grandchild /> </child> </parent> </root> The same document could be compacted with no white space and still follow the rules for well-formedness: <root><parent><child><grandchild /></child></parent></root> Conforming XML parsers and processors should verify that a document is well formed. If not, they stop processing and produce a report as soon as any errors are encountered. Improper nesting of elements causes a typical error. 12 Chapter 1: The Basics of XML
  • 34. XML parsers can be validating or nonvalidating. A valid XML docu- ment has an associated Document Type Definition (DTD), but not all XML documents require a DTD. An XML formatted document can be well formed and not valid. However, a valid XML document must be well formed. A Document Type Definition is a list of the “fields” that are allow- able in a particular XML document type. However, in XML they are not called fields but entities. The DTD contains the entities with element names, attributes of those elements, and the rules governing the enti- ties and the document. For data exchange in a business-to-business situation, the DTD can be the map of the entities of a document. Cre- ating well-formed and valid documents increases the accuracy of the data in those documents. Creating well-formed and valid XML docu- ments also helps standardize the data to assist the exchange of information. There are many DTDs, schemas, XML grammars, and other XML standards such as MathML (Mathematical Markup Lan- guage), SMIL (Synchronized Multimedia Integration Language), and XBRL (Extensible Business Reporting Language). 1.32 Data Validation in FileMaker Pro You have a similar way to assist with data integrity (validity) in FileMaker Pro. When you create a FileMaker Pro database file, you add fields in the Define Fields dialog. You define a field by naming the field and setting it to one of these data types: text, number, date, time, con- tainer, calculation, summary, or global. To further define the field, you can specify options to automatically enter specific data, to validate the data entered, and to store the field’s index or recalculation as needed. Figure 1.1 shows the Define Fields options dialog for setting validation in FileMaker Pro. The following exercise restricts a number field to only allow number values. Exercise 1.1 Validate Field Data Entry 1. Open the Define Fields dialog by choosing File, Define Fields... or using the keyboard shortcut Command+Shift+D on Macintosh, or Control+Shift+D on Windows. 2. Type Age in the Field Name box and select the Number radio button. Click the Create button to define the field. Now click the Options... button and select the Validation tab. Chapter 1: The Basics of XML 13
  • 35. 3. Check Strict data type and select Numeric Only from the pop-up. Close the Options dialog box by selecting OK or pressing Enter on your keyboard, and close the Define Fields dialog by selecting the Done button. 4. Enter Layout mode by choosing View, Layout Mode or using the keyboard shortcut Control+L on Windows or Command+L on Macintosh. 5. Place the new field on the layout if it is not already there by choosing the menu item Insert, Field. 6. Choose View, Browse Mode or use the shortcut Control+B on Windows or Command+B on Macintosh. 7. Enter the Age field by pressing the Tab key or by clicking into the field. Enter any number and tab out of the field or click anywhere else on the layout. You should not get a warning message. 8. Create a new record by choosing Records, New Record or the shortcut Command+N on Macintosh or Control+N on Windows. 9. Enter abc into the Age field. After you leave the field, you will be presented with the warning: “This field is defined to contain numeric values only. Allow this non-numeric value?” and the but- tons: “Revert field,” “No,” and “Yes.” This dialog will allow you to override the warning if you select Yes. This override feature can be valuable at times but not if you want to have a valid number field. 14 Chapter 1: The Basics of XML Figure 1.1: FileMaker Pro Define Fields Options dialog
  • 36. 10. Open the Define Fields dialog again and select the Age field. Click on the Options button and change the validation to provide a custom warning message. Check Strict: Do not allow user to override data validation and Display custom message if validation fails, then type Please enter a number in the field. 11. When you enter abc in the Age field, you get your custom mes- sage and the validation cannot be overridden. Figure 1.2 shows this custom message. Using a DTD to validate an XML document or setting the validation on fields for FileMaker Pro data entry provides for reliability of the infor- mation exchanged. Your XML documents should be well formed and valid. You will see in Chapter 2 how FileMaker Pro exports your data in a well-formed and valid XML document. Examples of the terms in DTDs will be discussed in Chapter 3, “Document Type Definitions (DTDs).” Document Type Definitions for the three XML document types published by FileMaker Pro will be discussed in Chapter 4, “FileMaker Pro XML Schema or Grammar Formats (DTDs).” 1.33 XML Document Structure An application that opens or reads files needs to know the type of doc- ument to process. Few applications are capable of processing all file types. Often the file type is determined by the file extension (.txt, .sit, .exe, .csv, .jpeg, .FP5, or .html) or the Creator Code and File Type on the Macintosh operating system. Sometimes the file type will also be embedded in the document itself. For example, you will find “%PDF” at the beginning of a Portable Document Format file created by Adobe Acrobat or “GIF89a” at the beginning of a Graphics Interchange Format (.gif) file. Well-formed XML documents begin with a prolog. This opening statement tells the XML parser the type of file it will be processing. The XML document prolog contains an optional XML declaration, one or more miscellaneous entities (comments and processing instruc- tions), and optional Document Type Declarations. An HTML Chapter 1: The Basics of XML 15 Figure 1.2: FileMaker Pro invalid entry alert dialog
  • 37. document, for example, can be a well-formed XML document with minor corrections to the standard HTML markup. The well-formed HTML document includes the XML declaration in the prolog. You can read more about the other optional elements of the prolog in section 2.8 of the XML specification, “Prolog and Document Type Declaration,” http://www.w3.org/TR/REC-xml#sec-prolog-dtd. Examples of XML declarations are listed below. <?xml version="1.0" encoding="encoding type" standalone="yes" ?> <?xml version='1.0'?> <?xml version="1.0" encoding="ISO 8859-1" ?> The version attribute is required in all XML declarations. When you include the version attribute, the document contains the information used should there be future versions of the XML specifications. The current version number is 1.0 and is based on the W3C Recommenda- tion as of October 6, 2000, http://www.w3.org/TR/REC-xml. The encoding attribute, optional in the XML declaration statement, specifies the character sets used to compose the document. This encod- ing attribute uses Unicode Transformation Formats (UTF-8) as the default. The 256 letters, digits, and other characters we commonly use for transmitting text are called ASCII (American Standard Code for Information Interchange) characters and are a subset of UTF-8. ASCII may also be called ISO 8859-1 or Latin-1, although only the first 128 characters of all these formats may be the same depending upon plat- form and font faces. XML processors must be able to read both UTF-8 and UTF-16 encoding. UTF-16 allows for more characters, such as would be used to compose ideographical alphabets. Graphical alphabets could be sym- bols, icons, or Asian characters. You may specify other UTF or encoding types. See “Unicode vs. ASCII” in section 1.42 of this chapter, for further explanation and examples of encoding types. Three com- mon encoding types are listed below. encoding="UTF-8" encoding="UTF-16" encoding="ISO-8859-1" FileMaker Pro and UTF-8 According to the FileMaker Pro Developer’s Guide, p. 7-8, “About UTF-8 encoded data”: All XML data generated by the Web Companion is encoded in UTF-8 (Unicode Transformation 8 Bit) format... UTF-8 encoded data is compressed almost in half (lower ASCII characters are compressed from 2 bytes to 1 byte), which helps data download faster. 16 Chapter 1: The Basics of XML
  • 38. Note: Because your XML data is UTF-8 encoded, some upper ASCII characters will be represented by two or three characters in the text editor—they will appear as single characters only in the XML parser or browser. An example of this type of encoding is shown in Listing 2.4. The new XML parser in FileMaker Pro 6 uses a larger set of encodings. The FileMaker Pro Help topic “Importing XML data” states: “FileMaker uses the Xerces-C++ XML parser which supports ASCII, UTF-8, UTF-16 (Big/Small Endian), UCS4 (Big/Small Endian), EBCDIC code pages IBM037 and IBM1140 encodings, ISO-8859-1 ("Latin1"), and Windows-1252.” You can find additional information FileMaker Pro supports for encodings by typing “UTF” in FileMaker Pro Help under the Find tab. Standalone Documents Standalone is also optional in the XML declaration statement. If standalone="yes," there are no external markup declarations associ- ated with this document. The XML processor needs to know whether to process or skip these. If standalone="no," then you will need to specify the location of the external declarations. A document can have both embedded markup declarations and external markup declara- tions. Documents that might have external calls could contain references to stylesheets or graphics and sounds. The following prolog tells the processors to look for external definitions and where to find them. <?xml version="1.0" standalone="no"?> <!ENTITY % image1 SYSTEM "http://www.mydomain.com/images/image1.gif"> %image1; 1.34 Document Type Declarations (DOCTYPE) You may have seen Document Type Declarations in web pages. The Document Type Declaration (DOCTYPE) should be one of the first statements in an HTML document, because it is part of the prolog of the document. The DOCTYPE tells more about the document and where the definition for this type of format can be found. A common declaration for an HTML 4.0 document follows. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/1998/REC-html40-19980424/loose.dtd"> They may sound similar, but Document Type Declaration (DOCTYPE) should not be confused with Document Type Definition (DTD). Chapter 1: The Basics of XML 17
  • 39. However, the declaration (DOCTYPE) can point to the location of any definition (DTD) to which a particular document should conform. Tip: Tip: While using an HTML editor, you may have the option or prefer- ence to check the syntax of your document as you edit. You can specify how strict (precise) the document should be if you insert the DOCTYPE statement first. When you check the document, the editor should warn you if you have not followed the rules according to the specified DOCTYPE. Good HTML editors will tell you what the error is and where it is located in your document. Let’s analyze the parts of the DOCTYPE declaration. Only the topElement is required. Each of the other parts may be optional but occur in the declaration as follows: <!DOCTYPE topElement availability "registration//organization//type label definition//language" "URL"> topElement is the root element (first significant markup) found in the document; “HTML ” is the default for web pages. Remember that the DOCTYPE is part of the prolog and is placed above the root ele- ment in the document. Valid documents must have this element match the root element. availability is a “PUBLIC” or a “SYSTEM” resource. Documents used internally or references to documents related to this one would have “SYSTEM” availability. registration is “ISO” (an approved ISO standard), “+” (registered but not approved by the ISO), or “–” (not registered by the ISO). The International Organization for Standardization might not register XML or HTML DOCTYPEs. organization is a unique label of the owner ID or entity that created the DTD. Common organizations are “IETF” (Internet Engineering Task Force) and “W3C” (World Wide Web Consortium). type is the type of object being referenced. “DTD” is the default. label is a unique description for the text being referenced. “HTML 4.0,” for example, refers to the version of these recommendations. definition is the type of document. “Frameset,” “Strict,” or “Transi- tional” are common definitions for HTML documents. Strict documents have more limited markup but can be used across a broader set of devices. 18 Chapter 1: The Basics of XML
  • 40. language is the two-character code of the language used to create the document. “EN” is English and “ES” is Spanish. The ISO 639 stan- dard is used for this code, which are the same codes used for the “xml:lang” attribute. Here, language is used for the entire document, although specific elements in the document can still be redefined by using “xml:lang.” URL (Uniform Resource Locator) is the location of the DTD. You can name your own document type. This is the only required ele- ment of the DOCTYPE statement. You should remember this naming suggestion: Stick with alphanumeric characters and the underscore character and you cannot go wrong! Also avoid any combination of the letters “X” or “x,” “M” or “m,” and “L ” or “l,” in that order, when nam- ing your document type, as these are reserved. DOCTYPES can contain internal Document Type Definitions (DTDs) or external DTDs. Internal DTDs stay with the document and can only be used with that document. You are making the definition of the document in itself. External DTDs can be used for multiple docu- ments and are referenced by the PUBLIC location, or if used internally, by the SYSTEM location as relative path to the document. Listing 1.6 shows some examples of XML documents with external DTD refer- ences. Compare them to the code below, which is complete with internal DTD: <?xml version="1.0" standalone="yes" ?> <!DOCTYPE myDoc [<!ELEMENT myDoc (#PCDATA)>]> <mydoc>Here's the text!</mydoc> Listing 1.6 XML documents with external DTD references Example 1: <?xml version="1.0" standalone="no" ?> <!DOCTYPE myDoc SYSTEM "myDoc.dtd"> <myDoc> <head>This is the first element of my document</head> <main> <para>Now I can add content.</para> <para>Each line is another child of the main element</para> </main> </mydoc> Example 2: <?xml version="1.0" standalone="no" ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/2000/REC-xhtml1-20000126/DTD/ xhtml1-strict.dtd"> Chapter 1: The Basics of XML 19
  • 41. <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> <head> <meta http-equiv="content-type" content="text/html; charset=utf-8" /> <title>New Document</title> </head> <body> <div> Because this is strict XHTML, every tag needs &quot;closure&quot;<br /> Including the break just inserted before this line and the meta tag in the head. </div> <div> Also note the way the quote mark is encoded around the word closure.<br /> You will see this later as a predefined entity in Element Content. </div> </body> </html> 1.35 Processing Instructions You can include processing instructions in your document prolog. Pro- cessing instructions begin with “<?” and end with “?>.” Although the XML declaration in the prolog has similar markup, it is not used as a processing instruction. You may find processing instructions used to reference an XSL (XML Stylesheet Language) document. Use process- ing instructions rather than comments if you wish the XML processor to see them. <? target ?> The target is the name of the application to receive the instruction. Because the end of this special markup is “?>,” do not use these char- acters in your target declaration. The code below shows examples of the processing instructions that FileMaker Pro produces if you use a stylesheet. In section 5.2, “XML Request Commands for Web Compan- ion,” you will see the request for stylesheets. <? xml-stylesheet href="headlines.css" type="text/css" ?> <? xml-stylesheet href="headlines.xsl" type="text/xsl" ?> 20 Chapter 1: The Basics of XML
  • 42. 1.36 Comments When you create documents, you may wish to add comments near any statements that need further clarification. Comments should not con- tain any important part of the document as any processing may ignore them. However, some processors may use comments or they may be helpful to humans reading the document. Comments may be anywhere in the document; they are not only for inclusion in the prolog of the document. Comments are placed outside any other markup. Comments are simply created using “<!--” at the start of the comment and “-->” at the end. These characters are reserved, so they should not be used anywhere else in a document. Additional “--” or “-” should not be used within any comment. Any white space is ignored, so you may have spaces and returns in a comment. Example comments can be found in Listing 1.7. Listing 1.7 Example comments <!-- THIS IS A COMMENT --> <!-- THIS IS ALSO A COMPLETE COMMENT ALTHOUGH IT SPANS MULTIPLE LINES --> <!-- While it is permissible to begin and end the comment next to the --> <!-- markup, it may be easier to read if you include some white space --> <!-- as well. This is an ILLEGAL comment. Note the additional dash at --> <-- the end: ---> Using Comments to Test HTML Documents Comments can be very useful when checking HTML and CDML docu- ments for accuracy in the markup, including FileMaker Pro replacement tags, such as “[FMP-Field: myField]”. This can be a valu- able tool when troubleshooting or debugging a problematic document. You may place comment tags around a large portion of the document so a browser will not process this part of the document. If the result is as you desired, move the comments around a smaller portion and check again. Errors in HTML and CDML markup can be found easily this way. Be careful when commenting out table elements. If you place the comment tags around complete tables or rows, you will not receive browser errors. If you need to be more precise, add the comment around the contents of a particular table cell but not the tags them- selves. Listings 1.8 and 1.9 show the proper placement of comments inside of HTML table code. Chapter 1: The Basics of XML 21
  • 43. Listing 1.8 Comments around table cell <table> <tr> <td>content here</td> </tr> <tr> <td><!-- a new row --><td> </tr> </table> Listing 1.9 Comment around table row <table> <tr> <td>content here</td> </tr> <!-- <tr> <td><!-- a new row --><td> </tr> --> </table> Comments for Future Reference Comments may also be valuable if more than one person is helping create a document. Notes to others can be provided in the comments. Additional examples of comments are shown in Listing 1.10. Listing 1.10 Single-line or multiple-line comments <!-- === NEW RECORD BEGINS HERE === --> <!-- *** do not revise this section --> <!-- *** --> ... your static document text here ... <!-- *** --> <!-- *** end "do not revise" --> ... free to edit text here ... <!-- === NEW RECORD ENDS HERE === --> <!-- ******************************* * make comment highly visible * ******************************* --> <!-- created by me on 09 MAR 1999 --> <!-- revised by you on 21 MAR 2000 --> 1.37 Elements and Attributes Each XML document has one or more elements. These elements are the entities where the content is declared. The construction of the ele- ment is simply the type of element as the name of the tag. Elements 22 Chapter 1: The Basics of XML
  • 44. have a start and end tag. The tag name is the same for the start tag with “/” added to the end tag: <elementName>content</elementName> An empty element contains no content but may have attributes: <elementName /> <elementName></elementName> <elementName attrName="attrValue"/> <elementName attrName="attrValue" attr2="too!" /> The question arises whether to place a space before the “/>” in the standalone empty element. Should you use “<emptyElement/>,” “<emptyElement />,” or simply make all elements paired (“<empty></empty>”)? Section 3.1, “Start-Tags, End-Tags, and Empty-Element Tags,” of the XML specification http://www.w3.org/ TR/REC-xml, states that the empty element tag is composed of “<” followed by the name of the element, zero or more occurrences of spaces and attribute name/value pairs, ending with an optional space and “/>”. For human readability, the space before the final characters in the empty element may be preferable. Another suggestion is made by the XHTML 1.0 recommendation: section C.2, “Empty Elements,” http://www.w3.org/TR/xhtml1/, to always include the space for com- patibility with browsers and other applications that may read or write HTML and XHTML. Tag Names Tag names may contain one or more of the following (in any combina- tion): letter, number, period (.), dash (-), underscore (_), and colon (:). These tag names should begin with a letter, underscore, or colon. You should avoid the use of these reserved words (in any combination of upper- and lowercase): “XML ” or “xml”. Section 2.3, “Common Syn- tactic Constructs,” of the XML specification http://www.w3.org/TR/ REC-xml#sec-common-syn, gives some ideas of how names are to be constructed for elements and attributes in an XML document. The World Wide Web Consortium suggestions allow for more than alpha- numeric characters and the underscore in element and attribute names. However, you may have discovered that different systems use the period, dash, and colon to signify something special on each sys- tem. To maintain the portability of your documents, you should carefully consider the names you choose. For example, you may use lowerUppercase notation for element and attribute names, such as <myElement myPositive="yes" myNegative="no" />. Chapter 1: The Basics of XML 23
  • 45. Attributes Attributes are found in the start tag or empty tag for elements and are composed of name and value pairs. Attributes are used to refine the definition of the element. You do not want to name your attributes the same within a single element, but the same attribute name may be used for different elements. Generally, one piece of information is included in each attribute, although an element may have one or more attributes. Attributes should always be quoted in element start tags and in empty elements. Attributes can use double or single quotes, but the quotes surrounding any single element must match (for example, <element myAttribute="bad quotes' /> is incorrect). Try to avoid “smart quotes” (also called curly quotes), as they may be interpreted incorrectly in documents that need to be read by different applications and systems. Listing 1.11 shows proper element attributes. Listing 1.11 Examples of elements with attributes <elementName attributeName="attributeValue" /> <child firstborn="yes" /> <child firstborn='yes' /> <child firstborn="yes"> <firstName>Dawn</firstName> </child> <pen color="#EEEEEE" pattern="1" size="2" /> <fill color="#FF00FF" pattern="" /> 1.38 Element Content The content of most elements is your information. The content is the text or character data that you want to pass along from one applica- tion or system to another. Any text that is not considered markup is character data. You could think of this character data as the leaves on a tree. In the family tree metaphor, any branch can have multiple branches. Therefore, elements can also contain other elements. When an element contains character data and other elements, that element has mixed content. Listing 1.12 mixes content with other elements inside the root element element1. Elements used for XML export or XML web publishing in FileMaker Pro do not contain mixed content. You may encounter XML documents using this format for the elements and need to understand the structure if you are importing XML into FileMaker Pro. 24 Chapter 1: The Basics of XML
  • 46. Listing 1.12 Example of mixed content <element1> <element2>Some text here</element2> Some content to element1 <emptyElement3/> <emptyElement4></emptyElement4> </element1> Character data can be composed of any letters, numbers, or symbols. The XML processors need to know if you are using characters as markup or as a part of your text content. The comparison symbols greater than (>) and less than (<) might be interpreted incorrectly if used in a computation statement. You might also be writing an XML document about markup that contains text that you do not want to be processed as markup. There is unique markup used to tell the proces- sor to not parse the literal contents. You can see this unique markup in Listing 1.13. The only special character sequence is the “]]>” pattern, so you must not use this pattern anywhere in your content. You may, however, use the “<![CDATA[” beginning pattern within the content. The XML processors are looking for the end of the character data (“]]>” ) after encountering the beginning pattern. Listing 1.13 Markup for raw or unparsed data <![CDATA[your data goes here]]> <![CDATA[This text contains less than and greater than in a calculation, so must be treated in a special way. Is 1 > 2 (one greater than two)? No, 1 < 2 (one is less than two).]]> <![CDATA[In your HTML document if you want to hide data in an input form, use this: <input type="hidden" name="myField" value="">.]]> <![CDATA[ The text can be many lines & contain values that might otherwise be converted. ]]> <![CDATA[An example of an XML prolog statement is: <?xml version="1.0" encoding="encoding type" standalone="yes" ?>.]]> Another way to include data that might otherwise get translated is to use predefined entities. The characters are encoded so that they will be passed through the XML parser but can be converted by the displaying application. The encoding uses the reserved character “&” (amper- sand) followed by the entity name and “;” (semicolon). These entities are found in Table 1.1 and are used in the examples in Listing 1.14. Chapter 1: The Basics of XML 25
  • 47. Table 1.1 Some predefined entities Character Entity Name & &amp; ampersand < &lt; less than > &gt; greater than ' &apos; apostrophe or single quote " &quot; double quote Listing 1.14 Character data using predefined entities <element1>This has a greater than symbol in the function: if(a &gt; b).</element1> <company>Brown &amp; Jones Excavating</company> <title>&quot;Gone With the Wind&quot;</title> 1.39 The Element Tree Completed Putting all of the element information together, you can build a well-formed XML document. You can have empty elements or elements containing data and other elements. You can have comments to fur- ther describe your tree, but they are not crucial to the structure of the tree. The image of the tree (Figure 1.3) follows the rules for the XML document in Listing 1.15. Listing 1.15 The complete tree <?xml version="1.0" standalone="yes" ?> <!DOCTYPE tree [ <!ELEMENT tree (BRANCH)> <!ELEMENT BRANCH (branchlet, twig)> <!ELEMENT branchlet (#PCDATA)> <!ELEMENT twig (#PCDATA)> ]> <tree> <!-- the root or trunk of the tree has some main branches --> <BRANCH> <!-- a BRANCH can have branchlets and twigs --> <branchlet> <twig>leaves</twig> <!-- empty element (no leaves) --> <twig/> <twig>leaves</twig> </branchlet> 26 Chapter 1: The Basics of XML Figure 1.3
  • 48. <branchlet> <twig>leaves</twig> <twig>leaves</twig> </branchlet> <twig>leaves</twig> </BRANCH> <BRANCH> <branchlet> <twig>leaves</twig> </branchlet> <branchlet> <twig>leaves</twig> <twig>leaves</twig> </branchlet> </BRANCH> </tree> 1.4 XML Character Conventions To keep XML documents well formed, you should remember the requirements and recommendations for naming elements, attributes, and documents. While the recommendations are not requirements, you may find later that they facilitate the exchange of data. Here you will learn about white space and end-of-line characters, and how Unicode and ASCII, the standards for character representation, are used in XML documents. More about the name of entities, such as links, can be found in section 1.51, “URI, URL, and URN.” 1.41 White Space and End-of-Line Characters White space is not just the space character between words. White space is a set of invisible characters that perform visual spacing of the words and lines of text. These characters are introduced in Table 1.2. White space is important if you are displaying or printing text. The beginning of this paragraph, for example, would be difficult to read if there were no spaces between the words or if a new line began at the wrong place. Below is an example of improper white space. Whitespaceisnot justthespac echaracter betweenwords. White space in an XML document is important if the character is retained within your content where you intended, but it is ignored oth- erwise. White space in an HTML document is compressed down to one Chapter 1: The Basics of XML 27
  • 49. character, even in the content. Multiple spaces become one space in HTML but are ignored in the markup in the XML document. Using white space to make a document more human readable is permissible (and advisable) because the XML processor does not attach signifi- cance to it. Since white space is ignored in the markup by the XML processors, you will want to avoid using white space in any element or attribute name. You and the XML processors would have difficulty determining the element name in the example below because of the use of improper white space. <!-- incorrect element --> <an element name attribute="here you go" /> <!-- should be: --> <anElementName attribute="here you go" /> Table 1.2 White space characters Character ASCII Unicode space 32 #x0020 horizontal tab 9 #x0009 carriage return 13 #x000D line feed 10 #x000A The end-of-line character is the special white space that we rarely see as we type a new line or a new paragraph of text. You press the Return or Enter key and magically you can begin typing to the left and one line down in the document. You do not actually see any “character” there, although one or more exists in the electronic document. Your word processor or text editor may have a utility to toggle the display of white space on and off. The paragraph symbol (¶) may be shown at the end of a line or paragraph if the toggle is on. 28 Chapter 1: The Basics of XML Figure 1.4: Showing invisibles
  • 50. Where Do We Get These End-of-Line Characters? If you have ever typed on an old manual (non-electric) typewriter, you probably pulled a lever to return the carriage (the type head) to the left margin and you made the roller feed the paper up one line (or more for multiple spacing). When the process for document composi- tion is automated, printers and teletype machines have to be given precise instructions for everything they do. The two instructions for the location of the print head are carriage return and line feed. The return to the beginning of a line does not necessarily mean that you want the line to feed down at the same time. Separating these two instructions allows for printing text on top of text in the same line and creating unique symbols or simulated graphics from a limited set of characters. Using the End-of-Line Characters Electronic typewriters and computers include a Return or Enter key for the end-of-line action. A single keystroke sends a signal to the system processor, which takes the return to the left margin and moves down a line when the text is displayed on a monitor or as a printed document. A new line is created when the instruction for end of line is received. We also may see the text flow to the next line if the screen is a particu- lar width. This is not a new line but is called text wrap and is the continuation of the same line. End-of-line or new line instructions may be called a hard return or end of paragraph. Hard returns occur only where you specifically press the Return or Enter key. The end-of-line character is different on various systems. On Macintosh, the end-of-line character is the carriage return. The UNIX operating system uses line feed for the end-of-line character. Carriage return and line feed are both utilized on the Windows operating sys- tem. The document is stored with these invisible characters wherever there is an end of line. Sometimes they are not interpreted correctly by applications if the document is written on one system and read on another. You may have seen text appear incorrectly or contain a box character to replace the invisible character it cannot interpret. XML documents can be processed on any operating system. If the document contains carriage returns, line feeds, or any combination of these two characters, an XML processor may convert the end of line to the line feed character (Unicode #x00010) after processing. This keeps the document consistent for further processing. Chapter 1: The Basics of XML 29
  • 51. 1.42 Unicode vs. ASCII There are so many ways to say the same thing and so little time! We have graphical representations for many of our spoken languages. These are our written languages. Machines need a way to transmit a representation of our spoken and written languages. Just like typing white space characters, other characters on a computer keyboard send a signal for each key or combination of keys. This signal is a numerical representation of the key pressed. Most keyboards use the standard ASCII 256-character set, and often a sort will use the ASCII numerical value. Some of the ASCII characters can be found in Listing 1.16. An exercise to create the ASCII character set in HTML is also included in this section. Listing 1.16 Sample ASCII codes and character representation 65 A 66 B 67 C 97 a 98 b 99 c 191 ø 59 ; 49 1 50 2 51 3 184 p 60 < 163 £ This representation can be used to translate text from one written lan- guage to another representation of the same language. Note these special symbols: the Greek pi (p), Scandinavian o-slash (ø), and British pound symbol (£). However, the American Standard Code for Information Interchange (ASCII) is quite limited for use internation- ally. ASCII omits a way to represent Japanese, Chinese, symbols, and other highly ideographical languages. ASCII can also be limiting if dif- ferent applications and systems do not translate the numerical representations identically. Exercise 1.2 Create Your Own ASCII Table 1. Open FileMaker Pro. 2. Create a database called ASCII.FP5 and define these four fields: n ASCII (number) 30 Chapter 1: The Basics of XML
  • 52. n Character (calculated, text result, = "&#" & ASCII & ";") n HTML (text) n gCounter (global number) 3. Create the script Create ASCII Table: Set Error Capture [ On ] Show All Records Delete All Records [ No dialog ] # Comment: Set the counter to zero Set Field [ “gCounter”, “0” ] Loop New Record/Request Set Field [ “ASCII”, “gCounter” ] Set Field [ “HTML”, “If(ASCII = 0, "<html><head><title>ASCII TABLE</title></head> <body><table border=0>¶ <tr><th>ASCII</th> <th>Character</th></tr>¶", "") & "<tr><td>" &ASCII & "</td><td>" & Character & "</td></tr>¶" & If(ASCII = 255, "</table></body></html>", "")” ] Set Field [ “gCounter”, “gCounter + 1” ] Exit Loop If [ “gCounter = 256” ] End Loop Export Records [ Filename: “ASCII.html”; Export Order: HTML (Text) ] [ Restore export order, No dialog ] After you perform the script and export this table, you can open the document in a text editor to see the results. You can also open the doc- ument in your browser to see the characters created. You may get different results from the same document if you change the font type or size in your browser preferences. Viewing the same document on different systems may also produce different results as the character mapping may be different. A standard (ISO/IEC 10646) has been devised for representing characters used for electronic transmission. Information about the International Organization for Standardization can be found at http://www.iso.ch/iso/en/ISOOnline.frontpage. This representation of characters is called Unicode. If you tested the above exercise, you may have seen how the same character may not be precisely rendered the same by changing your browser default font. The Unicode standard was created to avoid these problems. Unicode attempts to include characters such as those used for scientific symbols and non-English text characters, thus making it a UNIversal CODE set. Only the first 128 characters are the same in Unicode and the ASCII table. Chapter 1: The Basics of XML 31
  • 53. 1.43 Names Using Alphanumeric Characters The use of white space can cause problems when naming your XML elements. Other characters not in the ASCII and Unicode tables might also be a problem for all systems to process. Even within those first 128 characters, you will have control characters that may not be visi- ble. If you follow the recommendation of only using alphanumeric characters for naming entities, you will be assured of compatibility with most systems and applications. The common letters and numbers have ASCII and Unicode equivalents. These ranges can be found in Table 1.3. Table 1.3 Alphanumeric, ASCII, and Unicode equivalents Characters ASCII UTC Unicode 0-9 48-57 #x0030-#X0039 A-Z 65-90 #x0041-#x005A a-z 97-122 #x0061-#x007A FileMaker Pro Help makes recommendations for naming fields. Figure 1.5 is a screen shot of this information. The same recommendations might apply to all object names, such as file names, value list names, relationship names, layout names, and script names. Your preference may work well for single databases or complete sets of databases, but for XML or any web publishing, you may need to reconsider current choices. 32 Chapter 1: The Basics of XML Figure 1.5: Naming fields in FileMaker Pro
  • 54. 1.5 Beyond Basic XML—Other Standards So far we have studied well-formed and valid documents containing data and other elements. XML is a language that allows other stan- dards to be built upon it. Included in the list of additions to the XML family is XSL (XML Stylesheet Language). You will read more about XSL and how it can be used to transform XML data into neatly format- ted output in Chapter 7. The World Wide Web Consortium has also recommended addi- tional standards for interconnecting documents and addressing precise locations within XML documents. Among these other XML standards are XPointer and XPath, which extend XML. This section gives an over- view of each of these and the URI (Uniform Resource Identifier) standard for identifying and locating resources used by XML docu- ments. These recommendations have been grouped together here, as they often work together. However, they can also work independently. Keep in mind that this section is a very basic overview to help you understand these additions to XML, parsing of XML with FileMaker Pro, and how these standards work with XML and FileMaker Pro. Remember, too, that the specifications and recommendations may change, although it is unlikely that these changes will affect the cur- rent technology. The changes may enhance the current specifications just as XPath and XPointer have added to the functionality of XML. You may consult the World Wide Web Consortium for the latest informa- tion, http://www.w3.org/. 1.51 URI, URL, and URN (The Uniform Resource Standards) Uniform Resource Identifiers (URIs) encompass all references to web files: text, images, mailboxes, and other resources. URIs include URLs (Uniform Resource Locators): ftp, gopher, http, mailto, file, news, https, and telnet, common protocols for accessing information on the Internet. Some examples of these are found in Listing 1.18. Remember that the World Wide Web is only a part of the Internet. URIs may be used in XPaths and XPointers if they refer to an address on the Internet. Another URI type is the URN (Uniform Resource Name). The URN has globally persistent significance; only the name of the resource need be known, not the location of it as in the URL. The Uniform Chapter 1: The Basics of XML 33
  • 55. Other documents randomly have different content
  • 56. the tourist chiefly from its university, and its castle, which is one of the last creations of the old castle-builders, and seems in its style to be something between a stronghold and a chateau, a palace and a fortification. It certainly is a most imposing and magnificent ruin, with its lofty turrets, great round towers, terraces, arched gateways, and still splendid court-yards and grounds; the splendor of the building and beauty of its situation induce one enthusiastic guide- book to style it "the Alhambra of the Germans." A good, comfortable night's rest at the Eagle Hotel prepared us for the ascent next morning by the steep pathway and steps that led up to it from the Corn Market; up we go, and after an ascent of about fifteen minutes, we pass through a massive arch-way, known as Frederic IV.'s building, and stand in the great court-yard of the castle. The portion of the buildings fronting on this grand enclosure are elegantly carved and decorated with arcades and life-size sculptures; here is one known as Rudolf's building, the oldest part of the castle, a Gothic structure, then Rupprecht's building, founded in the year 1400, by Rupprecht III., with beautiful Gothic windows, over which are the architect's arms, three small shields upon an escutcheon. This carving is taken by many to be some sort of a masonic mark, but is nothing of the kind, but according to a little local guide, a coat of arms common to all German artists; and an interesting legend as to its origin is told, which is to the effect that one day the Emperor Charles V. visited Holbein, the artist, and found him busy painting at the top of a high scaffolding; the emperor signed to the artist not to disturb himself, and at the same time motioned to one of his suite to steady the tottering ladder; the young noble, however, thinking it beneath his dignity to render such menial service to an artist, pretended not to understand the emperor, who thereupon advanced and steadied it himself, and commanded that from that time the German artists should be reckoned among the nobility of the empire, and their coat of arms should be such as Holbein decided upon. The
  • 57. artist then made choice of three small uniform silver shields on a blue field. Then we have other beautiful buildings fronting on the great court-yard, and named after their builders, who at different periods made their contributions of architectural ornament to this romantic old pile. One of the most gorgeous is that known as Otto Heinrich's building, finished in 1559, restored twice,—the last time in 1659, and finally destroyed in 1764,—but the splendid front remains standing, and even now, in its partially ruined condition, excites admiration, with its splendid façade, rich to prodigality with statues, carvings, and decorations. Ludwig's building is another, into which we can go and see the great kitchen, with its huge fireplace and great hearth in the middle, where, on festal occasions, whole oxen were roasted. Near here is the castle well, fifty-four feet deep, with four pillars taken from Charlemagne's palace, to support its canopy, the pillars being those sent to Charlemagne by Rome for his royal edifice. Then comes Frederick's building, founded by Frederick IV. in 1601, rich in statues and sculpture, and under it a chapel, over the portal of which is inscribed, in Latin, the words of the Psalmist,— "This is the gate of the Lord; The righteous shall enter into it." But we are bewildered with the different façades, towers, fronts, and buildings that succeed each other in this, what we now find to be a sort of agglomeration of castles, and so pass out to the great stone terrace or platform that looks down upon the town and the valley below. These old castle-builders did have an eye for the beautiful; and a grand point for observation is this great terrace. Only fancy a broad stone platform, seventy or eighty feet long by thirty feet wide, midway up the front wall of an elegant castle, rich in architectural beauty, the terrace itself with heavy cut stone rails, vases, seats, and ornamental stone bowers at the corners, while spread out far below
  • 58. and before the spectator lies one of the loveliest landscape views that can be imagined. We can look right into the streets of the town directly below us; beyond is the winding River Neckar, with its beautiful arched bridge, and beyond that a vine-clad height known as the Holy Mountain; on one side is the lovely valley of the Neckar, romantically and luxuriously beautiful as it stretches away in the distance. The town of Heidelberg itself is squeezed in between the castle hill and the River Neckar, which widens out below the town, and finally unites with the Rhine, which we see in the distance, and beyond it blue mountains, binding in the distant horizon, frame in the charming picture. I cannot, of course, describe, in the limits of a sketch, the massiveness, vast extent, and splendor of this castle, the production of three centuries,—commenced when the crusades were at their height, and not finished till long after cannon were in use; so that we mark the progress and changes of architecture in each century, and cannot but feel that, in some respects, the builders of old times were in advance of those of the present day. One might stay here weeks, and enjoy the romantic scenery of the vicinity and the never- ending new discoveries which he makes in this picturesque old ruin. In 1689 the French captured the place and undertook to blow up the principal round tower; it was so solidly and compactly built, however, that the enormous mass of powder they placed under it, instead of lifting the great cylinder into the air to fall back a heap of ruins, only broke off a third part of it, which toppled over entire in one solid chunk, and it lies as it fell, broken off from the main body as if by the stroke of a gigantic mallet, and exposes the wall of close-knit masonry twenty feet in thickness. We wander through halls, court-yards, vaulted passages, deep dungeons, and lofty banquet halls, into round and square towers; cross a regular broad old drawbridge wide enough for a troop of mail-clad knights to ride out from the great arched entrance, which stands in good preservation, with its turrets and posts for warders
  • 59. and guards, and there is the huge, deep castle moat and all, just as we have read about them, or seen them illustrated in poetic fictions. We pass out upon a sort of long spur or outwork from the castle —a kind of outer battery, which is styled the great terrace, and was built in 1615—a charming promenade, upon which is a mall, shaded by trees, and from which we get another picturesque view of the scene below, and of the castle itself. But we must not leave Heidelberg Castle without seeing the Great Tun; and so we pay our kreutzers to the little maid who acts as guide, and descend below, to the cellars of the famous wine- bibbers of old. We came to a cellar in which there was a big barrel indeed, as it held two hundred hogsheads of wine; but this not coming up to the expectations of some of the party, there were expressions of dissatisfaction, until our guide informed us that this was only the front cellar, where they used to keep twelve little barrels of this size, and pointed out the raised platforms upon which they used to stand; but the great barrel was in the back cellar. So we followed in, and found a big barrel indeed, large as a two-story house, thirty-two feet long and twenty-six feet high. It holds eight hundred hogsheads of the vinous fluid, and its contents fill two hundred and thirty-six thousand bottles. The diameter of the heads of this big barrel is twenty-two feet, and the circumference of the centre two hundred and thirty-one feet. The bung-hole of this great cask, however, seems more out of proportion than an elephant's eye, for it measured scarcely four inches in diameter. Steps lead around the tun, and up to its top, upon which is laid a platform, on which a cotillon has been danced by enthusiastic visitors. Remember, this is down cellar. If they keep barrels of this kind down cellar, the reader may imagine the size of the house above, and, perhaps, the drinking capacities of those who used to inhabit it. A beautiful carriage road, passing the ruined walls, and leaving them below, leads up to a pretty chalet, three hundred feet above the castle; and here, one day, we halted on the rocky platform, and
  • 60. gladdened the heart of the landlord by an order for lunch for the party, which was spread for us in the garden, from which we could look down into the ruins of the old castle, upon the town below, and the winding river. We were not permitted to enjoy our al fresco repast, for a thunder storm came rolling up the valley, and we were hustled in doors, where, however, we found the host was prepared for such emergencies, as our viands were spread out in an apartment with a glass side, looking towards the valley, so that we sat there, and watched the great gusts sweep up the river, and the rain come swirling down in sheets of rattling drops, amid the peals of thunder that echoed and reverberated between the hills, and finally swept past with the shower, angrily muttering in the distance, as though the spirits of the Hartz Mountains and Black Forest were retiring before the fairies of the valley, who went sweeping after them in great clouds of shining mist, overarched by a gorgeous rainbow. We enjoyed the prospect from this place, which was the site of the ancient castle, traces of which still remain, and then took carriage for the Königsstuhl, or King's Seat, a round tower far above us. A ride of about an hour through the dripping woods, with the vegetation bright and fresh from the recent shower, brought us to this elevation, which is eight hundred and fifty feet higher than the castle, and seventeen hundred and fifty feet above the level of the sea. Upon the summit of the King's Seat, a round stone tower, ninety feet in height, is erected, which we ascended, and were rewarded with a still more extensive view than any we had previously had of the surrounding country. In one direction is the dark and sombre foliage of the Black Forest; in another, the picturesque mountains and valleys of the Odenwald; in another, we look down upon the old castle and town far beneath, and see the River Rhine winding away off through the landscape, like a crinkled ribbon of steel; there are the Hartz Mountains, of which we have read so many old German legends, in which wehr wolves, and mysterious huntsmen, who
  • 61. wound magic horns, figured. Far in the distance, beyond the dark- green forests, we descry, with our field-glass, the cathedral spire of Strasburg. Turn whichever way we may, the view is superb, and the hill is indeed a kingly seat, for it commands as magnificent a prospect as king could wish to look upon. Heidelberg is a paradise of pipes—so I thought till I reached Vienna; but meerschaums of splendid carving and quality are sold here at prices so low, in comparison with what they cost in America, that the temptation to smokers to lay in a stock is almost irresistible. Malacca joint canes, with elegantly carved pure ivory handles, are another article that is marvellously cheap here, twenty francs (four dollars, gold) purchasing the best and most elaborate patterns, the grips or handles of which were wrought into figures of fruit, flowers, wreaths, and heads of birds and animals. The shop windows held many pictures of students' clubs,—some clubs famed for the number of glasses of beer their members could guzzle, he being elected president who could hold the most of that liquid—in fact, who made the biggest beer barrel of himself. In other windows were displayed huge horns, with a silver cup, and a tall mug, of huge capacity, said to represent the draught of the presidents of two rival clubs,— supposed to be what they could swill at a single pull. The beer halls frequented by the students are similar to the great lager beer saloons in this country; and, in the evening, the tables are thronged with students, talking, discussing questions, playing dominoes, smoking, and drinking. There is a tremendous clatter of voices, and the smoke is so thick—well, none but Germans and Spaniards could live in such a dense cloud. The University of Heidelberg, which is the oldest in Germany, I think was founded in 1386. The university buildings—which are very old, some of them erected in 1693—are plain and unpretending in their appearance. The great library here contains over two hundred thousand volumes, and many curious manuscripts, which we did not inspect, as they are of interest chiefly to scientific scholars, and only
  • 62. accessible between the hours of ten and twelve in the forenoon. There is but little in the town of Heidelberg itself to interest the tourist. The great attraction is the noble old castle, and the romantic highlands about it. A three hours' ride from Heidelberg, and we are at Baden- Baden, that gayest of the gay watering-places on the continent. We are driven to our hotel, the Hotel de l'Europe, a most charming house, large, clean, and splendidly kept by hosts who thoroughly know their business, and entirely free from any of the extortions, swindles, and sharp practices which disgrace our Saratoga and Newport hotels. Indeed, everything in the hotels in Baden-Baden is so comfortable to the tourist, so pleasant, and even luxurious, and at such comparatively moderate cost, that one is half inclined to think the proprietors of them may be interested in the gambling bank, and have an object in making their houses too agreeable to leave with a short visit. There are three proprietors to this hotel; and always one, and generally two, are in constant attendance in the lower halls and at the table d'hote, to attend personally to their guests, to answer all questions, and, in fact, to serve them in every way possible, which, it is but justice to say, is done in the most unexceptionable manner. The Hotel de l'Europe is wide, deep, and cool; the broad staircase in the centre is ornamented with pretty flowers in pots, and running and trailing plants twining about the balusters, all the way up to the second story. Directly beneath my window is a beautiful strip of flower-garden, and the fresh air comes in at the casement laden with the odors of roses, carnation pinks, honeysuckles, and a score of other beautiful flowers, which are blooming in profusion. Beyond this little garden, say twenty or thirty feet from the hotel, runs the little River Oos, over a smooth-paved, artificial bed of stone —a swift, clear, sparkling little stream, of scarce three feet deep, and its width of not more than a score, spanned by little rustic bridges, connecting the grounds of the different hotels that are strung along its banks with the opposite shore, which is the broad, high road,
  • 63. along which the numerous gay equipages which frequent watering- places are continually passing. Beyond the road, beneath shady trees, is the Trink Halle, or, as the English have dubbed the place, the pump-room, probably because there is no pump there, except the natural one of the springs, whose mineral waters are conducted into ornamental fountains, which the drinkers and bathers visit at seven A. M., to the inspiriting and lively music of an excellent band. This pump-room is a long, one-story building, two hundred and seventy feet long and thirty-six wide, the façade resting on sixteen Corinthian pillars. Beneath the façade, and upon large panels of the building behind the colonnade of pillars, are fourteen great frescoes, executed by an artist named Götzenbreger, and representing pictorially some of those wild legends and weird stories of magic and enchantment for which Germany is so noted. Baden, be it remembered, lies at the entrance of the celebrated Black Forest, popularly inhabited by various powerful enchanters, gnomes, dwarfs, and sprites. These great pictures were all handsomely executed, but the weather, to which they are partially exposed, is rapidly fading away their rich tints. There was one, representing a beautiful, light-haired, blue-eyed German girl, with but a light drapery flowing around her shapely limbs as she walked down to a mountain stream with her arm on the neck of a snow- white stag: an entranced huntsman knelt upon the opposite bank, gazing at this lovely vision; and while he gazed, one busy gnome was twisting a tough bramble about his ankle, another huge-headed fellow was reaching out from beneath a rock, and severing his bow- string, while a third, a sturdy, belted and hooded dwarf, was robbing his quiver of its arrows: all around, the rocks looked out in curious, wild, and grotesque faces; they leered from the crags, grinned from pebbles in the water, or frowned awfully from the great crags above the hunter, who, dazzled by the enchantress, sees nothing of this frightful scene, which is like the figures of a troubled dream— thoroughly phantasmagoric and German. Another picture shows a
  • 64. brave knight just on the point of espousing a weird lady before an abbot, the satanic glare of whose eyes betrays his infernal origin; cock-crow has evidently prevented these nuptials, as at one side chanticleer is represented vigorously sounding his clarion, and in the foreground lies another figure of the same knight in a deep sleep. Other scenes represent encounters of shepherds with beautiful water-sprites or Undines of the mountain lakes and rivers, knights at enchanted castles, and sprites in ruined churches, each one being the pictorial representation of some well-known legend of the vicinity. We arrived at Baden on Saturday, after dark, and I was roused Sunday morning to look out upon the scene I have described, by the music of a magnificent band, which commenced with the grand hymn of Old Hundred; then a piece from Handel; next came the grand Wedding March of Mendelssohn; and we looked from our windows to see throngs of people promenading up and down the piazza in front of the Trink Halle, to the inspiriting harmony, or coming in every direction from the different hotels and pensions, or boarding-houses, for their morning drink of spring-water. Gradually the music assumed a livelier character, till it wound up with sprightly quadrilles and a lively polka, played with a spirit that would almost have set an anchorite in a dancing fever. A fit illustration was this of the regard for the Sabbath in this headquarters of the enemy of man, where, at noon, the great doors of the gambling-house swung open, and the rouge-et-noir and roulette tables were at once thronged with players, without intermission, till midnight. This great gaming-house, which has been so often described, is styled the Conversation-haus, and is beautifully fitted up with drawing-rooms, lofty and elegant ball-room, with each end opening out into magnificent gardens, that are rich in parterres of flowers, shady alleys, beautiful trees, fountains, and statues. During the afternoon and evening these gardens are thronged, the magnificent
  • 65. band plays the choicest of music, elegantly-dressed people saunter amid the trees and flowers, or sit at little tables and sip light wines, eat ices, and chat; you hear German, French, English, and Italian amid the clatter of voices in any momentary lull of the music; you may order your ice-cream in any of these languages, and a waiter is at hand to understand and serve you; you may spend the whole day in this beautiful spot, enjoy music that you gladly pay a concert price at home to hear, without a penny expense, or even the remotest hint for remuneration from any servant, except it be for the refreshments you order—for the proprietor of the gaming establishment gladly defrays all the expenses, for the privilege he enjoys exclusively, and he pays besides the sum of sixty thousand dollars per annum; so we enjoy it somewhat freely, although we cannot help reflecting, however, that those who really bear the expense are the victims insnared in the glittering and alluring net which they themselves help to weave. From the flutter of passing butterflies of fashion, the clatter of tongues, the moving throng, and rich strains of music, we pass through the noiselessly swinging doors that admit us to the almost hushed inner court of the votaries of chance. Here, as at Wiesbaden, the only voices above a subdued tone are those of the dealers, with their regular formula of expression, while ever and anon, following the rattle of the roulette wheel, comes the clink of the gold and silver which the presiding high priests of Mammon rake into the clutches of the bank. People of every grade, nation, and profession jostle each other at these tables. Here all meet on a common level, and rank is not recognized. The only rank here is the guinea-stamp, and that, if the possessor conduct himself in an orderly manner, insures prince and peasant an equal chance at the tables. The language used is French. I have seen beautiful young ladies, scarce turned nineteen, seated here next their young husbands, with whom they were making their bridal tour, jostled by the elegant Parisian member of the demi-monde, whose noble "friend" hands her a thousand francs
  • 66. to enjoy herself with for a while; young students, trembling, eager old men; raw Americans, taking a "flyer;" and sometimes astonishing the group by the magnitude of their bets; old women, Russian counts, who commence by getting several notes changed into a big pile of gold, which steadily diminishes beneath the assaults they make on the bank, with as little effect as raw infantry charging against a fortified breastwork; nay, I even saw the sallow countenance of a Turk, looking on from beneath his fez cap, while its owner fumbled uneasily at his girdle till he had detached his purse, and gratified his curiosity by losing a few gold pieces; professional gamblers, sharpers, women of uncertain character; old, young, and middle-aged, all sacrificing at the same shrine. "But some win?" Yes, and the very ones whose success is least expected. Old habitués will study the combination of figures for weeks, and keep a record of the numbers, and the order in which they turn up, and then, having, by mathematical certainty, made sure of lucky numbers, stake—and lose. The croupiers go on regularly, mechanically, and, unmoved by success or loss, or whatever takes place about them, they rake in heavy stakes, and pay out huge losses, without moving a muscle of their countenances, or betraying the least emotion, raking in a huge stake while I was watching the game that made even the old habitués glare at the player, without even so much as a glance at him, and paying out a big loss with only the simple dialogue,— "Billets du banque?" "Non." And a dozen rouleaux of twenty-franc pieces were pushed over to the winner. I saw one of these unexpected winners, in the person of a young Heidelberg student, who commenced with a couple of
  • 67. Napoleons (forty francs). He won; doubled his stake, won again; doubled, and won again; then he took up the pile of gold, and placed two double Napoleons (eighty francs) on a single number; it came up, and the bank paid him the amount won, which was fifteen or twenty times the amount of his stake; he put this whole heap on rouge (red), and the ball fell in rouge, and he won, and the amount was doubled; he moved the increased heap to noir (black), and won again! He pulled the heap of loose gold, rouleaux, and notes towards him; players looked up, an obsequious servant brought a chair for him to sit down, and two or three friends gathered at his back; he crammed gold and notes—all but five twenty-franc pieces— promiscuously into his pantaloons pocket, bet those five on the red, won; moved the ten to the black, won again; the twenty to another figure, and won thrice his stake. By this time other players began to follow him in their bets; he put forty francs on a single number, and half a dozen players crowded their bets on to the same. It lost. Nothing daunted, they followed him, and rained down their Napoleons upon the black; this time they were rewarded; black won. The student pocketed his heap of gold again, all except five pieces, and then with that capital bet again; lost three of the five; tried a single number with one Napoleon, lost, of course; put the other on the black, won again; balanced the two pieces on his fingers for a moment, while half a dozen players were watching him, and then put one on the black again, which in an instant was almost obscured by the thick plating of metal that followed the lead of his stake from other players. "Rouge, dix-huit." Down came the croupier's rake, and away rattled the glittering heap towards the banker, while the student smilingly balanced his
  • 68. remaining Napoleon in a sort of uncertain manner on his forefinger, then turned and whispered a word to his friends, rose and tossed the twenty francs magnificently to the servant who had handed him a chair, and who was still behind him, and then, with bulging pockets, walked away. Baden is beautifully situated, and its scenery and surroundings charming. A broad, well-kept, and shady avenue commences opposite our hotel, and affords a splendid drive of over two miles, and, like the drive at Newport, is frequented by gay equipages during the fashionable season. Then there are the old and new castles above the town, reached by winding and romantic roads, and from the summit of the former a fine view of the valley of the Rhine, and the beautiful valley of Baden, with its great hotels, elegant grounds, and pretty villas. The bazaar, a sort of open-air fair of booths, in a pleasant grove, not far from the grounds of the Conversation-haus, is another novelty, and an attractive one to foreigners; for here is a collection of all those miscellaneous trinkets that tourists load themselves down with, such as carved wood of Switzerland, garnets from Prague, worsted work from Berlin, shaded photographs from Munich, all sorts and kinds of sleeve-buttons, breast-pins, shawl-pins, ivory carvings, ribbons, crystals from the Alps, leather work from Vienna, and a thousand and one curious and pretty articles to tempt the taste of purchasers. We left the beautiful Hotel de l'Europe, with its pleasant rooms, elegant table d'hote, and prompt attention, with regret, for two reasons: one, that it was so agreeable a place of rest; and the other, that the price, at this most expensive of the hotels, with all its privileges, was less than two dollars per diem. Up and away, for we must see the grand old Cathedral of Strasburg—a two hours' journey; and here we are, at the magnificent portal of this edifice, founded by old King Clovis, in 510.
  • 69. The carvings above the portal are magnificent. Here are equestrian statues of Clovis, Dagobert, and other old worthies, elegantly wrought, amid a wealth of rich tracery and carving; but as the spectator looks up, up, up, at the magnificent cathedral tower and spire, soaring away into the air till it seems to have a needle-like sharpness, he gets almost dizzy with gazing; and, upon being informed that the ascent of this highest spire in the world is not unattended with danger, of coarse all Americans are seized with an uncontrollable desire to ascend it; and so were we. So we took a look at the splendid front, with the two great square towers, something after the style of those of York Minster or Westminster Abbey, with a huge rose window between them; the elegant Gothic architecture of arches, pillars, and points; the grand, arched portal, crowded, every inch of it, with carving and statues; and finally, up again at the light steeple, which, from one of the square towers, rose into the air with such grace and boldness. We enter direct from the street, pay the custodian at the foot of a flight of stairs of easy ascent, and, ladies and all, begin the climb- up. We go till we have trodden over three hundred and thirty stairs, and find ourselves two hundred and thirty feet above the street, upon a place called the platform. Here are several rooms, and a custodian lives up here, who acts as a watchman for fires, has general charge of the place, keeps a visitors' register, and sells stereoscopic views. The panoramic view from here is superb, and this point, which is about two thirds of the way up, is as high as ladies generally ascend; for the remainder of the ascent, which is by circular staircases on four sides of the tower, requires some nerve and steadiness of head, the masonry being of open-work, with the apertures nearly large enough for the body to pass through, while the staircases, which are winding and narrow, are likely to provoke an attack of giddiness. I could compare the ascent to nothing but an ant climbing a corkscrew. Every turn brought us to these great wrought openings, which, from the ground, appeared like delicate lacework, and which seemed to give one the feeling, as he went
  • 70. round and round, as if he were swinging and swaying in the network between heaven and earth; and the wind, which pipes, whistles, rushes, roars, and sighs, in every variety of tone, and apparently from every point of the compass, owing to the innumerable and different-shaped openings, adds to this illusion. Breathless, we reach a circular gallery running round outside, and at the top of the square part of the steeple, and pause, clinging to the stone-work of the balustrade to look at the fine view, which takes in Baden, the Black Forest, the Rhine, and the chain of the Jura, in the distance. Still higher! Here we are at the base of a pyramid of light, ornamental turrets, which gradually converge towards a point, and support the "lantern" above us. The winding staircases in these turrets were also narrow, and through open stone-work, as before, till you reach the lantern, an enclosed observatory. Higher up is the "crown" which, as the steps leading to it are outside, and with no other protection than the wall to which they were fastened, we did not care to attempt. The total height of this lofty spire is four hundred and sixty-eight feet. The descent through the open-work spire to the platform where the ladies were left was far more trying to the nerves than the ascent. In ascending, one is continually looking up, and the open spaces in the stone-work have the appearance of passages through which you are to pass, but continually avoid by the winding of the staircase; but in descending, the gaze being directed downward, you have the vast height continually before the view; the huge apertures, which appear at your very feet at every turn, seem like yawning crevasses, through which to shoot your body into the blue distance, or on to the Gothic points and pinnacles that are far, far below. I clung to the rope and iron hand-rails convulsively, and am not ashamed to mention that, more than once, as I came to the more elaborate open-work of this stone filigree, which seemed to dangle between heaven and earth, I closed my eyes, and followed
  • 71. the rail, feeling the way downwards. The descent was made almost in silence, and there was a sigh of relief when the platform was reached, and we joined the ladies again. The open-work that one encounters in the turrets during the ascent of the spire, although scarcely large enough to admit the passage of a man's body, is so frequent, and so directly on the staircases, which are winding and narrow, as to give the semblance of great danger and insecurity, though comparatively very little exists. The only thing to be feared is giddiness, which might render it difficult for the adventurer to go up or down, after reaching a certain point; and it is, therefore, not advisable for those liable to be affected in that manner to attempt the ascent above the gallery, which really adds very little to the view. Viewed architecturally, Strasburg Cathedral seems to bring together all the styles or orders of architecture of the middle ages, from the simplicity of the Byzantine to the Gothic, with its arches and excess of superfluous ornament. The façade of the church, and especially the portal, is so elaborately ornamented with carved work as to convey the impression of chasing, instead of sculpture. The figures in bass-relief and carving represent scenes in the life of the Saviour, the saints, and the apostles, besides statues of kings and warriors. A view of the interior is grand and impressive. Fourteen great cluster pillars uphold the lofty Gothic arched roof, over a hundred feet above the pavement. Midway, and above arches that unite the pillars, is a beautiful Gothic gallery on both sides, and many of the great stained-glass windows, representing scriptural subjects, are of wondrous beauty. In the nave is a beautiful pulpit, built in 1486, and covered with little statues, delicately carved, and not far from it the organ, up midway between the floor and arched ceiling. The perspective view in these old cathedrals is grand, and figures hardly give one an idea
  • 72. of their vastness. This cathedral is five hundred and twenty-five feet long, one hundred and ninety-five feet in width, and is one of the finest of those wonderful monuments of religious art that rose during the middle ages. The great astronomical clock here is a curious and wonderful piece of mechanism. Fancy a structure twenty-five or thirty feet in height, and twelve or fifteen broad at the base, having on either side two others nearly of equal height, one being the masonic flight of winding stairs, surmounted by five small emblematical Corinthian pillars, and the other a Gothic pillar, its panellings enriched with figures. Placed directly in front of the base of the clock is a celestial globe, which, by means of the clock-work, shows the precession of the equinoxes, solar and lunar equations for calculating geocentric ascension and declination of the sun and moon at true times and places. Then in the base itself is an orrery after the Copernican system, by which the mean tropical revolution of each of the planets, visible to the naked eye, is shown. Then comes an ecclesiastical calender, a sort of perpetual almanac, indicating holy, feast, and fast days; above, and about ten feet from the floor, and just beneath the clock-dial, is an opening with a platform in front, upon which come forth figures representing each day of the week, as Apollo on Tuesday, Diana on Monday, &c. Thus a figure in a chariot representing the day appeared at the entrance in the morning, it had reached the centre in full view by noon, and drove gradually out of sight at the close of day. On either side of the clock- dial sat two Cupids, the size of a three-years-old child, one holding a bell and hammer, with which it strikes the hours and quarters, and the other an hour-glass, which it reverses each hour. Above is another dial, with the signs of the zodiac; above that a figure of the moon, showing its different phases, also put in motion by the clock- work; and, still above this, two sets of automaton figures, which appear only at twelve o'clock, at which time there is always a crowd gathered to witness their performance.
  • 73. We viewed this wondrous piece of mechanism for an hour, and witnessed the following movements: At quarter past eleven the Cupid near the dial struck one; then from one of the upper compartments ran forth the figure of a little child with a wand, and as he passed he struck one on a bell, and ran away (Childhood, the first quarter). Round whirl the wheels of time, and the second quarter chimes; but this time it is Youth that passes, and taps the bell with his shepherd's staff twined with flowers. Again, we reach the third quarter, and Manhood strides forth, the mailed warrior, and smites the sonorous bell, ere he leaves the scene, three sounding blows with his trenchant weapon—the third quarter. Once more, the hands tremble on the point of noon; the fourth quarter is here, and Old Age, a feeble, bent figure, hobbles out, pauses wearily at the bell, raises a crutch, and taps four strokes, and totters away out of sight—"last scene of all," when, as a finale, the skeleton figure of Death, before whom all the four have passed, slowly raises his baton, which the spectator now discovers to be a human bone, and solemnly strikes the hour of twelve upon the bell. While he is engaged in this act, a set of figures above him, representing the twelve apostles, pass in procession before the Saviour, who blesses each as they pause before him in turn, and chanticleer, the size of life, perched upon the pinnacle of one of the side structures, lifts up his voice in three rousing crows, with outstretched neck and flapping wings, while the Cupid on one side of the dial reverses the hour- glass for the sand to flow back, and the other also strikes the hour with his bell and hammer. Not far from this clock, in a sort of niched window, there is a sculptured figure, said to be that of the architect of this cathedral, represented as looking towards the entrance of the transept, and in such position as to attract attention and provoke inquiry—a cunning device for perpetuating one's memory as long as the figure shall last. Before leaving this fine cathedral we are reminded of the ancient order of Masons by an enclosure opening out of one of the chapels,
  • 74. which is the area of the workhouse of the stone-cutters of the edifice. These Master Masons down to this day form a particular and exclusive society, which originated in the days of the great master mason and architect of this cathedral, Erwin of Steinbach, who rebuilt the nave in 1275, commenced the façade of the church, designed its towers, and superintended the work and the carrying out of the grand designs in its construction through various vicissitudes till his death in 1318. The masons of this cathedral were distinct from other operative masons, did not admit all who presented themselves, and had secret signs, known only to each other. From the lodge of this cathedral emanated several others in Germany, and a general meeting of the masters was held at Ratisbon in 1459, at which they were united under one government or jurisdiction, and the Grand Masters chosen on that occasion were the architects of the cathedral at Strasburg, in which city the Grand Lodge was then established. The Emperor Maximilian I. confirmed the establishment of this body October 3, 1498, and it remained here till the early part of the eighteenth century, when it was removed to Mayence. With this bit of masonic history we will bid adieu to Strasburg Cathedral. The Church of St. Thomas looks inferior after it, though its magnificent monument to Marshal Saxe is one of the sights of the city. As we ride through the streets we see long-legged storks soaring far overhead, and perched on a tall old chimney-stack, behold the brushwood nest of one of these long-billed residents. We view the bronze statue of Guttenberg, who made his first experiments in the newly-discovered art preservative of arts in this city in 1436, and four hundred years afterwards he is remembered in this bronze memorial. I don't know what it was in particular that made me wish to see Basle, except it was, that when a youngster, I read of a curious old
  • 75. clock which the inhabitants on one side of the river put up to mock those on the other, which, the story said, it did by sticking out its tongue and rolling its eyes at every motion of the pendulum; so, when domiciled at the hotel of the Three Kings in that ancient town, I looked out on the swift-flowing Rhine, and as I gazed at the splendid bridge, nearly a thousand feet long, wondered if that was the one over which the wondrous head had ogled and mocked. Fancy my disappointment at being shown at the collection of antiquities a wooden face scarcely twice the size of life, which is said to be the veritable Lollenkonig, or lolling king, that used to go through this performance in the clock tower on the bank of the river till 1839. Here, in this collection, which is in a hall or vestry attached to the cathedral, we saw many curiosities; among them the arm- chair of Erasmus; for it was here in Basle that Erasmus, it will be recollected, waged bitter war with the Church of Rome; here also was preserved all that remains of the celebrated frescoes, the Dance of Death, painted in the fifteenth century, and ascribed to Holbein. The cathedral, a solid old Gothic structure, has some finely ornamented ancient arched portals, and its two towers are each two hundred feet in height. Going through some of the quaint, old-fashioned streets of Basle, we were struck with the quiet, antique, theatrical-canvas-look which they had. Here was an old circular stone fountain, at which horses could drink and the people fill their jars; the pavement was irregular, and the houses were of odd architecture, which we in America, who have not been abroad, are more than half inclined to think exist only in the imagination of artists, or are the fancy of scene-painters. I came upon one of these very scenes which I have before referred to, in this old city, and stood alone a quarter of an hour looking at the curious street that lay silent in the sunshine, with scarce a feature of it changed since the days of the Reformation, when Basle held so important a position in the history of Switzerland, and "Erasmus laid the egg that Luther hatched;" and had a group of cavaliers in doublet and hose, or a soldier with iron cap and partisan, sauntered through the street, they would all have
  • 76. been so much in keeping with the scene as to have scarcely excited a second glance at them. In the evening we attended one of those cheap musical entertainments which are so enjoyable here in the summer season of the year. It was given in a large building, one side of which opened on the river bank; and while thirty pieces of music played grand compositions, sprightly waltzes, or inspiriting marches, we sat at the little tables, with hundreds of other listeners, who sipped light wines or beer, enjoyed the evening air, and looked out upon the dark cathedral towers, the lights of the town reflected in the swift stream of the Rhine, watched the small boats continually passing and re- passing, marked "the light drip of the suspended oar," coming pleasantly to the ear, as they paused to listen to the melody, while now and then the tall, dark form of some great Dutch lugger-looking craft of a Rhine boat moved past, like a huge spectre out of the darkness—a dreamy sort of scene, the realization of old Dutch paintings, half darkened with age, that I have often gazed at when a boy. And all this fine music and pleasant lounge for half a franc (eleven cents). "Wines extra?" Yes. We called for a half flask, prime quality; price, a franc and a half more; total, forty-four cents. But then we were luxurious; for beer that was "magnifique" could be had in a "gros pot" for three cents. We rode from Basle to Zurich in a luxurious, easy, comfortable drawing-room car, which a party of us—six American tourists—had all to ourselves, and whirled through long tunnels, and amid lovely scenery, in striking contrast to our hot, uncomfortable railroad ride from Strasburg to Basle. The Swiss railway carriages are on the American plan, and the line of the road itself kept in exquisite order. The houses of the switchmen were pretty little rustic buildings, covered with running flowering vines, plats of flowers before them,
  • 77. and not a bit of rubbish or a speck of dirt to be seen about them. The little country stations are neatly kept, and have flower gardens around them; and, as we passed one crossing where two roads met, a diamond-shaped plat, about twenty feet space, enclosed by the crossing of three tracks, was brilliant with its array of red, blue, and yellow flowers. At the stations and stopping-places there seemed to be special pains taken to keep the rude, unsightly objects, that are seen at stations in America lying about uncared for, out of sight. Here, and in Germany, we notice the red poppy scattered in and growing among the wheat, which one would suppose must injure the grain; but the people say not, though it imparts, I think, a slightly perceptible bitter taste to the bread. We seem now to have got thoroughly into a land where they know how to treat travellers, that is, properly appreciate the value of tourist patronage, and treat them accordingly; and well they may, for a large portion of the Swiss people make their living for the year off summer tourists. Notwithstanding this, and notwithstanding the English grumblers who scold at these better hotels, better railway accommodations, and better attention than they can get anywhere else,— notwithstanding the shoddy Americans, whose absurd parade, lavish expenditure of money, ignorance, and boorish manners make them a source of mortification to educated men, and have served, in France and Italy during the past few years, almost to double certain travelling expenses,—notwithstanding this, the traveller will be more honorably dealt with, and less liable to be cheated, in Switzerland than elsewhere in Europe. Efforts are made to induce travellers to come often, and stay long. Roads, passes, and noted points are made as accessible as possible, and kept in good order during the season. No impositions are allowed by guides, post-drivers, &c., and the hotel-keepers strive in every way to make their houses as attractive as possible in every respect to the guest, who enjoys the real luxury of an elegant hotel, in an attractive or celebrated resort, at a reasonable price, and does not suffer to that extent the same
  • 78. Welcome to our website – the perfect destination for book lovers and knowledge seekers. We believe that every book holds a new world, offering opportunities for learning, discovery, and personal growth. That’s why we are dedicated to bringing you a diverse collection of books, ranging from classic literature and specialized publications to self-development guides and children's books. More than just a book-buying platform, we strive to be a bridge connecting you with timeless cultural and intellectual values. With an elegant, user-friendly interface and a smart search system, you can quickly find the books that best suit your interests. Additionally, our special promotions and home delivery services help you save time and fully enjoy the joy of reading. Join us on a journey of knowledge exploration, passion nurturing, and personal growth every day! ebookbell.com