I have a nav.inc file with the following:
<a href="/index.html" rel="external" ><img src="/images/ns.png" alt="Sample Page"/><span class="title" >Demo</span></a>
<a href="/demo.html" rel="external" ><img src="/images/missions.png" alt="Sample Page"/><span class="title" >Demo2</span></a>
<a href="/mobile.html" rel="external" ><img src="/images/ons.png" alt="Sample Page"/><span class="title" >Demo3</span></a>
.
.
.
and so on
I want to grab the value of the node and @href for each of these list elements through XSL and build a structure like
<li><a href="/index.html" rel="external">Demo</a></li>
.
.
I know that this can be done like:
<xsl:variable name="vText" select="unparsed-text('nav.inc')"/>
and something similar to:
<xsl:variable name="vExtracted" as="xs:token*">
<xsl:analyze-string select="$vText" regex="" flags="m">
<xsl:matching-substring>
<xsl:value-of select="regex-group(1)"/>
</xsl:matching-substring>
</xsl:analyze-string>
</xsl:variable>
and then something like
<xsl:for-each select="$vExtracted">
<li><xsl:value-of select="."/></li>
</xsl:for-each >
I'm not good at regex. Any help to approach this problem is highly appreciated.