Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » Parsing of xml with xs:any element with different namespaces(Mixed namespace xml parsing and editing how to)
Parsing of xml with xs:any element with different namespaces [message #1834829] Wed, 18 November 2020 16:47 Go to next message
Nicola Calgaro is currently offline Nicola CalgaroFriend
Messages: 1
Registered: November 2020
Junior Member
Hi,

I've got pure generated EMF code coming from a specific xsd file related to a model "A". Inside this xsd there are several elements of type "any" like:

          <xs:element name="Value" minOccurs="0">
            <xs:complexType>
              <xs:sequence>
                <xs:any minOccurs="0" processContents="lax" />
              </xs:sequence>
            </xs:complexType>
          </xs:element>


When I load a resource there are no validation checks on content of that elements but in the xml that I'm loading I can found that data inside "Value" tag for example is modeled by a specific namespace (tags inside the element "any" have prefix related to a specific namespace):

        <Value>
            <xyz:ListOfExtensionObject>
                <xyz:ExtensionObject>
                    <xyz:TypeId>
                        <xyz:Identifier>i=7616</xyz:Identifier>
                    </xyz:TypeId>
                    <xyz:Body>
                    .....


I've got also the xsd for the second model "B" and I can generate java code also for that model but I don't know how to give the possibility to the editor generated for the model "A" to manage "any" elements by java code generated for model "B" in order parse them correctly (and not in the way you can see in the attached screenshot) and also to have the possibility to have the correct "add child" commands with reference to model "B" types.

Best regards,

Re: Parsing of xml with xs:any element with different namespaces [message #1834839 is a reply to message #1834829] Wed, 18 November 2020 19:49 Go to previous message
Ed Merks is currently offline Ed MerksFriend
Messages: 31834
Registered: July 2009
Senior Member
There simply is not enough information in this post to provide answers. There is no schema for A nor B. There is no full XML sample that shows what namespace is bound to prefix xyz in the snippet. There's just no way to come close to reproducing what you are seeing. There's just not enough to guess. what code you've written to try to load...

Ed Merks
Professional Support: https://www.macromodeling.com/
Previous Topic:arrayIndexOutOfBound Exception with ResourceSet.getResource
Next Topic:Element matching
Goto Forum:
  


Current Time: Fri Apr 16 03:41:32 GMT 2021

Powered by FUDForum. Page generated in 0.01670 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top