Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » ServerTools (WTP) » Prevent Eclispe content-assistance from xsd for the namespace, which is not declared in xml
Prevent Eclispe content-assistance from xsd for the namespace, which is not declared in xml [message #893163] Tue, 03 July 2012 01:29 Go to next message
rohit chawla is currently offline rohit chawlaFriend
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

Re: Content Assistance Bug (while referring multiple namespaces)? [message #893312 is a reply to message #893163] Tue, 03 July 2012 14:05 Go to previous message
rohit chawla is currently offline rohit chawlaFriend
Messages: 19
Registered: June 2012
Junior Member
In short,I want to prevent the content assistance for the elements referred in an xsd whose namespaces are not declared in the xml file...Write now,if I don't declare namespace, Eclipse is showing them in the proposal list without any namespace.

[Updated on: Tue, 03 July 2012 14:06]

Report message to a moderator

Previous Topic:ECMAScript Compliance Level 3 -> 5?
Next Topic:Invoking custom XMLContentAssistProcessor
Goto Forum:
  


Current Time: Thu Apr 25 08:47:03 GMT 2024

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

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

Back to the top