summaryrefslogtreecommitdiffstats
path: root/branches/sca-java-1.5.1/modules/contribution-xml/src/main
diff options
context:
space:
mode:
authorrfeng <rfeng@13f79535-47bb-0310-9956-ffa450edef68>2009-08-14 06:54:03 +0000
committerrfeng <rfeng@13f79535-47bb-0310-9956-ffa450edef68>2009-08-14 06:54:03 +0000
commit1d6516b79fb3a086b7002bfdda54ac2651ca58be (patch)
treed2f2a1a78ebe68ea8f44bd0c299c27ff105dc4ad /branches/sca-java-1.5.1/modules/contribution-xml/src/main
parenta0cde52968abd25f8d86804b90177c7a44ceb1a5 (diff)
Remove calls to XMLStreamWriter.setPrefix() as writeNamespace() invokes it internally (TUSCANY-3212)
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@804091 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'branches/sca-java-1.5.1/modules/contribution-xml/src/main')
-rw-r--r--branches/sca-java-1.5.1/modules/contribution-xml/src/main/java/org/apache/tuscany/sca/contribution/processor/xml/XMLDocumentStreamReader.java14
1 files changed, 9 insertions, 5 deletions
diff --git a/branches/sca-java-1.5.1/modules/contribution-xml/src/main/java/org/apache/tuscany/sca/contribution/processor/xml/XMLDocumentStreamReader.java b/branches/sca-java-1.5.1/modules/contribution-xml/src/main/java/org/apache/tuscany/sca/contribution/processor/xml/XMLDocumentStreamReader.java
index 70398deaa9..d326324a5d 100644
--- a/branches/sca-java-1.5.1/modules/contribution-xml/src/main/java/org/apache/tuscany/sca/contribution/processor/xml/XMLDocumentStreamReader.java
+++ b/branches/sca-java-1.5.1/modules/contribution-xml/src/main/java/org/apache/tuscany/sca/contribution/processor/xml/XMLDocumentStreamReader.java
@@ -6,15 +6,15 @@
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
- * under the License.
+ * under the License.
*/
package org.apache.tuscany.sca.contribution.processor.xml;
@@ -60,7 +60,7 @@ public class XMLDocumentStreamReader implements XMLStreamReader {
}
this.realReader = realReader;
-
+
if (realReader instanceof XMLFragmentStreamReader) {
((XMLFragmentStreamReader)realReader).init();
}
@@ -142,7 +142,11 @@ public class XMLDocumentStreamReader implements XMLStreamReader {
}
public String getCharacterEncodingScheme() {
+ if (isDelegating()) {
return realReader.getCharacterEncodingScheme();
+ } else {
+ return "UTF-8";
+ }
}
public String getElementText() throws XMLStreamException {
@@ -412,7 +416,7 @@ public class XMLDocumentStreamReader implements XMLStreamReader {
state = STATE_COMPLETED;
} else if (!realReader.hasNext()) {
state = STATE_COMPLETE_AT_NEXT;
- }
+ }
if (fragment && returnEvent == END_ELEMENT) {
level--;
if (level == -1) {