string - XSL substring on two levels -
i want sub string of text 0-500 characters , display image , again display remaining part of above text. getting 0-500 characters till first full stop, using below code :
<xsl:value-of select="substring(metadata/item/body, 1, 500 + string-length(substring-before(substring(metadata/item/body, 501),'.')))" disable-output-escaping="yes"/>.
then displaying image.after using code display remaining part of text :
<xsl:value-of select="substring(metadata/item/body, 500)" disable-output-escaping="yes"/>
output getting :
partnership private sector, pharmaceutical sector. image***** cal sector. added future vision health....till end.
expected output:
partnership private sector, pharmaceutical sector. image***** added future vision health....till end.
in code section before image doing wonderful job of finding right place break (which might not @ character 500. in second piece of code rather reuse same method of finding start starting @ character 500. if take solution pre image part , use post image part you'll output looking for.
Comments
Post a Comment