Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


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

From: Avihaimar <avihaimar@-----.--->
To: xmlschema-dev@--.---
Date: 8/25/2009 1:47:00 PM
Almost.

I want instance like you attach,but in your instance you have xmlns in the
test element.
Remove it and your instance is not valid.

And i dont want prefix at all. clean xml.



David Maze wrote:
> 
> 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>
>   </test>
> </Library>
> 
> That doesn't use any namespace prefixes, but puts the {
> http://www.library.org}Library, {}test and {}Title elements in the correct 
> namespaces.
> 
> 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@y...>
> To:     xmlschema-dev@w...
> Date:   08/25/2009 06:58 AM
> Subject:        Re: Unqualified elment - but still have prefix at the root
> Sent by:        xmlschema-dev-request@w...
> 
> 
> 
> 
> 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"
> attributeFormDefault="unqualified">
>                  <xs:import namespace="http://www.book.org" 
> schemaLocation="Book.xsd"/>
>                  <xs:element name="Library" type="Library"/>
>                  <xs:complexType name="Library">
>                                  <xs:sequence>
>                                                  <xs:element 
> name="BookCatalogue">
>  <xs:complexType>
>   <xs:sequence>
>                  <xs:element name="test" type="b:BookType" 
> maxOccurs="unbounded"/>
>   </xs:sequence>
>  </xs:complexType>
>                                                  </xs:element>
>                                  </xs:sequence>
>                  </xs:complexType>
> </xs:schema>
> 
> 
> 
> ---------------------   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:sequence>
>                                                  <xs:element name="Title" 
> type="xs:string"/>
>                                  </xs:sequence>
>                  </xs:complexType>
> </xs:schema>
> 
> 
> 
> When i generate xml in xmlspy i get the following xml (with n1 prefix , 
> but
> 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"
> xmlns:n1="http://www.library.org"
> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
>                  <BookCatalogue>
>                                  <test>
>                                                  <Title>String</Title>
>                                  </test>
>                  </BookCatalogue>
> </n1:Library>
> 
> 
> 
> 
> Thank you!!!!!!
> -- 
> View this message in context: 
> http://www.nabble.com/Unqualified-elment---but-still-have-prefix-at-the-root-tp25123070p25132221.html
> 
> Sent from the w3.org - xmlschema-dev mailing list archive at Nabble.com.
> 
> 
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/Unqualified-elment---but-still-have-prefix-at-the-root-tp25123070p25134560.html
Sent from the w3.org - xmlschema-dev mailing list archive at Nabble.com.




transparent
Print
Mail
Like It
Disclaimer
.

These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on www.altova.com/list/index.html. Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.

.
.

transparent

transparent