[xhtml]

JAXP and XSLT in Web Applications

R. Alexander Milowski

milowski at sims.berkeley.edu

#1

XSLT Extras

#2

Serialization Control

#3

Serialization Control - Prefixes

#4

Serialization Control - Whitespace

#5

Associating Stylesheets with Documents

#6

Extensions

#7

Multiple Output Documents

#8

What is JAXP?

#9

Reference Implementation

#10

Upgrading to SAXON

#11

Using JAXP to Apply XSLT

#12

Chaining Transforms

#13

XSLT in JSP - Step #1

#14

XSLT in JSP - Step #2

#15

XSLT in JSP - Step #3

#16

Transforms & Threading

#17

XSLT in JSP - Caching the Instance

#18

XSLT as a Web Service

#19

Example: Summing Costs

#20

Parsing a Document

#21

Parser Factories

#22

Create Parses with Schema Validation

#23

Readers and Parsers

#24

Adding Catalogs

#25

Parsing a Document

#26

Handling Content

#27

Serialization

#28

Handling Unicode

#29

Posting XML over HTTP - Step #1

#30

Posting XML over HTTP - Step #2

Check the response:

InputStream is = connection.getInputStream();
if (connection.getResponseCode()==HttpURLConnection.HTTP_OK) {
   String contentType = connection.getContentType();
   if (contentType.equals("text/xml")) {

      // Now you can parse your XML response!

   }
}

#31

Posting XML over HTTP - Step #3

Parse the response:

InputStream is = ...;
String encoding = connection.getContentEncoding();

Reader r = encoding==null ?
   new InputStreamReader(r) :
   new InputStreamReader(r,encoding);


xmlReader.parse(new InputSource(r));

connection.disconnect();