You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ws.apache.org by co...@apache.org on 2020/01/03 14:14:30 UTC
[ws-xmlschema] branch master updated: Some whitespace fixes
This is an automated email from the ASF dual-hosted git repository.
coheigea pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/ws-xmlschema.git
The following commit(s) were added to refs/heads/master by this push:
new 1958d1e Some whitespace fixes
1958d1e is described below
commit 1958d1e12d52453e5feaef83b3e176335c0fd70a
Author: Colm O hEigeartaigh <co...@apache.org>
AuthorDate: Fri Jan 3 14:14:16 2020 +0000
Some whitespace fixes
---
.../apache/ws/commons/schema/SchemaBuilder.java | 12 ++++++------
.../src/test/java/tests/IncludeTest.java | 22 ++++++++++------------
.../include-union-without-ns/datatypes.xsd | 18 ++++++++++++++++++
.../resources/include-union-without-ns/root.xsd | 18 ++++++++++++++++++
4 files changed, 52 insertions(+), 18 deletions(-)
diff --git a/xmlschema-core/src/main/java/org/apache/ws/commons/schema/SchemaBuilder.java b/xmlschema-core/src/main/java/org/apache/ws/commons/schema/SchemaBuilder.java
index 0e77c59..fc5de8c 100644
--- a/xmlschema-core/src/main/java/org/apache/ws/commons/schema/SchemaBuilder.java
+++ b/xmlschema-core/src/main/java/org/apache/ws/commons/schema/SchemaBuilder.java
@@ -804,13 +804,13 @@ public class SchemaBuilder {
if (offset == -1) {
uri = pContext.getNamespaceURI(Constants.DEFAULT_NS_PREFIX);
if (Constants.NULL_NS_URI.equals(uri)) {
- if (currentSchema.getTargetNamespace() == null
- && !currentSchema.getLogicalTargetNamespace().isEmpty()) {
- // If object is unqualified in a schema without a target namespace then it could
- // be that this schema is included in another one. The including namespace
- // should then be used for this reference
+ if (currentSchema.getTargetNamespace() == null
+ && !currentSchema.getLogicalTargetNamespace().isEmpty()) {
+ // If object is unqualified in a schema without a target namespace then it could
+ // be that this schema is included in another one. The including namespace
+ // should then be used for this reference
return new QName(currentSchema.getLogicalTargetNamespace(), pName);
- }
+ }
return new QName(Constants.NULL_NS_URI, pName);
}
localName = pName;
diff --git a/xmlschema-core/src/test/java/tests/IncludeTest.java b/xmlschema-core/src/test/java/tests/IncludeTest.java
index 65f801f..ffa807c 100644
--- a/xmlschema-core/src/test/java/tests/IncludeTest.java
+++ b/xmlschema-core/src/test/java/tests/IncludeTest.java
@@ -51,7 +51,7 @@ public class IncludeTest extends Assert {
/**
* This method will test the include.
- *
+ *
* @throws Exception Any exception encountered
*/
@Test
@@ -89,7 +89,7 @@ public class IncludeTest extends Assert {
XmlSchemaElement xse = s.getElementByName(new QName("http://soapinterop.org/types",
"test1include"));
assertEquals("test1include", xse.getName());
- assertEquals(new QName("http://www.w3.org/2001/XMLSchema", "string"),
+ assertEquals(new QName("http://www.w3.org/2001/XMLSchema", "string"),
xse.getSchemaTypeName());
} else if (schemaLocation.equals(Resources.asURI("include3.xsd"))) {
XmlSchemaElement xse = s.getElementByName(new QName("http://soapinterop.org/types",
@@ -142,7 +142,7 @@ public class IncludeTest extends Assert {
/**
* Schema included defined xmlns="http://www.w3.org/2001/XMLSchema"
- *
+ *
* @throws Exception
*/
@Test
@@ -157,7 +157,7 @@ public class IncludeTest extends Assert {
/**
* Schema included does not define xmlns="http://www.w3.org/2001/XMLSchema"
- *
+ *
* @throws Exception
*/
@Test
@@ -169,11 +169,11 @@ public class IncludeTest extends Assert {
XmlSchema schema = schemaCol.read(isource);
assertNotNull(schema);
}
-
-
-
+
+
+
@Test
- public void testSerializeSchema() throws Exception {
+ public void testSerializeSchema() throws Exception {
String uri = Resources.asURI("XMLSCHEMA-20/test.xsd");
InputSource isource = new InputSource(new FileInputStream(uri));
isource.setSystemId(uri);
@@ -189,9 +189,9 @@ public class IncludeTest extends Assert {
/**
- * Schema included does not have a namespace and defines a union whose members
+ * Schema included does not have a namespace and defines a union whose members
* should inherit the root (includer) namespace.
- *
+ *
* @throws Exception
*/
@Test
@@ -214,7 +214,5 @@ public class IncludeTest extends Assert {
assertEquals("oid", oid.getLocalPart());
assertEquals("urn:apache-org", oid.getNamespaceURI());
}
-
-
}
diff --git a/xmlschema-core/src/test/resources/include-union-without-ns/datatypes.xsd b/xmlschema-core/src/test/resources/include-union-without-ns/datatypes.xsd
index 04788a8..268e6fd 100644
--- a/xmlschema-core/src/test/resources/include-union-without-ns/datatypes.xsd
+++ b/xmlschema-core/src/test/resources/include-union-without-ns/datatypes.xsd
@@ -1,3 +1,21 @@
+<!--
+ ~ Licensed to the Apache Software Foundation (ASF) under one
+ ~ or more contributor license agreements. See the NOTICE file
+ ~ distributed with this work for additional information
+ ~ regarding copyright ownership. The ASF licenses this file
+ ~ 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.
+ -->
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified">
<xsd:simpleType name="uid">
<xsd:union memberTypes="oid uuid"/>
diff --git a/xmlschema-core/src/test/resources/include-union-without-ns/root.xsd b/xmlschema-core/src/test/resources/include-union-without-ns/root.xsd
index 96e1621..7fc4197 100644
--- a/xmlschema-core/src/test/resources/include-union-without-ns/root.xsd
+++ b/xmlschema-core/src/test/resources/include-union-without-ns/root.xsd
@@ -1,3 +1,21 @@
+<!--
+ ~ Licensed to the Apache Software Foundation (ASF) under one
+ ~ or more contributor license agreements. See the NOTICE file
+ ~ distributed with this work for additional information
+ ~ regarding copyright ownership. The ASF licenses this file
+ ~ 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.
+ -->
<xs:schema targetNamespace="urn:apache-org" xmlns="urn:apache-org" xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified">
<xs:include schemaLocation="datatypes.xsd"/>
<xs:complexType name="Root">