• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 373
  • Last Modified:

error in extracting text present between html tags

i m getting error invalid xpath expression. Unexpected token on this line of xslt

<xsl:value-of select="FIELD[NAME/text() = 'html']/VALUE/substring-before(substring-after(text(),'&lt;body&gt;'),'&lt;/body&gt;')"  />

when i m trying to extract text between the html body element

&lt;html&gt;&lt;body&gt;Living With Chronic Obstructive Pulmonary Disease (COPD) &lt;/body&gt;&lt;/html&gt;
0
mmalik15
Asked:
mmalik15
  • 2
1 Solution
 
Geert BormansCommented:
you are using an XSLT2 syntax with a XSLT1 processor
(it works by the way in XSLT2)

- you need to run this using XSLT2 processor
- also you should replace text() in favour of '.' to remove undesired effects

the XSLT1 alternative for this statement

       <xsl:value-of select="substring-before(substring-after(FIELD[normalize-space(NAME) = 'html']/VALUE,'&lt;body&gt;'),'&lt;/body&gt;')"  />  
0
 
mmalik15Author Commented:
thanks
0
 
Geert BormansCommented:
welcome
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now