100% found this document useful (4 votes)
45 views

XML NET Developer s Guide 1st Edition Henk-Evert Sonder 2024 scribd download

NET

Uploaded by

lazlopasmakd
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
100% found this document useful (4 votes)
45 views

XML NET Developer s Guide 1st Edition Henk-Evert Sonder 2024 scribd download

NET

Uploaded by

lazlopasmakd
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 60

Download the full version of the ebook at ebookname.

com

XML NET Developer s Guide 1st Edition Henk-Evert


Sonder

https://ebookname.com/product/xml-net-developer-s-guide-1st-
edition-henk-evert-sonder/

OR CLICK BUTTON

DOWNLOAD EBOOK

Download more ebook instantly today at https://ebookname.com


Instant digital products (PDF, ePub, MOBI) available
Download now and explore formats that suit you...

C NET Web Developer s Guide 1st Edition Dotthatcom.Com

https://ebookname.com/product/c-net-web-developer-s-guide-1st-edition-
dotthatcom-com/

ebookname.com

VB Net Web Developer s Guide Cameron Wakefield Et Al

https://ebookname.com/product/vb-net-web-developer-s-guide-cameron-
wakefield-et-al/

ebookname.com

Microsoft Visual C NET 2003 Developer s Cookbook 1st


Edition Mark Schmidt

https://ebookname.com/product/microsoft-visual-c-net-2003-developer-s-
cookbook-1st-edition-mark-schmidt/

ebookname.com

New Directions for Library Service to Young Adults Patrick


Jones

https://ebookname.com/product/new-directions-for-library-service-to-
young-adults-patrick-jones/

ebookname.com
Subject to Famine Food Crisis and Economic Change in
Western India 1860 1920 Michelle Burge Mcalpin

https://ebookname.com/product/subject-to-famine-food-crisis-and-
economic-change-in-western-india-1860-1920-michelle-burge-mcalpin/

ebookname.com

The Challenge of Third World Development 6th Edition


Howard Handelman

https://ebookname.com/product/the-challenge-of-third-world-
development-6th-edition-howard-handelman/

ebookname.com

Temporal Boundaries of Law and Politics Time Out of Joint


1st Edition Luigi Corrias

https://ebookname.com/product/temporal-boundaries-of-law-and-politics-
time-out-of-joint-1st-edition-luigi-corrias/

ebookname.com

Teach Yourself VISUALLY iPhone 14 Teach Yourself VISUALLY


Tech 7th Edition Guy Hart-Davis

https://ebookname.com/product/teach-yourself-visually-iphone-14-teach-
yourself-visually-tech-7th-edition-guy-hart-davis/

ebookname.com

Shoes Glues and Homework Dangerous Work in the Global


Footwear Industry 1st Edition Pia Markkanen

https://ebookname.com/product/shoes-glues-and-homework-dangerous-work-
in-the-global-footwear-industry-1st-edition-pia-markkanen/

ebookname.com
Statistics The Exploration Analysis of Data 7th Edition
Roxy Peck

https://ebookname.com/product/statistics-the-exploration-analysis-of-
data-7th-edition-roxy-peck/

ebookname.com
155_XML_NET_FM.qxd 3/7/02 3:01 PM Page i

solutions@syngress.com

With more than 1,500,000 copies of our MCSE, MCSD, CompTIA, and Cisco
study guides in print, we continue to look for ways we can better serve the
information needs of our readers. One way we do that is by listening.

Readers like yourself have been telling us they want an Internet-based ser-
vice that would extend and enhance the value of our books. Based on
reader feedback and our own strategic plan, we have created a Web site
that we hope will exceed your expectations.

Solutions@syngress.com is an interactive treasure trove of useful infor-


mation focusing on our book topics and related technologies. The site
offers the following features:
■ One-year warranty against content obsolescence due to vendor
product upgrades. You can access online updates for any affected
chapters.
■ “Ask the Author” customer query forms that enable you to post
questions to our authors and editors.
■ Exclusive monthly mailings in which our experts provide answers to
reader queries and clear explanations of complex material.
■ Regularly updated links to sites specially selected by our editors for
readers desiring additional reliable information on key topics.

Best of all, the book you’re now holding is your key to this amazing site.
Just go to www.syngress.com/solutions, and keep this book handy when
you register to verify your purchase.

Thank you for giving us the opportunity to serve your needs. And be sure
to let us know if there’s anything else we can do to help you get the
maximum value from your investment. We’re listening.

www.syngress.com/solutions
155_XML_NET_FM.qxd 3/7/02 3:01 PM Page ii
155_XML_NET_FM.qxd 3/7/02 3:01 PM Page iii

1 YEAR UPGRADE
BUYER PROTECTION PLAN

XML
.NET D e v e l o p e r ’s
Guide

Adam Sills
Mesbah Ahmed
Dotthatcom.com
Frank Boumphrey
Jonothon Ortiz Technical Editor
155_XML_NET_FM.qxd 3/7/02 3:01 PM Page iv

Syngress Publishing, Inc., the author(s), and any person or firm involved in the writing, editing, or
production (collectively “Makers”) of this book (“the Work”) do not guarantee or warrant the results
to be obtained from the Work.
There is no guarantee of any kind, expressed or implied, regarding the Work or its contents.The Work
is sold AS IS and WITHOUT WARRANTY. You may have other legal rights, which vary from state
to state.
In no event will Makers be liable to you for damages, including any loss of profits, lost savings, or
other incidental or consequential damages arising out from the Work or its contents. Because some
states do not allow the exclusion or limitation of liability for consequential or incidental damages, the
above limitation may not apply to you.
You should always use reasonable care, including backup and other appropriate precautions, when
working with computers, networks, data, and files.
Syngress Media®, Syngress®,“Career Advancement Through Skill Enhancement®,” and “Ask the
Author UPDATE®,” are registered trademarks of Syngress Publishing, Inc. “Mission Critical™,”“Hack
Proofing™,” and “The Only Way to Stop a Hacker is to Think Like One™” are trademarks of Syngress
Publishing, Inc. Brands and product names mentioned in this book are trademarks or service marks of
their respective companies.
KEY SERIAL NUMBER
001 PKH4T67VT5
002 ESTRT45RF4
003 BHER6W354N
004 9HD34B3QAN
005 ZR88JN6NVH
006 NTG4R54RM4
007 CG8VHTR46T
008 D6Y9R565MR
009 22N5M4BX6S
010 SD6YH2Y7FC
PUBLISHED BY
Syngress Publishing, Inc.
800 Hingham Street
Rockland, MA 02370
XML .NET Developer’s Guide
Copyright © 2002 by Syngress Publishing, Inc. All rights reserved. Printed in the United States of
America. Except as permitted under the Copyright Act of 1976, no part of this publication may be
reproduced or distributed in any form or by any means, or stored in a database or retrieval system,
without the prior written permission of the publisher, with the exception that the program listings
may be entered, stored, and executed in a computer system, but they may not be reproduced for
publication.
Printed in the United States of America
1 2 3 4 5 6 7 8 9 0
ISBN: 1-928994-47-4
Technical Editor: Jonothon Ortiz Cover Designer: Michael Kavish
Acquisitions Editor: Catherine B. Nolan Page Layout and Art by: Reuben Kantor and
Indexer: Robert Saigh Shannon Tozier
Copy Editor: Beth A. Roberts
Distributed by Publishers Group West in the United States and Jaguar Book Group in Canada.
155_XML_NET_FM.qxd 3/7/02 3:01 PM Page v

Acknowledgments

We would like to acknowledge the following people for their kindness and support
in making this book possible.
Ralph Troupe, Rhonda St. John, and the team at Callisma for their invaluable insight
into the challenges of designing, deploying and supporting world-class enterprise
networks.
Karen Cross, Lance Tilford, Meaghan Cunningham, Kim Wylie, Harry Kirchner,
Kevin Votel, Kent Anderson, Frida Yara, Bill Getz, Jon Mayes, John Mesjak, Peg
O’Donnell, Sandra Patterson, Betty Redmond, Roy Remer, Ron Shapiro, Patricia
Kelly, Andrea Tetrick, Jennifer Pascal, Doug Reil, and David Dahl of Publishers
Group West for sharing their incredible marketing experience and expertise.
Jacquie Shanahan, AnnHelen Lindeholm, David Burton, Febea Marinetti, and Rosie
Moss of Elsevier Science for making certain that our vision remains worldwide in
scope.
Annabel Dent and Paul Barry of Elsevier Science/Harcourt Australia for all their help.
David Buckland,Wendi Wong, Marie Chieng, Lucy Chong, Leslie Lim, Audrey Gan,
and Joseph Chan of Transquest Publishers for the enthusiasm with which they receive
our books.
Kwon Sung June at Acorn Publishing for his support.
Ethan Atkin at Cranbury International for his help in expanding the Syngress
program.
Jackie Gross, Gayle Voycey, Alexia Penny, Anik Robitaille, Craig Siddall, Darlene
Morrow, Iolanda Miller, Jane Mackay, and Marie Skelly at Jackie Gross & Associates
for all their help and enthusiasm representing our product in Canada.
Lois Fraser, Connie McMenemy, Shannon Russell and the rest of the great folks at
Jaguar Book Group for their help with distribution of Syngress books in Canada.

v
155_XML_NET_FM.qxd 3/7/02 3:01 PM Page vi

Contributors

Adam Sills is an Internet Programmer at GreatLand Insurance, a small


insurance company parented by Kemper Insurance. He works in a small IT
department that focuses on creating applications to expedite business pro-
cesses and manage data from a multitude of locations. Previously, he had a
small stint in consulting and also worked at a leading B2B eCommerce
company designing and building user interfaces to interact with a large-
scale enterprise eCommerce application. Adam’s current duties include
building and maintaining Web applications, as well as helping to architect,
build, and deploy new Microsoft .NET technologies into production use.
Adam has contributed to the writing of a number of books for Syngress
including ASP .NET Developer’s Guide (ISBN: 1-928994-51-2) and is an
active member of a handful of ASP and ASP.NET mailing lists, providing
support and insight whenever he can.

Todd Carrico (MCDBA, MCSE) is a Senior Database Engineer for


Match.com. Match.com is a singles portal for the digital age. In addition
to its primary Web site, Match.com provides back-end services to AOL,
MSN, and many other Web sites in its affiliate program.Todd specializes
in design and development of high-performance, high-availability data
architectures primarily on the Microsoft technology. His background
includes designing, developing, consulting, and project management for
companies such as Fujitsu, Accenture, International Paper, and
GroceryWorks.com. In addition to his contribution to C# .NET Web
Developer’s Guide (ISBN: 1-928994-50-4),Todd has also contributed
chapters to other books in the Syngress .NET Series including the
ASP .NET Web Developer’s Guide (ISBN: 1-928994-51-2) and the
VB .NET Developer’s Guide (ISBN: 1-928994-48-2).Todd resides in
Sachse,Texas with his wife and two children.

Greg Hack is a Senior Software Engineer with Allscripts Healthcare


Solutions. Greg has over 15 years of experience developing software on
platforms ranging from the mainframe to the desktop, using a wide
vi
155_XML_NET_FM.qxd 3/7/02 3:01 PM Page vii

variety of languages and technologies. Recent work includes a Web-based


application that allows patients to view their medical records and a Pocket
PC application that delivers clinical information to physicians at the point
of care. Greg has also contributed to C# .NET Web Developer’s Guide
(ISBN: 1-928994-50-4).

Patrick Coelho (MCP) is an instructor at The University of Washington


