Skip to content

Commit

Permalink
Add delimiter to diff namespace in record name
Browse files Browse the repository at this point in the history
  • Loading branch information
AzeemMuzammil committed Nov 28, 2023
1 parent 639ed2e commit 325c43b
Show file tree
Hide file tree
Showing 6 changed files with 32 additions and 32 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -478,7 +478,7 @@ private static boolean isLeafXMLElementNode(Element xmlElement) {
private static String getRecordName(String xmlElementNodeName) {
if (xmlElementNodeName.contains(COLON)) {
return Arrays.stream(xmlElementNodeName.split(COLON))
.map(val -> escapeIdentifier(StringUtils.capitalize(val))).collect(Collectors.joining());
.map(val -> escapeIdentifier(StringUtils.capitalize(val))).collect(Collectors.joining("_"));
}
return escapeIdentifier(StringUtils.capitalize(xmlElementNodeName));
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
type MainMainElement record {
type Main_MainElement record {
string[] child\:childElement;
};

Expand All @@ -9,8 +9,8 @@ type MainMainElement record {
prefix: "root",
uri: "http://example.com/root"
}
type RootRoot record {
MainMainElement main\:mainElement;
type Root_Root record {
Main_MainElement main\:mainElement;
@xmldata:Attribute
string xmlns\:child = "http://example.com/child";
@xmldata:Attribute
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
type MainLocation record {
type Main_Location record {
string main\:city;
string main\:state;
};

type MainCompanyInfo record {
type Main_CompanyInfo record {
string main\:name;
MainLocation main\:location;
Main_Location main\:location;
};

type Project record {
Expand Down Expand Up @@ -46,8 +46,8 @@ type Mixed record {
prefix: "root",
uri: "http://example.com/root"
}
type RootRoot record {
MainCompanyInfo main\:companyInfo;
type Root_Root record {
Main_CompanyInfo main\:companyInfo;
Employees employees;
Mixed mixed;
@xmldata:Attribute
Expand Down
Original file line number Diff line number Diff line change
@@ -1,31 +1,31 @@
type CCourse record {
type C_Course record {
string u\:name;
int c\:intake?;
string p\:professor?;
};

type DSubDepartment record {
type D_SubDepartment record {
string d\:name;
CCourse[] c\:course?;
DSubDepartment[] d\:subDepartment?;
C_Course[] c\:course?;
D_SubDepartment[] d\:subDepartment?;
};

type DDepartment record {
type D_Department record {
string u\:name;
CCourse[] c\:course;
DSubDepartment d\:subDepartment?;
C_Course[] c\:course;
D_SubDepartment d\:subDepartment?;
};

type FFaculty record {
type F_Faculty record {
string u\:name;
DDepartment[] d\:department;
D_Department[] d\:department;
};

@xmldata:Name {
value: "university"
}
type University record {
FFaculty[] f\:faculty;
F_Faculty[] f\:faculty;
@xmldata:Attribute
string xmlns\:c = "http://example.com/course";
@xmldata:Attribute
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
type Ns0Address record {
type Ns0_Address record {
string ns0\:street;
string ns0\:city;
string ns0\:country;
};

type Ns0Codes record {
type Ns0_Codes record {
int[] ns0\:code;
};

Expand All @@ -15,12 +15,12 @@ type Ns0Codes record {
prefix: "ns0",
uri: "http://sample.com/test"
}
type Ns0BookStore record {
type Ns0_BookStore record {
string ns0\:storeName;
int ns0\:postalCode;
boolean ns0\:isOpen;
Ns0Address ns0\:address;
Ns0Codes ns0\:codes;
Ns0_Address ns0\:address;
Ns0_Codes ns0\:codes;
@xmldata:Attribute
string status;
};
Original file line number Diff line number Diff line change
@@ -1,35 +1,35 @@
type Ns1Element1 record {
type Ns1_Element1 record {
@xmldata:Attribute
string ns1\:attribute1;
@xmldata:Attribute
string ns2\:attribute2;
};

type Ns2Null record {
type Ns2_Null record {
@xmldata:Attribute
string xmlns\:xsi = "http://www.w3.org/2001/XMLSchema-instance";
@xmldata:Attribute
string xsi\:nil;
};

type Ns2Array record {
type Ns2_Array record {
string[] ns2\:item;
};

type Ns2Element2 record {
type Ns2_Element2 record {
string ns2\:subelement;
decimal ns2\:number;
boolean ns2\:boolean;
Ns2Null ns2\:null;
Ns2Array ns2\:array;
Ns2_Null ns2\:null;
Ns2_Array ns2\:array;
};

@xmldata:Name {
value: "root"
}
type Root record {
Ns1Element1 ns1\:element1;
Ns2Element2 ns2\:element2;
Ns1_Element1 ns1\:element1;
Ns2_Element2 ns2\:element2;
@xmldata:Attribute
string xmlns\:ns1 = "http://namespace1.com";
@xmldata:Attribute
Expand Down

0 comments on commit 325c43b

Please sign in to comment.