Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Web Tools Project (WTP) » XML editor content assistor problem with multiple schemas
XML editor content assistor problem with multiple schemas [message #172843] Mon, 03 July 2006 05:55 Go to next message
Wang Xianzhu is currently offline Wang Xianzhu
Messages: 4
Registered: July 2009
Junior Member
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>
Re: XML editor content assistor problem with multiple schemas [message #173549 is a reply to message #172843] Sat, 08 July 2006 00:52 Go to previous message
Craig Salter is currently offline Craig Salter
Messages: 169
Registered: July 2009
Senior Member
Yep, you've hit a fairly subtle bug with the way xsi:type is handled.
Please open a bugzilla bug.
Previous Topic:Content Assist filtering
Next Topic:How to call deployed webservice through web browser
Goto Forum:
  


Current Time: Sat Aug 30 16:42:00 EDT 2014

Powered by FUDForum. Page generated in 0.01561 seconds