Link to home
Start Free TrialLog in
Avatar of mmalik15
mmalik15

asked on

how to extract nodes containing text

I have nodes like as attached below.From these nodes I need only those nodes which contain text 'dx.doi.org' and if there are more than one node containing this text then get first only.

I have tried something like this without any luck


<xsl:for-each select="dc:identifier_dbid">
                                    <mdbid>
                                          <xsl:choose>
                                                <xsl:when test='contains(.,"dx.doi.org")'>
                                                      <xsl:if test="position()= 1">
                                                            <xsl:value-of select="."/>
                                                      </xsl:if>
                                                </xsl:when>
                                          </xsl:choose>
                                    </mdbid>
                              </xsl:for-each>


 
<dc:identifier>http://site.ebrary.com/id/10297565</dc:identifier>
    <dc:identifier>http://dx.doi.org/10.1002/9780470697870</dc:identifier>
    <dc:identifier>http://www.myilibrary.com?id=234220</dc:identifier>
    <dc:identifier>http://www.netlibrary.com/urlapi.asp?action=summary&amp;v=1&amp;bookid=323900</dc:identifier>
    <dc:identifier>http://catdir.loc.gov/catdir/toc/ecip0719/2007022434.html</dc:identifier>
    <dc:identifier_isbn>9780470697900</dc:identifier_isbn>
    <dc:identifier_isbn>9780470512661 </dc:identifier_isbn>
    <dc:identifier_isbn>9780470059081 </dc:identifier_isbn>
    <dc:identifier_isbn></dc:identifier_isbn>
    <dc:identifier_isbn></dc:identifier_isbn>
    <dc:identifier_isbn></dc:identifier_isbn>
    <dc:identifier_isbn></dc:identifier_isbn>
    <dc:identifier_dbid>http://site.ebrary.com/id/10297565</dc:identifier_dbid>
    <dc:identifier_dbid>http://dx.doi.org/10.1002/9780470697870</dc:identifier_dbid>
    <dc:identifier_dbid>http://www.myilibrary.com?id=234220</dc:identifier_dbid>
    <dc:identifier_dbid>http://www.netlibrary.com/urlapi.asp?action=summary&amp;v=1&amp;bookid=323900</dc:identifier_dbid>
    <dc:identifier_dbid>http://catdir.loc.gov/catdir/toc/ecip0719/2007022434.html</dc:identifier_dbid>

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of Gertone (Geert Bormans)
Gertone (Geert Bormans)
Flag of Belgium image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of mmalik15
mmalik15

ASKER

Thanks Gertone. I just manage to do it.