| XML editor content assistor problem with multiple schemas [message #172843] | 
Mon, 03 July 2006 05:55   | 
 
Eclipse User  | 
 | 
 | 
   | 
 
I defined a hierarchy of xsd types in multiple xsd files with different  
target namespaces, and then reference the xsd files in a xml file (File  
contents are attached below).  In the XML editor, when I press Alt+/ after  
xsi:type=, only "base:abstractBaseType" and "base:baseType" shown, missing  
"ext:extType".  After I manually enter "ext:extType" here, the validator  
accepts it, then prompt "cvc-complex-type.4: Attribute 'extAttr' must appear  
on element 'ext:node'", which is OK, but the content assistor still can't  
prompt required attributes when I press Alt+/.  It also can't prompt  
sub-elements in the content of the root element. 
 
If I change xsi:type to "base:baseType", the assistor works fine. 
 
Summary: The validator works fine, but the content assistor only works for  
base types. 
 
I tried the example several months ago when I use WTP 1.01, and I thought  
this was a temporary bug in WTP 1.01.  Today, I tried this example with the  
newest WTP 1.5 release, and the problem still exists.  Do you all think this  
is a bug? 
 
base.xsd: 
 
<?xml version="1.0" encoding="UTF-8"?> 
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" 
    targetNamespace="urn:xmlns:base" xmlns:base="urn:xmlns:base"> 
 
  <xsd:complexType name="abstractBaseType" abstract="true"/> 
 
  <xsd:complexType name="baseType"> 
    <xsd:complexContent> 
      <xsd:extension base="base:abstractBaseType"> 
        <xsd:sequence> 
          <xsd:element name="node" type="base:abstractBaseType"  
minOccurs="0" maxOccurs="unbounded"/> 
        </xsd:sequence> 
        <xsd:attribute name="baseAttr" type="xsd:string" use="required"/> 
      </xsd:extension> 
    </xsd:complexContent> 
  </xsd:complexType> 
 
  <xsd:element name="node" type="base:abstractBaseType"/> 
 
</xsd:schema> 
 
 
ext.xsd: 
 
<?xml version="1.0" encoding="UTF-8"?> 
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" 
    targetNamespace="urn:xmlns:ext" 
    xmlns:ext="urn:xmlns:ext" 
    xmlns:base="urn:xmlns:base"> 
 
  <xsd:import namespace="urn:xmlns:base" schemaLocation="base.xsd"/> 
 
  <xsd:complexType name="extType"> 
    <xsd:complexContent> 
      <xsd:extension base="base:baseType"> 
        <xsd:attribute name="ext" type="xsd:string" use="required"/> 
      </xsd:extension> 
    </xsd:complexContent> 
  </xsd:complexType> 
 
  <xsd:element name="node" type="base:abstractBaseType"/> 
 
</xsd:schema> 
 
 
test.xml: 
 
<?xml version="1.0" encoding="UTF8"?> 
<ext:node xmlns:ext="urn:xmlns:ext" 
    xmlns:base="urn:xmlns:base" 
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
    xsi:schemaLocation="urn:xmlns:ext ext.xsd 
          urn:xmlns:base base.xsd" 
    xsi:type="ext:extType" 
 
> 
</ext:node>
 |  
 |  
  | 
 | 
Powered by 
FUDForum. Page generated in 0.88980 seconds