Missing element in XML editor autocompletion [message #531801] |
Thu, 06 May 2010 05:14  |
Eclipse User |
|
|
|
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 #531950 is a reply to message #531820] |
Thu, 06 May 2010 10:48  |
Eclipse User |
|
|
|
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 #604659 is a reply to message #531820] |
Thu, 06 May 2010 10:48  |
Eclipse User |
|
|
|
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.
|
|
|
Powered by
FUDForum. Page generated in 0.03491 seconds