-
Notifications
You must be signed in to change notification settings - Fork 753
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
172 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
22 changes: 22 additions & 0 deletions
22
misc/xml-to-record-converter/src/test/resources/ballerina/sample_26.bal
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
type Title record { | ||
string \#content; | ||
@xmldata:Attribute | ||
string lang; | ||
}; | ||
|
||
type Price record { | ||
decimal \#content; | ||
@xmldata:Attribute | ||
string currency; | ||
}; | ||
|
||
@xmldata:Name {value: "book"} | ||
type Book record { | ||
int id; | ||
Title title; | ||
string author; | ||
string genre; | ||
Price price; | ||
string publication_date; | ||
string description; | ||
}; |
41 changes: 41 additions & 0 deletions
41
misc/xml-to-record-converter/src/test/resources/ballerina/sample_27.bal
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
type Customer record { | ||
string firstName; | ||
string lastName; | ||
string email; | ||
int id; | ||
@xmldata:Attribute | ||
string loyalty; | ||
@xmldata:Attribute | ||
string optedInNewsLetter; | ||
@xmldata:Attribute | ||
string 'xmlns; | ||
}; | ||
|
||
type Item record { | ||
string name; | ||
int quantity; | ||
decimal price; | ||
@xmldata:Attribute | ||
string id; | ||
}; | ||
|
||
type Items record { | ||
Item[] item; | ||
@xmldata:Attribute | ||
string 'xmlns; | ||
}; | ||
|
||
type Order record { | ||
int id; | ||
Customer customer; | ||
Items items; | ||
decimal total; | ||
@xmldata:Attribute | ||
string 'xmlns; | ||
}; | ||
|
||
type Orders record { | ||
Order[] 'order; | ||
@xmldata:Attribute | ||
string 'xmlns; | ||
}; |
12 changes: 12 additions & 0 deletions
12
misc/xml-to-record-converter/src/test/resources/xml/sample_26.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
<book> | ||
<id>123456</id> | ||
<title lang="en">The Great Gatsby</title> | ||
<author>F. Scott Fitzgerald</author> | ||
<genre>Fiction</genre> | ||
<price currency="USD">10.99</price> | ||
<publication_date>1925-04-10</publication_date> | ||
<description> | ||
A classic novel depicting the roaring twenties in America, | ||
exploring themes of love, wealth, and the American Dream. | ||
</description> | ||
</book> |
68 changes: 68 additions & 0 deletions
68
misc/xml-to-record-converter/src/test/resources/xml/sample_27.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
<Orders xmlns="www.example.com/orders"> | ||
<order xmlns="www.example.com/order"> | ||
<id>001</id> | ||
<customer xmlns="www.example.com/customer" loyalty="premium" optedInNewsLetter="true"> | ||
<firstName>John</firstName> | ||
<lastName>Doe</lastName> | ||
<email>john.doe@example.com</email> | ||
<id>1001</id> | ||
</customer> | ||
<items xmlns="www.example.com/items"> | ||
<item id="a1"> | ||
<name>Widget A</name> | ||
<quantity>2</quantity> | ||
<price>15.00</price> | ||
</item> | ||
<item id="b2"> | ||
<name>Gadget B</name> | ||
<quantity>1</quantity> | ||
<price>25.00</price> | ||
</item> | ||
</items> | ||
<total>55.00</total> | ||
</order> | ||
<order xmlns="www.example.com/order"> | ||
<id>002</id> | ||
<customer xmlns="www.example.com/customer" loyalty="regular" optedInNewsLetter="false"> | ||
<firstName>Jane</firstName> | ||
<lastName>Smith</lastName> | ||
<email>jane.smith@example.com</email> | ||
<id>1002</id> | ||
</customer> | ||
<items xmlns="www.example.com/items"> | ||
<item id="c3"> | ||
<name>Tool C</name> | ||
<quantity>3</quantity> | ||
<price>10.00</price> | ||
</item> | ||
<item id="d4"> | ||
<name>Device D</name> | ||
<quantity>1</quantity> | ||
<price>40.00</price> | ||
</item> | ||
</items> | ||
<total>70.00</total> | ||
</order> | ||
<order xmlns="www.example.com/order"> | ||
<id>003</id> | ||
<customer xmlns="www.example.com/customer" loyalty="new" optedInNewsLetter="true"> | ||
<firstName>Alice</firstName> | ||
<lastName>Brown</lastName> | ||
<email>alice.brown@example.com</email> | ||
<id>1003</id> | ||
</customer> | ||
<items xmlns="www.example.com/items"> | ||
<item id="e5"> | ||
<name>Accessory E</name> | ||
<quantity>2</quantity> | ||
<price>5.00</price> | ||
</item> | ||
<item id="f6"> | ||
<name>Supplement F</name> | ||
<quantity>4</quantity> | ||
<price>8.00</price> | ||
</item> | ||
</items> | ||
<total>54.00</total> | ||
</order> | ||
</Orders> |