Export to XML (1 Viewer)

shahiq

Registered User.
Local time
Today, 05:19
Joined
Mar 31, 2007
Messages
29
Can any one explain to me how i can export a table with following fields conforming attached schema.

listing
name_abbreviated
datetime_start
datetime_end
classification
captioned
title
synopsis
<?xml version="1.0" encoding="utf-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:annotation>
<xs:appinfo>
MHEG EPG/PVR input data format. version 0_6

Changes:
Version 0_6
- Removed unreferenced RecommendationsType type and recommendations element.
- Removed unneccessary escape chars from date checking regex.

Version 0_5
- A single mandatory Channel element per document.
- Removed Listings level DefaultAuthority.

Version 0_4
- Synopsis is now optional for programmes, series and recommendations.


Version 0_3
- Made programme level CRID optonal to aid integration with exitsing (non-PVR) data sources.
NOTE: The programme level CRID must be defined when PVR functionality is required.

Version 0_2
- Added RecommendationsType to ProgrammeType
- Added RecommendationType to RecommendationsType
- Added SeriesType to ProgrammeType to allow a single series to be defined per programme
- RecommendationType and SeriesType define title, synopsis and single crid

Version 0_1
- Initial draft based on SimpleEPG.dtd with TVAnytime extentions.

</xs:appinfo>
</xs:annotation>
<xs:element name="listings" type="ListingsType">
<xs:annotation>
<xs:documentation>
The root of the XML document
</xs:documentation>
</xs:annotation>
</xs:element>
<xs:complexType name="ChannelType">
<xs:sequence>
<xs:element ref="programmes" />
</xs:sequence>
<xs:attribute ref="name" use="required" />
<xs:attribute ref="name_abbreviated" use="optional" />
<xs:attribute ref="default_authority" use="optional" />
</xs:complexType>
<xs:complexType name="ListingsType">
<xs:sequence>
<xs:element ref="channel" />
</xs:sequence>
</xs:complexType>
<xs:complexType name="SeriesType">
<xs:group ref="titleSynopsisCrid" />
</xs:complexType>
<xs:group name="titleSynopsisCrid">
<xs:sequence>
<xs:element ref="title" />
<xs:element minOccurs="0" ref="synopsis" />
<xs:element ref="crid" />
</xs:sequence>
</xs:group>
<xs:complexType name="RecommendationType">
<xs:group ref="titleSynopsisCrid" />
</xs:complexType>
<xs:complexType name="ProgrammeType">
<xs:sequence>
<xs:annotation>
<xs:documentation>
CRID element is optional only to aid integrattion with existing non-PVR data sources.
CRID is mandatory at the programme level when for PVR functionality to work.
</xs:documentation>
</xs:annotation>
<xs:element ref="title" />
<xs:element minOccurs="0" ref="synopsis" />
<xs:element minOccurs="0" ref="crid" />
<xs:sequence minOccurs="0">
<xs:element ref="series" />
</xs:sequence>
<xs:sequence minOccurs="0" maxOccurs="unbounded">
<xs:element ref="recommendation" />
</xs:sequence>
</xs:sequence>
<xs:attribute ref="datetime_start" use="required" />
<xs:attribute ref="datetime_end" use="required" />
<xs:attribute ref="classification" use="optional" />
<xs:attribute default="N" ref="captioned" use="optional" />
<xs:attribute ref="descriptor1" use="optional" />
<xs:attribute ref="descriptor2" use="optional" />
<xs:attribute ref="descriptor3" use="optional" />
</xs:complexType>
<xs:complexType name="CridType">
<xs:attribute ref="crid_type" use="required" />
<xs:attribute ref="crid_value" use="required" />
</xs:complexType>
<xs:complexType name="ProgrammesType">
<xs:sequence minOccurs="0" maxOccurs="unbounded">
<xs:element ref="programme" />
</xs:sequence>
</xs:complexType>
<xs:attribute name="name" type="NameType" />
<xs:attribute name="name_abbreviated" type="NameAbbreviatedType" />
<xs:attribute name="datetime_start" type="DateTimeType" />
<xs:attribute name="datetime_end" type="DateTimeType" />
<xs:attribute name="classification" type="ClassificationType" />
<xs:attribute default="N" name="captioned" type="CaptionedType" />
<xs:attribute name="default_authority" type="AuthorityType" />
<xs:attribute name="crid_type" type="CridTypeType" />
<xs:attribute name="crid_value" type="CridValueType" />
<xs:attribute name="descriptor1" type="DescriptorType" />
<xs:attribute name="descriptor2" type="DescriptorType" />
<xs:attribute name="descriptor3" type="DescriptorType" />
<xs:simpleType name="CridValueType">
<xs:annotation>
<xs:documentation>
The TVAnytime CRID. Example: crid://s-and-t.com/01DF5#one.
May be shortenned to /01DF5#one is default_authority covers this entry.
</xs:documentation>
</xs:annotation>
<xs:restriction base="xs:string" />
</xs:simpleType>
<xs:simpleType name="AuthorityType">
<xs:annotation>
<xs:documentation>
The Default Authority in scope of the location of the default_authority. Example default_authority: crid://s-and-t.com.
</xs:documentation>
</xs:annotation>
<xs:restriction base="xs:string" />
</xs:simpleType>
<xs:simpleType name="ClassificationType">
<xs:annotation>
<xs:documentation>
characters in this field define the arbitrarality named graphic file also delivered with the data.
Example: classification="15" describes a file named 15.png that is to be displayed by the EPG.
</xs:documentation>
</xs:annotation>
<xs:restriction base="xs:string" />
</xs:simpleType>
<xs:simpleType name="DescriptorType">
<xs:restriction base="xs:string" />
</xs:simpleType>
<xs:simpleType name="CaptionedType">
<xs:restriction base="xs:string">
<xs:enumeration value="Y" />
<xs:enumeration value="N" />
</xs:restriction>
</xs:simpleType>
<xs:simpleType name="NameType">
<xs:annotation>
<xs:documentation>
The name of the channel as seen on TV.
</xs:documentation>
</xs:annotation>
<xs:restriction base="xs:string" />
</xs:simpleType>
<xs:simpleType name="NameAbbreviatedType">
<xs:annotation>
<xs:documentation>
Unix type identifier for the channel
</xs:documentation>
</xs:annotation>
<xs:restriction base="xs:string" />
</xs:simpleType>
<xs:simpleType name="TitleType">
<xs:annotation>
<xs:documentation>
The title of the television programme. The length must be defined by the design of the EPG so cannot be restricted here.
</xs:documentation>
</xs:annotation>
<xs:restriction base="xs:string" />
</xs:simpleType>
<xs:simpleType name="SynopsisType">
<xs:annotation>
<xs:documentation>
The synopsis for the television programme. The length must be defined by the design of the EPG so cannot be restricted here.
</xs:documentation>
</xs:annotation>
<xs:restriction base="xs:string" />
</xs:simpleType>
<xs:simpleType name="DateTimeType">
<xs:annotation>
<xs:documentation>
Format = dd/MM/yyyy HH:mm:ss
</xs:documentation>
</xs:annotation>
<xs:restriction base="xs:string">
<xs:pattern value="\d{1,2}/\d{1,2}/\d{4}[ ]\d{2}:\d{2}:\d{2}" />
</xs:restriction>
</xs:simpleType>
<xs:simpleType name="CridTypeType">
<xs:restriction base="xs:string">
<xs:enumeration value="programme" />
<xs:enumeration value="series" />
</xs:restriction>
</xs:simpleType>
<xs:element name="channel" type="ChannelType">
<xs:annotation>
<xs:documentation>
Once channel of programme data per XML document is recommended, though no restriction is made here.
</xs:documentation>
</xs:annotation>
</xs:element>
<xs:element name="recommendation" type="RecommendationType" />
<xs:element name="programmes" type="ProgrammesType" />
<xs:element name="series" type="SeriesType" />
<xs:element name="programme" type="ProgrammeType">
<xs:annotation>
<xs:documentation>
The list of programme schedule data must be contiguous in scope of the current EPG.
</xs:documentation>
</xs:annotation>
</xs:element>
<xs:element name="title" type="TitleType" />
<xs:element name="crid" type="CridType" />
<xs:element name="synopsis" type="SynopsisType" />
</xs:schema>

