Skip to main content



      Home
Home » Language IDEs » Java Development Tools (JDT) » XML Schema editor sees "form" as a failure(Why Eclipse XML Schema editor flags "form" attribute in "element" as to be false?)
XML Schema editor sees "form" as a failure [message #1784640] Sat, 31 March 2018 10:48 Go to next message
Eclipse UserFriend
Using "Eclipse Editor and Tools" 3.9.2, experimenting with namespaces in XML schema:
<schema xmlns="http://www.w3.org/2001/XMLSchema" xmlns:a="http://exmaple.com/v0_0_1"
    elementFormDefault="qualified">
    <import namespace="http://example.com/v0_0_1" schemaLocation="a.xsd" />
    <element name="root" form="unqualified">
        <complexType>
            <sequence>
                <element name="elA" type="a:A" />
                <element ref="a:aEl"/>
            </sequence>
        </complexType>
    </element>
</schema>


I get a failure message about form attribute at line 4:

s4s-att-not-allowed: Attribute 'form' cannot appear in element 'element'.

Why shouldn't I use that form attribute there?
How to unqualify that element otherwise?
Validation against that schema works fine.

[Updated on: Sat, 31 March 2018 10:52] by Moderator

Re: XML Schema editor sees "form" as a failure [message #1784651 is a reply to message #1784640] Sun, 01 April 2018 03:41 Go to previous messageGo to next message
Eclipse UserFriend
This is the JDT forum so it's not really an appropriate question for there.

As you know, the form attribute is used to affect the namespace of the element, but note that for a global element, i.e., one not nested in a particle of a model group or complex type, the target namespace is always defined to be that of the schema:

https://www.w3.org/TR/xmlschema-1/#e-target_namespace

In section https://www.w3.org/TR/xmlschema-1/#element-element where it says "otherwise if the <element> element information item has <complexType> or <group> as an ancestor and the ref [attribute] is absent, the corresponding schema components are as follows" where it then mentions "{target namespace} If form is present and its ·actual value· is qualified, or if form is absent and the ·actual value· of elementFormDefault on the <schema> ancestor is qualified, then the ·actual value· of the targetNamespace [attribute] of the parent <schema> element information item, or ·absent· if there is none, otherwise ·absent·."

So no, a global element always is qualified by the schema's target namespace, you cannot use the form attribute in that context/scope, so you can only define unqualified global elements in the no-namespace schema.
Re: XML Schema editor sees "form" as a failure [message #1796473 is a reply to message #1784651] Sun, 14 October 2018 06:47 Go to previous messageGo to next message
Eclipse UserFriend
Thank you Ed - means: If I want to describe different namespaces in one schema - for what reason ever - including the no-namespace, the target namespace has to be the no-namespace.
Re: XML Schema editor sees "form" as a failure [message #1796474 is a reply to message #1796473] Sun, 14 October 2018 11:11 Go to previous message
Eclipse UserFriend
No, you can't describe/define different namespaces in one schema. Each namespace needs to be described/defined by one or more schemas with that target namespace. Only elements defined local to a complex type can choose whether they are qualified by the schema's target namespace or not, but if you want them to be qualified with some other namespace, they must be define in a schema for that namespace and be referenced.
Previous Topic:Eclipse to update module-info.java
Next Topic:http://download.eclipse.org/releases/neon/ site is down
Goto Forum:
  


Current Time: Mon Jul 14 08:32:11 EDT 2025

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

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

Back to the top