XML Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me

The Shed is going Social! Join us on FaceBook and Twitter and chime in on the conversation.

Go Back   Dev Shed ForumsProgramming Languages - MoreXML Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old February 18th, 2011, 09:47 AM
Northie's Avatar
Northie Northie is offline
Square Peg in a Round Hole
Click here for more information.
 
Join Date: Oct 2007
Location: North Yorkshire, UK
Posts: 3,416 Northie User rank is General 43rd Grade (Above 100000 Reputation Level)Northie User rank is General 43rd Grade (Above 100000 Reputation Level)Northie User rank is General 43rd Grade (Above 100000 Reputation Level)Northie User rank is General 43rd Grade (Above 100000 Reputation Level)Northie User rank is General 43rd Grade (Above 100000 Reputation Level)Northie User rank is General 43rd Grade (Above 100000 Reputation Level)Northie User rank is General 43rd Grade (Above 100000 Reputation Level)Northie User rank is General 43rd Grade (Above 100000 Reputation Level)Northie User rank is General 43rd Grade (Above 100000 Reputation Level)Northie User rank is General 43rd Grade (Above 100000 Reputation Level)Northie User rank is General 43rd Grade (Above 100000 Reputation Level)Northie User rank is General 43rd Grade (Above 100000 Reputation Level)Northie User rank is General 43rd Grade (Above 100000 Reputation Level)Northie User rank is General 43rd Grade (Above 100000 Reputation Level)Northie User rank is General 43rd Grade (Above 100000 Reputation Level)Northie User rank is General 43rd Grade (Above 100000 Reputation Level) 
Time spent in forums: 3 Weeks 5 Days 9 h 44 m 4 sec
Reputation Power: 3835
Can't make xml validate against schema when omitting elements

I'm not a big fan of XML or XSD or XLS either because the documentation is poor, or my understandig of the documentation is poor.

Either way I have a problem. Part of a schema that a 3rd part has supplied is this

xml Code:
Original - xml Code
  1.  
  2. <xs:element name="DeliveredToAE" maxOccurs="unbounded">
  3.     <xs:complexType>
  4.         <xs:sequence>
  5.             <xs:element name="DeliveredToOperator">
  6.                 <xs:complexType>
  7.                     <xs:sequence>
  8.                         <xs:element name="AEApprovalNo" type="aeApprovalNoType"/>
  9.                         <xs:element name="OperatorName">
  10.                             <xs:simpleType>
  11.                                 <xs:restriction base="xs:string">
  12.                                     <xs:maxLength value="250"/>
  13.                                 </xs:restriction>
  14.                             </xs:simpleType>
  15.                         </xs:element>
  16.                     </xs:sequence>
  17.                 </xs:complexType>
  18.             </xs:element>
  19.             <xs:element name="Return" type="TonnageReturnType" maxOccurs="26"/>
  20.         </xs:sequence>
  21.     </xs:complexType>
  22.     <xs:unique name="uniqueCategoryObligationDeliveredToAE">
  23.         <xs:selector xpath="Return"/>
  24.         <xs:field xpath="CategoryName"/>
  25.         <xs:field xpath="ObligationType"/>
  26.     </xs:unique>
  27. </xs:element>


When I have relevant records I have no problem in creating the valid XML that validates agaisnt this part of the schema.

The validation fails when I have no data to make any XML elements of <DeliveredToAE>.

If i leave it out then the validation fails saying that it was expected
If I put an empty one in then I get an error saying that it is incomplete

Assuming I have no data for "DeliveredToAE" and given this schema, what would be the valid XML to put in?
__________________
PHP OOPS! <?php DB::Execute(SQL::makeFrom($_GET))->fetchArray()->FormatWith(Template::getInstance('default'))->printHtml(); ?>

PDO vs mysql_* functions: Find a Migration Guide Here

[ Xeneco - T'interweb Development ] - [ Are you a Help Vampire? ] - [ Read The manual! ] - [ W3 methods - GET, POST, etc ] - [ Web Design Hell ]

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming Languages - MoreXML Programming > Can't make xml validate against schema when omitting elements

Developer Shed Advertisers and Affiliates



Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.

© 2003-2013 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap