Tutorial: XSLT Designer Quick Start Guide

Source: Internet
Author: User
Tags pack xmlns xsl xsl stylesheet xslt netbeans wsdl
Tutorials | Quick Start

  Directory

Overview

Configuring the Tutorial Environment

To create an XSLT module project

Creating XML schemas

Creating a WSDL File

To create an XSL style sheet

Creating and deploying composite applications

Testing the XSL Transformation service

  Overview

In this tutorial, you will learn about the use of the XSLT Designer included with the NetBeans Enterprise Pack 5.5.1 beta release. The XSLT Designer is used to develop, deploy, and test XSL Transformation Services.

The XSL Transformation service is used as a WEB service. It receives messages from external clients, converts the messages according to the XSL style sheet, and then sends the message back to the initiator or forwards the message to another WEB service.

In this tutorial, you will create a simple XSL transformation service that receives messages, converts messages, and then sends the message back to its Web service.

Prerequisite conditions

This tutorial assumes that you have a basic understanding of the NetBeans IDE and that you have experience using NetBeans IDE programming.

System Requirements

This tutorial assumes that your system complies with the requirements specified in the "System Requirements" section of the NetBeans Enterprise Pack 5.5.1 Beta Release notes.

The software required for the tutorial

Note: The NetBeans IDE 5.5.1 Release Candidate is now published. The NetBeans Enterprise Pack 5.5.1 Beta is used in conjunction with this RC version of the IDE. We are not going to release any further updates to the NetBeans Enterprise Pack 5.5.1 Beta. All of our development efforts are focused on NetBeans 6.0 and the SOA Pack. Before you begin, you must install the following software on your computer:

L NetBeans IDE 5.5.1 RC1 (download IDE)

L NetBeans Enterprise Pack 5.5.1 Beta

  Configuring the Tutorial Environment

The JBI Runtime and Sun Java System application Server 9 must be properly configured and run before the application can be deployed.

To confirm that the JBI server is started, perform the following steps:

1. Open the Runtime window.

2. Expand the Servers node.

3. Right-click the Sun Java System application Server 9 node and select Start from the pop-up menu. If the Start option is not available, and a green triangle is next to the Sun Java System Application Server node, your server is already running.

4. Expand the Sun Java System application Server 9 > JBI > Service engines and ensure that the XSLT service engine is running. If the service engine is not running, right-click the Com.sun.xsltse-1.0-2 node and choose Start from the pop-up menu. If the start option is not available, it means that the service engine is already running.

 To Create an XSLT module project

Create the XSL transformation service in the XSLT module project.

To create a new XSLT module project, do the following:

1. From the IDE's main menu, select File > New Project.

2. Under Categories, choose Service Oriented Architecture.

3. Under Projects, select XSLT Module.

4. Click Next.

5. In the Project Name field, type Helloxsltransformation.

6. Modify the project location or accept the default settings.

7. Click Finish.

8. The Projects window now contains helloxsltransformation project nodes.

Next, we will create two XML schema (. xsd) files, a Web service description (. wsdl) file, and an XSL stylesheet (. xsl) file. To run the XSL transformation Service, you need at least one XML schema file, one WSDL file, and one XSL style sheet file. In this tutorial, we will create two XML schema files.

  Creating XML schemas

We will create two XML schemas: helloxsltincoming.xsd and helloxsltoutgoing.xsd. We will use the former as the basis for incoming messages, which serve as the basis for outgoing messages.

To create an XML schema for incoming messages, do the following:

1. In the Projects window, right-click the Helloxsltransformation > Transformation Files node and select New > File/folder.

2. Under the Categories of the New File dialog box, select XML.

3. Under File Types, select the XML Schema.

4. Click Next.

5. In the File Name field, type helloxsltincoming.

6. Click Finish. A new node helloxsltincoming.xsd will appear under the Transformation Files node of the Helloxsltransformation project, and the new schema opens in the XML schema Editor.

7. In the first column of the Schema view, right-click Elements and select Add Element from the pop-up menu. The Element dialog box opens.

8. In the Name field, type name.

9. Under Type, select the Inline simple Type radio button.

10. Click OK.

11. To view the source code of the schema that you created, click the Sources button in the XML Schema Editor toolbar. You will see the following code:

<?xml version= "1.0" encoding= "UTF-8"?>
<xsd:schema xmlns:xsd= "Http://www.w3.org/2001/XMLSchema"
Targetnamespace= "Http://xml.netbeans.org/schema/HelloXSLTIncoming"
Xmlns:tns= "Http://xml.netbeans.org/schema/HelloXSLTIncoming"
elementformdefault= "qualified" >
<xsd:element name= "Name" >
<xsd:simpleType>
<xsd:restriction base= "xsd:string"/>
</xsd:simpleType>
</xsd:element>
</xsd:schema>

To create an XML schema for outgoing messages, do the following:

1. Repeat step 1-4 above.

2. In the File Name field, type helloxsltoutgoing.

3. Click Finish. A new node helloxsltoutgoing.xsd will appear under the Transformation Files node of the Helloxsltransformation project, and the new schema will open in the XML schema Editor.

4. In the first column of the Schema view, right-click Elements and select Add Element from the pop-up menu. The Element dialog box opens.

5. In the Name field, type greeting.

6. Under Type, select the Inline simple Type radio button.

7. Click OK.

8. To view the source code of the schema that you created, click the Sources button in the XML Schema Editor toolbar. You should see the following code:

<?xml version= "1.0" encoding= "UTF-8"?>

<xsd:schema xmlns:xsd= "Http://www.w3.org/2001/XMLSchema"
Targetnamespace= "Http://xml.netbeans.org/schema/HelloXSLTOutgoing"
Xmlns:tns= "Http://xml.netbeans.org/schema/HelloXSLTOutgoing"
elementformdefault= "qualified" >
<xsd:element name= "Greeting" >
<xsd:simpleType>
<xsd:restriction base= "xsd:string"/>
</xsd:simpleType>
</xsd:element>
</xsd:schema>

9. Click the Save All button on the toolbar.

You should see the two schema files listed under the Transformation Files node of the Helloxsltransformation project.

Note: XML Schema Editor is not the subject of this tutorial.

  Creating a WSDL file

Now we will create a Web service description file that defines the Web interface for the XSL transformation service.

To create a WSDL file, do the following:

1. In the Projects window, right-click the Helloxsltransformation > Transformation Files node and select New > File/folder.

2. Under the Categories of the New File dialog box, select XML.

3. Under File Types, select the WSDL Document, and then click Next.

4. In the File Name field, type helloxsltwsdl, and then click Next.

5. In the Element Or Type column under Input, click the ellipsis (...) button. The Select Element Or Type dialog box opens.

6. Select Helloxsltransformation > Src/helloxsltincoming.xsd > Elements > Name and click OK.

7. In the Element Or Type column of Output, click the ellipsis (...) button. The Select Element Or Type dialog box opens.

8. Select Helloxsltransformation > Src/helloxsltoutgoing.xsd > Elements > Greeting and click OK.

9. Click Next.

10. In the Binding Type field, select SOAP.

11. Under Binding subtype, select Document Literal, and then click Finish.

You should see the helloxsltwsdl.wsdl files listed under the Transformation Files node of the Helloxsltransformation project.

Note: Creating and editing WSDL files is not the subject of this tutorial. For more information, see the WSDL Editor Developer's Guide.



Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.