W3C home > Mailing lists > Public > xmlschema-dev@w3.org > August 2009

Re: Unqualified elment - but still have prefix at the root

From: <dmaze@us.ibm.com>
Date: Tue, 25 Aug 2009 09:36:16 -0400
To: Avihaimar <avihaimar@yahoo.com>
Cc: xmlschema-dev@w3.org
Message-ID: <OF1ECC1F3E.0DD32666-ON8525761D.0049BB06-8525761D.004A831D@lotus.com>
It sounds like you're looking for an instance more like:

<Library xmlns="http://www.library.org">
  <test xmlns="">
    <Title>XSLT 2.0 Programmer's Reference</Title>

That doesn't use any namespace prefixes, but puts the {
http://www.library.org}Library, {}test and {}Title elements in the correct 

xs:schema/@elementFormDefault and xs:element/@form affect whether an 
element is in the xs:schema/@targetNamespace or in the null namespace; 
there is no particular requirement for a "qualified" element to have a 
namespace prefix or not.  (Which is to say, I kind of suspect you might 
actually want elementFormDefault="qualified", so that everything is in the 
same namespace.)

David Maze
Senior Software Engineer, IBM WebSphere DataPower SOA Appliances
One Rogers Street, Cambridge, MA 02142
Phone: 617-693-1306  Fax: 617-693-5541

From:   Avihaimar <avihaimar@yahoo.com>
To:     xmlschema-dev@w3.org
Date:   08/25/2009 06:58 AM
Subject:        Re: Unqualified elment - but still have prefix at the root
Sent by:        xmlschema-dev-request@w3.org

Exampel :  lib.xsd import book.xsd (both with unqualified)

------   LIB -------
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns="http://www.library.org" xmlns:b="http://www.book.org"
targetNamespace="http://www.library.org" elementFormDefault="unqualified"
                 <xs:import namespace="http://www.book.org" 
                 <xs:element name="Library" type="Library"/>
                 <xs:complexType name="Library">
                 <xs:element name="test" type="b:BookType" 

---------------------   Book  --------------
<?xml version="1.0"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns="http://www.book.org" targetNamespace="http://www.book.org"
elementFormDefault="unqualified" attributeFormDefault="unqualified">
                 <xs:complexType name="BookType">
                                                 <xs:element name="Title" 

When i generate xml in xmlspy i get the following xml (with n1 prefix , 
i dont want prefix!!!!)

------------------------ XML -------------------
<?xml version="1.0" encoding="UTF-8"?>
<!--Sample XML file generated by XMLSpy v2008 sp1 (http://www.altova.com
<n1:Library xsi:schemaLocation="http://www.library.org lib.xsd"

Thank you!!!!!!
View this message in context: 

Sent from the w3.org - xmlschema-dev mailing list archive at Nabble.com.
Received on Tuesday, 25 August 2009 13:34:41 UTC

This archive was generated by hypermail 2.3.1 : Wednesday, 7 January 2015 14:56:16 UTC