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
Missing element in XML editor autocompletion [message #604643] 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 #604648 is a reply to message #604643] Thu, 06 May 2010 09:23 Go to previous message
Ed Merks is currently offline Ed MerksFriend
Messages: 33140
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/
Previous Topic:Incorrect validation
Next Topic:Missing element in XML editor autocompletion
Goto Forum:
  


Current Time: Thu Apr 25 14:11:45 GMT 2024

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

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

Back to the top