Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- I need to be able to output the text of an XML document separated by line breaks
- Need output following
- <ShortNote>
- <SNHeading1>Criminal Law</SNHeading1>
- <SNHeading2>Police</SNHeading2>
- <SNHeading3>#Appointment to Sensitive Posts</SNHeading3>
- <SNHeading4>Director General of Police (DGP)</SNHeading4>
- </ShortNote>
- following code use but not output according to me:-
- <xsl:template match="ShortNote/CatchWord">
- <xsl:param name="text" select="normalize-space(.)"/>
- <xsl:if test="normalize-space(substring-before(concat($text,'—'),'—'))!=''">
- <xsl:element name="SNHeading{position()}">
- <xsl:value-of select="normalize-space(substring-before(concat($text,'—'),'—'))"/>
- </xsl:element>
- </xsl:if>
- <xsl:if test="contains($text,'—')">
- <xsl:message><xsl:value-of select="."/></xsl:message>
- <xsl:element name="SNHeading{position()+1}">
- <xsl:apply-templates select=".">
- <xsl:with-param name="text" select="substring-after($text,'—')"/>
- </xsl:apply-templates>
- </xsl:element>
- </xsl:if>
- </xsl:template>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement