Re: Schema Problem

At 3:46 PM +0000 2009-06-12, Anand Khandewale wrote:
>Dear Sir/ Madam,
>
>I am a novice to the world of xml. I am working on a project that 
>involves conversion of data entered in excel into xml based on some 
>predefined schema. I am using excel 2003 professional for this 
>purpose and I have mapped all the elements in the schema to excel 
>cells. Using the Export command in excel, I can create an xml file. 
>However, on validation, there are two errors found in the xml -
>
>1. Some of the data fields are related to some other field in the 
>excel file. e.g., the fields spouse name and number of childern are 
>related to the field marital status. If the value in the field 
>Marital Status is unmarried, the other two fields should not appear 
>in the xml. however, this does not work. Even if the value for the 
>field Marital status is unmarried, the other two fields do appear in 
>the xml.
>
>2. There are some lists in the data. The fields are mapped. but the 
>problem is that if there is no data in the list, the corresponding 
>fields should not be exported to xml. This does not work.
>
>Can you help me in modifying the schema to achieve the desired results?

Anand:  I When you dump your spreadsheet in XML format, you don't have much
control of what elements are present.  I suggest you just expect Excel to
put those inappropriate (from your perspective) elements, and then run that
XML document through an XSLT processor to eliminate or modify the result.
The XSLT program shouldn't be too complicated, once you get familiar with
XSLT.  If you want to validate the result, to be sure it does follow your
rules, you can use Schema to do the validation.

Good luck.
-- 
Dave Peterson
SGMLWorks!

davep@iit.edu

Received on Tuesday, 16 June 2009 00:23:49 UTC