summaryrefslogtreecommitdiffstats
path: root/java/sca/modules
diff options
context:
space:
mode:
authorlresende <lresende@13f79535-47bb-0310-9956-ffa450edef68>2008-06-26 01:29:06 +0000
committerlresende <lresende@13f79535-47bb-0310-9956-ffa450edef68>2008-06-26 01:29:06 +0000
commit620c1801ffab03b04cc62326676f23c510545f30 (patch)
tree0af0254c0ffa81ef3223fe3f9cd484105ee8d2d3 /java/sca/modules
parent2c5b145988ffc9b4ccd334ac287134b015b40b8f (diff)
TUSCANY-2427 - merging changes from 1.3 release to trunk
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@671701 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'java/sca/modules')
-rw-r--r--java/sca/modules/databinding-saxon/pom.xml14
-rw-r--r--java/sca/modules/databinding-saxon/src/main/java/org/apache/tuscany/sca/databinding/saxon/Node2NodeInfoTransformer.java10
-rw-r--r--java/sca/modules/databinding-saxon/src/main/java/org/apache/tuscany/sca/databinding/saxon/NodeInfo2NodeTransformer.java2
-rw-r--r--java/sca/modules/databinding-saxon/src/main/java/org/apache/tuscany/sca/databinding/saxon/SimpleType2ValueTransformer.java10
-rw-r--r--java/sca/modules/databinding-saxon/src/main/java/org/apache/tuscany/sca/databinding/saxon/Value2ObjectTransformer.java2
-rw-r--r--java/sca/modules/databinding-saxon/src/main/java/org/apache/tuscany/sca/databinding/saxon/Value2SimpleTypeTransformer.java2
6 files changed, 28 insertions, 12 deletions
diff --git a/java/sca/modules/databinding-saxon/pom.xml b/java/sca/modules/databinding-saxon/pom.xml
index 27c98ad6a4..e8d4ac025b 100644
--- a/java/sca/modules/databinding-saxon/pom.xml
+++ b/java/sca/modules/databinding-saxon/pom.xml
@@ -53,7 +53,7 @@
<version>1.4-SNAPSHOT</version>
</dependency>
- <dependency>
+ <!--dependency>
<groupId>net.sf.saxon</groupId>
<artifactId>saxon</artifactId>
<version>9.0.0.2</version>
@@ -69,6 +69,18 @@
<groupId>net.sf.saxon</groupId>
<artifactId>saxon-dom</artifactId>
<version>9.0.0.2</version>
+ </dependency-->
+
+ <dependency>
+ <groupId>net.sf.saxon</groupId>
+ <artifactId>saxon</artifactId>
+ <version>8.7</version>
+ </dependency>
+
+ <dependency>
+ <groupId>net.sf.saxon</groupId>
+ <artifactId>saxon-dom</artifactId>
+ <version>8.7</version>
</dependency>
<dependency>
diff --git a/java/sca/modules/databinding-saxon/src/main/java/org/apache/tuscany/sca/databinding/saxon/Node2NodeInfoTransformer.java b/java/sca/modules/databinding-saxon/src/main/java/org/apache/tuscany/sca/databinding/saxon/Node2NodeInfoTransformer.java
index 182c7e29d9..fabadd34ea 100644
--- a/java/sca/modules/databinding-saxon/src/main/java/org/apache/tuscany/sca/databinding/saxon/Node2NodeInfoTransformer.java
+++ b/java/sca/modules/databinding-saxon/src/main/java/org/apache/tuscany/sca/databinding/saxon/Node2NodeInfoTransformer.java
@@ -21,6 +21,7 @@ package org.apache.tuscany.sca.databinding.saxon;
import javax.xml.transform.dom.DOMSource;
import net.sf.saxon.Configuration;
+import net.sf.saxon.event.Builder;
import net.sf.saxon.om.NodeInfo;
import net.sf.saxon.trans.XPathException;
@@ -42,13 +43,16 @@ import org.w3c.dom.Node;
public class Node2NodeInfoTransformer extends BaseTransformer<Node, NodeInfo> implements
PullTransformer<Node, NodeInfo> {
- public NodeInfo transform(Node source, TransformationContext context) {
- Configuration configuration = new Configuration();
+ public NodeInfo transform(Node source, TransformationContext context) {
+ Configuration configuration = SaxonDataBindingHelper.CURR_EXECUTING_CONFIG;
+ if (configuration == null) {
+ configuration = new Configuration();
+ }
NodeInfo docInfo = null;
try {
source = DOMHelper.promote(source);
- docInfo = configuration.buildDocument(new DOMSource(source));
+ docInfo = Builder.build(new DOMSource(source), null, configuration);
} catch (XPathException e) {
throw new TransformationException(e);
}
diff --git a/java/sca/modules/databinding-saxon/src/main/java/org/apache/tuscany/sca/databinding/saxon/NodeInfo2NodeTransformer.java b/java/sca/modules/databinding-saxon/src/main/java/org/apache/tuscany/sca/databinding/saxon/NodeInfo2NodeTransformer.java
index 9b9d8926b9..1e5b816662 100644
--- a/java/sca/modules/databinding-saxon/src/main/java/org/apache/tuscany/sca/databinding/saxon/NodeInfo2NodeTransformer.java
+++ b/java/sca/modules/databinding-saxon/src/main/java/org/apache/tuscany/sca/databinding/saxon/NodeInfo2NodeTransformer.java
@@ -46,7 +46,7 @@ public class NodeInfo2NodeTransformer extends BaseTransformer<NodeInfo, Node> im
Properties props = new Properties();
props.setProperty(OutputKeys.METHOD, "xml");
props.setProperty(OutputKeys.INDENT, "yes");
- QueryResult.serialize(source, destination, props);
+ QueryResult.serialize(source, destination, props, source.getConfiguration());
} catch (Exception e) {
throw new TransformationException(e);
}
diff --git a/java/sca/modules/databinding-saxon/src/main/java/org/apache/tuscany/sca/databinding/saxon/SimpleType2ValueTransformer.java b/java/sca/modules/databinding-saxon/src/main/java/org/apache/tuscany/sca/databinding/saxon/SimpleType2ValueTransformer.java
index 11d2fd0d56..67d89a6e0b 100644
--- a/java/sca/modules/databinding-saxon/src/main/java/org/apache/tuscany/sca/databinding/saxon/SimpleType2ValueTransformer.java
+++ b/java/sca/modules/databinding-saxon/src/main/java/org/apache/tuscany/sca/databinding/saxon/SimpleType2ValueTransformer.java
@@ -23,7 +23,7 @@ import java.math.BigDecimal;
import net.sf.saxon.value.DecimalValue;
import net.sf.saxon.value.DoubleValue;
import net.sf.saxon.value.FloatValue;
-import net.sf.saxon.value.Int64Value;
+import net.sf.saxon.value.IntegerValue;
import net.sf.saxon.value.ObjectValue;
import net.sf.saxon.value.StringValue;
import net.sf.saxon.value.Value;
@@ -63,13 +63,13 @@ public class SimpleType2ValueTransformer extends BaseTransformer<Object, Value>
public Value transform(Object source, TransformationContext context) {
Value result = null;
if (source instanceof Integer) {
- result = new Int64Value((Integer)source);
+ result = new IntegerValue((Integer)source);
} else if (source instanceof Long) {
- result = new Int64Value((Long)source);
+ result = new IntegerValue((Long)source);
} else if (source instanceof Short) {
- result = new Int64Value((Short)source);
+ result = new IntegerValue((Short)source);
} else if (source instanceof Byte) {
- result = new Int64Value((Byte)source);
+ result = new IntegerValue((Byte)source);
} else if (source instanceof Double) {
result = new DoubleValue((Double)source);
} else if (source instanceof Float) {
diff --git a/java/sca/modules/databinding-saxon/src/main/java/org/apache/tuscany/sca/databinding/saxon/Value2ObjectTransformer.java b/java/sca/modules/databinding-saxon/src/main/java/org/apache/tuscany/sca/databinding/saxon/Value2ObjectTransformer.java
index 0af3ce6a04..7589f6789b 100644
--- a/java/sca/modules/databinding-saxon/src/main/java/org/apache/tuscany/sca/databinding/saxon/Value2ObjectTransformer.java
+++ b/java/sca/modules/databinding-saxon/src/main/java/org/apache/tuscany/sca/databinding/saxon/Value2ObjectTransformer.java
@@ -36,7 +36,7 @@ public class Value2ObjectTransformer extends BaseTransformer<Value, Object> impl
public Object transform(Value source, TransformationContext context) {
Object object;
try {
- object = Value.convertToJava(Value.asItem(source));
+ object = Value.convert(Value.asItem(source));
} catch (XPathException e) {
throw new TransformationException(e);
}
diff --git a/java/sca/modules/databinding-saxon/src/main/java/org/apache/tuscany/sca/databinding/saxon/Value2SimpleTypeTransformer.java b/java/sca/modules/databinding-saxon/src/main/java/org/apache/tuscany/sca/databinding/saxon/Value2SimpleTypeTransformer.java
index 0dcea88184..5da4effcfd 100644
--- a/java/sca/modules/databinding-saxon/src/main/java/org/apache/tuscany/sca/databinding/saxon/Value2SimpleTypeTransformer.java
+++ b/java/sca/modules/databinding-saxon/src/main/java/org/apache/tuscany/sca/databinding/saxon/Value2SimpleTypeTransformer.java
@@ -36,7 +36,7 @@ public class Value2SimpleTypeTransformer extends BaseTransformer<Value, Object>
public Object transform(Value source, TransformationContext context) {
Object object;
try {
- object = Value.convertToJava(Value.asItem(source));
+ object = Value.convert(Value.asItem(source));
} catch (XPathException e) {
throw new TransformationException(e);
}