stevedlawrence commented on code in PR #1104:
URL: https://github.com/apache/daffodil/pull/1104#discussion_r1376102840


##########
daffodil-test/src/test/resources/org/apache/daffodil/extensions/repType/repType_01_a.dfdl.xsd:
##########
@@ -0,0 +1,39 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  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.
+-->
+
+<schema
+  xmlns="http://www.w3.org/2001/XMLSchema";
+  xmlns:xs="http://www.w3.org/2001/XMLSchema";
+  xmlns:dfdl="http://www.ogf.org/dfdl/dfdl-1.0/";
+  xmlns:a="http://example.com";
+  targetNamespace="http://example.com";
+  elementFormDefault="unqualified">
+
+  <include 
schemaLocation="/org/apache/daffodil/xsd/DFDLGeneralFormat.dfdl.xsd" />
+
+  <include schemaLocation="repType_01_b.dfdl.xsd" />
+
+  <annotation>
+    <appinfo source="http://www.ogf.org/dfdl/";>
+      <dfdl:format ref="a:GeneralFormat"/>
+    </appinfo>
+  </annotation>
+
+  <element name="value" type="a:valueType" />

Review Comment:
   This actually causes a failure with the error:
   
   > A schema cannot contain two global components with the same name; this 
schema contains two occurrences of 'http://example.com,repType'.
   
   Because both schemas use the same namespace (even though they have different 
namespaces prefixes) it can only be defined in one file because one includes 
the other. I did test that we could move the repType simpleType from the "a" 
file to the "b" file and it still works, but the "b" file still needs to 
reference it as `b:repType` using the "b" namespace prefix, because the "a" 
prefix doesn't exist in the "b" files scope.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to