problem with xsd file creation


 
Thread Tools Search this Thread
Top Forums Programming problem with xsd file creation
# 1  
Old 12-06-2011
problem with xsd file creation

Hi every one,
I am new to xml data files,I have two xml files with same data but only small difference as shown below
Code:
<List>
    <number>1101</number>
  <Area>inner walls in a room.</Area>
  <Detection>less pressure.</Detection>
  <reason>
    <normal>
      <Component Num="15" Type="electric">
        <Beha Num="97" working="yes" acceptrate="100"/>
      </Component>
    </normal>
  </reason>
  <reaction>
    <Informal/>
  </reaction>
  <action>
    <Informal>some data here.
</Informal>
  </action>
</list>

second xml file
Code:
<List>
    <number>1102</number>
  <Area>outside  of  room.</Area>
  <Detection>more pressure.</Detection>
  <reason/>
  <reaction>
    <Informal/>
  </reaction>
  <action/>
</list>

In the above two xml files the difference is in second xml file i Have two empty tag elements One is action and another is reason tags. I created one xsd file file using xmlpad for frist xml file and validated using that xsd , Its giving no errors, but when I tried same xsd for second xml file it giving error like.
Code:
element action{}has invalid structure for schema definition:(informal)

used xsd is like this
Code:
  <xs:element name="Action">
    <xs:complexType>
      <xs:sequence>
        <xs:element ref="Informal" minOccures="0"/>
      </xs:sequence>
    </xs:complexType>
  </xs:element>
<xs:element name="Informal" type="xs:string"/>

same error for reason tags also, I tried in different ways but problem not solved can any one suggest me how to solve this problem.
Thanks in advance.
# 2  
Old 12-06-2011
Why not have no action tag, instead of an empty one?
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Validating XML file using XSD in UNIX

Hi, I have a xml file and a xsd file(xml schema file). Here using unix script i wanted to validate the xml file by referring to xsd file. The validation is in terms of Datatype,Field length and null values. If the data present in the xml file is not matching in terms of datatype,field length... (3 Replies)
Discussion started by: shree11
3 Replies

2. Programming

File creation problem

I am creating a file to store data, but the file does not get created at all. #include <unistd.h> #define DEFAULT_ID 0 int main() { int d, n=0; int sz, data=0; char fn; char *bv; snprintf(fn, 256, "bv", DEFAULT_ID); bv=fn; printf("%s\n", bv); if ((d =... (4 Replies)
Discussion started by: powyama
4 Replies

3. Shell Programming and Scripting

Text file creation problem

Using KSH, I have one text file which just contains a list of distinct references on each line, e.g.; 123456789 987654321 15457544X 164450200 etc. The file will always be called "InputRefs.txt". The number of distinct refs will be different each time. For each line (distinct ref) I... (1 Reply)
Discussion started by: b.hamilton
1 Replies

4. Shell Programming and Scripting

How to: Validate a CSV file using an XSD?

Hi All, I was wondering if there is a utility/perl library/way of validating the contents of a CSV file using an XSD. i.e. Customer csv (including Header & Trailer) Cust_num, Cust_nme, Cust_typ, Cust_act_dte, Cust_loc, 101,Joe's Pizza,Retail,10121979,Detroit, 102,Sony... (6 Replies)
Discussion started by: luinzi
6 Replies

5. Shell Programming and Scripting

Help required converting XSD to XML file in PERL

Hi, Please find below the xsd. <?xml version="1.0" encoding="ISO-8859-1" ?> <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"> <xs:element name="fruitorder"> <xs:complexType> <xs:sequence> <xs:element name="orderperson"... (2 Replies)
Discussion started by: vanitham
2 Replies

6. AIX

User creation problem

Hi, I am getting tired in creating several users in a day. Can anyone have a script to create several users in the same server, as well as, to create one user in several servers. where i have to put script and how to run the script. Waiting for your reply. Thanks in advance (5 Replies)
Discussion started by: udtyuvaraj
5 Replies

7. Shell Programming and Scripting

File Creation Problem

I recently got a problem with a program. It said that Create a file using shell script and insert details in it and take a String from the user and see whether it matches with any of the details of the String. I know how to create a file, insert details, but hw to check whether the String matches... (2 Replies)
Discussion started by: ramj
2 Replies

8. HP-UX

Problem With exceutable file creation

Hello , I came up with a new problem during creation of an exceutable file. My application all the c files and links them to create a new executable file. Till last month everything was fine and yester day i tried to change one file and tried to create an exe file but unsuccesfull. I am... (8 Replies)
Discussion started by: jagan_kalluri
8 Replies

9. Solaris

File creation problem

Hi to all, I am facing a strange problem on the Solaris-10 server. I am unable to create/write files on the server. After writing, when I go for the save, then it gives me and 'jag: I/O error'..where 'jag' is a file name. Please suggest me... Regards, Jagdish Machhi (2 Replies)
Discussion started by: jagdish.machhi@
2 Replies

10. UNIX for Dummies Questions & Answers

user creation problem

hello, Actually I want to create a user for our brower based custom application for the mail access from our mailserver(linux). I create user dummy and I granted all the privileages to dummy user and made dummy equivelent to root and if I tried to create a another user logging as dummy ... (1 Reply)
Discussion started by: jarkvarma
1 Replies
Login or Register to Ask a Question