-
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 #42486 from mindula/xmlToRecord
[Master] Add new options in xml conversion service
- Loading branch information
Showing
6 changed files
with
96 additions
and
33 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
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
34 changes: 34 additions & 0 deletions
34
misc/xml-to-record-converter/src/test/resources/ballerina/sample_25.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 @@ | ||
type Book_Title record { | ||
string __text; | ||
@xmldata:Attribute | ||
string edition; | ||
@xmldata:Attribute | ||
string lang; | ||
}; | ||
|
||
type Book_Author record { | ||
string __text; | ||
@xmldata:Attribute | ||
string gender; | ||
@xmldata:Attribute | ||
string nationality; | ||
}; | ||
|
||
type Book_Book record { | ||
Book_Title title; | ||
Book_Author author; | ||
string publish_date; | ||
string description; | ||
}; | ||
|
||
type Books record { | ||
string genre; | ||
Book_Book book; | ||
}; | ||
|
||
@xmldata:Name {value: "library"} | ||
type Library record { | ||
Books books; | ||
@xmldata:Attribute | ||
string genre; | ||
}; |
11 changes: 11 additions & 0 deletions
11
misc/xml-to-record-converter/src/test/resources/xml/sample_25.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,11 @@ | ||
<library xmlns:book="http://example.com/books" genre="genre"> | ||
<books> | ||
<genre>Programming</genre> | ||
<book:book> | ||
<book:title lang="en" edition="1st">XML Developer's Guide</book:title> | ||
<book:author gender="male" nationality="American">Gambardella, Matthew</book:author> | ||
<book:publish_date>2000-10-01</book:publish_date> | ||
<book:description>An in-depth look at creating applications with XML.</book:description> | ||
</book:book> | ||
</books> | ||
</library> |