-
Notifications
You must be signed in to change notification settings - Fork 751
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #42589 from mindula/fix-42556
[Master] Fix record generation for xml with multiple namespaces
- Loading branch information
Showing
12 changed files
with
312 additions
and
8 deletions.
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
17 changes: 17 additions & 0 deletions
17
misc/xml-to-record-converter/src/test/resources/ballerina/sample_28.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,17 @@ | ||
@xmldata:Name {value: "book"} | ||
@xmldata:Namespace {prefix: "bk", uri: "http://example.com/book"} | ||
type Bk_Book record { | ||
@xmldata:Name {value: "title"} | ||
@xmldata:Namespace {prefix: "bk", uri: "http://example.com/book"} | ||
string bkTitle; | ||
@xmldata:Name {value: "title"} | ||
@xmldata:Namespace {prefix: "au", uri: "http://example.com/author"} | ||
string auTitle; | ||
@xmldata:Name {value: "title"} | ||
@xmldata:Namespace {prefix: "da", uri: "http://example.com/date"} | ||
string daTitle; | ||
@xmldata:Namespace {prefix: "bk", uri: "http://example.com/book"} | ||
int chapter; | ||
@xmldata:Namespace {prefix: "au", uri: "http://example.com/author"} | ||
string country; | ||
}; |
23 changes: 23 additions & 0 deletions
23
misc/xml-to-record-converter/src/test/resources/ballerina/sample_29.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,23 @@ | ||
type Lib_Book record { | ||
@xmldata:Namespace {prefix: "lib", uri: "http://example.com/library"} | ||
int id; | ||
@xmldata:Name {value: "title"} | ||
@xmldata:Namespace {prefix: "lib", uri: "http://example.com/library"} | ||
string libTitle; | ||
@xmldata:Name {value: "title"} | ||
@xmldata:Namespace {prefix: "au", uri: "http://example.com/author"} | ||
string auTitle; | ||
@xmldata:Name {value: "author"} | ||
@xmldata:Namespace {prefix: "lib", uri: "http://example.com/library"} | ||
string libAuthor; | ||
@xmldata:Name {value: "author"} | ||
@xmldata:Namespace {prefix: "au", uri: "http://example.com/author"} | ||
string auAuthor; | ||
}; | ||
|
||
@xmldata:Name {value: "library"} | ||
@xmldata:Namespace {prefix: "lib", uri: "http://example.com/library"} | ||
type Lib_Library record { | ||
@xmldata:Namespace {prefix: "lib", uri: "http://example.com/library"} | ||
Lib_Book book; | ||
}; |
24 changes: 24 additions & 0 deletions
24
misc/xml-to-record-converter/src/test/resources/ballerina/sample_30.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,24 @@ | ||
type Lib_Book record { | ||
@xmldata:Namespace {prefix: "lib", uri: "http://example.com/library"} | ||
string[] title; | ||
}; | ||
|
||
type Au_Author record { | ||
@xmldata:Namespace {prefix: "au", uri: "http://example.com/author"} | ||
string[] name; | ||
}; | ||
|
||
type Pr_Price record { | ||
@xmldata:Namespace {prefix: "pr", uri: "http://example.com/price"} | ||
(decimal|int)[] price; | ||
}; | ||
|
||
@xmldata:Name {value: "library"} | ||
type Library record { | ||
@xmldata:Namespace {prefix: "lib", uri: "http://example.com/library"} | ||
Lib_Book book; | ||
@xmldata:Namespace {prefix: "au", uri: "http://example.com/author"} | ||
Au_Author author; | ||
@xmldata:Namespace {prefix: "pr", uri: "http://example.com/price"} | ||
Pr_Price price; | ||
}; |
24 changes: 24 additions & 0 deletions
24
misc/xml-to-record-converter/src/test/resources/ballerina/sample_31.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,24 @@ | ||
type St_Product record { | ||
string[] name; | ||
}; | ||
|
||
type Mk_Brand record { | ||
string name; | ||
string counry; | ||
int year; | ||
}; | ||
|
||
type Mk_Maker record { | ||
Mk_Brand[] brand; | ||
}; | ||
|
||
type Pr_Cost record { | ||
int[] amount; | ||
}; | ||
|
||
@xmldata:Name {value: "store"} | ||
type Store record { | ||
St_Product product; | ||
Mk_Maker maker; | ||
Pr_Cost cost; | ||
}; |
11 changes: 11 additions & 0 deletions
11
misc/xml-to-record-converter/src/test/resources/ballerina/sample_32.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,11 @@ | ||
type Bk_Chapter record { | ||
int[] number; | ||
}; | ||
|
||
@xmldata:Name {value: "book"} | ||
type Bk_Book record { | ||
string[] title; | ||
string subtitle; | ||
string language; | ||
Bk_Chapter[] chapter; | ||
}; |
7 changes: 7 additions & 0 deletions
7
misc/xml-to-record-converter/src/test/resources/xml/sample_28.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,7 @@ | ||
<bk:book xmlns:bk="http://example.com/book" xmlns:au="http://example.com/author" xmlns:da="http://example.com/date"> | ||
<bk:title>string</bk:title> | ||
<au:title>string</au:title> | ||
<da:title>string</da:title> | ||
<bk:chapter>1</bk:chapter> | ||
<au:country>string</au:country> | ||
</bk:book> |
9 changes: 9 additions & 0 deletions
9
misc/xml-to-record-converter/src/test/resources/xml/sample_29.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,9 @@ | ||
<lib:library xmlns:lib="http://example.com/library" xmlns:au="http://example.com/author"> | ||
<lib:book> | ||
<lib:id>601971</lib:id> | ||
<lib:title>string</lib:title> | ||
<au:title>Title</au:title> | ||
<lib:author>Name</lib:author> | ||
<au:author>Name</au:author> | ||
</lib:book> | ||
</lib:library> |
14 changes: 14 additions & 0 deletions
14
misc/xml-to-record-converter/src/test/resources/xml/sample_30.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,14 @@ | ||
<library xmlns:lib="http://example.com/library" xmlns:au="http://example.com/author" xmlns:pr="http://example.com/price"> | ||
<lib:book> | ||
<lib:title>string</lib:title> | ||
<lib:title>string</lib:title> | ||
</lib:book> | ||
<au:author> | ||
<au:name>string</au:name> | ||
<au:name>string</au:name> | ||
</au:author> | ||
<pr:price> | ||
<pr:price>1000</pr:price> | ||
<pr:price>1000.50</pr:price> | ||
</pr:price> | ||
</library> |
22 changes: 22 additions & 0 deletions
22
misc/xml-to-record-converter/src/test/resources/xml/sample_31.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,22 @@ | ||
<store xmlns:st="http://example.com/store" xmlns:mk="http://example.com/maker" xmlns:pr="http://example.com/price"> | ||
<st:product> | ||
<st:name>Laptop</st:name> | ||
<st:name>Desktop</st:name> | ||
</st:product> | ||
<mk:maker> | ||
<mk:brand> | ||
<mk:name>Dell</mk:name> | ||
<st:counry>USA</st:counry> | ||
<year>2024</year> | ||
</mk:brand> | ||
<mk:brand> | ||
<mk:name>HP</mk:name> | ||
<st:counry>USA</st:counry> | ||
<year>2023</year> | ||
</mk:brand> | ||
</mk:maker> | ||
<pr:cost> | ||
<pr:amount>1000</pr:amount> | ||
<pr:amount>800</pr:amount> | ||
</pr:cost> | ||
</store> |
17 changes: 17 additions & 0 deletions
17
misc/xml-to-record-converter/src/test/resources/xml/sample_32.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,17 @@ | ||
<bk:book xmlns:bk="http://example.com/book" xmlns:au="http://example.com/author" xmlns:da="http://example.com/date"> | ||
<bk:title>string</bk:title> | ||
<au:title>string</au:title> | ||
<da:title>string</da:title> | ||
<bk:subtitle>string</bk:subtitle> | ||
<bk:language>string</bk:language> | ||
<bk:chapter> | ||
<bk:number>1</bk:number> | ||
<au:number>1</au:number> | ||
<da:number>1</da:number> | ||
</bk:chapter> | ||
<bk:chapter> | ||
<bk:number>1</bk:number> | ||
<au:number>1</au:number> | ||
<da:number>1</da:number> | ||
</bk:chapter> | ||
</bk:book> |