Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Trouble doing XML

Status
Not open for further replies.

StuM

MIS
Jan 16, 2001
148
US
I'm trying to generate an XML file that has a "complex structure" that is indicated in the XSD data below.
I can't find any examples on the internet for this kind of output. I can do "simple XML" with 2 different addon programs BUT need help with this one.

<?xml version="1.0" encoding="UTF-8" ?>
<xsd:schema xmlns:xsd=" <!-- root element scheduledata
-->
<xsd:element name="scheduledata">
<xsd:complexType>
<xsd:sequence>
<!-- the scheduledata may contain one ore more aircraft
-->
<xsd:element name="aircraft" minOccurs="1" maxOccurs="unbounded">
<xsd:complexType>
<xsd:sequence>
<!-- each aircraft must contain one and only one updateenddate
-->
<xsd:element name="updateenddate" minOccurs="1" maxOccurs="1">
<xsd:complexType>
<xsd:all>
<xsd:element name="datetime" type="xsd:dateTime" />
</xsd:all>
</xsd:complexType>
</xsd:element>
<!-- each aircraft must contain one schedule
-->
<xsd:element ref="schedule" minOccurs="1" maxOccurs="1" />
</xsd:sequence>
<!-- each aircraft has an regnr attribute wich identifies the aircraft in the avinonde system
-->
<xsd:attribute name="regnr" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:sequence>
<!-- the scheduledata element must have a version attribute
-->
<xsd:attribute name="version" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
<!-- description of the schedule tag
-->
<xsd:element name="schedule">
<xsd:complexType>
<xsd:sequence>
<!-- each schedule may contain one or more activities
-->
<xsd:element name="activity" minOccurs="0" maxOccurs="unbounded">
<xsd:complexType>
<xsd:all>
<!-- each activity must be one of the following types; "onground", "ferry"
-->
<xsd:element name="type">
<xsd:simpleType>
<xsd:restriction base="xsd:string">
<xsd:enumeration value="onground" />
<xsd:enumeration value="ferry" />
</xsd:restriction>
</xsd:simpleType>
</xsd:element>
<!-- each activity must have a start tag, wich contains an airport (ICAO) and a dateTime
-->
<xsd:element name="start">
<xsd:complexType>
<xsd:all>
<xsd:element name="airport" type="airport" />
<xsd:element name="datetime" type="xsd:dateTime" />
</xsd:all>
</xsd:complexType>
</xsd:element>
<!-- each activity must also have a end tag, wich contains an airport (ICAO) and a dateTime
-->
<xsd:element name="end">
<xsd:complexType>
<xsd:all>
<xsd:element name="airport" type="airport" />
<xsd:element name="datetime" type="xsd:dateTime" />
</xsd:all>
</xsd:complexType>
</xsd:element>
<!-- each activity must set allowlisting with string values "yes" or "no"
-->
<xsd:element name="allowlisting">
<xsd:simpleType>
<xsd:restriction base="xsd:string">
<xsd:enumeration value="yes" />
<xsd:enumeration value="no" />
</xsd:restriction>
</xsd:simpleType>
</xsd:element>
</xsd:all>
</xsd:complexType>
</xsd:element>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
<!-- description of the airport tag, the ICAO code must contain at least 3 and at most 4 letters [a-zA-Z0-9]
-->
<xsd:simpleType name="airport">
<xsd:restriction base="xsd:string">
<xsd:pattern value="[\w]{3,4}" />
</xsd:restriction>
</xsd:simpleType>
</xsd:schema>


====================
 
I can't find any examples on the internet for this kind of output"

What do you mean by that? XML output? XSD output? filesave format? (BTW: Never even heard of this "XSB" thingy)

[bobafett] BobbaFet [bobafett]
Code:
if not Programming = 'Severe Migraine' then
                       ShowMessage('Eureka!');
 
I'm looking for delphi programs that write out XML files.
with complex XML structure like

<scheduledata version="0.6"/>
<aircraft regnr="N100GP">
<activity/>
<start>
<airport/>PWK
<TIME>10:00</TIME>
</start>
<END>
<airport/>LAS
<TIME>22:00</TIME>
<allowlisting>yes</allowlisting>
</END>
</aircraft>


XSB == XSD files

 
Remember... XML is plain text file format. You could just do without one and use a couple of functions instead...

[bobafett] BobbaFet [bobafett]
Code:
if not Programming = 'Severe Migraine' then
                       ShowMessage('Eureka!');
 
XML is plain text file format" ..... this is true .... But why invent the wheel if it is already there.... Only trouble my wheel is flat right now.

 
Ok but why spend money on something that simple? (business is business)

[bobafett] BobbaFet [bobafett]
Code:
if not Programming = 'Severe Migraine' then
                       ShowMessage('Eureka!');
 
Point taken .... But if XDOM was put in the public sector, then I'm just looking for people that have used it and have some "in-site / use" of the software.
 
Have you checked these tutorials? I haven't had a chance to look at them, but I would have thought they'd explain how to generate complex XML structures.

Clive
Runner_1Revised.gif

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
"To err is human, but to really foul things up you need a computer." (Paul Ehrlich)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
To get the best answers from this forum see: faq102-5096
 
THANKS !! That's the tutorial I couldn't find.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top