Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    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 14:48 Go to next message
Rolf Schumacher is currently offline Rolf SchumacherFriend
Messages: 46
Registered: January 2014
Member
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 14:52]

Report message to a moderator

Re: XML Schema editor sees "form" as a failure [message #1784651 is a reply to message #1784640] Sun, 01 April 2018 07:41 Go to previous message
Ed Merks is currently offline Ed MerksFriend
Messages: 29539
Registered: July 2009
Senior Member
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.
Previous Topic:Eclipse JDT Oxygen 2 Crashes
Next Topic:Eclipse compatibility with Java updates
Goto Forum:
  


Current Time: Thu Sep 20 22:04:09 GMT 2018

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

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

Back to the top