Here I attach a sample XML generated using the table conforming the attached schema.
 

Attachments

  • HBO_MediaNet.txt
    35.1 KB · Views: 163
Last edited:

the_net_2.0

Banned
Local time
Today, 07:19
Joined
Sep 6, 2010
Messages
812
Are you asking for a method to export a table to XML that looks like the structure you've attached?

Or are you asking how to export a table to XML?
 

shahiq

Registered User.
Local time
Today, 05:19
Joined
Mar 31, 2007
Messages
29
I want to know how to export to XML according to the structure given. Here I have attached a sample XML file which was exported conforming the same schema. I believe we can have VBA code to do this.

Thanks
 

shahiq

Registered User.
Local time
Today, 05:19
Joined
Mar 31, 2007
Messages
29
I know how to export the table to XML which is quite simple. But exporting a table Conforming a specific schema/XSD needs bit of coding I think for which I'm looking for some help. Thanks
 

John.Woody

Registered User.
Local time
Today, 13:19
Joined
Sep 10, 2001
Messages
354
You could use Print # commands to create, edit and save your xml file and use a recordset to populate the values you require.
 

shahiq

Registered User.
Local time
Today, 05:19
Joined
Mar 31, 2007
Messages
29
Appreciate of you could enlighten me more.
 

the_net_2.0

Banned
Local time
Today, 07:19
Joined
Sep 6, 2010
Messages
812
Appreciate of you could enlighten me more.
look up "Print #" in the Access help menu. It's a command that is used in a streaming environment.

If you do use this method, you're going to have to analyze the output that you already have because the default output of XML in Access in simply a table-related schema. What that means is that it looks like this:
Code:
<table>
   <field1>
      <value>
   <field2>
      <value>
<table>
<table>
etc, etc...

That is not really close to what you've exampled here.
 

John.Woody

Registered User.
Local time
Today, 13:19
Joined
Sep 10, 2001
Messages
354
The point of using Print # is you can put whatever text you want in the file, so you build the whole schema and populate data values looping through a recordset, ending up with exactly what you want.
 

Users who are viewing this thread

Top Bottom