First, I'm wondering when I read:
<xsl:template match="/">
<xsl:apply-templates
select=".//Bioseq-set/
whether you really want to read all the descendant Bioseq-set elements here, or only the one at the top level? If you only want the top-level, then searching the whole document for it is very inefficient.
Secondly, when you're using output method="text" then you don't need disable-output-escaping, because the text output method never does any escaping in the first place.
Looking at this expression:
<xsl:value-of select="ancestor::Seq-entry_seq/Bioseq/Bioseq_id/Seq-id/Seq-id_other/Textseq-id/Textseq-id_accession"/>
when you're positioned in the NP_973385 entry the only ancestor Seq-entry_seq is within the second of the two Seq_entry elements, so I can't see why you imagine it will select something within the first Seq_entry. From your description, I would think the right path expression is
<xsl:value-of select="ancestor::Seq-entry/preceding-sibling::Seq-entry[1]/Seq-entry_seq/Bioseq/Bioseq_id/Seq-id/Seq-id_other/Textseq-id/Textseq-id_accession"/>
or perhaps more simply
<xsl:value-of select="preceding::Textseq-id_accession[1]"/>
Michael Kay
Michael Kay
http://www.saxonica.com/
Author, XSLT Programmer's Reference and XPath 2.0 Programmer's Reference