Prevent Eclispe content-assistance for the namespace which is not declared in xml

Thijmen

New Member
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.\[code\]<?xml version="1.0" encoding="UTF-8"?><p:page xmlns="http://www.google.com" xmlns:p="http://www.google.com" xmlns:xsi="w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.google.com http://www.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>\[/code\]Note that the namespace xmlns:c = http://www.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.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.rohit.xsd\[code\]<?xml version="1.0" encoding="UTF-8"?><xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" attributeFormDefault="unqualified" xmlns:c="http://www.custom.com" targetNamespace="http://www.google.com"> <xs:import schemaLocation="custom.xsd" namespace="http://www.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" /> <xs:attribute name="controller" type="xs:NCName"/> </xs:complexType> </xs:element></xs:schema\[/code\]>custom.xsd\[code\]<?xml version="1.0" encoding="UTF-8"?><xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:p="mohit" xmlns:custom="http://www.custom.com" targetNamespace="http://www.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="http://stackoverflow.com/questions/11303431/[{][!][$]?([a-zA-Z.])*[}]"/> </xs:restriction> </xs:simpleType></xs:schema>\[/code\]Thanks.
 
Back
Top