kelangthang3
New Member
I have problem with parsing XML file using XLTS.\[code\] <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="pl"> <body style="margin-top: 0px;"> <a name="top"/> <a name="menu"> </a> <a href="http://stackoverflow.com/questions/12741028/cool html"> </a> <table width="100%" cellspacing="0" cellpadding="2" border="0" class="aws_border sortable"/> </body> </html>\[/code\]And I need to delete all node with \[code\]<a name="something"> </a>\[/code\], while preserving \[code\]<a href>\[/code\] nodes and other nodes in document.I have tried \[code\] <xsl:stylesheet version = '1.0' xmlns:xsl='http://www.w3.org/1999/XSL/Transform'> <xsl:template match="body"> <xsl:for-each select="a"> <xsl:if test="@href != '' "> <xsl:copy-of select="."/> </xsl:if> </xsl:for-each> </xsl:template> </xsl:stylesheet>\[/code\]But it preserves only \[code\]<a href >\[/code\] nodes, and deleting all the other nodes.