Skip to content

Commit 3c6cf68

Browse files
committed
Updated example for onverting file, added sample file
1 parent 46cb5e6 commit 3c6cf68

2 files changed

Lines changed: 35 additions & 3 deletions

File tree

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,20 @@
11
<?php
22

3-
require_once __DIR__ . '/vendor/autoload.php';
3+
require_once __DIR__ . '/../vendor/autoload.php';
44

55
use \ConversionTools\ConversionClient;
66

77
// put token here from your Profile page at https://conversiontools.io/profile
88
$token = '';
99

10-
$fileInput = 'test.xml';
10+
$fileOrUrlInput = 'test.xml';
1111
$fileOutput = 'test.csv';
1212

1313
$options = ['delimiter' => 'tabulation'];
1414

1515
$client = new ConversionClient($token);
1616
try {
17-
$client->convert('convert.xml_to_csv', $fileInput, $fileOutput, $options);
17+
$client->convert('convert.xml_to_csv', $fileOrUrlInput, $fileOutput, $options);
1818
} catch (Exception $e) {
1919
print 'Exception: ' . $e->getMessage() . "\n";
2020
}

examples/test.xml

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
<breakfast_menu>
2+
<food>
3+
<name>Belgian Waffles</name>
4+
<price>$5.95</price>
5+
<description>two of our famous Belgian Waffles with plenty of real maple syrup</description>
6+
<calories>650</calories>
7+
</food>
8+
<food>
9+
<name>Strawberry Belgian Waffles</name>
10+
<price>$7.95</price>
11+
<description>light Belgian waffles covered with strawberries and whipped cream</description>
12+
<calories>900</calories>
13+
</food>
14+
<food>
15+
<name>Berry-Berry Belgian Waffles</name>
16+
<price>$8.95</price>
17+
<description>light Belgian waffles covered with an assortment of fresh berries and whipped cream</description>
18+
<calories>900</calories>
19+
</food>
20+
<food>
21+
<name>French Toast</name>
22+
<price>$4.50</price>
23+
<description>thick slices made from our homemade sourdough bread</description>
24+
<calories>600</calories>
25+
</food>
26+
<food>
27+
<name>Homestyle Breakfast</name>
28+
<price>$6.95</price>
29+
<description>two eggs, bacon or sausage, toast, and our ever-popular hash browns</description>
30+
<calories>950</calories>
31+
</food>
32+
</breakfast_menu>

0 commit comments

Comments
 (0)