diff --git a/distribution/examples/xslt/README.md b/distribution/examples/xslt/README.md
index 0086e87594..d28abee20a 100644
--- a/distribution/examples/xslt/README.md
+++ b/distribution/examples/xslt/README.md
@@ -5,110 +5,131 @@ With the XSLTInterceptor you can apply XSLT stylesheets to requests and response
#### RUNNING THE EXAMPLE
-At the following URL you will get a REST representation of a customer resource.
-
-
-http://www.thomas-bayer.com/samples/sqlrest/CUSTOMER/7/
-
-
-In this example we will transform that representation with the XSLTInterceptor.
-
-
Execute the following steps:
1. Go to the `examples/xslt` directory.
2. Execute `service-proxy.bat` or `service-proxy.sh`
-2. Open the URL http://www.thomas-bayer.com/samples/sqlrest/CUSTOMER/7/ in your browser.
+2. Open the URL https://api.predic8.de/restnames/name.groovy?name=Pia in your browser.
-3. Compare it with the response of http://localhost:2000/samples/sqlrest/CUSTOMER/7/
+3. Compare it with the response of http://localhost:2000/restnames/name.groovy?name=Pia
### HOW IT IS DONE
-The following part describes the example in detail.
-
First take a look at the proxies.xml file.
-
-```
+```xml
-
-
-
+
+
+
```
-You will see that there is a `` that directs calls to the port `2000` to www.thomas-bayer.com. Additionally, the `XSLTInterceptor` is set for the rule. The interceptor will be called while processing each request and response.
+You will see
+that there is a `` that directs calls to the port `2000` to [api.predic8.de](https://api.predic8.de).
+Additionally, the `XSLTInterceptor` is set for the rule.
+The interceptor will be called while processing each request and response.
Now take a closer look at the transform element.
-```
-
+```xml
+
```
-You can reference stylesheets that will be applied to the request and response with the `xslt` attribute. If you leave the attribute blank or do not specify them at all, no transformation will be done. With the element above the interceptor will apply the specified XSLT stylesheet to the response and request. To limit the transformation only to the request or response, use request or response elements to wrap the interceptor. In this example we wrapped the interceptor with a response element so that the transformation is only applied to the response.
+You can reference stylesheets that will be applied to the request and response with the `xslt` attribute.
+If you leave the attribute blank or do not specify them at all, no transformation will be done.
+With the element above, the interceptor will apply the specified XSLT stylesheet to the response and request.
+To limit the transformation only to the request or response, use request or response elements to wrap the interceptor.
+In this example, we wrapped the interceptor with a response element
+so that the transformation is only applied to the response.
-```
+```xml
-
+
```
Take a look at the stylesheet:
-```
-
+```xml
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+ male
+ female
+
+
+
+
+
+
+
+
+
+
```
-We will use the stylesheet to transform the REST resource into another representation. When we open http://www.thomas-bayer.com/samples/sqlrest/CUSTOMER/7/ in our browser, the REST resource will return the following XML document.
-
-```
-
- 7
- Roger
- Seid
- 3738 N Monroe St
- Tallahassee
-
+We will use the stylesheet to transform the REST resource into another representation.
+When we open https://api.predic8.de/restnames/name.groovy?name=Pia in our browser,
+the REST resource will return the following XML document.
+
+```xml
+
+
+ Pia
+
+ Netherlands
+ Austria
+ Sweden
+ Belgium
+ Frisia
+ Norway
+ Finland
+ Denmark
+ Italy
+ Swiss
+ Germany
+ Spain
+
+ female first name
+ false
+ true
+
+
```
-When we open http://localhost:2000/samples/sqlrest/CUSTOMER/7/ in a browser the response is transformed by Membrane and the browser will show the following document:
+When we open http://localhost:2000/restnames/name.groovy?name=Piain a browser, the response is transformed by Membrane,
+and the browser will show the following document:
-```
-
-
+```xml
+
- Roger
- Seid
+ Pia
+ female
-
- 3738 N Monroe St
- Tallahassee
-
-
+
+ Netherlands
+ Austria
+ Sweden
+ Belgium
+ Frisia
+ Norway
+ Finland
+ Denmark
+ Italy
+ Swiss
+ Germany
+ Spain
+
+
```
\ No newline at end of file
diff --git a/distribution/examples/xslt/customer2person.xsl b/distribution/examples/xslt/customer2person.xsl
deleted file mode 100644
index e1ee6f95ba..0000000000
--- a/distribution/examples/xslt/customer2person.xsl
+++ /dev/null
@@ -1,22 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/distribution/examples/xslt/proxies.xml b/distribution/examples/xslt/proxies.xml
index 06e1242cc5..968ed8cac0 100644
--- a/distribution/examples/xslt/proxies.xml
+++ b/distribution/examples/xslt/proxies.xml
@@ -8,9 +8,9 @@
-
+
-
+
diff --git a/distribution/examples/xslt/reformat.xsl b/distribution/examples/xslt/reformat.xsl
new file mode 100644
index 0000000000..21f300a385
--- /dev/null
+++ b/distribution/examples/xslt/reformat.xsl
@@ -0,0 +1,27 @@
+
+
+
+
+
+
+ male
+ female
+
+
+
+
+
+
+
+
+
+
+
+
+
+ ,
+
+
+
+
+
\ No newline at end of file
diff --git a/distribution/src/test/java/com/predic8/membrane/examples/tests/XSLTTest.java b/distribution/src/test/java/com/predic8/membrane/examples/tests/XSLTTest.java
index 10a8afce04..49a632a36c 100644
--- a/distribution/src/test/java/com/predic8/membrane/examples/tests/XSLTTest.java
+++ b/distribution/src/test/java/com/predic8/membrane/examples/tests/XSLTTest.java
@@ -21,9 +21,9 @@
public class XSLTTest extends AbstractSampleMembraneStartStopTestcase {
- public static final String PATH = "/samples/sqlrest/CUSTOMER/7/";
+ public static final String PATH = "/restnames/name.groovy?name=Pia";
public static final String CUSTOMER_HOST_LOCAL = "http://localhost:2000";
- public static final String CUSTOMER_HOST_REMOTE = "http://www.thomas-bayer.com";
+ public static final String CUSTOMER_HOST_REMOTE = "https://api.predic8.de";
@Override
protected String getExampleDirName() {
@@ -32,7 +32,7 @@ protected String getExampleDirName() {
@Test
public void test() throws Exception {
- assertContains("FIRSTNAME", getAndAssert200(CUSTOMER_HOST_REMOTE + PATH));
- assertContains("first", getAndAssert200(CUSTOMER_HOST_LOCAL + PATH));
+ assertContains("", getAndAssert200(CUSTOMER_HOST_REMOTE + PATH));
+ assertContainsNot("", getAndAssert200(CUSTOMER_HOST_LOCAL + PATH));
}
}