|
Rank: Newbie
Joined: 10/16/2018 Posts: 4
|
Hello, please, could anybody help me with this problem?
As a sorce file I have excel wtih defined are (e.g. C7:K28). All cells I need map to XML structure like this:
<xs:element name="cell"> <xs:complexType> <xs:simpleContent> <xs:extension base="xs:string"> <xs:attribute name="row" use="required" type="ordNumType"/> <xs:attribute name="col" use="required" type="xs:token"/> <xs:attribute name="decimals" use="optional"> <xs:simpleType> <xs:restriction base="xs:string"> <xs:pattern value="([-]?[1-9][0-9]{0,1})|[0]|(INF)"/> </xs:restriction> </xs:simpleType> </xs:attribute> </xs:extension> </xs:simpleContent> </xs:complexType> </xs:element>
I don't know, how can I map the row and col from source. I will be thankfull for any advice.
GeorgiFile Attachment(s): example1.xlsx (12kb) downloaded 376 time(s). example1.xml (2kb) downloaded 350 time(s).
|
|
Rank: Newbie
Joined: 10/28/2002 Posts: 1,283 Location: AT
|
HI,
please attach your Excel source file, your target xsd file(s) and the exact xml file that you wish to output from the given input Excel source data.
|
|
Rank: Newbie
Joined: 10/16/2018 Posts: 4
|
Here I'm sending attachments. File Attachment(s): example1.xlsx (12kb) downloaded 347 time(s). example1.xml (2kb) downloaded 354 time(s).
|
|
Rank: Newbie
Joined: 10/28/2002 Posts: 1,283 Location: AT
|
See attached mapping "test.mfd".
The mapping consists of two steps. The first step maps the excel source to an intermediate structure which outputs a file containing multiple "statPart" elements (see example_intermediate.xml).
The second step maps the intermediate structure to the ultimate target which generates only one "statPart" element as desired (see example_final.xml).
The intermediate component uses the "Duplicate Input" functionality to provide additional "cell" elements to map to.
Note the intermediate structure generates an output file in this mapping i.e. "example_intermediate.xml". This is simply to facilitate understanding of the example. Once you understand how it works you can replace the intermediate structure with a variable which does not generate an intermediate file (INSERT | Variable).
File Attachment(s): test.zip (11kb) downloaded 354 time(s).
island attached the following image(s):
|
|
Rank: Newbie
Joined: 10/16/2018 Posts: 4
|
Yes! It works! Thanks a lot for help!
Best regards.
|
|
Rank: Newbie
Joined: 10/28/2002 Posts: 1,283 Location: AT
|
Hi,
here is an even better variation without the need for an intermediate component.
File Attachment(s): test2.mfd (13kb) downloaded 380 time(s).
island attached the following image(s):
|
|
Rank: Newbie
Joined: 10/28/2002 Posts: 1,283 Location: AT
|
and the third iteration is even better ..... File Attachment(s): test3.mfd (7kb) downloaded 364 time(s).
island attached the following image(s):
|
|
guest |