O'Reilly - Java and XML 2nd Edition - Brett McLaugblin.pdf

(2491 KB) Pobierz
XML & Java 2nd Edition
Java & XML, 2nd Edition
Java & XML, 2nd Edition
Brett McLaughlin
Publisher: O'Reilly
Second Edition September 2001
ISBN: 0-596-00197-5, 528 pages
New chapters on Advanced SAX, Advanced DOM, SOAP and data binding, as well as new
examples throughout, bring the second edition of Java & XML thoroughly up to date. Except
for a concise introduction to XML basics, the book focuses entirely on using XML from Java
applications. It's a worthy companion for Java developers working with XML or involved in
messaging, web services, or the new peer-to-peer movement
1
184550180.001.png 184550180.002.png
Java & XML, 2nd Edition
2
Java & XML, 2nd Edition
Table of Contents
Preface ___________________________________________________________7
Organization ________________________________________________ 7
Who Should Read This Book? ___________________________________9
Software and Versions ________________________________________ 9
Conventions Used in This Book ________________________________ 10
Chapter 1. Introduction ________________________________________11
1.1 XML Matters ____________________________________________ 11
1.2 What's Important?________________________________________ 12
1.3 The Essentials __________________________________________ 14
1.4 What's Next?____________________________________________ 16
Chapter 2. Nuts and Bolts ______________________________________17
2.1 The Basics _____________________________________________ 17
What's with the Space Before Your End-Slash, Brett? _______22
2.2 Constraints _____________________________________________ 26
2.3 Transformations _________________________________________ 32
2.5 What's Next?____________________________________________ 38
Chapter 3. SAX __________________________________________________39
3.1 Getting Prepared ________________________________________ 39
3.2 SAX Readers ___________________________________________ 40
3.3 Content Handlers ________________________________________ 46
3.4 Error Handlers __________________________________________ 58
3.5 Gotcha! ________________________________________________ 62
3.6 What's Next?____________________________________________ 65
Chapter 4. Advanced SAX ______________________________________67
4.1 Properties and Features ___________________________________ 67
4.2 More Handlers __________________________________________ 72
4.3 Filters and Writers________________________________________ 77
4.4 Even More Handlers ______________________________________ 83
4.5 Gotcha! ________________________________________________ 87
4.6 What's Next?____________________________________________ 89
Chapter 5. DOM _________________________________________________90
3
Java & XML, 2nd Edition
5.1 The Document Object Model _______________________________ 90
5.2 Serialization ____________________________________________ 93
5.3 Mutability______________________________________________ 104
5.4 Gotcha! _______________________________________________ 104
5.5 What's Next?___________________________________________ 106
Chapter 6. Advanced DOM ____________________________________107
6.1 Changes ______________________________________________ 107
6.2 Namespaces ___________________________________________ 116
Overloaded? ___________________________________________________117
6.3 DOM Level 2 Modules ___________________________________ 119
6.4 DOM Level 3 ___________________________________________ 131
6.5 Gotcha! _______________________________________________ 134
6.6 What's Next?___________________________________________ 135
Chapter 7. JDOM _______________________________________________137
7.1 The Basics ____________________________________________ 137
7.2 PropsToXML ___________________________________________ 140
7.3 XMLProperties _________________________________________ 149
7.4 Is JDOM a Standard? ____________________________________ 159
7.5 Gotcha! _______________________________________________ 159
7.6 What's Next?___________________________________________ 161
Chapter 8. Advanced JDOM ___________________________________162
8.1 Helpful JDOM Internals___________________________________ 162
8.2 JDOM and Factories_____________________________________ 166
8.3 Wrappers and Decorators_________________________________ 170
8.4 Gotcha! _______________________________________________ 181
8.5 What's Next?___________________________________________ 183
Chapter 9. JAXP ________________________________________________184
9.1 API or Abstraction_______________________________________ 184
9.2 JAXP 1.0______________________________________________ 185
9.3 JAXP 1.1______________________________________________ 191
9.4 Gotcha! _______________________________________________ 199
9.5 What's Next?___________________________________________ 200
Chapter 10. Web Publishing Frameworks ____________________202
10.1 Selecting a Framework __________________________________ 203
10.2 Installation____________________________________________ 205
4
Java & XML, 2nd Edition
10.3 Using a Publishing Framework ____________________________ 209
10.4 XSP_________________________________________________ 221
10.5 Cocoon 2.0 and Beyond _________________________________ 234
10.6 What's Next?__________________________________________ 236
Chapter 11. XML-RPC __________________________________________237
11.1 RPC Versus RMI ______________________________________ 237
11.2 Saying Hello __________________________________________ 239
11.3 Putting the Load on the Server ____________________________ 249
11.4 The Real World ________________________________________ 262
11.5 What's Next?__________________________________________ 264
Chapter 12. SOAP ______________________________________________265
12.1 Starting Out___________________________________________ 265
12.2 Setting Up ____________________________________________ 268
12.3 Getting Dirty __________________________________________ 271
12.4 Going Further _________________________________________ 278
12.5 What's Next?__________________________________________ 286
Chapter 13. Web Services _____________________________________288
13.1 Web Services _________________________________________ 288
13.2 UDDI ________________________________________________ 289
13.3 WSDL _______________________________________________ 290
13.4 Putting It All Together ___________________________________ 291
13.5 What's Next?__________________________________________ 307
Chapter 14. Content Syndication _____________________________308
14.1 The Foobar Public Library _______________________________ 308
14.2 mytechbooks.com______________________________________ 316
14.3 Push Versus Pull ______________________________________ 324
14.4 What's Next?__________________________________________ 332
Chapter 15. Data Binding _____________________________________333
15.1 First Principles ________________________________________ 334
15.2 Castor _______________________________________________ 338
15.3 Zeus ________________________________________________ 345
15.4 JAXB ________________________________________________ 352
15.5 What's Next?__________________________________________ 358
Chapter 16. Looking Forward _________________________________360
16.1 XLink ________________________________________________ 360
5
Zgłoś jeśli naruszono regulamin