Extension, North Seattle Community College, Puget Sound Center, and
Seattle Vocational Institute, where he teaches courses in Web Development
(DHTML, ASP, XML, XSLT, C#, and ASP.NET). Patrick is a Co-Founder
of DotThatCom.com, a company that provides consulting, online develop-
ment resources, and internships for students. He is currently working on a
.NET solution with contributing author David Jorgensen and nLogix.
Patrick holds a bachelor of science degree from the University of
Washington, Bothell. He lives in Puyallup,Washington with his wife,
Angela. Patrick is a contributor to Syngress Publishing’s C# .NET Web
Developer’s Guide (ISBN: 1-928994-50-4) and the ASP .NET Web
Developer’s Guide (ISBN: 1-928994-51-2).

David Jorgensen (MCP) is an instructor at North Seattle Community


College, University of Washington Extension campus, and Puget Sound
Centers. He is also developing courses for Seattle Vocational Institute, which
teach .NET and Web development to the underprivileged in the Seattle
area. David also provides internship opportunities through his company,
DotThatCom.com, which does online sample classes and chapters of books.
David holds a bachelor’s degree in Computer Science from St. Martin’s
College and resides in Puyallup,Washington, with his wife, Lisa and their
two sons, Scott and Jacob. David is a contributor to Syngress Publishing’s
C# .NET Web Developer’s Guide (ISBN: 1-928994-50-4) and the
ASP .NET Web Developer’s Guide (ISBN: 1-928994-51-2).

Joe Dulay (MCSD) is the Vice-President of Technology for the IT Age


Corporation. IT Age Corporation is a project management and software
development firm specializing in customer-oriented business enterprise
and e-commerce solutions located in Atlanta, Georgia. His current

vii
155_XML_NET_FM.qxd 3/7/02 3:01 PM Page viii

responsibilities include managing the IT department, heading the tech-


nology steering committee, software architecture, e-commerce product
management, and refining development processes and methodologies.
Though most of his responsibilities lay in the role of manager and archi-
tect, he is still an active participant of the research and development team.
Joe holds a bachelor’s degree from the University of Wisconsin in
Computer Science. His background includes positions as a Senior
Developer at Siemens Energy and Automation, and as an independent
contractor specializing in e-commerce development. Joe is also co-
author of Syngress Publishing’s Hack Proofing Your Web Applications
(ISBN: 1-928994-31-8). Joe would like to thank his family for always
being there to help him.

Henk-Evert Sonder (CCNA) has over 15 years of experience as an


Information and Communication Technologies (ICT) professional,
building and maintaining ICT infrastructures. In recent years, he has spe-
cialized in integrating ICT infrastructures with secure business applica-
tions. Henk’s company, IT Selective, works with small businesses to help
them develop high-quality, low cost solutions. Henk has contributed to
several Syngress books, including the E-Mail Virus Protection Handbook
(ISBN: 1-928994-23-7), Designing SQL Server 2000 Databases for .NET
Enterprise Servers (ISBN: 1-928994-19-9), VB .NET Developer’s Guide
(ISBN: 1-928994-48-2), and BizTalk Server 2000 Developers Guide for
.NET (ISBN: 1-928994-40-7). Henk lives in Hingham, Massachusetts
with his wife, Jude and daughter, Lilly.

Chris Garrett is the Technical Manager for a large European Web


agency. He has been working with Internet technologies since 1994 and
has provided technical and new media expertise for some of the world’s
biggest brands. Chris is a co-author of Syngress Publishing’s ASP .NET
Web Developer’s Guide (ISBN: 1-928994-51-2). Chris lives in Yorkshire,
England with his wife, Clare and his daughter, Amy.

Mesbah Ahmed (PhD and MS, Industrial Engineering) is a Professor of


Information Systems at the University of Toledo. In addition to teaching

viii
155_XML_NET_FM.qxd 3/7/02 3:01 PM Page ix

and research, he provides technical consulting and training for IT and


manufacturing industries in Ohio and Michigan. His consulting experi-
ence includes systems design and implementation projects with Ford
Motors, Dana Corporation, Riverside Hospital, Sears, and others.
Currently, he provides IT training in the areas of Java Server, XML, and
.NET technologies. He teaches graduate level courses in Database
Systems, Manufacturing Systems, and Application Development in
Distributed and Web Environment. Recently, he received the University
of Toledo Outstanding Teaching award, and the College of Business
Graduate Teaching Excellence award. His current research interests are in
the areas of data warehousing and data mining. He has published many
research articles in academic journals such as Decision Sciences, Information
& Management, Naval Research Logistic Quarterly, Journal of Operations
Management, IIE Transaction, and International Journal of Production Research.
He has also presented numerous papers and seminars in many national
and international conferences. Mesbah is also a co-author of Syngress
Publishing’s ASP .NET Web Developer’s Guide (ISBN: 1-928994-51-2).

Dreamtech Software India, Inc., is a leading provider of corporate


software solutions. Based in New Delhi, the company is a successful pio-
neer of innovative solutions in e-learning technologies.The Dreamtech
Software team, which authored all the books in the Cracking the Code
series has over 50 years of combined software-engineering experience in
areas such as Java, wireless application, XML, voice-based solutions, .NET,
COM/COM+ technologies, distributed computing, DirectX,Windows
Media technologies, and security solutions. For more information, log on
to www.dreamtechsoftware.com.

Frank Boumphrey is a retired professor of surgery who now specializes in


Internet applications and medical documentation. As well as numerous
medical papers, he has authored several books on XML, the Internet and
on other related subjects. Frank is the president of the HTML Writers
Guild, a 125,000 member strong, not-for-profit, International organization
of Web page Writers, and was a participant in various working groups of
the World Wide Web Consortium (W3C). Presently his main objective is to
help XML to become the language of choice in Web documents.
ix
155_XML_NET_FM.qxd 3/7/02 3:01 PM Page x

Technical Editor and Reviewer

Jonothon Ortiz is Vice President of Xnext, Inc. in Winter Haven,


Florida. Xnext, Inc. is a small, privately owned company that develops
Web sites and applications for prestigious companies, such as the New
York Times. Jonothon is the head of the programming department and
works together with the CEO on all company projects to ensure the best
possible solution. His primary field of experience is database backend for
Web applications and occasionally programming the GUI of a Web appli-
cation. He has developed over 30 databases, ranging from small e-com-
merce sites to client identification and storage. Many of these databases
incorporated XML in some fashion, from a small footprint file to the
generation of smaller XML files to increase performance time for often-
used queries and results.The majority of these applications were coded in
either PHP, Perl, or ASP 3.x / .NET. Johothon has been a contributor to
a variety of title from Syngress Publishing, including ASP .NET Web
Developer’s Guide (ISBN: 1-928994-51-2), the VB .NET Developer’s
Guide (ISBN: 1-928994-48-2), and the Ruby Developer’s Guide
(ISBN: 1-928994-64-4). Jonothon lives with his wife, Carla in
Lakeland, Florida.

x
155_XML_NET_TOC.qxd 3/7/02 3:12 PM Page xi

Contents

Foreword xxi
Chapter 1 Introducing the Microsoft
.NET Framework 1
Introduction 2
What Is the .NET Framework? 3
Introduction to the Common Language Runtime 3
Step 1 of the Location Using .NET-Compliant Programming Languages 5
Process
Creating Assemblies 5
Reference Request
Using the Manifest 8
Is it a static? Assembly Cache 11
YES Locating an Assembly 12
NO
Private Assembly Files 17
to Step 2

It is dynamic;
Shared Assembly Files 17
create on-the-fly
then proceed. Understanding Metadata 17
Manifest
The Benefits of Metadata 18
Identifying an Assembly with Metadata 18
Types 19
Defining Members 19
Using Contracts 20
Assembly Dependencies 21
Unmanaged Assembly Code 21
Reflection 21
Attributes 22
Ending DLL Hell 22
Side-by-Side Deployment 23
Versioning Support 23
Using System Services 24
Exception Handling 24
xi
155_XML_NET_TOC.qxd 3/7/02 3:12 PM Page xii

xii Contents

StackTrace 25
InnerException 26
Message 26
HelpLink 26
Garbage Collection 26
Console I/O 26
Microsoft Intermediate Language 27
The Just-in-Time Compiler 27
Using the Namespace System to Organize Classes 28
The Common Type System 29
Type Safety 32
Relying on Automatic Resource Management 32
The Managed Heap 33
Garbage Collection and the Managed Heap 35
Assigning Generations 40
Using Weak References 41
Security Services 41
Framework Security 43
Granting Permissions 43
Gaining Representation through
a Principal 45
Security Policy 46
The Toolbox Window Summary 48
Solutions Fast Track 49
Frequently Asked Questions 52
Chapter 2 Visual Studio.NET IDE 55
Introduction 56
Introducing Visual Studio.NET 56
Components of VS.NET 58
Design Window 59
Code Window 59
Server Explorer 60
Toolbox 61
Docking Windows 62
Properties Explorer 63
Solution Explorer 64
155_XML_NET_TOC.qxd 3/7/02 3:12 PM Page xiii

Contents xiii

Class View 65
Dynamic Help 66
Task List Explorer 67
Features of VS.NET 68
IntelliSense 68
XML Editor 70
Documentation Generation
(XML Embedded Commenting) 73
The Goals of XML Adding XML Document Comments
to C# Pages 74
■ XML shall be Customizing the IDE 75
compatible with SGML. Creating a Project 76
■ It shall be easy to write Projects 76
programs that process Creating a Project 76
XML documents.
Add Reference 77
■ The number of optional
features in XML is to
Build the Project 77
be kept to the absolute Debugging a Project 77
minimum; ideally, zero. Summary 78
■ XML documents should Solutions Fast Track 79
be human-legible and Frequently Asked Questions 81
reasonably clear.
■ The XML design should Chapter 3 Reviewing the Fundamentals
be prepared quickly. of XML 83
■ The design of XML Introduction 84
shall be formal and An Overview of XML 84
concise.
The Goals of XML 85
■ XML documents shall What Does an XML Document Look Like? 85
be easy to create.
Creating an XML Document 86
■ Terseness in XML Creating an XML Document in
markup is of minimal
importance. VS.NET XML Designer 87

Components of an XML Document 88
XML shall be
straightforwardly Structure of an XML Document 91
usable over the Well-Formed XML Documents 92
Internet. Schema and Valid XML Documents 93
■ XML shall support a XML Schema Data Types 97
variety of applications.
Transforming XML through XSLT 98
XSL Use of Patterns 102
155_XML_NET_TOC.qxd 3/7/02 3:12 PM Page xiv

xiv Contents

XPath 105
Summary 107
Solutions Fast Track 107
Frequently Asked Questions 109
Chapter 4 Using XML in the .NET
Framework 111
Introduction 112
The Document Explaining the XML Document Object Model 112
Interface Attributes
The Different XML DOM Levels 113
Attribute Description XML DOM Core Interfaces 114
DOM Structure Model 115
doctype The Document
Type Declaration
DOM Traversal 118
(DTD) with this NodeIterator 119
document. If TreeWalker 120
DTD is not NodeFilter 121
present, this
DOM Range 122
returns null.
DOM XPath 123
document The root
Element element in the
Introduction to the System.Xml Namespace 124
document. Overview of System.Xml.Schema Classes 124
Mapping XML DOM on the
System.Xml Namespace 130
Explaining a Selection of System.Xml Classes 132
Using the System.Xml Namespace 145
Building the XML Address Book 145
Loading the XML Address Book 145
Creating and Deleting Categories 149
Creating, Editing, and Deleting Entries 151
Summary 156
Solutions Fast Track 157
Frequently Asked Questions 158
Chapter 5 Understanding .NET and
XML Security 159
Introduction 160
The Risks Associated with Using XML in
the .NET Framework 160
155_XML_NET_TOC.qxd 3/7/02 3:12 PM Page xv

Contents xv

Confidentiality Concerns 161


.NET Internal Security as a Viable Alternative 162
Permissions 163
Principal 164
Authentication 165
Authorization 165
You can determine the Security Policy 165
permission set of a
code group by Type Safety 165
performing these Code Access Security 166
steps: .NET Code Access Security Model 166
Stack Walking 167
1. Run Microsoft
Management Console
Code Identity 168
(MMC) by choosing Code Groups 169
Start | Run and typing Declarative and Imperative Security 172
mmc.
Requesting Permissions 173
2. Open the .NET Demanding Permissions 177
Management snap-in,
via Console |
Overriding Security Checks 179
Add/Remove Snap-in. Custom Permissions 184
3. Expand the Console Role-Based Security 185
Root | .NET Principals 186
Configuration | My WindowsPrincipal 186
Computer.
GenericPrincipal 187
4. Expand Runtime Manipulating Identity 188
Security Policy |
Enterprise |Code Role-Based Security Checks 190
Groups. Security Policies 192
5. Select the code group Creating a New Permission Set 195
All_Code. Modifying the Code Group Structure 200
6. Right-click All_Code Remoting Security 207
and select Properties. Cryptography 207
7. Select the Permission Security Tools 210
Set tab. Securing XML—Best Practices 212
8. The Permission Set XML Encryption 212
field lists the current XML Digital Signatures 218
value.
Summary 222
Solutions Fast Track 223
Frequently Asked Questions 228
155_XML_NET_TOC.qxd 3/7/02 3:12 PM Page xvi

xvi Contents

Chapter 6 XML and the Web with


ASP.NET 231
Introduction 232
Reviewing the Basics of the ASP.NET Platform 232
Reading and Parsing XML 234
Answers to Your
Frequently asked Parsing an XML Document 235
Questions Navigating through an XML Document
to Retrieve Data 236
Q: Why so much emphasis Writing an XML Document Using the
on the Web? Can’t I XmlTextWriter Class 239
use XML on the
desktop as well? Generating an XML Document Using
XmlTextWriter 239
A: Yes, you can use XML
on the desktop. Exploring the XML Document Object Model 242
However, one of the Navigating through an XmlDocument
main goals of .NET is Object 243
to properly connect
the desktop with the Parsing an XML Document Using the
Internet and not suffer XmlDocument Object 244
any setback due to Using the XmlDataDocument Class 247
server type, program-
ming language, and so Loading an XmlDocument and
on. As you might have Retrieving the Values of Certain Nodes 248
noticed as well, Using the Relational View of an
ASP.NET can be
thought of as a Web
XmlDataDocument Object 249
wrapper for desktop Viewing Multiple Tables of an
code. This helps ensure XmlDataDocument Object 252
that what you see
online will be mostly
Querying XML Data Using XPathDocument
reproducible offline. and XPathNavigator 256
Using XPathDocument and
XPathNavigator Objects 259
Using XPathDocument and XPathNavigator
Objects for Document Navigation 261
Transforming an XML Document Using XSLT 264
Transforming an XML Document
to an HTML Document 266
Transforming an XML Document into
Another XML Document 268
Working with XML and Databases Online 274
155_XML_NET_TOC.qxd 3/7/02 3:12 PM Page xvii

Contents xvii

Creating an XML Document from


a Database Query 275
Reading an XML Document into a DataSet 278
Summary 280
Solutions Fast Track 280
Frequently Asked Questions 283
Migrating… Chapter 7 Creating an XML.NET
Guestbook 283
Online Forms Introduction 284
As you have noticed and Functional Design Requirements
learned throughout this of the XML Guestbook 285
book, ASP.NET enables
programmers to use Web Constructing the XML 286
forms, which can be Adding Records to the Guestbook 288
described as the VB6.0 Understanding the pnlAdd Panel 292
desktop form. In this par-
ticular example, your Adding a Thank-You Panel with PnlThank 294
“AddClick” sub would be Exploring the Submit Button Handler Code 294
placed within the Viewing the Guestbook 298
OnClick() event for what-
ever button you wanted to
Displaying Messages 298
use as your trigger for this Advanced Options for the Guestbook Interface 301
action. One other little Manipulating Colors and Images 301
trick is to view each
“panel” as a small form
Modifying the Page Output 305
within an mdi, namely the Summary 308
browser window, with Solutions Fast Track 308
their own “hide” and
“show” features.
Frequently Asked Questions 310
Chapter 8 Creating a Message Board
with ADO and XML 311
Introduction 312
Setting Up the Database 312
MS Access Database 313
SQL Server Database 317
Designing Your Application 321
Designing Your Objects 323
Creating Your Data Access Object 323
Designing the User Class 325
Designing the Board Class 335
155_XML_NET_TOC.qxd 3/7/02 3:12 PM Page xviii

xviii Contents

Designing the ThreadList Class 344


Designing the Thread Class 347
Designing the PostList Class 350
Designing the Post Class 353
Designing the MessageBoard Class 356
The Board Class
Designing the User Interface 357
Board Setting Up General Functions 358
+BoardID : Long
+Name : String Building the Log-In Interface 366
+Description : String Designing the Browsing Interface 373
+ChildThreads
+ChildThread Board Browsing 373
+Update()
+CreateThread()
Thread Browsing 376
+Delete() Message Browsing 379
+DeleteThread()
+DeletePost() Creating the User Functions 382
+CreateBoard() : Board
Editing the Member Profile 383
Creating Threads and Posts 385
Building the Administrative Interface 389
Summary 403
Solutions Fast Track 403
Frequently Asked Questions 405
Chapter 9 Building a Remote
Database Viewer 407
Introduction 408
Understanding ADO.NET 408
The ADO.NET Architecture 410
Using .NET Data Provider 410
Connection 411
Command 411
Data Reader 411
Data Adapter 412
Using DataSets and DataTables 413
A Quick Comparison of ADO and
ADO.NET 414
Accessing Data from a Database Using ADO.NET 414
Database Design 415
Navigating between Records 415
Add Record Form 419
Delete/Update Form 422
155_XML_NET_TOC.qxd 3/7/02 3:12 PM Page xix

Contents xix

Converting Binary Data Using Base64 428


How Base64 Works 429
Understanding
ADO.NET Converting Binary Data into Base64 Format 431
Database Design 431
The ADO.NET also sports Reading Base64 Encoded Data from an
these features: XML File 436
■ Interoperability Designing and Implementing a Simple Remote
■ DataSet Database Viewer 440

What Is a Remote Database? 441
Performance
Advantages and Disadvantages of
■ Scalability
Remote Data Access 442
■ Maintainability Implementing a Simple Remote Database
Viewer 445
Summary 448
Solutions Fast Track 448
Frequently Asked Questions 449
Chapter 10 Building a Wholesale Catalog 451
Introduction 452
Basic Design Considerations 453
Storage: XML versus Traditional Databases 453
Information Transport Methods 454
XML and EDI 455
XML Vocabularies 456
Implementation of the Agora Markets
Catalog 456
Data Store 456
Transport Protocols 457
Vocabularies 457
Requirements 457
Analysis 458
Data Store 458
Catalog Updating 459
Business-to-Business E-Communications 459
The XML Files 460
Data Typing Entries 461
Catalog 462
155_XML_NET_TOC.qxd 3/7/02 3:12 PM Page xx

xx Contents

Coding the Project 462


Database Design 463
OLTP versus OLAP 463
Developing & XML Packages Design 465
Deploying… Supplier Interface and B2B Design 469
Fatal Errors versus Nonfatal Errors 469
DataReader versus DataSet
Coding updatecat1.aspx 470
DataReader for the most Analysis of Code Listing updatecat1.aspx 482
part works pretty much
like the old recordset with Customer Interface Design 490
which ASP programmers GUI:The Catalog Page 490
are familiar. DataSet will Analysis of Code 493
create a virtual database
(preserved in XML) that
Analysis of Code 498
we can work with even GUI:The Shopping Cart Page(s) 502
while disconnected to the Analysis of Code Listing
database. It requires a
complete new subset of
‘shopcartadd.aspx’ 508
objects and methods to Business and Web Services 514
work with it. Business versus Web Services 514
Coding a Business Service 514
Analysis of Code 516
Creating a Web Service 519
An Overview of Web Services 519
Coding a Web Service 519
Analysis of Code 521
Testing the Web Service 522
Using Web Services 524
Universal Description, Discovery,
and Integration 524
Web Service Description Language 524
Installation: Migrating to SQL Server 529
Changing the Connection String 530
Compatible Data Types 530
SQL Strings 531
Converting to SQL Server 531
Summary 533
Solutions Fast Track 533
Frequently Asked Questions 535
Index 537
155_XML_NET_fore.qxd 3/6/02 5:16 PM Page xxi

Foreword

Welcome to the XML.NET Developer’s Guide! We have taken great care to create a
quality reference book for XML programmers who want to enhance their coding
skills to include applications for the .NET platform.This book assumes that you do
have previous exposure to XML and are familiar with VB.NET, C#, and ASP.NET.
In other words, this book is not for a novice or beginner.
Since its inception in February of 1998, XML has been moving forward through
the continued efforts of the World Wide Web Consortium (W3C). At first many
developers scoffed at XML, thinking it was just a new way to script. However, those
developers who regularly worked with database management and development soon
realized the potential of what XML could be—a way to provide data between parties
without needing to rely on proprietary solutions.
Developers began to incorporate snippets of XML into their desktop applica-
tions, maybe to store configuration data or maybe as an export file. As time passed,
they began to transfer XML to the Internet. Databases began to communicate to
each other via XML and companies were finding that they had an easier time coping
with external database data thanks to XML.
Developers, however, were not the only ones to notice the potential of XML:
Microsoft and made it one of the cornerstones of the .NET Framework. .NET aims
to bridge the gap between desktop applications and online applications, and facilitate
the communication of objects between the two.
The XML .NET Developer’s Guide was created and organized using the following
principal: XML, in the real world, lives up to its flexibility.You are just as likely to
stumble across a desktop application running XML as you are to find an online
e-commerce shop that uses XML to transfer data.

xxi
155_XML_NET_fore.qxd 3/6/02 5:16 PM Page xxii

xxii Foreword

As you work through this book you’ll find that we will be jumping around from
VB.NET to C# or maybe use a little bit of both.This flexibility within .NET allows
you to use the right code always to optimize your XML code; if you thought C#
provides faster queries than VB.NET but VB.NET delivers the better front-end you’ll
find; it’s not an issue, as within .NET you can use both.
If this sounds confusing to you it may mean that you are still a beginner with
.NET in general; if this is the case we suggest you pick up a copy of VB.NET
Developer’s Guide (ISBN: 1-928994-48-2) and C# Web Developer’s Guide (ISBN: 1-
928994-50-4) from Syngress Publishing.These books contain greater detail on the
.NET framework including how it works, and how to work with it using the pro-
gramming language of your choice. As new .NET languages become available
Syngress’ set of .NET programming books will increase and so will your choices in
programming for XML.
If you have read any of Syngress’ .NET books in the past you’ll be familiar with
the layout.We introduce either introductory material (or, in this case, refresher mate-
rial) in the first couple of chapters, move on to the meat of the book with in-depth
views on specific points in the programming language, and finish off with a set of
case studies that enhance the skills and ideas you’ve learned throughout the book. All
in all, the XML.NET Developer’s Guide has a total of ten chapters.
Chapter 1 (Introducing the .NET Framework) will bring you up to speed with a
refresher in how .NET works internally, with Chapter 2 (Visual Studio .NET IDS)
providing an introductory look into VS.NET, Microsoft’s IDE for .NET program-
ming.This new IDE can work more with XML than its predecessor, so even if you
are familiar with the VS.NET IDE it may be a good idea to browse through this
chapter.
Chapter 3 (Reviewing the Fundamentals of XML) kicks off by giving you a quick
refresher for XML basics.This is followed up by Chapter 4 (Using XML in the .NET
Framework), in which we start to look at how you can work with XML through
.NET. Both Chapter 3 and 4 cover basic XML items such as proper XML syntax and
validation through Schemas.You will also learn about many of the major namespaces
and how they work, and begin to familiarize yourself with the appropriate classes
you need to complete your projects.You will be surprised at the flexibility that XML
offers and how even some other classes that do not directly revolve around XML can
work with XML as well.
Chapter 5 (Understanding .NET and XML Security) introduces a major issue in the
XML user community—security.While XML is unable to provide proper security by

