Free2Code
 
Time: 2008-11-21, 12:14am
python and xml file
Subject: python and xml file  ·  Posted: 2005-11-01, 05:45am
Rank: ? (2)
Member #: 25642
I have to generate a xml file using python.The structure of the file is:

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" xmlns:sql="urn:schemas-microsoft-com:mapping-schema">

<xs:annotation>
<xs:appinfo>
<sql:relationship name="HeaderDetail"
parent="Study_Header"
parent-key="study_revision_no"
child="Study_Detail"
child-key="study_revision_no" />
</xs:appinfo>
</xs:annotation>

<xs:element name="HEADER" sql:relation="Study_Header" sql:key-fields="study_revision_no" >
<xs:complexType>
<xs:sequence>
<xs:element name="ROW" sql:relation="Study_Detail" sql:relationship="HeaderDetail">
<xs:complexType>
<xs:sequence>
<xs:element name="FIRST_NAME" type="xs:string"/>
<xs:element name="LAST_NAME" type="xs:string"/>
<xs:element name="EVENING_BEST_TIME_CALL" type="xs:string"/>
<xs:element name="EVENING_PHONE_NUMBER" type="xs:string"/>
<xs:element name="EVENING_PHONE_EXTENSION" type="xs:string"/>
<xs:element name="DAY_BEST_TIME_CALL" type="xs:string"/>
<xs:element name="DAY_PHONE_NUMBER" type="xs:string"/>
<xs:element name="DAY_PHONE_EXTENSION" type="xs:string"/>
<xs:element name="ACCOUNT_CODE" type="xs:string"/>
<xs:element name="SUBJECT_ID" type="xs:string"/>
<xs:element name="AGE" type="xs:string"/>
<xs:element name="GENDER" type="xs:string"/>
<xs:element name="CATEGORY_CODE" type="xs:string"/>
<xs:element name="CALLER_FIRST_NAME" type="xs:string"/>
<xs:element name="CALLER_LAST_NAME" type="xs:string"/>
<xs:element name="CALLER_RELATIONSHIP" type="xs:string"/>
<xs:element name="ENCOUNTER_DATE" type="xs:string"/>
<xs:element name="ENCOUNTER_ID" type="xs:string"/>
<xs:element name="EPISODE_ID" type="xs:string"/>
<xs:element name="REGION" type="xs:string"/>
<xs:element name="CATCHMENT_AREA" type="xs:string"/>
<xs:element name="MSG">
<!--
<xs:complexType>
<xs:sequence>
<xs:element name="DISPOSITION_CODE"/>
<xs:element name="ATTEMPT_COUNT"/>
<xs:element name="SURVEY_ADD_DATE"/>
</xs:sequence>
</xs:complexType>
-->
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:sequence>
<xs:attribute name="study_revision_no" type="xs:string"/>
<xs:attribute name="row_count" type="xs:string"/>
<xs:attribute name="account_group" type="xs:string"/>
<xs:attribute name="start_date" type="xs:string"/>
<xs:attribute name="end_date" type="xs:string"/>
</xs:complexType>
</xs:element>
</xs:schema>


Iam very new to python.can anyone send me the code.?

Thanks and Regards,
Rahul.


 
  Reply to this ·  Post link ·  Top

Pages: 1

Please login or register to post a reply.

icons