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

Re: Transformation XML to Datapacket

From: Jeni Tennison <jeni@jenitennison.com>
Date: Wed, 19 Jun 2002 11:06:23 +0100
Message-ID: <110-1634153639.20020619110623@jenitennison.com>
To: "Pierre Louis" <plouise@wanadoo.fr>
CC: xmlschema-dev@w3.org

Hi Pierre,

> 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.

First, I think that you're addressing this question to the wrong forum
-- xmlschema-dev@w3.org is concerned with XML Schema rather than
transforming XML.

Second, it looks as though you're creating your own transformation
language to describe the transformation that you want to make. You
might find it easier to use an existing transformation language, such
as XSLT, instead, or perhaps to transform your transformation language
to XSLT so that you can take advantage of those tools. A simplified
XSLT stylesheet for the transformation you appear to wish to make is:

<DATAPACKET Version="2.0"
      <FIELD attrname="No_" fieldtype="string" WIDTH="13"/>
      <FIELD attrname="Name" fieldtype="string" WIDTH="28"/>
    <xsl:for-each select="/tst/Customer">
      <ROW No_="{No_}" Name="{Name}"
           Search_Name="{Search_Name}" City="{City}" />

Note that XSLT 1.0 doesn't use information from a schema to perform a
transformation. This feature is added in XSLT 2.0.

I suggest you direct questions about XSLT to XSL-List@mulberrytech.com
(see http://www.mulberrytech.com/xsl/xsl-list).



Jeni Tennison
Received on Wednesday, 19 June 2002 06:06:28 UTC

This archive was generated by hypermail 2.3.1 : Wednesday, 7 January 2015 14:55:57 UTC