473,387 Members | 1,542 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Parsing error for schema file

I have written the following schema file:
Expand|Select|Wrap|Line Numbers
  1. <schema xmlns="http://www.w3.org/2001/XMLSchema" 
  2.         xmlns:tns="http://www.abc.com/DDSchema" 
  3.         targetNamespace="http://www.abc.com/DDSchema" 
  4.         elementFormDefault="qualified" 
  5.         version="1.0">
  6.  
  7.          <complexType name="PSType">
  8.              <element ref="tns:ProfileName" maxOccurs="unbounded"/>        
  9.        </complexType>
  10.  
  11.   <element name="ProfileName" type="string"/>
  12.   <element name="ProfilesSummary" type="tns:PSType"/>
  13. </schema>
  14.  
while parsing i am getting the following exception:
[ERROR] s4s-elt-invalid-content.1: The content of 'PSType' is invalid. Element 'element' is invalid, misplaced, or occurs too often.

I want to write the above schema for the sample xml:
Expand|Select|Wrap|Line Numbers
  1. <ProfilesSummary>
  2.   <ProfileName>cat</ProfileName>
  3.   <ProfileName>dog</ProfileName>
  4.   <ProfileName>rat</ProfileName>
  5. </ProfilesSummary>
  6.  
Can someone please help? Thanks a lot !
Jun 29 '08 #1
1 3129
jkmyoung
2,057 Expert 2GB
The element inside the complexType needs to be nested inside of a sequence.
Expand|Select|Wrap|Line Numbers
  1. <complexType name="PSType">
  2.     <sequence>
  3.         <element ref="tns:ProfileName" maxOccurs="unbounded"/>
  4.     </sequence>
  5. </complexType>
  6.  
Jul 2 '08 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

3
by: Willem Ligtenberg | last post by:
I decided to use SAX to parse my xml file. But the parser crashes on: File "/usr/lib/python2.3/site-packages/_xmlplus/sax/handler.py", line 38, in fatalError raise exception...
0
by: Ewan B | last post by:
Hi, I'm using Xerces to parse XML files using SAX2, and am wondering if there is any information as to what exceptions are being thrown when certain validation errors occur. Taking a simple...
4
by: Pushya | last post by:
Hello - I am trying to parse a .XSD file to obtain information about element name and type in the file. I have been trying to find some kind of documentation for Schema Parsing. All I come...
2
by: Cigdem | last post by:
Hello, I am trying to parse the XML files that the user selects(XML files are on anoher OS400 system called "wkdis3"). But i am permenantly getting that error: Directory0: \\wkdis3\ROOT\home...
0
by: Pentti | last post by:
Can anyone help to understand why re-parsing occurs on a remote database (using database links), even though we are using a prepared statement on the local database: Scenario: ======== We...
4
by: Mike [MCP VB] | last post by:
Hi, I hope this is the right place to ask. I have an xml file thus: <?xml version="1.0" encoding="UTF-8"?> <Message xmlns="urn:myurl-org:ns2"...
8
by: pradeepsarathy | last post by:
Hi all, Does the SAX parser has eventhandlers for parsing xml schema. Can we parse the xml schema the same way as we parse the xml document using SAX Parser. Thanks in advance. -pradeep
1
by: David Williams | last post by:
Has the Schema of the Web.Config changed in Web App Projects? After converting my 2005 Web Site project to a 2005 WAP, and switching to IIS Web Server, I am getting a number of errors at run time...
1
by: christian.eickhoff | last post by:
Hi, I have a general question regarding the parsing of XSD files, referenced within the namespace using Apache Xerces 2.7.0 (CDT). My current c++ application can parse and validate an XML file...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.