Jump to content

the next node


Guest mma2000

Recommended Posts

Guest mma2000

Hello I want to navigate to the next node ,(actuall Position <title> )and I want to use a certain format for each node,how can I do it with xsl?I ve tried to use <xsl:template match="bold"><xsl:attribute name="paragraphformat">bold</xsl:attribute></xsl:template>or <xsl:if test="following-sibling::bold"><xsl:attribute name="paragraphformat">bold</xsl:attribute></xsl:if>but it does n´t work :) the Result is,that "***some text***" would be formated too.the xml code is : <title> ***some text*** <bold>BOLDTEXT</bold> <italic>ITALICTEXT</italic></title>Thanksssssssssssssssssssss & sorry for my bad English :)

Link to comment
Share on other sites

  • 4 months later...

first stop: the attribute element is applyed on it's container element. Therefore, it's recommender that you include it in something which you are fammiliar with.Instead of IFs or templates I would go for "for-each"s.

<xsl:for-each select="following-sibling::title"><p><xsl:attribute name="paragraphformat">bold</xsl:attribute></p>

The following-sibling::title should select all sublings to title, which are bold and italic. If you want only the italic, you may always go to it "manually" like:

/title/bold

The paragraphformat with it's value "bold" is going to be applyed onto the <p> element.Sorry for replying after all theese months, but it's just that I see this post now.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...