C IBM Redbooks

For information on ordering these publications see How to get IBM Redbooks on page 287. The XML Files Using XML for Business-to-Business and Business-to-Consumer Applications, SG24-6104 The XML Files Using XML and XSL with IBM WebSphere V3.0, SG24-5479 Lotus Domino Release 5.0 A Developer's Handbook, SG24-5331 Using VisualAge for Java to Develop Domino Applications, SG24-5424 Connecting Domino to the Enterprise Using Java, SG24-5425 Domino and WebSphere Together, SG24-5955

Transforming to a simple text file

We've already done most of the work involved in setting up the environment to transform the same DXL output file we used in the last example for XML output. In this case, we've copied the original Domino agent TransformXMLtoXMLfile and renamed the new copy TransformXMLtoTextFile. In the new agent we've specified a new XSL stylesheet to use for the transformation and a new output file name. Refer to 4.3, Transforming from XML to XML on page 212 to get an overview of the environment and the Java...

Transforming to EDI

EDI Electronic Data Interchange has been around for over 30 years, and has a loyal following of hundreds of thousands of organizations, which use it for conducting secure business transactions between EDI-compatible organizations. EDI transactions follow a syntax called X12, which provides security and flexibility in a compact and rigidly standardized format. Because of this, transformations between EDI and XML are possible, but standards have to be just as rigid on the XML side to make sure...

Using an agent to generate computed XML to a browser

Just as with the previous LCLSX data integration example, there are several options for real-time RDBMS queries using Java. In this case, we're using an exact copy of the example form we used for LCLSX. This time, however, we're calling an agent that uses a Java Database Connectivity JDBC driver to connect to an Open Database Connectivity ODBC data source using something called a JDBC ODBC bridge. Here's the WebQuerySave event for the JDBC Fish Query Form If ButtonPressed FID SetField Form...

XML schema

DTD is the current standard to define XML document structure. But DTDs have a few known limitations. There are two issues when using DTDs 1. DTDs are not written using XML document syntax. 2. DTDs can handle only text data type. The syntax of DTDs is different than the syntax of XML. This difference makes for two problems. The first is every XML programmer has to learn both of these syntaxes. The other problem is data type. DTDs can only handle text data, described as PCDATA. It would be better...

Data integration example using LCLSX

As mentioned in the previous section, DECS is just one of many tools that Domino developers can use to integrate back-end data with the Web. Once a prototype application has been created, the query functionality facilitated by DECS can be swapped for a WebQueryOpen event agent. This agent can contain LotusScript or Java, and in each of these languages there are several options for connecting to back-end data via Domino. In this example we'll show you how to use the Lotus Connector LSX LCLSX to...

Document Object Model

Not to be confused with the Domino Object Model, the document object model is an API to access an XML data structure. Using DOM, we can access XML data represented as a tree object model. In DOM programming, every element is handled as a node, which is defined as an interface in the DOM. DOM creates a tree of the entire XML document in memory and can access and control any of these objects using the DOM API. Sometimes DOM is not the best API to use when handling a large document since it holds...

Transforming XML data from the browser client

When transforming XML data, the transformation will either occur on the server or on the browser client. From the development point of view this means writing applications that call the client's processing capabilities or processing the XML data on the server and then sending the data down to the client. From a performance perspective there are benefits to offloading the processing to the client. This frees up resources on the server to handle more requests. If all Web clients have the same...

XSLT stylesheets

In this section we start with some simple examples of transformation and then gradually progress to more complex transformations. To facilitate learning and applying stylesheets in Domino, we first build a form design that allows us to write and apply stylesheets to XML data. 1. In the Domino Designer, create a form design that looks similar to the one shown in Figure 56. Figure 56. Stylesheet primer form design Figure 56. Stylesheet primer form design We have named the form stylesheet Primer...

Using ReadViewEntries on existing views

Of all the methods for generating XML from Domino, using the ReadViewEntries URL command is the easiest, because it is a built-in function of Domino and requires no programming. However, this also makes it the least flexible option for generating XML from Domino data. While the ReadViewEntries command is an easy way to generate XML, it is only useful if the XML parser used to receive the data conforms to the Domino view XML format. In this case, the system receiving the XML is probably a Domino...

