-
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.
Merge pull request #42699 from mindula/fix-42698
[Master] Fix xml to record conversion for default value node
- Loading branch information
Showing
6 changed files
with
119 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
20 changes: 20 additions & 0 deletions
20
misc/xml-to-record-converter/src/test/resources/ballerina/sample_33.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,20 @@ | ||
@xmldata:Namespace {prefix: "a", uri: "[www.example.org/personAddress](http://www.example.org/personAddress)"} | ||
type A_Address record { | ||
@xmldata:Namespace {prefix: "c", uri: "[www.example.org/addressCity](http://www.example.org/addressCity)"} | ||
string city; | ||
@xmldata:Namespace {prefix: "s", uri: "[www.example.org/addressState](http://www.example.org/addressState)"} | ||
string state; | ||
@xmldata:Namespace {prefix: "ct", uri: "[www.example.org/addressCountry](http://www.example.org/addressCountry)"} | ||
string country; | ||
}; | ||
|
||
@xmldata:Name {value: "person"} | ||
@xmldata:Namespace {prefix: "p", uri: "[www.example.org/personData](http://www.example.org/personData)"} | ||
type P_Person record { | ||
@xmldata:Namespace {prefix: "n", uri: "[www.example.org/personName](http://www.example.org/personName)"} | ||
string name; | ||
@xmldata:Namespace {prefix: "a", uri: "[www.example.org/personAddress](http://www.example.org/personAddress)"} | ||
A_Address address; | ||
@xmldata:Attribute | ||
string age; | ||
}; |
34 changes: 34 additions & 0 deletions
34
misc/xml-to-record-converter/src/test/resources/ballerina/sample_34.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,34 @@ | ||
@xmldata:Namespace {prefix: "n", uri: "http://www.example.org/personName"} | ||
type N_Name record { | ||
string __text; | ||
@xmldata:Attribute | ||
string 'type; | ||
}; | ||
|
||
@xmldata:Namespace {prefix: "p", uri: "http://www.example.org/personData"} | ||
type P_Address record { | ||
@xmldata:Namespace {prefix: "p", uri: "http://www.example.org/personData"} | ||
string street; | ||
@xmldata:Namespace {prefix: "p", uri: "http://www.example.org/personData"} | ||
string city; | ||
}; | ||
|
||
@xmldata:Namespace {prefix: "p", uri: "http://www.example.org/personData"} | ||
type P_Occupation record { | ||
string __text; | ||
@xmldata:Attribute | ||
string country; | ||
}; | ||
|
||
@xmldata:Name {value: "person"} | ||
@xmldata:Namespace {prefix: "p", uri: "http://www.example.org/personData"} | ||
type P_Person record { | ||
@xmldata:Namespace {prefix: "n", uri: "http://www.example.org/personName"} | ||
N_Name name; | ||
@xmldata:Namespace {prefix: "p", uri: "http://www.example.org/personData"} | ||
P_Address address; | ||
@xmldata:Namespace {prefix: "p", uri: "http://www.example.org/personData"} | ||
P_Occupation occupation; | ||
@xmldata:Attribute | ||
string age; | ||
}; |
8 changes: 8 additions & 0 deletions
8
misc/xml-to-record-converter/src/test/resources/xml/sample_33.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,8 @@ | ||
<p:person xmlns:p="[www.example.org/personData](http://www.example.org/personData)" age="30"> | ||
<n:name xmlns:n="[www.example.org/personName](http://www.example.org/personName)">John</n:name> | ||
<a:address xmlns:a="[www.example.org/personAddress](http://www.example.org/personAddress)"> | ||
<c:city xmlns:c="[www.example.org/addressCity](http://www.example.org/addressCity)">Hollywood</c:city> | ||
<s:state xmlns:s="[www.example.org/addressState](http://www.example.org/addressState)">FL</s:state> | ||
<ct:country xmlns:ct="[www.example.org/addressCountry](http://www.example.org/addressCountry)">USA</ct:country> | ||
</a:address> | ||
</p:person> |
8 changes: 8 additions & 0 deletions
8
misc/xml-to-record-converter/src/test/resources/xml/sample_34.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,8 @@ | ||
<p:person xmlns:p="http://www.example.org/personData" age="30"> | ||
<n:name xmlns:n="http://www.example.org/personName" type="first">John</n:name> | ||
<p:address xmlns:p="http://www.example.org/personData"> | ||
<p:street>Main Street</p:street> | ||
<p:city>New York</p:city> | ||
</p:address> | ||
<p:occupation xmlns:p="http://www.example.org/personData" country="USA">Software Engineer</p:occupation> | ||
</p:person> |