Results 1 to 6 of 6

Thread: XML - XSD: What is elementFormDefault="qualified" for?

  1. #1
    Join Date
    May 2008
    Posts
    23

    XML - XSD: What is elementFormDefault="qualified" for?

    Having just started a new job I have been thrown in the deep end with some heavy XML work so I am finding my feet and I am sure that this will be the first of many posts on here!

    My first question is to do with Complex Types in XSD. I have figured out what a complex type is, and I have found that what the API provider is doing, is to do <xs:extension /> in a secondary set of XSDs.

    What I have noticed is that at the top of the XSD in the <xs:schema /> opening tag, it says elementFormDefault="qualified" - and I was just wondering if somebody could tell me what it is there for because I can't find any documentation on what it does?

  2. #2
    Join Date
    Feb 2008
    Posts
    1,852
    elementFormDefault="qualified" declaration indicates that all elements, even local (i.e., those defined within complexType) should be qualified in the instance documents.

  3. #3
    Join Date
    May 2008
    Posts
    23
    Thanks MindSpace, I know that you're answer is spot-on but still with my newbie hat on - what does "qualified" mean?

    I know that is a very novice question, but as I say, I am really new to all this!

    Many thanks.

  4. #4
    Join Date
    Apr 2008
    Posts
    2,005
    All "qualified" elements and attributes are in the targetNamespace of the schema and all "unqualified" elements and attributes are in no namespace. All global elements and attributes are qualified.

  5. #5
    Join Date
    Apr 2008
    Posts
    1,948
    "Qualified", in XML terms, means "Associated with a namespace, either by the use of a declared prefix or via a default namespace declaration".

    As to what elementFormDefault means: It indicates "whether or not locally declared elements and attributes must be unqualified."

  6. #6
    Join Date
    Jan 2008
    Posts
    1,521
    Element form default is kept qualified when the namespace is not needed to be hidden in the xml document or instance document .That means for all the elements in the xml document you have to prefix the namspace variable also. All the elements in the instance document must have namespace variables prefixed with them.

    Element form default is kept unqualified when the namespace needs to be hidden in the xml schema itself and need not be exposed in the instance document. That means all the elements that are used in the xml document don't have to be prefixed with the namspace variables. Only the root element has to be prefixed with the namespace variable.

Similar Threads

  1. Replies: 3
    Last Post: 10-01-2014, 10:40 AM
  2. Replies: 6
    Last Post: 18-05-2010, 12:27 AM
  3. Replies: 3
    Last Post: 25-06-2009, 03:49 AM
  4. Replies: 2
    Last Post: 24-12-2008, 05:06 PM
  5. Replies: 1
    Last Post: 06-11-2007, 02:18 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Page generated in 1,715,165,002.94993 seconds with 16 queries