TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Ani
169
11.2k
34.5k
Converting XML values to JSON aaray
Feb 11 2021 6:53 AM
Hi,
I have below xml which has to be converted to JSON array using xslt. Please help me
Input xml
<employee>
<empid>123</empid>
<empdesignation>MGR</empdesignation>
<emprole>employee,supervisior,manager</emprole>
<address>
<addressLine1>123 TEST LANE</addressLine1>
<addressLine2></addressLine2>
<cityName>BOSTON</cityName>
<countryName>USA</countryName>
<postalCode>07723</postalCode>
</address>
</employee>
<company>
<companylocationid>2</companylocationid>
<companylocation>USA</companylocation>
<address>
<addressLine1>789 WORK LANE</addressLine1>
<addressLine2></addressLine2>
<cityName>
California
</cityName>
<countryName>USA</countryName>
<postalCode>90210</postalCode>
</address>
</company>
Expected JSON
{
"employee":[
{
"empid":"123",
"empdesignation":"MGR",
"emprole": [
"employee,supervisior,manager"
],
"address":{
"addressLine1":"123 TEST LANE",
"addressLine2":"AddressLine2",
"cityName":"BOSTON",
"countryName":"USA",
"postalCode":"07723"
}
}
],
"company":[
{
"companylocationid":"2",
"companylocation":"USA",
"address":{
"addressLine1":"789 WORK LANE",
"addressLine2":"AddressLine2",
"cityName":"
California
",
"countryName":"USA",
"postalCode":"90210"
}
}
],
}
Reply
Answers (
5
)
Entity query - to form a balance
SOLVED Empty txtbx error "input string was not in a correct format"