•
•
•
•
What is DaniWeb IT Discussion Community?
You're currently browsing the XML, XSLT and XPATH section within the Software Development category of DaniWeb, a massive community of 363,388 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 2,813 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our XML, XSLT and XPATH advertiser:
Views: 410 | Replies: 1
![]() |
•
•
Join Date: May 2008
Posts: 1
Reputation:
Rep Power: 0
Solved Threads: 0
Hi I need to convert below part
<ul>
<li id="L_115775_tr">
<span>
<a href="http://support.microsoft.com/ph/11732" id="L_115775">Windows Vista Solution Center</a>
</span>
<li id="L_116381_tr">
<span>
<a href="http://support.microsoft.com/ph/8722" id="L_116381">Windows Internet Explorer 7 Solution Center</a>
</span>
<li id="L_125705_tr">
<span>
<a href="http://support.microsoft.com/ph/1173" id="L_125705">Windows XP Solution Center</a>
</span>
<li id="L_147192_tr">
<span>
<a href="http://support.microsoft.com/gp/cp_email" id="L_147192">E-mail Solution Center </a>
</span>
<li id="L_140164_tr">
<span>
<a href="http://support.microsoft.com/ph/8753" id="L_140164">2007 Microsoft Office Suites Solution Center</a>
</span>
</li>
</li>
</li>
</li>
</li>
</ul>
To
<ul>
<li id="L_115775_tr">
<span>
<a href="http://support.microsoft.com/ph/11732" id="L_115775">Windows Vista Solution Center</a>
</span>
</li>
<li id="L_116381_tr">
<span>
<a href="http://support.microsoft.com/ph/8722" id="L_116381">Windows Internet Explorer 7 Solution Center</a>
</span>
</li>
<li id="L_125705_tr">
<span>
<a href="http://support.microsoft.com/ph/1173" id="L_125705">Windows XP Solution Center</a>
</span>
</li>
<li id="L_140164_tr">
<span>
<a href="http://support.microsoft.com/ph/8753" id="L_140164">2007 Microsoft Office Suites Solution Center</a>
</span>
</li>
</ul>
Basically it should copy all nodes and attributes till occurence of next <li> . Same process should be repeated for all <li> using xslt 1.0
<ul>
<li id="L_115775_tr">
<span>
<a href="http://support.microsoft.com/ph/11732" id="L_115775">Windows Vista Solution Center</a>
</span>
<li id="L_116381_tr">
<span>
<a href="http://support.microsoft.com/ph/8722" id="L_116381">Windows Internet Explorer 7 Solution Center</a>
</span>
<li id="L_125705_tr">
<span>
<a href="http://support.microsoft.com/ph/1173" id="L_125705">Windows XP Solution Center</a>
</span>
<li id="L_147192_tr">
<span>
<a href="http://support.microsoft.com/gp/cp_email" id="L_147192">E-mail Solution Center </a>
</span>
<li id="L_140164_tr">
<span>
<a href="http://support.microsoft.com/ph/8753" id="L_140164">2007 Microsoft Office Suites Solution Center</a>
</span>
</li>
</li>
</li>
</li>
</li>
</ul>
To
<ul>
<li id="L_115775_tr">
<span>
<a href="http://support.microsoft.com/ph/11732" id="L_115775">Windows Vista Solution Center</a>
</span>
</li>
<li id="L_116381_tr">
<span>
<a href="http://support.microsoft.com/ph/8722" id="L_116381">Windows Internet Explorer 7 Solution Center</a>
</span>
</li>
<li id="L_125705_tr">
<span>
<a href="http://support.microsoft.com/ph/1173" id="L_125705">Windows XP Solution Center</a>
</span>
</li>
<li id="L_140164_tr">
<span>
<a href="http://support.microsoft.com/ph/8753" id="L_140164">2007 Microsoft Office Suites Solution Center</a>
</span>
</li>
</ul>
Basically it should copy all nodes and attributes till occurence of next <li> . Same process should be repeated for all <li> using xslt 1.0
![]() |
•
•
•
•
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
•
•
•
•
•
•
•
•
DaniWeb XML, XSLT and XPATH Marketplace
- Previous Thread: convert xml using xslt
- Next Thread: Text file to XML


Linear Mode