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.o rg")'>
<xsl:if test="position()= 1">
<xsl:value-of select="."/>
</xsl:if>
</xsl:when>
</xsl:choose>
</mdbid>
</xsl:for-each>
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.o
<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&v=1&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&v=1&bookid=323900</dc:identifier_dbid>
<dc:identifier_dbid>http://catdir.loc.gov/catdir/toc/ecip0719/2007022434.html</dc:identifier_dbid>
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
welcome
ASKER