www.syngress.com
155_XML_NET_fore.qxd 3/6/02 5:16 PM Page xxiii

Foreword xxiii

itself, a thorough understanding of what XML can do combined with an under-


standing of .NET security is vital.
Chapter 6 (Web Development Using XML and ASP.NET) will introduce you to the
online aspect of XML using ASP .NET and teach you how XML is a vital part of
online applications through the use of multiple examples, including an online catalog.
Chapters 7, 8, 9, and 10 are the hands-on case studies (Creating an XML.NET
Guestbook; Creating a Message Board with ADO and XML; Building a Simple Remote
Database Viewer; and Building a Wholesale Catalog).These applications, with the excep-
tion of Chapter 7, are fairly large, complex, and require an understanding of basic
.NET concepts as well as .NET programming.
You wanted XML? You got it!
—Jonothon Ortiz,Technical Editor

www.syngress.com
155_XML_NET_fore.qxd 3/6/02 5:16 PM Page xxiv
Random documents with unrelated
content Scribd suggests to you:
Mìrt. (ad Aglae) E tu lo lodi, tu lo lodi! Mettiti nei panni di quella
povera moglie abbandonata...
Agl. Mi metto nei panni di quell'altra.
Mèn. Ma che abbandono! che abbandono! Cosa credi, che i giudici
abbiano cuor di macigno? Quando Isèo s'accorse che il suo albero
sui giudici faceva un effettone e che i due vecchi rischiavano restar
soli, per ultimo argomento, tirò fuori... (pausa, segni di attenzione)
un altro albero...
Cròb. Ma era una foresta questa arringa!
Mèn. Proprio così... un altro albero, dal quale appariva come
qualmente il vecchio abbandonato fosse parente in quarto o quinto
grado della vecchiarella derelitta: onde Isèo concluse, e il Tribunale
accolse, i lor precedenti matrimonî doversi sciogliere anche per ciò:
che la settantenne Pànfila essendo... orfanella, la legge obbligava il
vecchietto a sposarla per la perpetuazione della stirpe. E stese le
mani sulle due teste venerande, ripetè il verso di Omero: che Giove
ama congiunti i simili coi simili!... Ah che oratore! che oratore!
Mìrt. (mal frenando la stizza) Aglae, nei processi di tuo marito ci son
troppi alberi... e a viaggiar pei boschi si incontrano i malandrini... Se
credi, son da te...
Agl. (alzandosi) Come vuoi...
Cròb. (ad Aglae sottovoce, mentre questa, prima d'uscire, sta
mettendo a posto qualcosa sul suo tavolo) Mi raccomando... non le
mostrar tutta la guardaroba... perchè poi a me tocca di portarla...
e... vesti chiuse... vesti chiuse... riparano dai freddi...
Agl. (a Mènecle, nell'andarsene con Mìrtala) Tu sei a casa oggi?
Mèn. (asciutto) No.
Agl. Sei via a cena?
Mèn. (c. s.) Sì.
Agl. Tornerai presto?
Mèn. Forse. (Aglae s'allontana senza dir parola. Quando ella è già
sull'uscio, Mènecle la richiama) A proposito, è stato qui Elèo?
Agl. (ferma sull'uscio, dopo una pausa, come risovvenendosi) Ah...
sì!
Mèn. Perchè non dirmelo...?
Agl. (fredda) Non me l'hai chiesto.
Mèn. Ha detto ove andava?...
Agl. No.
Mèn. Tornerà?
Agl. (imitando il forse precedente di Mènecle, con accento
espressivo) Forse! (esce con Mìrtala).

SCENA IX.

Mènecle e Cròbilo.

Cròb. (comicamente, a parte) (Che tenerezze!) (a Mènecle) Non si


può dire che tra marito e moglie sprechiate eccessivamente il fiato...
Vi parlate sempre così?
Mèn. Quasi sempre.
Cròb. Non vi anderà giù la voce. E, dimmi, il giorno che l'hai sposata,
l'hai almeno avvertita delle tue abitudini di... eloquenza domestica?...
Mèn. Non ci ho pensato.
Cròb. Eppure, scusa sai, ma mi sembra... era forse il caso di
pensarci... essendo tu quel galantuomo che sei... che tutta Atene
conosce...
Mèn. (vivissimo) E chi, chi ti dice ch'io non lo sia?...
Cròb. Lo sei! lo sei! per Ercole! l'han fino scritto col carbone sui
pilastri del Ceràmico... [145] Appunto...
Mèn. Appunto... se si è galantuomini e si è fatta una minchioneria,
non si seguita a sospirarne tutto l'anno e ingrassarci sopra...
(parlando, fissa l'occhio su Cròbilo)... Si fa di meglio... Ci si ripara...
Cròb. Eh?
Mèn. (energicamente incalzando) Altrimenti sui pilastri del Ceràmico
potrebbero scrivere... di me... o di te... anche questo: Mènecle... o
Cròbilo, il tal giorno è stato un imbecille... e adesso ci trova il
tornaconto a rimanerlo... E questo, per mio conto, non voglio che lo
si dica... non voglio... intendi...
Cròb. Intendo un bel niente.
Mèn. Intenderai con comodo.
Cròb. Quando?
Mèn. Prima della luna nuova.

Dette queste parole appoggiandovi sopra con accento vibrato,


s'avvia ad uscire.

Cròb. (Che diamine sta mulinando?) Te ne vai?...


Mèn. Ho da fare... alla cancelleria dell'Arconte. (si fruga indosso
cercando qualcosa che non trova) (Dove l'ho messa?) (torna verso
Cròbilo) Però ti avverto di una cosa. Sai che Aglae per via di madre
vien dalla famiglia dei Brìtidi; [146] io per via di padre dagli
Almeònidi...
Cròb. Lo so...
Mèn. Il padre suo poi era cugino di Cimone, la madre mia cugina di
Pericle: il suo proavo paterno combattè insiem col mio a Salamìna...
le linee laterali si estinsero...
Cròb. (lo guarda stupìto, senza comprendere) Eh?...
Mèn. Era solo per dirti che le nostre genealogie rispettive sono
perfettamente in chiaro: e non c'è pericolo che ci spuntino intorno
cugini nuovi, come i funghi sui fusti delle piante...
Cròb. E così?
Mèn. E così... io non sono il vecchio Fràstore che fece giudizio senza
suo merito: io sono Mènecle, che so far giudizio da me — e il merito
sarà mio — tutto mio: — e non occorreranno cugini in ritardo (lo
fissa in volto) che abbiano bisogno di sbarazzarsi di qualche moglie
avanzata dal diluvio di Deucalione. E se i vecchi stanno male con le
giovani, i giovani che han le vecchie... se le tengano!... (lo saluta e
se ne va: durante l'ultima parlata, Mènecle ha continuato a frugarsi
in dosso: nell'andarsene, fruga sempre e borbotta fra sè) (Dove l'ho
messa, per Ercole!... Ah... che l'abbia lasciata là...) (s'avvia, poi torna
bruscamente verso Cròbilo e gli ripete battendogli sulla spalla) I
giovani che han le vecchie... se le tengano!... (borbottando sempre
esce).

SCENA X.

Cròbilo solo.

(Facendo gesti e segni d'uomo che è riuscito a comprendere). La


morale della favola, si direbbe quasi che sia per me... Non
importa!... Ah, ah, ora comprendo!... Così... per modo di dire...
l'amico Mènecle prepara alla sordina un bel divorzio!... Peuh!... È una
soluzione come un'altra... Non è molto onorifica per Aglae, ma è
abbastanza onesta per lui... Meglio che farla vivere in quel modo!...
E Aglae, si vede, non ne sa ancora niente!... Per quanto sì... non le
debba riuscire un complimento, scommetto non le parrà vero di
ricuperare la libertà!... E con la dote di Mènecle, [147] e con quel
visino, e quei due occhioni, non le sarà difficile trovare chi la faccia
discorrere un po' di più. Perchè, infine, è una gran bella ragazza!...
Che occhi! che linee! che curve!... Pare la Venere degli Orti! To'! io
non ci avevo mai fatto attenzione, ma proprio... più la si guarda
dappresso, più è bella!... Mènecle, ad ogni modo, poi che s'è deciso
a questo passo, dovrebbe almeno prepararvela. Quasi, quasi, se non
fosse... (passeggiando, si ferma, come venutagli un'idea) Ma sì... per
Bacco!... e perchè no?

(Aglae e Mìrtala, in questo mentre, rientrano).

SCENA XI.

Aglae, Mìrtala, Cròbilo, un momento Tratta.

Agl. (rientra discorrendo con Mìrtala). Oh, trattienla quanto vuoi!...


Mìrt. (con un involto in mano). Grazie!..
Agl. (a Cròb.). È già uscito Mènecle?
Cròb. Or ora... (senza por mente a Mìrtala che sta raggiustando il
suo involto, contempla di sottecchi Aglae e parla fra sè). (Quel
nasino grazioso che guarda in su!).
Agl. Niente lasciò detto?
Cròb. No... Parea cercar delle carte... (continuando a sbirciar Aglae).
Che bei capelli biondi!... Con quella acconciatura oggi par fin più
bella del solito!... Sicuro!... è più bella del solito!... Che boccone per
quello a cui tocca!...

(Nel volgersi, mentre è immerso in queste riflessioni, si trova


faccia a faccia con Mìrtala, che gli pon su le braccia l'involto
da portare).

Mìrt. Mi fai piacere di tenermelo...


Cròb. (con una smorfia e un lungo sospiro). E a me ecco che cosa
tocca!...
Mìrt. Bada a non la sciupare...
Cròb. No, no... (annasando l'involto) Hu!hu! che profumo!... Ma di'
un po', Mìrtala, la ti andrà poi bene?
Mìrt. (accennandogli Aglae). E non vedi, orbo, che abbiam la stessa
taglia?
Cròb. Ah sì!... (orbo, quando t'ho preso!) Hu! hu! che odor
d'ambrosia!... Che profanazione!...
Agl. (passata presso il tavolo a cui Mènecle era seduto sul cominciar
dell'atto, e visto un rotolo caduto per terra, lo raccoglie sorridente).
To'!... nel grande accalorarsi per la mia felicità, ha dimenticato fin le
sue carte!... Che mi dicevi Cròbilo? che Mènecle cercava delle
carte?...
Cròb. Appunto... frugava...
Agl. E allora saran queste che gli son cadute o ha dimenticato qui.
Sai dove andava?...
Cròb. Alla cancelleria dell'arconte.
Agl. Le darò a Blèpo che glie le porti...

(Fa per chiamare).

Mìrt. È inutile. Dà qui. Passiamo ora di là noi.


Agl. Grazie allora...

(Le passa il rotolo con indifferenza).

Mìrt. Così gli dirò anche, a quel rusticone, che non è questo il modo
di andarsene...
Agl. Non gli dire nulla. È il suo carattere.
Mìrt. Bel carattere!... Anche gli Sciti lo hanno così: [148] ma non
isposano donne d'Atene. Se fosse mio marito... vedrebbe! Già, tu sei
troppo buona... Vorrei veder io che Cròbilo stesse su la notte a
consumarmi l'olio della lucerna, senza neanche saper quel che
scrive... E tu ti fidi?...
Agl. Completamente.
Mìrt. (scrollando il capo). Basta!... contenta tu!... (a Cròbilo,
maliziosa, mostrandogli il rotolo). Neh, Cròbiluccio, che avessimo
senza saperlo, a far la parte... tu di Mercurio... e io di Iride?...
Cròb. (O Dei! che vaga Iride!) Peuh! Mercurio portator di fagotti...
Mìrt. Vieni dunque. Addio Aglae.
Agl. Addio.
Cròb. (sbirciando sempre Aglae). (Che cara creatura! Eh, se
sapesse!...)
Mìrt. (a Cròbilo). Vieni?... (nell'avviarsi ad uscire con Cròbilo, va
curiosando nell'interno del rotolo; d'un tratto si ferma esclamando)
Oh, cara Venere!... (si volta verso Aglae) Ma voi altri due fate
all'amore di nascosto? e invece di parlarvi, vi scrivete?...
Agl. (non comprendendo). Eh?
Mìrt. Ma le carte degli affari non saran queste. Questa è per te.
Agl. (sorpresa). Che cosa?...
Mìrt. Ma sì!... qui nell'angolo dice: Mia cara Aglae!... guarda!
guarda!... (Aglae osserva dove Mìrtala le indica). Ma allora, poi ch'è
per te, puoi aprirla in coscienza: gli risparmi la fatica...
Cròb. (a parte, avendo seguìto la scena). Volevo ben dire! Capirai
prima della luna nuova! È la lettera di partecipazione. Ora ho
capito...
Agl. (indifferente, prende il rotolo, lo esamina un minuto
esternamente, poi senza aprire lo torna a deporre). Leggerò poi...
(fra sè) (Sarà la ripetizione dei discorsi allegri di stamane!)
Cròb. (inquieto, a parte). Ma se non legge... bisognerebbe...
Mìrt. (ad Aglae maliziosamente). Ho capito... segreti fra coniugi...
Rispettiamoli!... Vieni, Cròbilo?...
Cròb. Vengo!... (segue lentamente Mìrtala; mentre ella esce,
s'appressa rapido ad Aglae e le dice affrettato, sottovoce, con
accento drammatico). So tutto. Coraggio. Sei giovane, sei bella.
Venere ti proteggerà... (allontanandosi, la torna a guardare) (Che
nasino! È più bella del solito!)
Mìrt. (mentre Cròbilo, già avviato ad uscire, si indugia di soppiatto
nella contemplazione di Aglae, Mìrtala sulla soglia si volge
amorosamente al marito, e ad un tratto lo abbraccia scoccandogli un
sonoro bacio e ripetendo con caricatura amorosa il verso di Crìside).
«T'amo!..... È la nova parola ch'io so».

(Cròbilo, strappato improvvisamente alla sua contemplazione


dal bacio di Mìrtala, con una smorfia comica lo subisce, e
mandando un sospiro di rassegnazione disperata, si lascia da
Mìrtala trascinar via).

SCENA XII.

Aglae sola.

Agl. (Ha accolto con un movimento di dispetto e di fierezza le ultime


parole di Cròbilo). Che ha inteso dire?... Ah, già!... qui tutti han
preso il vezzo di compiangermi!... Perfin le vecchie! Una vera gara di
pietà! Grazie! non so che farne!... (torna lentamente, pensierosa, al
suo lavoro e riprende in mano la corona). Qui metteremo i narcisi di
Elèo... Povero Elèo!... Fino a Colòno... là sulla rupe... me li è andati a
prendere... Dunque la piccola Aglae non è del tutto dimenticata... E
voleva fingere! Serbarmi rancore!... Perchè fingere con Aglae?... Che
colpa ne ho io?... Ah Mènecle, Mènecle, co' tuoi benefici ti sei preso
tutto, è tua la mia vita... ma la memoria del cuore... di questa
neppur gli Dei mi possono chiedere conto. Quanto alla mia felicità, di
cui Mènecle si prende scrupolo e mi parla e mi scrive... (prende in
mano il rotolo e lo svolge macchinalmente) glie ne domando conto
forse io?... (spiega e legge) È diretta proprio a me. (la scorre
dapprima sbadatamente e indifferente, poi si fa più attenta) Che
cos'è questo?... (legge:) «Di casa, la notte al nove della luna calante
di Ecatombèo, anno iv della 99ª Olimpiade.» L'ha proprio scritta
stanotte! «Mia cara Aglae!... Il giorno che leggerai questa mia, i tuoi
rapporti meco saran mutati da quelli dell'ora in cui la scrivo...» (fra
sè, interrompendosi) Eh... peggio di quel che sono!... «e forse in
quel giorno non ti dorrà il poter dare della condotta di Mènecle
giudizio meno amaro di quello che oggi parla segretamente in cuor
tuo». Che ne sa? «Il cancelliere ti darà questo scritto, dopo la
sentenza dell'arconte che avrà disciolto le nostre nozze... per
domanda tua!...» (esclamazion di stupore) Che!... mia domanda?...
io domandarlo?... «Depositato da ora presso lui, ti sarà allora
documento della verità delle mie parole...» (s'arresta sempre più
stupita) Che vuol dir ciò?... (scorre rapidissimamente il resto della
lettera, con segni di crescente sorpresa e commozione: terminato,
rimane assorta, la testa fra le mani, asciugandosi una lagrima).
Povero vecchio!... povero vecchio!... (si alza vivamente e passeggia
concitata). Così... io avevo l'orgoglio di credermi generosa verso
Mènecle... ed è lui che mi soverchia in generosità!... Tutti, tutti, mi
umiliano! Soverchiare Aglae!... Ah! la vedremo!...

(Rinchiude, e va per riporre al posto di prima il rotolo, ma in


quel punto si affaccia Tratta).

SCENA XIII.

Aglae, Tratta ed Elèo.

Tr. (dalla soglia) Elèo!...


Agl. Ah!... (momento di pausa, di perplessità e lotta interna
vivissima. Poi risolvendosi) Passi.
El. (entra vivacissimo e reca dei corimbi di narcisi). Aglae!... li ho
colti là... dove tu sai... (Aglae non risponde, è triste, pensierosa —
Elèo, interdetto, depone i fiori) Che hai?
Agl. (mesta, chinando lo sguardo). Nulla. Leggevo una lettera... di
Mènecle... per me. La puoi leggere anche tu... Leggi.... continua pur
forte!...

(Elèo, guardandola tra sorpreso ed esitante, prende


lentamente la lettera, che ella gli stende, la legge e poi ripiglia
a voce forte la lettura al punto che Aglae gli ha segnato.
Aglae segue la lettura, profondamente commossa).

El. (leggendo). «Quando tuo padre morente affidavati a me, tu eri


fanciulla quattordicenne appena. Accorrevano, allettati dalla dote
ch'io t'avrei fatto, i concorrenti: ma pel tuo cuore di fanciulla l'ora
della scelta non era suonata: e libera e felice bramavo la tua. Ed io
dissi fra me: che tre o quattro anni a te restavano prima d'affacciarti
alle soglie vere della vita, e non più di tre o quattr'anni — ero anche
malfermo di salute a que' dì — mancavano a me per abbandonarle.
Pensai che sposandoti a un estraneo in quell'età, io rinunziavo in
mani ignote un incarico sacro; che la mia casa poteva offrirti, pei
tuoi anni verdissimi, asilo, fino al dì che la mia morte t'avrebbe
trovata, giovane e bella, erede delle mie fortune, padrona della
scelta del cuor tuo, e in grado di porne le condizioni...»
Agl. (ad Elèo). Che ti sembra?
El. (triste e serio). È leale. (prosegue la lettura) «... Se in quel mio
desiderio sia entrato anche un desiderio egoistico: veder consolata la
mia vecchiaia dal tuo sorriso, lo squallore del mio inverno da un
ultimo raggio di sole, oh Aglae, io non oso domandarlo a me stesso:
non oso cercar tra le pieghe del mio cuore più nascose, in quell'unico
mesto desiderio, l'unico mio torto verso di te...»
Agl. (asciugando una lagrima) Povero vecchio!...
El. (prosegue a leggere). «Ve lo hai letto tu forse? Non so. So che in
queste nozze il cuor tuo volle scorgere un debito verso l'ombra
paterna: le accettasti prima colla ingenuità della gratitudine; le
subisti poi colla abnegazione del sagrificio... Non volli disingannarti.
Per la educazione del tuo animo quella prova era troppo bella. Nella
Parca liberatrice confidavo perchè fosse breve. Ma ecco, l'ora che io
pensavo è suonata; e trova te fatta donna, nello splendore dei doni
di Venere; e trova me vecchio e vivo e senza il diritto di prevenire la
Parca. [149] Sciupar con un vecchio il tuo aprile, invecchiar senza
gioie nè di sposa, nè di madre, non era questo ch'io promisi, non
può essere questo il premio alla tua virtù. [150] Ma s'io ti dicessi ora
ciò, se pregandoti di recar teco delle mie fortune quel che in mia
mente è già tuo, io ti offrissi di sciogliere di mutuo accordo le nozze,
la tua fierezza, resa dall'idea del sacrifizio più altera, rifiuterebbe
sdegnosamente».
Agl. (a sè). Certo!...
El. (segue a leggere). «... Valermi della legge, e liberar te col
ripudio? triste felicità la tua sarebbe, comperata a prezzo del peggior
degli affronti. [151] Sola una via mi restava. Scioglierti dagli scrupoli
verso di me: obbligarti a ricorrere all'arconte tu medesima. Sei
nervosa, impaziente, irascibile: pensai di stancare la tua pazienza.
Sei virtuosa e leale: il giorno che il tuo cuore sentirà prepotente il
bisogno di vivere, tra l'abbandonarmi lealmente a fronte alta e
l'ingannarmi, il tuo cuore, ne sono certo, nella scelta non esiterà.
Quando leggerai queste righe avrai scelto, e mi perdonerai questi
giorni di tedio e l'inganno dell'esserti parso egoista, duro, scortese.
Me lo perdonerai pensando alla triste solitudine che m'attende [152],
e in cui non avrò altro conforto che di saperti felice, e aver sciolto la
mia promessa alla cara ombra del padre tuo.
«Mènecle».
Agl. (Elèo lascia cadere il foglio, mestissimo in volto. Aglae ha da
qualche minuto in mano e sta contemplando i fiori di Elèo: alle
ultime parole della lettera, se gli è già venuta accostando: nel punto
in cui egli termina, con atto dolce e amorevole gli ripresenta i
ramoscelli di narciso. Elèo vorrebbe rifiutare, ella insiste con gesto
muto, amorevole di preghiera; Elèo riprende i fiori ad occhi bassi,
senza dir parola. Aglae prosegue con voce lentissima e dolce). Vedi
bene che a quell'ombra non potrei più offrirli... (lunga scena muta
fra i due). Non sarebbe bello!... Non sarebbe bello!...

(Saluto lungo e silenzioso. Elèo si allontana lentamente ed


esce. Aglae ricade sulla sedia, celando il volto nelle mani).

CALA LA TELA.
NOTE

81. Per la topografia della casa ateniese, rimandasi alle


descrizioni di Vitruvio (Archit., vi) e ai lavori archeologici
moderni che le illustrano. Chi non voglia sciupar tempo in
minute ricerche, può farsene un'idea abbastanza chiara ed
esatta dai disegni topografici, per es., dell'opera di Guhl e
Körner, Leben der Griechen und Römer, fig. 90-91, o da
quelli aggiunti all'Anacarsi. La stanza da lavoro di questa
scena è una, s'intende, dell'appartamento segregato
femminile, propriamente detto (γυναικωνῖτις); occupato
dalla padrona di casa e dalle sue donne, e generalmente
posto nella parte posteriore della casa; appartamento al
quale non accedeano gli uomini tranne i parenti, o gli
estranei che ne aveano il permesso dal marito. Da queste
stanze riposte del gineceo (ove la moglie attendeva alla
sua toletta, o ai lavori delle fantesche, o alle occupazioni
geniali del ricamo, del tesser ghirlande, della musica ed
altre, o riceveva le amiche), da queste un corridoio
(metaulo o mesaulo) metteva appunto direttamente alla
sala aperta comune (πρόστας o παραστάς) che dava sul
cortile o peristilio (ἀυλή), e ch'era destinata ai ricevimenti
di famiglia, ai sagrifici domestici o ai pranzi quotidiani. In
questa sala comune nella quale era il domestico altare, e
la quale segnava come il confine tra il gineceo e gli
appartamenti anteriori occupati dal marito (ἀνδρωνῖτις),
supporrassi la scena dei due atti successivi.

82. «Tremo e mi mordo le labbra, per presentimento di


disgrazia, come quei che passano allato ad un qualche
silenzioso eroe». Alcifr., Lett., iii, 58. La antichissima
superstizione greca imaginava lo spazio fra la terra e la
luna abitato dagli eroi o genj, esseri di sostanza fra
l'umana e la divina; i quali talora, siccome mediatori tra gli
dei e gli uomini, scendeano in terra a mescolarsi fra questi
ultimi, ma senza parlare. E infesti a coloro in cui
imbattevansi, era credenza che il loro incontro portasse
disgrazia.

83. Cfr. Aristof., Lisistrata: «Lis. Nella guerra e nel tempo


passato, voi uomini non ci lasciavate a noi donne aprir
bocca...: e spesso in casa vi udivamo prendere cattivi
partiti in affari gravissimi. Quindi col dolore nell'anima, ma
col sorriso sul labbro, v'interrogavamo: Che avete
determinato oggi nell'assemblea? E il marito: Che fa a te
questo? Non vuoi tacere? Ed io mi taceva. Provveditore.
Saresti stata battuta, se non tacevi. Lis. Ma poi, udendo
qualch'altra vostra decisione anche peggiore,
domandavamo al marito: Perchè far questo? E quegli,
squadrandomi con occhio bieco, dicevami: Se tu non tessi
la tua tela, ti dorrà a lungo la testa. Sta agli uomini aver
cura della guerra». v. 507-520.

84. V. Sofocle, Trachinie, v. 9-17.

85. Luglio-agosto. V. il lunario attico nelle note all'Alcibiade.

86. «Ut omnia de speculis peragantur, optima apud majores


fiebant Brundusina stanno et ære mixtis». Plin., xxxiii, 9.
Questi specchi di Brindisi, lodatissimi, fatti di bronzo e di
stagno, finchè, come dice lo stesso Plinio (xxxiv, 17) si
usarono d'argento persin dalle ancelle, sono
verosimilmente la stessa cosa degli specchi chiamati, forse
per error di copista, d'Abrotesio, in Alcifr., Lett., iii, 66.
Caratteristiche poi, nella toletta delle signore ateniesi,
erano di questi specchi certe forme piccole, rotonde, per lo
più con manico riccamente lavorato, e raffigurante, il più
delle volte, l'effigie di Venere Afrodite. Cfr. Guhl e Körner,
p. 217, fig. 227. Mènecle ne parla più innanzi.

87. Calisseno rodio, pr. Aten. Deipnos. — v. Teofr., Caratt., 5.

88. Su la parte grandissima che nella vita della donna di


famiglia ateniese aveano le divozioni, le feste e le pratiche
religiose d'ogni genere, e su quel che costavano, di occhi
del capo, ai poveri mariti, abbondano i tratti nei comici e
altrove. «Ogni Iddia di cui si celebra la festa è una
maledizione pei mariti: i poveri uomini non ne conoscono
neppure i nomi: le Coliadi, per es., e le Genetillidi, e la dea
Frigia, e la processione d'infelice amore sul pastore
(Adonie)». Luciano, Amori. E in Menandro: «Ahimè —
sclama un marito — la mia donna spende dieci mine in
profumerie: e le occorrono scatole d'oro per chiudervi i
sandali... In casa la mi faceva cinque sacrifici al giorno: e
ad ogni sacrificio, sette schiave in circolo, picchiavan ne'
cimbali, mentre altre mandavano gli urli rituali. Son
soprattutto gli dei che ci rovinano, noi altri mariti: sempre
delle feste a cui far le spese!» Men., Mysogin., fr. 3. Cfr. i
frammenti di un'altra commedia di Menandro, La
sacerdotessa (‘Ιέρεια), ove un marito cerca distogliere la
moglie dalla manìa delle pratiche religiose per il culto di
Cibele.

89. «Solo di tutti gli uomini, o Trofimo, tua madre t'ha posto al
mondo sotto astro sì propizio che tu possa conseguir co'
tuoi sforzi lo scopo di ogni tua brama, e condurre tutte le
tue imprese a buon fine? T'ha forse qualche Iddio
assicurato con promesse questo privilegio? S'è così hai
ragione di indignarti: poichè questo Iddio t'ha ingannato e
t'ha usato una ingiustizia. Ma se tu hai ricevuto alle stesse
condizioni di noi quest'aria che respiri e che è a noi
comune, ti bisogna far uso della ragione e sopportare con
più coraggio questa sventura...» Menandro, fram. inc.;
Meineke, fr. com. gr., iv, 227.
«Iscrizione: Ai numi soli è dato — ogni successo aver felice
appieno — l'uomo quaggiù non ha contrasto al fato. Non
odi, o Eschine, che aver prosperi successi è solo degli
Dei?» Demost., Corona.

90. Nel diritto attico «la donna è maritata legittimamente dal


padre, dal fratello consanguineo, dall'avo paterno»
(Demost., C. Stef., ii, 1134) che, succedentisi in ordine di
diritto, ponno dar la ragazza a chi loro talenta (cfr. Petit,
Leges att., vi, 1). Il padre può dar la figlia in isposa lui
vivente (Dem., C. Spud., 1024; C. Neera, 1345) o legarla
per testamento. «Demostene mio padre lasciò la sua
sostanza di 14 talenti, me di 7 anni, la sorella di cinque, e
la madre nostra. In punto di morte, tra sè consigliandosi
sul come disporre di noi, affidò tutte queste cose a questo
Afobo e a Demofonte nipoti suoi.... A Demofonte poi sposò
la mia sorella e diede subito due talenti». Dem., C. Afob., i,
814. Questo diritto del padre, o di quelli che in sua
mancanza lo rappresentavano, è subordinatamente
esercitato anche dal primo marito, il quale può pur esso
morendo designare per testamento il proprio successore
nel talamo. Così, nel passo testè citato, Demostene
soggiunge che il padre suo legò sua mamma in moglie ad
Afobo (C. Afob., i, 814); e così Pasione lega morendo la
propria moglie a Formione (Dem., per Form., 946, 953; C.
Stef., i, 1110; C. Stef., ii, 1133), sempre per disposizione
testamentaria. — Cfr. Desjardins, Condition de la femme
dans le droit civil athén., mémoires lus à la Sorbonne. —
Lallier, La femme dans la famille athénienne.

91. «I nostri mariti tornando a casa ci guardan con l'occhio del


porco, tante malizie costui (Euripide) ha insegnato loro:
sicchè se una moglie sta intrecciando una corona, subito si
crede che la sia innamorata...» (ἐάν τις χαὶ πλέκῃ γννή
στέφανον, ἐρᾶν δοχεῖ) — Aristof., Tesmofor. V. 395-401.

92. σποδὸς δὲ τἄλλα, Περικλέης, Κόδρος, Κίμων — Alessi


(poeta comico della commedia di mezzo) nel Maestro di
nequizie (’Ασωτσδιδάσκαλος). Mein., fr. com. gr., iii, 395.

93.

Φοιταᾴ δ’ἀν αὶθέρ’, ἔστι δ’εν θαλασσίφ


κλύδωνι Κύπρις, πάντα δ’εκ ταύτης ἔφυ.
‘Ηδ’ ἐστιν ὴ σπείρουσα καὶ διδοῦσ’ ἔρον,
οὖ πάντες ἐσμὲν οὶ κατὰ χθόν’ ἒκγονοι.
Eurip., Ippol., v. 447-450.

94. Eurip., Medea, v. 230-247.

95. Fu nell'anno 379 av. l'E. V. (2º della 100ma Olimp.) che lo
spartano Febida, d'accordo cogli oligarchici tebani, si
impadronì a tradimento della rocca di Tebe (Cadméa) e
della città, rovesciandone il governo democratico e
instaurandovi la tirannide spartana. I Tebani di parte
democratica che poteron salvarsi — circa 400 —
rifugiaronsi ad Atene: tra questi fuorusciti «Pelopida, e
Ferenico, e Androclide, i quali fuggiti essendo, furono
unitamente agli altri condannati in esilio. Ma Epaminonda
sen restò nel paese, trascurato venendo come uomo che
applicandosi alla filosofia, non si ingeriva punto nelle
faccende, e ch'essendo povero non potea far cosa
alcuna». (Plutarco, Pelop.) E di questa presunta innocuità
avvantaggiandosi Epaminonda, da Tebe mantenea le
segrete comunicazioni co' fuorusciti e attendea per il
giorno della riscossa «a riempiere di sensi coraggiosi la
gioventù tebana e ad addestrarla a lottar coi
Lacedemoni». (Ibid.) — Cfr. Senof., Ellen.

96. Eschilo, Sette a Tebe, v. 181, 200-1.


97. «O Minerva Promacorma! Bramo ch'altri mi calpesti disteso
morto sotto un monticello, fuor della porta Diometide o
dell'Ippade, anzichè sopportar più a lungo le gran delizie
del Peloponneso». Alcifr., Lett., iii, 52. Gli Ateniesi non
usavano seppellir alcuno dentro le mura. La porta
Diometide o Diomea, nel quartiere di questo stesso nome,
conduceva al Cinosargo, a levante della città; la porta
Ippade (nominata nella scena appresso) metteva a
settentrione, sulla via di Colono e di là a Tebe.

98. Cfr. Alcifr., Lett., ii, 4.

99. Sofocle, Edipo a Colono.

100.
Giove Ctesio (κτήσιος) ossia Giove posseditore o donatore,
custode della domestica proprietà; del numero degli Dei
penati, principalissimo: aveva altare nelle case, o se ne
teneva un idoletto nelle dispense. «Il Dio di Dodona
comanda che a Bacco popolare si faccia un sagrificio
perfetto; ad Apollo scacciamali si immoli un bue; liberi e
servi s'inghirlandino e vachino dai lavori un giorno intero;
anche a Giove Ctesio sia sacrificato un bue bianco».
Demost., C. Midia. — E in una arringa di Iseo è descritto un
vecchio che celebra sacrificio, circondato dai figli di sua
figlia. «Alle Dionisie campestri egli ci conduceva con lui, e
con lui celebravamo tutte le feste. Quando sacrificava a
Giove Ctesio, ed era per lui l'atto religioso più importante,
non ammetteva nessuno schiavo nè estraneo; compiva da
sè tutte le cerimonie; noi l'aiutavamo, maneggiando gli
oggetti sacri, ponendo sull'altare le viscere; ed egli, come
a l'avo conviensi, supplicava il Dio di accordarci la salute e
un tranquillo possesso della nostra fortuna». Iseo, Ered. di
Cirone, § 15-16.
101.
La battaglia sanguinosa di Nemea, dove gli Ateniesi, alleati
coi Tebani, Argivi e Corinzî furono sconfitti dagli Spartani,
accadeva nel 394 av. l'E. V., ossia 15 anni prima dell'epoca
in cui è supposta questa scena. Gli alleati vi erano forti di
24 mila opliti e 1550 cavalli; i Lacedemoni vincitori
avevano 13.500 uomini soli: ma la mancanza d'accordo tra
i capi portò la disfatta dei primi, che vi perdettero 2500
uomini. I vincitori ebbero 1100 morti.

102.
«Comandano le leggi che l'arconte abbia cura dei pupilli».
Demost., C. Timarc. — «Legge: l'arconte abbia cura degli
orfani e delle orfane ereditarie (epiclére); e delle case
vuote; e delle mogli che rimangono nelle case dei mariti
defunti, e che dicono di essere gravide». Demost., C.
Macart., 1076. — Indi il tutore rappresentava l'arconte,
verso il quale rispondeva della tutela; e mancando agli
obblighi di questa, poteva esser tratto in giudicio o punito
dall'arconte d'ufficio. — Cfr. Schöm., Ant. gr.; Petit, Leg.
att., vi, 7; Meurs., Them. att., ii, 10.

103.
V. Eschilo, Coefore; Sof., Elettra; Euripide, Ifig. in Aul., ecc.

104.
«Elettra. I parentali — libamenti spargendo sulla tomba —
qual grata prece proferir degg'io? — Come il padre
invocar?... Di' pur, come t'ispira — la riverenza alla paterna
tomba... Coro. Prega, il licor versando, ai fidi amici —
fausti tutti gli eventi... Elettra. Qual altro aggiungerò?
Coro. D'Oreste — ti risovvenga ancor che lunge ei sia». —
Eschilo, Coef., v. 86-88, 108-115.
105.
«Dicesi che Anassagora di Clazomene (il filosofo che fu
maestro di Socrate) non fu mai veduto ridere, e neppur
fare il minimo sogghigno: Aristosseno parimenti fu nemico
del ridere, ed Eraclito piagneva per ogni cosa della umana
vita». Eliano, V. Stor., viii, 13.

106.
«Carico di corimbi in questo loco — il fiorente narciso —
ghirlanda delle due gran Dive antica — tuttodì si nutrica —
di celeste rugiada...» Sofoc., Edipo a Colono. — Su le due
dee sotterranee, Cerere e Proserpina, V. note all'Alcibiade.

107. τὴν μὲν ἅπασι τοῖς ἐαυτῆς φιλοτίμοις κεκόσμηκεν


Αφροδίτη, μόνου τοῦ κεστοῦ φεισαμενή. Aristen., Lett., i,
10.

108.
«Che cosa vi è di più dolce per un marito che una sposa
secondo il suo cuore, che cosa di più dolce, sopratutto
nella gioventù?» Antifonte, pr. Stob. Flor., lxviii. Superfluo
avvertire qui, una volta per tutte, quello che Eudemonippo
ha già accennato nel prologo: che se la Sposa di Mènecle
è stata scritta da lui nella 120ª Olimpiade, vale a dire
quando Menandro fioriva, e Aristotile aveva fatto scuola,
egli è alla luce dei lavori della commedia nuova e delle
pagine più belle dello Stagirìta, che s'hanno a studiare, nei
novi costumi e sentimenti di quell'epoca, i novi ideali della
famiglia, dell'affetto coniugale e dell'amore; e i richiami
alle caste dolcezze amorose, e le scene di tenerezza fra
giovani fidanzati e sposi, giunte fino a noi negli sparsi
frammenti greci, e nelle pitture più delicate di Terenzio.
Fabula jucundi nulla est sine amore Menandri. Nella
dignità cresciuta del matrimonio la moglie ritrova al 4º
secolo un posto quasi nuovo fino allora per lei: e nella
femmina, presa per confinarla nel gineceo a procrear figli,
appare per la prima volta la compagna amante dell'uomo.
Ed ecco Aristotile dichiarare che «la tenerezza è naturale
fra il marito e la moglie, l'uomo essendo da natura ancor
più incline alla vita in due che non alla vita sociale; e in
questa tenerezza ritrovarsi molto profitto e molte dolcezze
insieme riunite». (Ar. Eth. Nicomac., viii, 14). Che più?
Eccolo altrove premunir i giovani sposi contro l'eccesso
della tenerezza, contro la intimità spinta al punto da
divenire una abitudine tirannica e un bisogno inquieto, sì
che poi non diventi loro impossibile di staccarsi un minuto
l'un dall'altro; e insegnar loro a padroneggiarsi così da
bastare l'uno all'altro, anche colla sola memoria, quando
l'un d'essi è lontano! (Aristot., Econom., i, 4). — Però il
mio Fània meritava le attenuanti, se i moniti di Aristotile
(ch'era in que' giorni un bambino) non eran fatti per lui.

109.
«’Ὀλβιε γαμβρ’ ἀγαθός τις ἐπέπταρεν ἐρχομένῳ τοι». O
felice sposo, qualche buon genio a te veniente sternutò.
Teocr., Id., 18. — Hoc ut dixit amor, sinistra ut ante —
dextra sternuit adprobatione. Catullo. — Sullo sternuto, or
buono or cattivo augurio, cfr. note Alcibiade, 157.

110.
Cfr. Schömann. Ant. greche; Lallier, La femme dans la
famille athénienne. — Teofr., Caratt., 22.

111.
Siam le nipoti di Teseo e non siam le schiave dei mariti.
Cfr. in Senofonte le ammirabili pagine (Econom., vii) dove
Iscomaco spiega alla sua sposa giovinetta i doveri e i diritti
della moglie; e com'ella non dee considerarsi la schiava,
bensì la compagna del marito, e avente ella stessa nel
domestico governo la sua parte di sovranità. (Econ., vii, 13
e seg.) E con che delicata e viva imagine, Iscomaco
paragona questa sovranità della moglie nella casa a quella
della regina delle api; e come insiste mostrando alla donna
sua gli uffici del marito e della moglie, essere diversi ma
grandi del pari, «si da non potersi discernere chi vaglia più
la donna o l'uomo!» «E finalmente — ei le soggiunge —
cosa sopra tutte le altre dolcissima, quando nel
compimento degli uffici tuoi, ti farai conoscere di maggior
valore che non son io, tu ti valerai, o moglie mia,
dell'opera di me, come di un tuo ministro; nè dubiterai che
nel tempo avvenire abbi ad essere meno riverita». Econ.,
vii, 41-2. Siamo già evidentemente nelle idee ben lontani
dalla posizione umiliante e servile assegnata alla donna di
famiglia nella antica legislazione ateniese! È vero che al
tempo di Senofonte, tra questo ideale e la generalità del
costume, del divario ancora ne poteva e ne doveva
correre: ma la parola dell'epoca è detta e la nuova
missione della donna della famiglia è cominciata. Verrà tra
breve Aristotile a paragonare i diritti della sposa coi diritti
sacri e augusti del supplice che ha deposto il ramo d'olivo
sull'ara domestica, e che acquista con ciò verso il marito i
privilegi della inviolabile ospitalità. (Arist., Econ., i, 4). E
verranno tra breve i comici della commedia nuova a
lamentarsi delle usurpazioni di autorità commesse dalle
mogli sui mariti, e a far ridere il pubblico alle spese dei
mariti tiranneggiati!

112.
E Temistocle ateniese stava sotto alla moglie. «Diceva
Temistocle scherzando che suo figlio, ancora piccino, era il
più potente di tutti i Greci. Gli Ateniesi comandano ai
Greci; io comando agli Ateniesi; sua madre comanda a
me, e lui comanda a sua madre». Plut., Temist., 18; cfr.
Plut., Prec. matrim. — E in una commedia di Menandro:
«Ecco un uomo di cui ognun vanta la felicità in piazza: ma
appena varcata la soglia di casa sua, è il più infelice di
tutti. Sua moglie è la padrona di tutto: essa comanda e
litiga senza posa». Menandro, Piloti, fr. 2.
113.
Vedi la legge citata nel Prologo, pag. 26.

114.
Il fratello consanguineo succede in diritto al padre nel
disporre della sorte dell'orfana da maritare. V. sopra nota
10. — Cfr. Demost., C. Onetore, 865, 866; C. Eubulide,
1311; C. Beoto, ii, 1010. Iseo, Eredità di Mènecle, § 5-9.

115.
Colombi di Sicilia, allevati e tenuti in pregio nelle case
ateniesi. Teofr., Caratt., 5.

116.

’Εὰν δὲ κινήσῃ μόνον τὴν Μυρτίλην


ταύτην τις, ἢ τιτθὴν καλᾖ, πέρας οὐ ποιει
λαλιᾶς. τὸ Δωδοναῖον ἄν χαλκίον,
ὃ λέγουσιν ἠχεῖν, ἀν παράψηθ’ ὁ παριών,
τὴν ὴμεραν ὅλην. καταπαύσαι θᾶττον ἢ
ταύτην λαλοῦαν˙ νύκτα γὰρ προσλαμβάνει.

Menandro, La suonatrice di flauto. (’Αῤῤ ήφορος ἤ


αὐλητρίς) pr. Stef. Biz. — Mein., Fr. Com. gr., iv, 89.

117. Le arie di alterigia e le pretese che le ricche ereditiere


recavan seco insiem con la dote nella casa maritale
doveano realmente dar non poco fastidio ai signori mariti
ateniesi, se fornirono così larga materia agli scrittori comici
della antica commedia e della nuova (le imitazioni di
Terenzio comprese): dove si incontrano ad ogni piè
sospinto le lamentazioni dei poveri mariti.

Εἴθ’ ὤφελ’ ὴ προμνήστρι’ ἀπολέσθαι κακῶς


ἥτις με γῆμ’ ἐπῆρε τὴν σὴν μητέρα
«Ahi, fosse perita di mala morte la pronuba che m'indusse
a sposar la madre tua!» Aristof., Nubi, v. 41. «Oh Dei! che
sproposito ho io mai fatto a sposar per i suoi sedici talenti
questa Crobila, una donnicciuola alta un cubito! È mai
possibile di sopportare una tanta arroganza? Per Giove
Olimpo, e per Minerva, ohibò!» Menandro, La collana
(πλόκιον), pr. Aul. Gel., ii. — Mein., Fr. Com. gr., iv, 189.
«Questa vita del matrimonio m'è odiosa! — Perchè l'hai
presa per il cattivo verso... Se passi il tempo a lagnarti de'
suoi guai, senza mettere in bilancia i compensi, ti desolerai
eternamente». Men., L'odiator delle donne (Μισογόνης) pr.
Stob., lxix. — Mein., Fr. Com. gr., iv, 164. «Han fatto bene a
dipinger Prometeo inchiodato allo scoglio... È lui che ha
creato le donne... Una donna è migliore a sotterrarsi che a
sposarsi». Menandro, fram. inc. — Mein., Fr. Com. gr., iv,
228. «Maledetto il primo che inventò di prender moglie! E
poi il secondo, e il terzo, e il quarto e tutti quelli che
l'imitarono!» Menand., La ragazza bruciata. (’Εμπιπραμένη)
pr. Aten., xiii. — Mein., Fr. Com. gr., iv, 114.
E la litania dei lamenti non finisce qui: vedine qui sotto
degli altri (note 39, 41, 42): e potrei aggiungerne ancora:
ma pare che bastino.

118.
τὰ τῆς γῆς ἀγαθά. — Alcifr., Lett., ii, 3.

119.
’Ὲχν δ’ἐπίχληρον Αάμιαν «Ho (sposato) una strega con la
dote (esclama lamentosamente in Menandro un vecchio
marito): non te l'ho già detto? Non te l'ho già detto? Casa
e campi mi vengono da lei: e m'è toccato per averli di
prendere anche lei insieme: e questo, o Apollo, è il peggior
dei mali!» Men., La collana (Πλόκιον), pr. Aul. Gel., i. —
Mein., Fr. Com. gr., iv, 191.
120.
Plutarco. Proverbii — E poco diverso dai Greci diciamo
anche noi: chi sprezza vuol comprare.

121.
Terenzio, Formione: «Nausistrata. In verità mio marito
amministra senza una cura al mondo i poderi bene
acquistati dal padre mio: chè egli ne ricavava, senza
manco, due talenti l'anno d'argento: vedete che differenza
da uomo ad uomo! — Demifone. Due talenti! — Nausis.
Proprio! due talenti! e sì le derrate non valeano uno per
cento d'adesso». v. 788-790. — Cfr. sopra, nota 37,
framm. del Πλόκιον.

122.
Πατρῷ’ ἒχειν δεῖ τὸν χαλῶς εύδαιμονα «Fortunato quegli
che è ricco dell'eredità del padre! poichè delle cose che
entrano in casa colla moglie il possesso non è nè sicuro nè
allegro». Men., inc. fab., fr. 54. «Se siete povero e sposate
una donna ricca, vi pigliate una padrona e non una
moglie: vi riducete alla condizione di essere a un tempo e
servo e povero». Anassandride, incert. fab. «O tre volte
infelice chiunque essendo povero conduce moglie!» Men.,
Πλόκιον, pr. Stob., lxviii. «Alla fronte superba e alle sue
arie tutti si voltano a guardar Crobila: poichè è ben nota
mia moglie, dalla ricca dote, o piuttosto la padrona che mi
possiede!» Men., Πλόκιον, pr. Aul. Gel., ii, 23. «La moglie
di lui è la padrona di tutto: essa comanda e lo strapazza
senza posa». Men., Piloti, (Κυβερνῆται).

123.
«Ma il nostro tesoro è stato carboni (ἄνθρακες ὸ θησαυρὸς
ἦσαν) come dice il proverbio». Luciano, Zeusi. «Se sapessi
ch'ella ha rivolto ad altri il suo amore, tutti i tesori mi
diventerebbero cenere». Alcifr., Lett., ii, 3.
124.
Cfr. Aristof., Nubi, v. 71.

125.
Disposizione degli attori in iscena:
Aglae, Crìside — Cròbilo, Fania.

126.
V. un frammento dei tempi della commedia di mezzo in
Eubulo, Χρύσιλλα. — Mein., Frag. Com. græc., iii, 260. —
Cfr. in Aristofane, Tesmofor., v. 545-550: ed Euripide,
Androm., Jon, Ippolito, Alceste, ecc.

127. V. un frammento di un altro poeta della commedia di


mezzo: «L'uomo è animale infelice per natura, ma ha
trovato a' suoi dolori questo conforto (il teatro): poichè la
mente, dimentica dei propri mali nel compatire i mali
altrui, vi si diletta e si istruisce insieme. Vedi prima, se
vuoi, i tragici come giovano a tutti! Imperocchè il povero
venendo a sapere che vi è stato Telefo più povero di lui,
già più facilmente sopporta la mendicità; l'infermo per
qualche insania considera Alcmeone; oppur soffre di
oftalmia? I figli di Fineo sono ciechi. Morì il figlio al padre?
Niobe lo consola. O qualcuno e zoppo? Si specchia in
Filottete. O un altro è vecchio e sfortunato? Lo ammaestra
Eneo. Qualunque cosa infine uno soffra, maggiori
stimando le altrui calamità, meno delle proprie si lagna».
Timocle, Le Baccanti (Αιονυσιάξουσαι), pr. Stob., Flor., 124.
— Mein., Frag. Com. græc. III. 592. Al quale frammento di
Timocle, G. Guizot, nello studio su Menandro (pag. 135),
contrappone lo scherzo di Voltaire nella novella Les deux
consoles: «Songez à Hécube, songez à Niobé, dit le
philosophe — Ah, dit la dame, si j'avais vecu de leur
temps, et si, pour les consoler, vous leur aviez conté mes
malheurs, pensez vous qu'elles vous eussent ecouté?».
128.
ὢμοι... ὢμοι, Eschilo, Agamenn. v. 1343-5.

129.
λίοπη γλῶσσα (Aristof., Rane, v. 826), lingua scortecciata
ossia senza pelo dicevano anche i Greci, allo stesso modo
nostro, di chi sa bene adoperarla.

130.
«Io mi mostrerò forte e coraggioso e guardante l'orìgano»
βλέποντ’ ὀρίγανον, Aristof., Rane, v. 602: ossia guarderò
torvo e brusco. Modo proverbiale, derivato fra i Greci
dall'odor acre di quell'erba.

131.
Su le pretese e il bisticciare e il rimbrottar continuo con
che le mogli dotate molestavano i mariti, vedemmo
abbondare in Menandro e ne' comici della commedia
nuova gli esempi. — Cfr. Lallier, La femme dans la famille
athénienne. — Benoit, Sur la Comédie de Ménandre.

132.
«A quella di noi donne che partorisse un uomo utile alla
città, legislatore o capitano, era giusto le si desse qualche
premio, e il primo seggio nelle feste Stenie e nelle Scire, e
nelle altre che noi donne sogliamo celebrare». Aristof.
Tesmof., v. 834. «Tu lampada sarai a parte dei presenti
consigli, che furon presi dalle amiche mie nelle feste
Scire». Aristof. Eccles., v. 18. Si celebravano dalle donne
in onor di Minerva le Scire o feste dell'ombrella, ai dodici
del mese detto appunto sciroforione (giugno-luglio), sulla
via da Atene a Sciro ov'era il tempio di Minerva Scirade. Il
sacerdote portava nella processione un ombrello bianco.
133.
«Che mai di buono farem noi donne, noi che sediamo con
chiome tinte di biondo, portiam tuniche color di croco, e
siam cariche di ornamenti e vestiam cimberiche a strascico
(κιμβερίκ’ ὸρθοστάδια) e peribàridi ai piedi?» Aristof.,
Lisistr., 45. — τὼ Περσικά, ibid., 230. Eran calzari di gala,
alla persiana.

134.
Eurip., Medea, Androm. — Anassandride, Inc. fab. Vedi
avanti la nota 69.

135.
Simili al bisso (ch'era una specie di tessuto di lino) ma
assai più fini erano i tessuti rinomati che l'isola di Amorgo
forniva per certe tonache o camicie di donna, di
straordinaria finezza e trasparenza, e che dal luogo
d'origine si chiamavano ἀμόργινα. Aristof., Lisistr., v. 150;
Scol. in Eschine, C. Timarco, 97.

136.
Sotto il nome di Colìade (dal borgo attico di Colias ov'era il
tempio) e di Genetìllide (come preside agli atti sessuali)
avea Venere speciali onoranze di riti lascivi femminili. «Se
alcuno le avesse convocate (le donne) nel tempio di Pane,
di Venere Colìade o di Genetìllide, non si potrebbe più
passare per la gran copia dei timpani». Aristof., Lisistr., v.
1 seg. «Sposatala, giacevo con lei che olezzava di
unguento di croco, di baci con la lingua tra le labbra, di
ghiottornie, di Colìade e di Genetìllide». Aristof., Nubi, v.
41 seg.

137. Era devoluta ai tesmotéti (gli ultimi sei de' nove arconti)
oltre la presidenza de' giudizi, de' comizi elettorali, ecc.,
anche la sorveglianza dell'ordine e della quiete pubblica.
Per che di notte l'uno di essi per turno andava in ronda per
la città. Vedi Ulpiano, nei Commenti a Demostene, orazione
Contro Midia: e fu probabilmente durante il suo giro di
ispezione, che il tesmoteta di cui ivi si parla, per essersi
inframmesso in un parapiglia, a soccorso di un suonatore,
toccò la sua parte di bastonate.

138.
Per brevità, nella recita, da questo punto si ometta il brano
di scena che segue, da qui saltando addirittura a pag. 123,
alle parole di Cròbilo:
Cròb. (sotto voce ad Aglae che s'allontana con Mìrtala) Mi
raccomando non le mostrar tutta la guardaroba, ecc.

139.
«Fanciulla di sette anni, portai nella processione di Minerva
i sacri arnesi; di dieci, macinai l'orzo di Minerva nostra
signora; poi, vestita dell'abito color di croco, simboleggiai
l'orsa di Diana nelle feste Brauronie; quindi, fatta fanciulla
leggiadra, portai il canestro sacro con un monile di fichi
secchi al collo». Aristof., Lisistr., 641 seg. In queste parole
della Lisistrata è brevemente riassunta la prima
educazione delle fanciulle ateniesi di distinta nascita.

140.
Cfr. Aristof., Vespe, 103-4; 850. Rendevano i giudici, come
s'è detto, le sentenze ne' giudizi in varie forme, oltre
quelle dei ciottoli neri e bianchi, o delle palline forate ed
intere (v. Prologo, nota 52). Era anche uso segnar la
condanna col tirar righe lunghe sulla cera delle tavolette.
Questo però non toglieva l'uso de' ciottoli o delle
pallottole, necessario a ogni modo, per lo scrutinio de'
voti: come vedi nel passo citato delle Vespe: «e per
severità tirando una lunga riga in segno di condanna,
rientra in casa con le unghie impiastricciate di cera: e
temendo gli vengano meno i ciottoli, per aver modo di
dare il voto, mantiene in casa un litorale». v. 103 seg.
141.
Sul banchetto funebre che, in onor dell'estinto, al nono e
al trigesimo giorno dalla morte, celebravasi, in vesti
bianche di lutto, da' parenti suoi, cfr. Iseo, Eredità di
Cirone; Demostene, Corona; Polluce, i, 7, ecc. La
trascuranza ne' figli, delle onoranze funebri ai genitori era
punita dalle leggi e portava seco interdizione civile. Senof.,
Memorab.

142.
Iseo, Ered. Pirro, § 64. Cfr. Prologo, pag. 27.

143.
Le deposizioni degli schiavi nei giudizi, non erano assunte
e tenute valide come prove, se non estorte coi tormenti
(βασανίξειν) dagli inquisitori a ciò destinati (βασανισταὶ),
in presenza dei rappresentanti delle parti che scrivevano il
deposto per unirlo agli atti. Ε βάσανος dicevasi, oltre il
supplicio, anche la deposizione de' servi col supplicio
strappata: a differenza di μαρτυρία ch'era la testimonianza
de' liberi. (Potevano in casi eccezionali anche i liberi
cittadini esser posti a tortura, ma solo per espresso
decreto del popolo: così Mantiteo e Apsefione, senatori, a
stento la scansano, abbracciando supplici l'altare. Andoc.,
Misteri). Quello dei contendenti che vi aveva interesse
provocava a ciò l'avversario (πρόκλησις εὶς βάσανον)
esibendo di dare ai tormenti i proprî schiavi o disfidando
l'avversario a dare i proprî. Accettar la provocazione o
richiesta non era obbligo: ma ricusarla induceva
presunzione sfavorevole al ricusante. «Voi tutti sapete che
le provocazioni furono create per quelle cose che non si
possono produrre innanzi a voi. Quando non può farsi
investigazione innanzi a voi, ha luogo per via di tormenti la
provocazione». Demost., i, C. Stef. «Io gli chiesi pei
tormenti tre sue ancelle informate del fatto e dei danari
che Afobo e la donna possedevano: acciocchè a

You might also like