You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tuscany.apache.org by sv...@apache.org on 2007/02/27 16:49:33 UTC
svn commit: r512291 -
/incubator/tuscany/branches/sca-java-integration/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/util/stax/StaxUtil.java
Author: svkrish
Date: Tue Feb 27 07:49:32 2007
New Revision: 512291
URL: http://svn.apache.org/viewvc?view=rev&rev=512291
Log:
Fixes to make xpath with namespace prefixes working
Modified:
incubator/tuscany/branches/sca-java-integration/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/util/stax/StaxUtil.java
Modified: incubator/tuscany/branches/sca-java-integration/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/util/stax/StaxUtil.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/branches/sca-java-integration/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/util/stax/StaxUtil.java?view=diff&rev=512291&r1=512290&r2=512291
==============================================================================
--- incubator/tuscany/branches/sca-java-integration/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/util/stax/StaxUtil.java (original)
+++ incubator/tuscany/branches/sca-java-integration/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/util/stax/StaxUtil.java Tue Feb 27 07:49:32 2007
@@ -148,10 +148,8 @@
DocumentBuilder builder
) throws XMLStreamException {
Document doc = null;
- try {
- doc = builder.newDocument();
- } catch ( Exception e ) { e.printStackTrace();}
if (element == null && type != null && SimpleTypeMapperExtension.isSimpleXSDType(type)) {
+ doc = builder.newDocument();
// root element has no namespace and local name "value"
Element root = createDefaultRootElement(type, doc);
doc.appendChild(root);
@@ -161,6 +159,7 @@
}
} else {
+ doc = builder.newDocument();
loadPropertyValue(reader, null, doc);
if (doc.getChildNodes().getLength() == 0) {
return null;
@@ -199,6 +198,7 @@
QName name = reader.getName();
Element child =
document.createElementNS(name.getNamespaceURI(), name.getLocalPart());
+ child.setPrefix(name.getPrefix());
// add the attributes for this element
int count = reader.getAttributeCount();
---------------------------------------------------------------------
To unsubscribe, e-mail: tuscany-commits-unsubscribe@ws.apache.org
For additional commands, e-mail: tuscany-commits-help@ws.apache.org