stevedlawrence commented on a change in pull request #332: Refactor isHidden URL: https://github.com/apache/incubator-daffodil/pull/332#discussion_r390371278
########## File path: daffodil-test/src/test/resources/org/apache/daffodil/section14/sequence_groups/SequencesWithHiddenRefs.dfdl.xsd ########## @@ -0,0 +1,94 @@ +<?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. +--> + +<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" + xmlns:fn="http://www.w3.org/2005/xpath-functions" + xmlns:dfdl="http://www.ogf.org/dfdl/dfdl-1.0/" xmlns:ex="http://example.com" + targetNamespace="http://example.com" elementFormDefault="unqualified"> + <xs:include + schemaLocation="org/apache/daffodil/xsd/DFDLGeneralFormat.dfdl.xsd" /> + <xs:annotation> + <xs:appinfo source="http://www.ogf.org/dfdl/"> + <dfdl:format ref="ex:GeneralFormat" lengthKind="delimited" /> + </xs:appinfo> + </xs:annotation> + <xs:group name="s1"> + <xs:sequence> + <xs:element name="f" type="xs:int" dfdl:outputValueCalc="{ 1 }" /> + </xs:sequence> + </xs:group> + <xs:element name="e1" dfdl:lengthKind="delimited"> + <xs:complexType> + <xs:sequence dfdl:separator=","> + <xs:sequence dfdl:hiddenGroupRef="ex:s1" /> + <xs:element name="g" type="xs:int" /> + </xs:sequence> + </xs:complexType> + </xs:element> + <xs:element name="e2" dfdl:lengthKind="delimited"> + <xs:complexType> + <xs:sequence dfdl:separator=","> + <xs:group ref="ex:s1" /> + <xs:element name="g" type="xs:int" /> + </xs:sequence> + </xs:complexType> + </xs:element> + <xs:element name="e3" dfdl:lengthKind="delimited"> + <xs:complexType> + <xs:sequence dfdl:separator=","> + <xs:sequence dfdl:hiddenGroupRef="ex:s1" /> + <xs:element name="g"> + <xs:complexType> + <xs:group ref="ex:s1" /> + </xs:complexType> + </xs:element> + </xs:sequence> + </xs:complexType> + </xs:element> + <xs:group name="s2"> + <xs:sequence> + <xs:element name="f"> + <xs:complexType> + <xs:sequence> + <xs:element name="h"> + <xs:complexType> + <xs:group ref="ex:s1" /> + </xs:complexType> + </xs:element> + </xs:sequence> + </xs:complexType> + </xs:element> + </xs:sequence> + </xs:group> + <xs:element name="e4" dfdl:lengthKind="delimited"> + <xs:complexType> + <xs:sequence dfdl:separator="~"> + <xs:sequence dfdl:hiddenGroupRef="ex:s2" /> + <xs:group ref="ex:s2" /> + </xs:sequence> + </xs:complexType> + </xs:element> + <xs:element name="e5" dfdl:lengthKind="delimited"> + <xs:complexType> + <xs:sequence dfdl:separator="~"> + <xs:group ref="ex:s2" /> + <xs:sequence dfdl:hiddenGroupRef="ex:s2" /> + </xs:sequence> + </xs:complexType> + </xs:element> +</xs:schema> Review comment: It might also be useful to have a test where a hidden group ref contains another hidden group ref just to ensure that nesting works as expected. ---------------------------------------------------------------- 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. For queries about this service, please contact Infrastructure at: [email protected] With regards, Apache Git Services
