Hello experts,
I am trying to extract the abstract from the following XML code that appears as follow;

<abstract>
<p>
In eukaryotes, glutathione S-transferases (GSTs) participate in the detoxification of reactive electrophillic compounds by catalysing their conjugation to glutathione. GST is found as a domain in S-crystallins from squid, and proteins with no known GST activity, such as eukaryotic elongation factors 1-gamma and the HSP26 family of stress-related proteins, which include auxin-regulated proteins in plants and stringent starvation proteins in 
<taxon tax_id="562">
Escherichia coli
</taxon>
. The major lens polypeptide of cephalopods is also a GST [
<cite idref="PUB00007306"/>
]. Bacterial GSTs of known function often have a specific, growth-supporting role in biodegradative metabolism: epoxide ring opening and tetrachlorohydroquinone reductive dehalogenation are two examples of the reactions catalysed by these bacterial GSTs. Some regulatory proteins, like the stringent starvation proteins, also belong to the GST family [
<cite idref="PUB00007311"/>
]. GST seems to be absent from Archaea in which gamma-glutamylcysteine substitute to glutathione as major thiol.
</p>
<p>
Glutathione S-transferases form homodimers, but in eukaryotes can also form heterodimers of the A1 and A2 or YC1 and YC2 subunits. The homodimeric enzymes display a conserved structural fold. Each monomer is composed of a distinct N-terminal sub-domain, which adopts the thioredoxin fold, and a C-terminal all-helical sub-domain, which adopts a 4-helical bundle fold. This entry is the C-terminal domain.
</p>
<p>
Glutaredoxin 2 (Grx2), glutathione-dependent disulphide oxidoreductases, is structurally similar to GSTs, even though they lack any sequence similarity. Grx2 is also composed of N and C-terminal subdomains. It is thought that the primary function of Grx2 is to catalyse reversible glutathionylation of proteins with glutathione in cellular redox regulation including the response to oxidative stress. Grx2 is dissimilar to other glutaredoxins apart from containing the conserved active site residues [
<cite idref="PUB00014033"/>
].
</p>
</abstract>

i just want the plain text that is the whole abstract without anything in between..
if i try plain code like the following

<field name="abstract"> <xsl:value-of select="abstract"/>
             </field>

it gives me the output but, new line still exists also empty square brackets exists like the following

In eukaryotes, glutathione S-transferases (GSTs) participate in the detoxification of reactive electrophillic compounds by catalysing their conjugation to glutathione. GST is found as a domain in S-crystallins from squid, and proteins with no known GST activity, such as eukaryotic elongation factors 1-gamma and the HSP26 family of stress-related proteins, which include auxin-regulated proteins in plants and stringent starvation proteins in 

Escherichia coli

. The major lens polypeptide of cephalopods is also a GST [

]. Bacterial GSTs of known function often have a specific, growth-supporting role in biodegradative metabolism: epoxide ring opening and tetrachlorohydroquinone reductive dehalogenation are two examples of the reactions catalysed by these bacterial GSTs. Some regulatory proteins, like the stringent starvation proteins, also belong to the GST family [

]. GST seems to be absent from Archaea in which gamma-glutamylcysteine substitute to glutathione as major thiol.


Glutathione S-transferases form homodimers, but in eukaryotes can also form heterodimers of the A1 and A2 or YC1 and YC2 subunits. The homodimeric enzymes display a conserved structural fold. Each monomer is composed of a distinct N-terminal sub-domain, which adopts the thioredoxin fold, and a C-terminal all-helical sub-domain, which adopts a 4-helical bundle fold. This entry is the C-terminal domain.


Glutaredoxin 2 (Grx2), glutathione-dependent disulphide oxidoreductases, is structurally similar to GSTs, even though they lack any sequence similarity. Grx2 is also composed of N and C-terminal subdomains. It is thought that the primary function of Grx2 is to catalyse reversible glutathionylation of proteins with glutathione in cellular redox regulation including the response to oxidative stress. Grx2 is dissimilar to other glutaredoxins apart from containing the conserved active site residues [

].

I am all new and trying to learn this...could you please help me..
I thank you for your help and time..

Sammed

Dani AI

Generated

The visible newlines and the empty square brackets come from two separate things: literal whitespace/newlines inside element text nodes (for example around the inline <taxon>), and empty inline elements (<cite/>) that are wrapped in literal [ and ] characters in the source. noted the thread was solved, but here are concrete XSLT patterns that reliably produce a single plain-text abstract.

A compact, processor-portable approach (XSLT 1.0) is to strip whitespace-only text nodes, suppress cite elements, and normalize the string-value you output:

<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
  <xsl:strip-space elements="*"/>

  <xsl:template match="abstract">
    <field name="abstract">
      <xsl:value-of select="normalize-space(.)"/>
    </field>
  </xsl:template>

  <xsl:template match="cite"/>

  <xsl:template match="taxon">
    <xsl:value-of select="normalize-space(.)"/>
  </xsl:template>
</xsl:stylesheet>

If paragraph boundaries should be preserved (one blank line between paragraphs), handle p elements individually and emit explicit newlines:

<xsl:template match="abstract">
  <field name="abstract">
    <xsl:for-each select="p">
      <xsl:value-of select="normalize-space(.)"/>
      <xsl:text>&#10;&#10;</xsl:text>
    </xsl:for-each>
  </field>
</xsl:template>

For processors that support XSLT 2.0, use replace() to clean out empty bracket sequences produced by [<cite/>] patterns without touching legitimate bracketed text:

<xsl:value-of select="replace(normalize-space(.), '\[\s*\]', '')"/>

Cautions: removing all [ and ] or globally stripping brackets can corrupt legitimate bracketed content; prefer the regex removal shown above where available. See the XSLT spec entries for normalize-space() and xsl:strip-space for details: normalize-space() and xsl:strip-space. This approach addresses the whitespace and empty-citation artifacts that observed.

This was solved already :P.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.