Skip to content

[soap] fix #75747 correct detect namespace for attributeGroup #3032

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from

Conversation

iRipVanWinkle
Copy link

Corrects detect namespace for attributeGroup when parse xml file with absented targetNamespace or xmlns

On the step of parsing schema the empty namespace replace into target namespace. But on the step of fix up types the empty namespace stay empty so cannot find type in temporary hash table with attribute groups.
Detecting namespace in other tags are correct and similar to mine fix.

@DaveRandom
Copy link
Contributor

I haven't dug into this fully (yet) but this looks to me like a sticking plaster for a specific issue caused by a wider problem. Based on what the test does and looking at the patch code, it seems like the real problem is that the targetNamespace attribute is not correctly take into account when processing type definitions that came from an <xsd:include>. If so, this most likely affects many things in the included definitions, and not just <attributeGroup>.

For example, consider the following code for include.xml:

<?xml version="1.0" encoding="UTF-8"?>
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema">
  <xsd:complexType name="Inner">
    <xsd:sequence>
      <xsd:element name="el" type="xsd:string" />
    </xsd:sequence>
  </xsd:complexType>
	<xsd:complexType name="User">
    <xsd:sequence>
      <xsd:element name="inner" type="Inner" />
    </xsd:sequence>
  </xsd:complexType>
</xsd:schema>

When I run the test in this PR with that code in the included file, the defined types come out as:

struct Inner {
 string el;
}
struct User {
 anyType inner;
}

When I declare the namespaces explicitly - with prefixed namespace declarations and prefixes on the type names - in the included file, the inner member has a type of Test. I'm not 100% clear that this is the correct behaviour either (I think that an included file should always inherit the tns of the parent and ignore explicit declarations in the child?) but it's certainly indicative of a higher-level problem.

Ping @ThomasWeinert thoughts please?

@nikic nikic added the Bug label Jan 24, 2018
@krakjoe
Copy link
Member

krakjoe commented Feb 8, 2018

ping @DaveRandom can I ask that you look at this again (and in full) and relay an opinion please ?

@iRipVanWinkle
Copy link
Author

ping

@krakjoe
Copy link
Member

krakjoe commented May 10, 2021

This appears to have gone stale, so closing.

@krakjoe krakjoe closed this May 10, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants