W3C home > Mailing lists > Public > xmlschema-dev@w3.org > June 2002

Transformation XML to Datapacket

From: Pierre Louis <plouise@wanadoo.fr>
Date: Tue, 18 Jun 2002 01:53:35 +0100
To: <xmlschema-dev@w3.org>
Message-ID: <PHEKIBKFLHILAIOMOADLEEGBCBAA.plouise@wanadoo.fr>

Hi,

I do use Xml file, I need to convert the file to xml datapacket.

I want the attribute fieldname of the datapacket get the caption value of
the field.
Something like the following for the field "Name":
fieldname=value of the caption of the field.

Thanks for your help.
pierre.


<XmlTransformation Version="1.0"><Transform Direction="ToCds"><SelectEach
dest="DATAPACKET\ROWDATA\ROW" from="\tst\Customer"><Select dest="@No_"
from="\No_"/><Select dest="@Name" from="\Name"/><Select dest="@Search_Name"
from="\Search_Name"/><Select dest="@City"
from="\City"/></SelectEach></Transform><XmlSchema
RootName="tst"><![CDATA[<xs:schema
xmlns:xs="http://www.w3.org/2001/XMLSchema">
  <xs:element name="tst" type="tstType"/>
  <xs:complexType name="tstType">
    <xs:sequence>
      <xs:element name="Customer" type="CustomerType" minOccurs="0"
maxOccurs="unbounded"/>
    </xs:sequence>
  </xs:complexType>
  <xs:element name="Customer" type="CustomerType"/>
  <xs:complexType name="CustomerType">
    <xs:sequence>
      <xs:element name="No_" type="No_Type"/>
      <xs:element name="Name" type="NameType"/>
    </xs:sequence>
    <xs:attribute name="Version" type="xs:string"/>
  </xs:complexType>
  <xs:element name="No_" type="No_Type"/>
  <xs:complexType name="No_Type">
    <xs:sequence/>
    <xs:attribute name="Caption" type="xs:string"/>
    <xs:attribute name="FieldLength" type="xs:string"/>
  </xs:complexType>
  <xs:element name="Name" type="NameType"/>
  <xs:complexType name="NameType">
    <xs:sequence/>
    <xs:attribute name="Caption" type="xs:string"/>
    <xs:attribute name="FieldLength" type="xs:string"/>
  </xs:complexType>
</xs:schema>]]></XmlSchema><CdsSkeleton/><XslTransform/><Skeleton><![CDATA[<
?xml version="1.0"?><DATAPACKET Version="2.0"><METADATA><FIELDS><FIELD
attrname="No_" fieldtype="string" WIDTH="13"/><FIELD attrname="Name"
fieldtype="string"
WIDTH="28"/></FIELDS><PARAMS/></METADATA><ROWDATA/></DATAPACKET>
]]></Skeleton></XmlTransformation>

Cordialement,

Pierre Louis.
Received on Monday, 17 June 2002 19:36:32 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Tuesday, 11 January 2011 00:14:31 GMT