Prevent Eclispe content-assistance from xsd for the namespace, which is not declared in xml [message #893163] |
Tue, 03 July 2012 01:29 |
rohit chawla Messages: 19 Registered: June 2012 |
Junior Member |
|
|
Hi guys,
Please take a look at this problem, and tell me if its a inherent Eclipse bug or I am missing to specify something? (xsd's are at the bottom of the post.)
When I make an entry into the xml catalog for rohit.xsd, and then make the following xml file, associating it with the rohit.xsd.
<?xml version="1.0" encoding="UTF-8"?>
<p:page xmlns="google.com" xmlns:p="google.com" xmlns:xsi="w3.org/2001/XMLSchema-instance" xsi:schemaLocation="google.com google.com ">
<!-- When I hit Ctrl+space here, I see the element editMode(see xsd's at the bottom) in content assist suggestions-->
<!-- The element is shown as editMode in content proposal list, not fully qualified c:editMode,-->
</p:page>
Note that the namespace xmlns:c = custom.com is not declared,
but still , I see the element editMode in content-assist suggestions.
I want either one of the following to happen-:
If it shows then it should be fully-qualified, or it does not show at all.
Write now,the content proposal list only displays the element name, and when I hit enter to include that element, then it gets included, but immediately its marked with red-line indicating validation error, that this element is not expected at this place.
rohit.xsd
<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="w3.org/2001/XMLSchema" attributeFormDefault="unqualified" xmlns:c="custom.com" targetNamespace="google.com">
<xs:import schemaLocation="custom.xsd" namespace="custom.com"/>
<xs:element name="page" >
<xs:complexType>
<xs:choice minOccurs="0" maxOccurs="unbounded">
<xs:element ref="c:editMode"></xs:element>
</xs:choice>
<xs:attribute name="action" type="xs:string"/>
<xs:attribute name="controller" type="xs:string"/>
</xs:complexType>
</xs:element>
</xs:schema>
custom.xsd
<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="w3.org/2001/XMLSchema" xmlns:p="mohit" xmlns:custom="custom.com" targetNamespace="custom.com" >
<xs:element name="editMode">
<xs:complexType>
<xs:sequence>
</xs:sequence>
<xs:attribute name="value" type="custom:password"/>
</xs:complexType>
</xs:element>
<xs:simpleType name="password">
<xs:restriction base="xs:string">
<xs:pattern value="[{][!][$]?([a-zA-Z.])*[}]"/>
</xs:restriction>
</xs:simpleType>
</xs:schema>
The attached screenshot indicates the error, but the element editMode is proposed in the content assist list
Namespaces are little weird bcz I am lot allowed to post links on this forum before I have made 25 posts?
[Updated on: Tue, 03 July 2012 14:13] Report message to a moderator
|
|
|
|
Powered by
FUDForum. Page generated in 0.02955 seconds