When working on a WebSphere Application Server environment, sooner or later some Java code will need to be written by someone. There are thousands and thousands of books and articles written on general Java and its use and this book will not be another. It simply would not belong in such a book. However, that said, there are sometimes Java oriented topics that may crop up in conjunction with IBPM that are of value. This section of the book is where these will be captured.
Writing XML documents
We all know what an XML document is and there is no need to go into that again. What if we wish to generate an XML document from Java code? There are many ways to achieve that task. This section talks about one one them … the
First we will look at
This has a static method called
newInstance() which will return an instance of an
Given one of these, we can now obtain an
XMLStreamWriter object using the
XMLOutputFactory createXMLStreamWriter() method.
Now that we have an
XMLStreamWriter object, we can invoke its methods to write XML parts … part by part.
Working with Apache POI
Apache POI is a set of Java libraries that provide access to Microsoft Office based documents including Excel and Word. The home page for this project can be found at:
Reading an Excel Spreadsheet with POI
Writing an Excel Spreadsheet with POI