xslt code to convert string to nodes using delimiter (( . and ,
How do i convert string values in the below xml to nodes in output xml using xslt
input.xml
<root>
<AuthorDetail>Author:Joe Brown.Books.1st Editions</AuthorDetail>
<Details>Book((Autobiography,The Life Story.300 pages),
(Chapter1,Birthday.50 pages),
(Chapter2,Youth.150 pages),
(Chapter3,The End.100 pages)),
Book((Friction,The Another Story.400 pages),
(Chapter1,Happy Days.250 pages),
(Chapter2,Sad Days.150 pages))
</Details>
</root>
Output xml Required
<Joe Brown>
<Books>1st Editions</Books>
<Book>
<Autobiography>
<The Life Story>300 pages
<Chapter1><Birthday>50 pages</Birthday></Chapter1>
<Chapter2><Youth>150 pages</Youth></Chapter2>
<Chapter3><The End>100 pages</The End></Chapter3>
</The Life Story>
</Autobiography>
</Book>
<Book>
<Friction>
<The Another Story>400 pages
<Chapter1><Happy Days>250 pages</Happy Days></Chapter1>
<Chapter2><Sad Days>150 pages</Sad Days></Chapter2>
</The Another Story>
</Friction>
</Book>
</Joe Brown>
|