XML Files
Page
International Technical Support Organization
First Edition December
Contents
XML Collection
Contents
Part 4. Appendixes
Abbreviations and acronyms
Page
Copyright License
Trademarks
Cics
Preface
Team that wrote this redbook
Page
Become a published author
Comments welcome
Page
Part
Page
XML overview
XML concepts
Background
XML business benefits
Information sharing
XML within an organization
Technical benefits of XML
XML in new innovations
Voice XML
Scalable Vector Graphics
Acceptability of use for data transfer
Uniformity and conformity
Simplicity and openness
Separation of data and display
XML history
Extensibility
Industry acceptance
XML1.0
Xslt and Web applications
Web Tier
Web services and XML
Interaction of Web services
XML, W3C, and IBM
Recommendations
Working drafts in development
Page
Technologies in XML
XML Processor parser
Tree-based parsing
DTD and XML Schema
Event-based parsing
Page
Schema and style using CSS, XSLT, and XSL
Cascading Style Sheet CSS
XML namespaces
Example 2-1 a namespace example
Example 2-2 a namespace example using namespace prefix
Link and jump using XLink, XPointer, and XML Base
Example 2-3 a simple link
Example 2-4 An extended link
Example 2-5 An example of extended links using xbase
XML Base
XML Pointer
XPointer paths and steps
XPointer range functions
XPointer string functions
XPath
Example 2-6 An XPath example
XML digital
Book Library
Technologies in XML
Examples of XML encryption
Example 2-7 Information on passenger John Smith
Example 2-8 Encrypted Information on passenger John Smith
Example of a XML digital signature
Example 2-9 Encrypting only the credit card number
Example 2-10 Encryption of the whole document
Transforms
Example 2-11 An XML digital signature
Example 2-12 Part encryption of an XML document
Example 2-13 The final XML document after encryption
Other security specifications
XML query language
Path expressions
Element constructors
FLWRFOR, LET, Where and Return clauses expression
Conditional expressions if then Else
Quantifiers
Filtering
Example schema for relational database and Xquery comparison
Querying relational data
Grouping in XQuery
Joins
Xslt compilers Xsltc
Xslt interpreters
For more details, visit Using XSLTCThe Apache XML Project at
Java Architecture for XML Binding Jaxb
Cocoon
Generators and reader pipeline inputs
Transformers and actions processing steps
Serializer pipeline outputs
Matchers and selectors conditional processing
Sitemap
Example 2-14 Sample sitemap for Cocoon
Example 2-15 Components of a sitemap XML file
Part 2 XML technology in IBM WebSphere
Page
Processing XML
XML applications
Xalan
Xalan model of operation
SAX2
Javax.xml.transforms interfaces operation
Example 3-1 Sample XML document
Example 3-2 Sample event breakdown
SAX2 classes and interfaces
XML namespace support
Example 3-3 SAX2 callback methods
Example 3-4 Sample namespace
DOM level2
DOM hierarchy
Example 3-5 Sample XML document
Sample generated DOM tree
Jaxp
Using Jaxp
Example 3-6 Sample XML to Html transformation code
Xslt support packages in Jaxp
Stylesheet compilation
Introduction to IBM WebSphere Application Developer
WebSphere Studio product family
WebSphere Studio family
WebSphere Studio Site Developer Advanced
WebSphere Studio Application Developer
WebSphere Studio Application Developer Integration Edition
WebSphere Enterprise Developer
Tools
Web development tools
Relational database tools
XML tools
Web services development tools
Java development tools
EJB development tools
Team collaboration
Debugging tools
Server tools for testing and deployment
Performance profiling tools
Plug-in development tools
Plug-in project
Fragment project
Plug-in component
Application Developer XML Tools
XML perspective
Window-Open Perspective-XML
XML perspective editors
XML editor
Creating an XML file from scratch
Select the option Create XML file from scratch
Editing an XML file
XML editor
DTD editor
Validating the XML file
Creating a DTD from scratch
Using the Outline view to add DTD components
DTD Editor
Creating a schema from scratch
XSD editor
Validating DTD
Using the Outline view to add schema components
XML Schema Editor
Pop-up on schema file in the Outline view
Making changes and referential integrity
Validating schema
Namespace
XSL editor
Creating an XSL file from scratch
Namespace support
Editing an XSL file
Validating the XSL file
Indicate all local elements to be qualified
XPath support
XPath Builder
10 XPath definition
11 XPath Operators
12 XPath functions
XSL debugger
13 XPath Query Result screen
14 XSL Debugger
Web services support
Web Service Dadx group configuration wizard
Web service wizard
Application Developer XML Tools
Page
RDB and XML integration
101
SQL to XML wizards
Passenger List Select statement
SQL to XML wizard panel
Show table column as option
XML and XSL files
Example 6-1 XSL file for Show table columns as ‘Elements’
Html
XML file generated with the Elements option
Html file
Html with the ‘Recurse through foreign keys’ unchecked
Html generated for Foreign key as links option
XML Schema file
Aircraft Html generated for ‘Foreign key as links’ option
RDB and XML integration
076/schema
Sequence
Example 6-4 XML Schema for Aircraft table
DTD file
Page
Query template file
Flight Cdata #REQUIRED
Statement Options
XML to SQL wizard
Example 6-9 Customer.xml
XML to SQL wizard Selecting the connection
10 XML to SQL wizard Selecting Schema and Action
DDL to XML Schema wizard
11 XML to SQL wizard Selecting the column
12 Generate XML Schema
Example 6-10 XML Generated through the DDL to XML Schema
Restriction base=string length value=30 SimpleType Element
Example 6-11 XML Schema for a single table using a Select
DB2 XML Extender
XML Extender
13 shows an overview of the XML Extender
Administrative support tables, UDTs, and UDFs
Administrative support tables created
UDTs created
Stored Procedures created
UDFs created
DTD Repository
Document Access Definitions DAD
Example 6-12 DTD representation of a book
Page
When to use XML Column method
XML Column method
Elements/attributes
As is xml document
XML Collection
When to use XML Collection method
15 XML Collection Method overview
Mapping schemes for XML collections
Example 6-14 Sample DTD
SQL mapping
Employee table in Sample database
Column name Data type
Empact Table in Sample database
RDBnode for the top elementnode
Example 6-16 The RDBnode
XML Extender administration tools
RDBnode for each attribute and textnode
Example 6-17 RDBnode mapping
XML MQSeries enablement
RDB and XML integration
Page
145
Select passengerList.dtd Right-clickGenerate-XML Schema
DTD XSD
Click Finish
XML DTD/XSD
Create an XML file from a DTD file
Create an XML file from an XSD file
Create DTD/XSD files from XML
Select Select file from Workspace option
Select passengerList.xsd Right-clickGenerate-XML File
Example 7-1 Customer.xml
Select Customer.xml Right-clickGenerate-XML Schema
Select customer.xml Right-clickGenerate-DTD
Example 7-2 Customer DTD
Generate a Html from an XSD
Select passengerList.xsd file Right-clickGenerate-HTML Doc
Example 7-3 Customer.xsd
JavaBeans from DTD/XSD
Click File-New-Project
Select J2EE Web Application Project. Click Next
Generate XML/XSL from JavaBeans
Select passengerList.xsd Right-clickGenerate-JavaBeans
Select Generate sample test program. Click Finish
Example 7-4 passenger.java
Page
Click File-New-Java Bean XML Client
Input XML Form screen
Generate XML/XSL from Html
Click File-New-Other
Preparing the Html file for generation
Adding annotation tags
Example 7-5 cus-template.xhtml
Select cus-template.xhtml Right-clickGenerate-XSL File
Select Customer.xhtml. Click Next
Example 7-6 Customer.xml
Page
Part 3 XML application development
161
Page
WebSphere and XML approaches
163
XML in Application development
Web services
Passenger List application
Solution Outline
Web Services
Servlet
XML in this application
Client Web Tier
Technical implementation overview
Development and running of the Passenger List application
Page
Advantages of using the database
Discussion
Enterprise JavaBeans
Interprise Application Server
Customer Registration application
Technical overview
Page
Developing XML Web services
177
Creating the Web tier
Servlet
Create the Airline simple project
Name Type
Design the XML Schema
Select File-New-XML Schema
Create the Travel Web project
Select root node
PassengerList DOM Tree
Creating XML Schema
XML Schema Example 9-1 PassengerList.xsd
Generate XML file
Design an output
Html and mapping approach
Example 9-2 Static XML file
Select required and optional content, click Finish
Example 9-3 html.dtd
Example 9-4 html.xml source
Generate an XSL file
XML to Html mapping
Mapping XML to Html
Source Target
Create an XSL from scratch
Generating XSL from Xhtml
Testing the XSL
Developing the servlet
Javax.xml.transform.Source
Example 9-5 GetPassengerList Server doGet method
Test the passenger list application
Compiling XSL
Javax.xml.transform.TranfrormerFactory
Javax.xml.transform.Transformer
Creating a Web service
11 XML Web service
Create the database tier
Click Window-Open Perspective-Data
Right-clickNew Connection
Right-clickImport to folder
Generate DTD file
PassengerList.xsd-Generate-DTD Figure
Loading DTD into XML Extender
13 Generated DTD File
Creating DAD file using RDB to XML mapping
Membership
Select RDB Table to XML Mapping, click Next
Click Mapping-Edit Join Conditions
15 Edit Join Conditions
Select passengerList.rmx
16 RDB to XML mapping
Create the Web Service from Dadx file
DAD Extension
Web services and DB2 XML Extender
Dadx Group
Group.properties File
Generating the Dadx
Next
Dadx operations
18 Dadx Generation
RetrieveXML
Deploying the Web service
Example 9-6 Updated Dadx file
StoreXML
19 Web Service settings
Example 9-7 namspacetable mapping entry
Test the Web Service
20 Testing Web Service
Modify passenger list application to use the Web Service
Mapping DTDIDs to XSD namespaces and locations
Modifying the XSL file
Example 9-8 Namespaces
Example 9-9 Changing root element
Example 9-10 passengerList.xsl
Page
Creating Html input form
Center
Using Java proxy
22 Input form GetPassengerList.html
Conclusion
23 passengerList result
Page
Development of XML-based Enterprise applications
215
Multi-tier solution architecture
XML based Enterprise application architecture
Solution outline for customer registration sample
Customer registration
Retrieving customer information
Customer registration scenario outline
Developing the customer registration sample
Retrieving customer data scenario outline
Preparing to create the Web tier
JavaBean to XML client wizard
Customer JavaBean class specification
Creating the Web tier
JavaBean XML/XSL client wizard
JavaBean XML/XSL client JavaBean selection
JavaBean XML/XSL client methods and properties selection
JavaBean XML/XSL client input form design
10 JavaBean XML/XSL client results form design
11 JavaBean XML/XSL client prefix specification
Investigating the Web-tier generated files
Page
ProduceDOM Document
Org.w3c.dom.Document
Java Bean
XML Data
Example 10-2 Source code for CustomerXSLServlet init method
Development of XML-based Enterprise applications
ProduceDOMDocument
XML Document
Xslt Processor Stylesheet Transformer
Example 10-4 Source code for the servlet doPost method
Form action=/Registration/CustomerXSLServlet method=post
Membership
Example 10-10 Sample of CustomerResult stylesheet form
Example 10-12 Schema file for the XML data
Validating the Web tier
Building the entity EJB and the database schema
15 Customer registration form
Project configuration
EJB mapping approaches review
Preparing to create the entity EJB
Creating the entity EJB
17 Create an Enterprise Bean wizard
Creating the database mapping and tables
18 Enterprise bean details
19 EJB to RBD Mapping wizard for CustomerInfo module
20 Target database specification
21 EJB to RDB mapping editor
Access beans
22 Database connection definition
Creating an access bean for the entity bean
23 Access Bean creation wizard
Creating a Jdbc data source
24 Data source definition for a server configuration
Binding the EJB to a Jdbc data source
25 Jdbc data source definition
Integrating the entity EJB with the Web tier
Modifying CustomerXML
27 CustomerInfoWeb project properties
Example 10-13 create source code
Modifying CustomerXSLServlet
Example 10-14 CustomerXSLServlet doPost source code
Application deployment and testing
Retrieval function
Example 10-15 Retrieval function
Example 10-16 Confirming the creation
Testing the registration application
28 Generating the deployed code for the EJB
29 Customer Registration form
Page
Light weight XML-based Enterprise Application
257
SQL-XML solution architecture
SQL to/from XML libraries
Light weight XML-based Enterprise Application
Customer registration
Retrieving customer information
XSL Servlet
Adding the libraries to the project
XML Document format
XMLToSQL architecture
Converting an XML Document
Modifying CustomerXSLServlet
Initializing the XMLToSQL class
XMLToSQL
Creating an XML Document
Modifying the produceDOMDocument method
Example 11-1 initSQLProperties method
We need to change to
Example 11-2 ProduceDOMDocumentforTools
Executing the XMLToSQL class
Example 11-3 CustomerXSLServlet doRegister method
Modifying the doPost method
Example 11-4 CustomerXSLServlet doPost method
Example 11-5 The xslif tag
Adding the error case
Example 11-6 Customer.XSL firstname template
Retrieving a customer
JdbcDriver
Statement
Format
Initializing the SQLToXML class
SQLToXML
Example 11-7 initQueryProperties method
Executing the SQLToXML class
Example 11-8 CustomerXSLServlet doQuery method
Modifying the showPage method
Example 11-9 CustomerXSLServlet doPost method for query
Example 11-10 showPage method
Modifying the doGet method
Example 11-11 showPage method
Example 11-12 Customer.XSL membership template
Example 11-13 Result XSL
Page
Using datasource with SQLToXML and XMLToSQL class
Customer Registration form
Class definition
Getting the datasource
Constructors
Example 11-14 setDatasourceMethods
Example 11-15 setDatasourceMethods
Execute methods
Conclusion
11 Core data is an XML
Page
Deploying your Web application
283
Manual deployment
Exporting your project from Application Developer
Installing the EAR file on WebSphere AEs
Starting the WebSphere AEs Admin Console
Installing the EAR
Select Enterprise Applications
Testing the application
Publishing to a remote server AEs
Creating a remote server instance
Creating a remote server instance
WebSphere Studio Application Developer Programming Guide
Remote server instance settings
Remote file transfer option
Remote copy options
WebSphere Studio Application Developer Programming Guide
Publishing to remote server
WebSphere Studio Application Developer Programming Guide
Part 4 Appendixes
297
Page
299
Things to do before installation
Installing Application Developer
WebSphere Studio Application Developer installation
Selecting your workspace
Select options
Verifying the installation
Programs-IBM WebSphere Studio Application Developer-IBM
WebSphere Studio Application Developer Programming Guide
305
Hardware and software prerequisites
Create groups and users
Install WebSphere Application Server
Check that IP ports are unused
Stop the Web server processes
10 Installation options
11 Security options
12 Snoop servlet accessed through embedded Web server
Using the Web material
Locating the Web material
311
How to use the Web material
System requirements for downloading the Web material
Abbreviations and acronyms
313
OTS
IBM Redbooks
Referenced Web sites
Other resources
315
How to get IBM Redbooks
IBM Redbooks collections
Index
317
Jaxp
Wsaa Xacml
Xsltc 48
Spine 475-0.875 250 459 pages
Page
Page
XML Files