Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » XML Schema Definition (XSD) » Missing element in XML editor autocompletion(substitutionGroup element defined in 2nd xsd aren't proposed in autocompleted)
Missing element in XML editor autocompletion [message #531801] Thu, 06 May 2010 09:14 Go to next message
Arnaud is currently offline ArnaudFriend
Messages: 31
Registered: July 2009
Member
Hi,

In the following xml file:
<?xml version="1.0" encoding="UTF-8"?>
<tst:root
	xmlns:ext="testExt:/test/xsd/validation"
	xmlns:tst="test:/test/xsd/validation"
	>
	
	<tst:positiveComment/>
	
</tst:root>


only tst:positiveComment and tst:negativeComment take part of eclipse XML editor Ctrl+Space auto completion.
The element 'ext:extComment' is not proposed...
Is there something wrong in my configuration ?

Both xsd schema are 'defined' using catalogContributions extension point:
<extension point="org.eclipse.wst.xml.core.catalogContributions"> 
      <catalogContribution id="myId"> 
         <public
               publicId="test:/test/xsd/validation"
               uri="xsd/test.xsd">
         </public>
         <public
               publicId="testExt:/test/xsd/validation"
               uri="xsd/test_ext.xsd">
         </public>
      </catalogContribution> 
  </extension> 


text.xsd file is:
<?xml version="1.0" encoding="UTF-8"?> 
<xsd:schema 
  xmlns:xsd="http://www.w3.org/2001/XMLSchema" 
  elementFormDefault="qualified"
  attributeFormDefault="unqualified" 
  targetNamespace="test:/test/xsd/validation"  
  xmlns:tst="test:/test/xsd/validation"> 
  
  <xsd:element name="root">
    <xsd:complexType>      
       <xsd:choice minOccurs="0" maxOccurs="unbounded"> 
          <xsd:element ref="tst:comment" /> 
       </xsd:choice> 
    </xsd:complexType> 
  </xsd:element>
  
  <xsd:complexType name="CommentType" >
  </xsd:complexType>
  
  <!-- test abstract element and subs.group :: WORKS -->
  <xsd:element name="comment" type="tst:CommentType" abstract="true" />
  <xsd:element name="positiveComment" type="tst:CommentType"
           substitutionGroup="tst:comment" />
  <xsd:element name="negativeComment" type="tst:CommentType"
           substitutionGroup="tst:comment" />
   
  
 </xsd:schema>


and test_ext.xsd is:
<?xml version="1.0" encoding="UTF-8"?> 
<xsd:schema 
  xmlns:xsd="http://www.w3.org/2001/XMLSchema" 
  elementFormDefault="qualified"
  attributeFormDefault="unqualified" 
  targetNamespace="testExt:/test/xsd/validation"  
  xmlns:ext="testExt:/test/xsd/validation"
  xmlns:tst="test:/test/xsd/validation"> 
  
  <xsd:import namespace="test:/test/xsd/validation" />
  
  <!-- define a new comment type in substitution group -->
  <xsd:element name="extComment" type="tst:CommentType"
           substitutionGroup="tst:comment" >
     <xsd:annotation><xsd:documentation xml:lang="en">
       This kind of comment is defined in another xsd file...
    </xsd:documentation></xsd:annotation>      
  </xsd:element>
   
  
 </xsd:schema>


I suspect XML editor doesn't take care of imported substitutionGroup element. ? is it possible ?


In other hand I can add manually '<ext:extComment/>' after positiveComment, then Validate command return No errors
(meaning test_ext.xsd is known and parsed correctly).

Any suggestion to add 'ext:extComment' in editor proposals ?

Thanks for your help,
Arnaud.
Re: Missing element in XML editor autocompletion [message #531820 is a reply to message #531801] Thu, 06 May 2010 09:23 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 33141
Registered: July 2009
Senior Member
Arnaud,

The WTP project provides the editor, so I'm redirecting your post to
their newsgroup/forum.


Arnaud wrote:
> Hi,
>
> In the following xml file:
> <?xml version="1.0" encoding="UTF-8"?>
> <tst:root
> xmlns:ext="testExt:/test/xsd/validation"
> xmlns:tst="test:/test/xsd/validation"
> >
>
> <tst:positiveComment/>
>
> </tst:root>
>
> only tst:positiveComment and tst:negativeComment take part of eclipse
> XML editor Ctrl+Space auto completion. The element 'ext:extComment'
> is not proposed...
> Is there something wrong in my configuration ?
>
> Both xsd schema are 'defined' using catalogContributions extension point:
> <extension point="org.eclipse.wst.xml.core.catalogContributions">
> <catalogContribution id="myId"> <public
> publicId="test:/test/xsd/validation"
> uri="xsd/test.xsd">
> </public>
> <public
> publicId="testExt:/test/xsd/validation"
> uri="xsd/test_ext.xsd">
> </public>
> </catalogContribution> </extension>
> text.xsd file is:
> <?xml version="1.0" encoding="UTF-8"?> <xsd:schema
> xmlns:xsd="http://www.w3.org/2001/XMLSchema"
> elementFormDefault="qualified"
> attributeFormDefault="unqualified"
> targetNamespace="test:/test/xsd/validation"
> xmlns:tst="test:/test/xsd/validation">
> <xsd:element name="root">
> <xsd:complexType> <xsd:choice minOccurs="0"
> maxOccurs="unbounded"> <xsd:element ref="tst:comment" />
> </xsd:choice> </xsd:complexType> </xsd:element>
>
> <xsd:complexType name="CommentType" >
> </xsd:complexType>
>
> <!-- test abstract element and subs.group :: WORKS -->
> <xsd:element name="comment" type="tst:CommentType" abstract="true" />
> <xsd:element name="positiveComment" type="tst:CommentType"
> substitutionGroup="tst:comment" />
> <xsd:element name="negativeComment" type="tst:CommentType"
> substitutionGroup="tst:comment" />
>
> </xsd:schema>
>
> and test_ext.xsd is:
> <?xml version="1.0" encoding="UTF-8"?> <xsd:schema
> xmlns:xsd="http://www.w3.org/2001/XMLSchema"
> elementFormDefault="qualified"
> attributeFormDefault="unqualified"
> targetNamespace="testExt:/test/xsd/validation"
> xmlns:ext="testExt:/test/xsd/validation"
> xmlns:tst="test:/test/xsd/validation">
> <xsd:import namespace="test:/test/xsd/validation" />
>
> <!-- define a new comment type in substitution group -->
> <xsd:element name="extComment" type="tst:CommentType"
> substitutionGroup="tst:comment" >
> <xsd:annotation><xsd:documentation xml:lang="en">
> This kind of comment is defined in another xsd file...
> </xsd:documentation></xsd:annotation> </xsd:element>
>
> </xsd:schema>
>
> I suspect XML editor doesn't take care of imported substitutionGroup
> element. ? is it possible ?
>
>
> In other hand I can add manually '<ext:extComment/>' after
> positiveComment, then Validate command return No errors
> (meaning test_ext.xsd is known and parsed correctly).
>
> Any suggestion to add 'ext:extComment' in editor proposals ?
>
> Thanks for your help,
> Arnaud.


Ed Merks
Professional Support: https://www.macromodeling.com/
Re: Missing element in XML editor autocompletion [message #531863 is a reply to message #531820] Thu, 06 May 2010 12:20 Go to previous messageGo to next message
Arnaud is currently offline ArnaudFriend
Messages: 31
Registered: July 2009
Member
Sure,
sorry for the inconvenience.
Re: Missing element in XML editor autocompletion [message #531950 is a reply to message #531820] Thu, 06 May 2010 14:48 Go to previous message
Valentin is currently offline ValentinFriend
Messages: 36
Registered: July 2009
Member
Thanks Ed.

Arnaud, this seems similar to the scenario described in
https://bugs.eclipse.org/bugs/show_bug.cgi?id=247312

Regards, Valentin

"Ed Merks" <Ed.Merks@gmail.com> wrote in message
news:hru1pu$pnc$2@build.eclipse.org...
> Arnaud,
>
> The WTP project provides the editor, so I'm redirecting your post to their
> newsgroup/forum.
>
>
> Arnaud wrote:
>> Hi,
>>
>> In the following xml file:
>> <?xml version="1.0" encoding="UTF-8"?>
>> <tst:root
>> xmlns:ext="testExt:/test/xsd/validation"
>> xmlns:tst="test:/test/xsd/validation"
>> >
>> <tst:positiveComment/>
>> </tst:root>
>>
>> only tst:positiveComment and tst:negativeComment take part of eclipse XML
>> editor Ctrl+Space auto completion. The element 'ext:extComment' is not
>> proposed...
>> Is there something wrong in my configuration ?
>>
>> Both xsd schema are 'defined' using catalogContributions extension point:
>> <extension point="org.eclipse.wst.xml.core.catalogContributions">
>> <catalogContribution id="myId"> <public
>> publicId="test:/test/xsd/validation"
>> uri="xsd/test.xsd">
>> </public>
>> <public
>> publicId="testExt:/test/xsd/validation"
>> uri="xsd/test_ext.xsd">
>> </public>
>> </catalogContribution> </extension>
>> text.xsd file is:
>> <?xml version="1.0" encoding="UTF-8"?> <xsd:schema
>> xmlns:xsd="http://www.w3.org/2001/XMLSchema"
>> elementFormDefault="qualified"
>> attributeFormDefault="unqualified"
>> targetNamespace="test:/test/xsd/validation"
>> xmlns:tst="test:/test/xsd/validation"> <xsd:element name="root">
>> <xsd:complexType> <xsd:choice minOccurs="0"
>> maxOccurs="unbounded"> <xsd:element ref="tst:comment" />
>> </xsd:choice> </xsd:complexType> </xsd:element>
>> <xsd:complexType name="CommentType" >
>> </xsd:complexType>
>> <!-- test abstract element and subs.group :: WORKS -->
>> <xsd:element name="comment" type="tst:CommentType" abstract="true" />
>> <xsd:element name="positiveComment" type="tst:CommentType"
>> substitutionGroup="tst:comment" />
>> <xsd:element name="negativeComment" type="tst:CommentType"
>> substitutionGroup="tst:comment" />
>> </xsd:schema>
>>
>> and test_ext.xsd is:
>> <?xml version="1.0" encoding="UTF-8"?> <xsd:schema
>> xmlns:xsd="http://www.w3.org/2001/XMLSchema"
>> elementFormDefault="qualified"
>> attributeFormDefault="unqualified"
>> targetNamespace="testExt:/test/xsd/validation"
>> xmlns:ext="testExt:/test/xsd/validation"
>> xmlns:tst="test:/test/xsd/validation"> <xsd:import
>> namespace="test:/test/xsd/validation" />
>> <!-- define a new comment type in substitution group -->
>> <xsd:element name="extComment" type="tst:CommentType"
>> substitutionGroup="tst:comment" >
>> <xsd:annotation><xsd:documentation xml:lang="en">
>> This kind of comment is defined in another xsd file...
>> </xsd:documentation></xsd:annotation> </xsd:element>
>> </xsd:schema>
>>
>> I suspect XML editor doesn't take care of imported substitutionGroup
>> element. ? is it possible ?
>>
>>
>> In other hand I can add manually '<ext:extComment/>' after
>> positiveComment, then Validate command return No errors
>> (meaning test_ext.xsd is known and parsed correctly).
>>
>> Any suggestion to add 'ext:extComment' in editor proposals ?
>>
>> Thanks for your help,
>> Arnaud.
Re: Missing element in XML editor autocompletion [message #604653 is a reply to message #531820] Thu, 06 May 2010 12:20 Go to previous message
Arnaud is currently offline ArnaudFriend
Messages: 31
Registered: July 2009
Member
Sure,
sorry for the inconvenience.
Re: Missing element in XML editor autocompletion [message #604659 is a reply to message #531820] Thu, 06 May 2010 14:48 Go to previous message
Valentin is currently offline ValentinFriend
Messages: 36
Registered: July 2009
Member
Thanks Ed.

Arnaud, this seems similar to the scenario described in
https://bugs.eclipse.org/bugs/show_bug.cgi?id=247312

Regards, Valentin

"Ed Merks" <Ed.Merks@gmail.com> wrote in message
news:hru1pu$pnc$2@build.eclipse.org...
> Arnaud,
>
> The WTP project provides the editor, so I'm redirecting your post to their
> newsgroup/forum.
>
>
> Arnaud wrote:
>> Hi,
>>
>> In the following xml file:
>> <?xml version="1.0" encoding="UTF-8"?>
>> <tst:root
>> xmlns:ext="testExt:/test/xsd/validation"
>> xmlns:tst="test:/test/xsd/validation"
>> >
>> <tst:positiveComment/>
>> </tst:root>
>>
>> only tst:positiveComment and tst:negativeComment take part of eclipse XML
>> editor Ctrl+Space auto completion. The element 'ext:extComment' is not
>> proposed...
>> Is there something wrong in my configuration ?
>>
>> Both xsd schema are 'defined' using catalogContributions extension point:
>> <extension point="org.eclipse.wst.xml.core.catalogContributions">
>> <catalogContribution id="myId"> <public
>> publicId="test:/test/xsd/validation"
>> uri="xsd/test.xsd">
>> </public>
>> <public
>> publicId="testExt:/test/xsd/validation"
>> uri="xsd/test_ext.xsd">
>> </public>
>> </catalogContribution> </extension>
>> text.xsd file is:
>> <?xml version="1.0" encoding="UTF-8"?> <xsd:schema
>> xmlns:xsd="http://www.w3.org/2001/XMLSchema"
>> elementFormDefault="qualified"
>> attributeFormDefault="unqualified"
>> targetNamespace="test:/test/xsd/validation"
>> xmlns:tst="test:/test/xsd/validation"> <xsd:element name="root">
>> <xsd:complexType> <xsd:choice minOccurs="0"
>> maxOccurs="unbounded"> <xsd:element ref="tst:comment" />
>> </xsd:choice> </xsd:complexType> </xsd:element>
>> <xsd:complexType name="CommentType" >
>> </xsd:complexType>
>> <!-- test abstract element and subs.group :: WORKS -->
>> <xsd:element name="comment" type="tst:CommentType" abstract="true" />
>> <xsd:element name="positiveComment" type="tst:CommentType"
>> substitutionGroup="tst:comment" />
>> <xsd:element name="negativeComment" type="tst:CommentType"
>> substitutionGroup="tst:comment" />
>> </xsd:schema>
>>
>> and test_ext.xsd is:
>> <?xml version="1.0" encoding="UTF-8"?> <xsd:schema
>> xmlns:xsd="http://www.w3.org/2001/XMLSchema"
>> elementFormDefault="qualified"
>> attributeFormDefault="unqualified"
>> targetNamespace="testExt:/test/xsd/validation"
>> xmlns:ext="testExt:/test/xsd/validation"
>> xmlns:tst="test:/test/xsd/validation"> <xsd:import
>> namespace="test:/test/xsd/validation" />
>> <!-- define a new comment type in substitution group -->
>> <xsd:element name="extComment" type="tst:CommentType"
>> substitutionGroup="tst:comment" >
>> <xsd:annotation><xsd:documentation xml:lang="en">
>> This kind of comment is defined in another xsd file...
>> </xsd:documentation></xsd:annotation> </xsd:element>
>> </xsd:schema>
>>
>> I suspect XML editor doesn't take care of imported substitutionGroup
>> element. ? is it possible ?
>>
>>
>> In other hand I can add manually '<ext:extComment/>' after
>> positiveComment, then Validate command return No errors
>> (meaning test_ext.xsd is known and parsed correctly).
>>
>> Any suggestion to add 'ext:extComment' in editor proposals ?
>>
>> Thanks for your help,
>> Arnaud.
Previous Topic:Missing element in XML editor autocompletion
Next Topic:QName validation
Goto Forum:
  


Current Time: Thu Apr 25 16:09:48 GMT 2024

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

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

Back to the top