Transforming XML data on the server

We have discussed the mechanics of transforming XML data with an XSLT transformation engine. The transformation takes place wherever the Chapter 4. Transforming XML data in Domino 191 transformation engine lives. Transformation engines can live in standalone applications, Web clients and Web servers. As developers, we have to decide which transformation engine we are going to use and if that processing will be done on the server or on the client. In Domino and from the Domino platform this is...

Conforming to the Domino DTD

The Domino DTD is a document that forces validation with any XML document that contains DXL, the Lotus flavor of XML. It's maintained and created by the same people who bring you the LotusXML toolkit, described later in this chapter. At the time of writing, the domino.dtd has not shipped with Domino. It can be downloaded with the XML toolkit from In order to conform to a DTD, the header of an XML document must look like this lt xml version '1.0' encoding 'utf-8' gt lt DOCTYPE document SYSTEM...

SAX with XML Parser for Java

XML Parser for Java also has SAX API we can use this SAX from Domino Java Agent or Servlet. In SAX programming, we can use the Org.W3C.SAX package which has the interfaces identified in Table 11. A single input source for an XML entity. Encapsulates a general SAX error or warning. Encapsulates an XML parse error or warning. Following is an example of using XML Parser for Java in Domino Java Agent. The following code is a Domino Agent sample in which we also used an example of SAX code. import...

Parsing XML

Each XML document must be verified as conforming to XML syntax guidelines. XML parsers verify the document syntax. An XML parser must check each XML document for well-formed syntax and alternately check to ensure that it is valid. Let's see an example of well-formed parsing. Microsoft Internet Explorer 5.0 can verify the XML syntax and display the XML code if the document is well-formed. lt xml version 1.0 encoding UTF-8 gt lt Customer gt lt Lastname gt SMITH lt Lastname gt lt Company gt...

Dtd

DTD Document Type Definition defines the data structure of each XML document. It defines the names of elements and attributes, the tree structure of the data, the number of elements, and any rules related to data structure. XML documents do not always need this DTD. Non-valid XML documents do not need a DTD to describe XML. On the other hand, valid XML documents need a DTD and must conform to its definition. XML documents which are not described along with the DTD definition are not valid XML...

XML security as communication medium

While Domino provides security for data that is being stored, we must also consider the security of data while it is being exchanged. Since XML is a plain text format, we need to encrypt the data to maintain security. We can use either of the following two encryption schemes to protect the data Encrypt the protocol data on the transport layer Encrypting the data requires some encryption tool which is a private tool for XML. XML Security Suite is a good choice it is a tool that provides...

Developing a standalone Java XML application for Domino

The Lotus XML Toolkit is designed to export and import data between Domino documents and DXL elements. It is designed primarily to be used to develop C applications and Java servlets, applications and applets outside of the native Domino development environment. For our example we have developed an application which uses the java.awt Advanced Windowing Toolkit classes developed by Sun to create a platform-independent interface. XML Application Example - get Fish DXL File Saved to C nEMP...

Displaying multiple documents in an XML tree structure

As you can see from the previous example, the hierarchical display of the document data represented in just two lines of a Domino view can take a very complicated form when an XML element hierarchy and data format descriptions are applied. This is, in essence, the reason for complicated DTDs that validate data before parsing it back into non-XML data. In this case, the XML tags do a great job of describing the data as seen from a Domino view perspective, but are not very representative of the...

DOM with XML Parser for Java

XML parser for Domino provides two main interfaces, DOM and SAX. In DOM programming, we can use the Org.W3C.DOM package, which has the interfaces described in Table 10. The Attr interface represents an attribute in an Element object. CDATA sections are used to escape blocks of text containing characters that would otherwise be regarded as markup. The CharacterData interface extends Node with a set of attributes and methods for accessing character data in the DOM. This represents the content of...

Lotus XML toolkit

The toolkit allows developers to build applications that export and import DXL out of and into Domino R5 . It includes API class libraries for Java and C for use with Notes Java C applications. The toolkit includes sample command-line utilities to import and export. For more information on using the toolkit, see 3.9, Working with the Lotus XML Toolkit on page 135. There may be some confusion about whether the command-line samples, DXLimport and DXLexport, are samples or products. They are...