|
Re: Missing element in XML editor autocompletion [message #604648 is a reply to message #604643] |
Thu, 06 May 2010 09:23 |
Ed Merks Messages: 33264 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/
|
|
|
Powered by
FUDForum. Page generated in 0.04378 seconds