[prev in list] [next in list] [prev in thread] [next in thread] 

List:       webservices-general
Subject:    [jira] [Commented] (XMLSCHEMA-64) Schema walker thinks an element was previously visited when it's n
From:       "Oscar Westra van Holthe - Kind (Jira)" <jira () apache ! org>
Date:       2023-01-13 10:28:00
Message-ID: JIRA.13517925.1673558651000.319228.1673605680005 () Atlassian ! JIRA
[Download RAW message or body]


    [ https://issues.apache.org/jira/browse/XMLSCHEMA-64?page=com.atlassian.jira.plugi \
n.system.issuetabpanels:comment-tabpanel&focusedCommentId=17676562#comment-17676562 ] \


Oscar Westra van Holthe - Kind commented on XMLSCHEMA-64:
---------------------------------------------------------

Updated the PR with a test case. This tests:
* Recursion on element names is detected as soon as the loop closes
* Recursion on types is detected as soon as the loop closes
* Elements with the same name but different types are not marked as previously \
visited

> Schema walker thinks an element was previously visited when it's not
> --------------------------------------------------------------------
> 
> Key: XMLSCHEMA-64
> URL: https://issues.apache.org/jira/browse/XMLSCHEMA-64
> Project: XmlSchema
> Issue Type: Bug
> Reporter: Oscar Westra van Holthe - Kind
> Priority: Major
> 
> Consider this schema:
> {code:xml}
> <?xml version="1.0" encoding="UTF-8"?>
> <xs:schema targetNamespace="https://www.github.com/opwvhk/schemawalkerbug" \
> xmlns="https://www.github.com/opwvhk/schemawalkerbug" \
> xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified"> \
> <xs:element name="RepeatedSubElementNames"> <xs:complexType>
> <xs:sequence>
> <xs:element name="wrappedStringArray">
> <xs:complexType>
> <xs:sequence>
> <xs:element name="array" minOccurs="0" maxOccurs="unbounded">
> <xs:complexType>
> <xs:sequence>
> <xs:element ref="string"/>
> </xs:sequence>
> </xs:complexType>
> </xs:element>
> </xs:sequence>
> </xs:complexType>
> </xs:element>
> <xs:element name="wrappedNumber">
> <xs:complexType>
> <xs:sequence>
> <xs:element name="array" minOccurs="0" maxOccurs="unbounded">
> <xs:complexType>
> <xs:sequence>
> <xs:element ref="number"/>
> </xs:sequence>
> </xs:complexType>
> </xs:element>
> </xs:sequence>
> </xs:complexType>
> </xs:element>
> </xs:sequence>
> </xs:complexType>
> </xs:element>
> <xs:element name="string">
> <xs:complexType>
> <xs:simpleContent>
> <xs:extension base="xs:string"/>
> </xs:simpleContent>
> </xs:complexType>
> </xs:element>
> <xs:element name="number">
> <xs:complexType>
> <xs:simpleContent>
> <xs:extension base="xs:int"/>
> </xs:simpleContent>
> </xs:complexType>
> </xs:element>
> </xs:schema>
> {code}
> When walking this schema, the 2nd {{array}} element is not traversed, resulting in \
> missing the subelements {{{}number{}}}. 
> To fix, in line 237 of {{{}XmlSchemaWalker.java{}}}, adjust the cycle detection.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@ws.apache.org
For additional commands, e-mail: dev-help@ws.apache.org


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic