DescriptionWhat is this book about?
Extensible Markup Language (XML) is a rapidly maturing technology with powerful real-world applications, particularly for the management, display, and organization of data. Together with its many related technologies it is an essential technology for anyone using markup languages on the web or internally.
This book teaches you all you need to know about XML — what it is, how it works, what technologies surround it, and how it can best be used in a variety of situations, from simple data transfer to using XML in your web pages. It builds on the strengths of the first edition, and provides new material to reflect the changes in the XML landscape — notably SOAP and Web Services, and the publication of the XML Schemas Recommendation by the W3C.
What does this book cover?
Here are just a few of the things this book covers:
- XML syntax and writing well-formed XML
- Using XML Namespaces
- Transforming XML into other formats with XSLT
- XPath and XPointer for locating specific XML data
- XML Validation using DTDs and XML Schemas
- Manipulating XML documents with the DOM and SAX 2.0
- SOAP and Web Services
- Displaying XML using CSS and XSL
- Incorporating XML into tradition databases and n-tier architectures
- XLink and XPointer for linking XML and non-XML resources
Who is this book for?
Beginning XML, 2nd Edition is for any developer who is interested in learning to use XML in web, e-commerce or data-storage applications. Some knowledge of mark up, scripting, and/or object oriented programming languages is advantageous, but not essential, as the basis of these techniques are explained as required.
Chapter 1: What is XML?
Chapter 2: Well-Formed XML.
Chapter 3: XML Namespaces.
Chapter 4: XSLT.
Chapter 5: Document Type Definitions.
Chapter 6: XML Schemas.
Chapter 7: Advanced XML Schemas.
Chapter 8: The Document Object Model (DOM).
Chapter 9: The Simple API for XML (SAX).
Chapter 10: SOAP.
Chapter 11: Displaying XML.
Chapter 12: XML and Databases.
Chapter 13: Linking and Querying XML.
Case Study 1: Using XSLT to Build Interactive Web Applications.
Case Study 2 - XML Web Services.
Appendix A: The XML Document Object Model.
Appendix B: XPath Reference.
Appendix C: XSLT Reference.
Appendix D: Schema Element and Attribute Reference.
Appendix E: Schema Datatypes Reference.
Appendix F: SAX 2.0: The Simple API for XML.
Appendix G: Useful Web Resources.
|42||Adding Attributes to Als CD |
In this example, the code and the screenshot do not agree. Single quotes are used around the values of the attributes we are asked to add in the code but double quotes appear in the screenshot. As either single or double quotes are acceptable for attributes, either can be used but IE will display whichever you use in the code ordinarily.
Also, the How It Works for this example on Page 43 describes adding the first attribute without quotes and then receiving an error message in IE as the parser finds this error - this step is not described in the Try It Out section.
Thanks to Howard for spotting this.
|49||Incorrect Screenshot |
The screenshot on page 49 is incorrect and does not represent how the file cd4.xml will look when viewed with Internet Explorer 5 or later. It is the one on page 47 repeated.
The correct screenshot (named cd4xml.jpg) is available within the code download for this book.
It shows the inclusion of the
Thanks to Silhone Sung
|84||Unseen members of namespaces list|
At the top of page 84 we give a list of namespaces and introduce them as having been seen before in the chapter. In fact, only the pers namespace has been seen before.
The text surrounding the list can be reworded to read:
Imagine we choose to create three namespaces for Serna Ferna Inc:
We could instead create one namespace which the company would use for all of its XML document types. Or, conversely, we could break down or namespaces down further, perhaps splitting the <person> document type into multiple namespaces. Why did we choose three?
|4||88||Incorrect URL for the Java Version of Xalan|
The correct URL for the download of Xalan for Java is:
|94||"given" should be "quantity" |
The second paragraph on page 94 incorrectly states that the template shown on page 93 will be applied for any elements named given . In fact it should be quantity .
|94||Incorrect example |
The explanation of the example given to illustrate the use of the <xsl:value-of> element does not agree with the example code. The code uses the <quantity> element, whereas the explanation uses <first>.
|94||Incorrect backwards reference to CSS|
In the 'Associating Stylesheets with XML Documents Using Processing Instructions' section, there is an erroneous backwards reference to CSS. At this stage in the book we haven't covered this in detail (please see Chapter 11 where this discussion does take place).
|4||104||Incorrect font used|
The formatting of the last 2 words on the page should have been the other way around. At present, the word axis is formatted to indicate that it is the name of an axis when, in fact, the name of the axis is attribute.
|111||Missing closing slashes|
In both code fragments in the <xsl:apply-templates> section of the page, the <xsl:apply-templates> elements are missing the closing slash required to make the fragments well formed XML.
|4||127||Header missing from ElemsToAtts.xsl |
The line is missing from the top of the ElemsToAtts.xsl stylesheet created in stage 4 of the Try It Out example.
|131||Location of order.xml code|
The code for order.xml is shown on pages 99-100, but it's easy to miss as it's not used in any Try It Out example until we get to this page.
|132||Try It Out - Default Template Gotchas |
n step 3, the command to run the file should be:
|134||Erroneous element in code|
The code for the <xsl:choose> example does not match the text. The code shows the use of the <salary> element rather than the <number> element discussed.
|4||140||Wrong function name in stylesheet|
On page 123 the stylesheet AttsToElems.xsl is shown. This stylesheet is reshown on page 140, however there is a difference. In the last template of the stylesheet on page 123 the local-name() function is used, but in the last template of the same stylesheet on page 140 the name() function is used. This should still work but the name should not have changed from page 123. Thanks to Michael O' Sullivan for bringing this to our attention
|194||Incorrect NMTOKENS example|
The first line of code on page 194 should read:
|260||Incorrect example for date datatype|
The value 05-07-1995 has been given as a valid example of date datatype value.
|278||Extending simpleType Definitions|
The second of the examples showing valid code according to the element declaration earlier in the page contains an error - the attribute name, gender, is missing.
|7||293||Incorrect Namespace Prefix |
Page 293 shows the following code snippet: <artist title= Mr > <name:first>Alfred</name:first> <name:middle>middle</name:middle> <name:last>Yankovic</name:last> </artist> The namespace prefix of name: used here is incorrect. This namespace prefix is declared in the root element of the instance document as n: and not name: so this code snippet should be: <artist title= Mr > <n:first>Alfred</n:first> <n:middle>middle</n:middle> <n:last>Yankovic</n:last> </artist> Note that this also means the very last sentence at the bottom of the page needs the reference to the 'name' prefix changed to n. In other words this last sentence should read: 'therefore we must qualify them with the n prefix we declared in the root element of our instance document'. Thank you Michael O' Sullivan for bringing this to our attention.
|324||Incorrect Screenshot |
Unfortunately the first screenshot on this page is a repeat of the second one.
|353||Minimal Parsing Using Sax |
In the Try It Out section beginning on page 352 the java listing in step 2 fails to include the statement:
|441||em should be i |
The second code block on the page does not correspond with the first. It shows the use of em in a container relationship, instead of i . The code should read:
|476||Incorrect field name in diagram |
In the first diagram on the page, which shows the CorporateCustomer table, the third field name is incorrect.
|552||Running the Address Book Application and Tomcat 4.0.2 |
Unfortunately, the latest release of Tomcat, Tomcat 4.0.2, has changed XML parsing capabilities and class loading methods from the release that was current at the time the book was written. This means that if you have Tomcat 4.0.2 you will need to carry out some extra steps in order to run the address book application sucessfully (this is because the code was designed to run with an earlier version).