使用 NetBeans Enterprise Pack 5.5.1 Beta 內建的 XSLT Designer,建立、部署並測試一個簡單的 XSL 轉換 Web 服務:接收訊息 → 依 XSL 樣式表轉換 → 回傳結果。
Sun Java System Application Server 9 > JBI > Service Engines,確認 XSLT Service Engine 運行中 (若無,右鍵 com.sun.xsltse-1.0-2 → Start)。HelloXSLTransformation → Finish需兩個:輸入 HelloXSLTIncoming.xsd、輸出 HelloXSLTOutgoing.xsd。
Transformation Files → New → File/Folder → XML → XML SchemaHelloXSLTIncoming → Finishname,型別 Inline Simple Type → 字串HelloXSLTOutgoing.xsd,元素名 greeting,型別字串。產生的 XSD 片段:
<?xml version="1.0" encoding="UTF-8"?>
<xsd:schema xmlns:xsd="https://www.w3.org/2001/XMLSchema"
targetNamespace="https://xml.netbeans.org/schema/HelloXSLTIncoming"
elementFormDefault="qualified">
<xsd:element name="name">
<xsd:simpleType><xsd:restriction base="xsd:string"/></xsd:simpleType>
</xsd:element>
</xsd:schema>
Transformation Files → New → WSDL DocumentHelloXSLTWSDL → NextHelloXSLTIncoming.xsd → nameHelloXSLTOutgoing.xsd → greetingTransformation Files → New → XSL StylesheetHelloXSLT → Finishname 到輸出 greeting,雙擊編輯 XPath 運算式:concat('Hello, ', /in:name, '!')<name>World</name>,預期收到 <greeting>Hello, World!</greeting>。