• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Generic question on <xsl:apply-templates>

 
Kumar Raja
Ranch Hand
Posts: 547
2
Hibernate Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello All,

I actually have two questions related to XSLT.

1) What is the purpose, meaning and usage of <xsl:template match="*"/>

2) When we say <xsl:apply-templates select="SomeName"/> (Here somename is really some randam name), what is actually happening ?

For my second question, I believe "SomeName" could be really some XPath expression. Is that correct?

So for example, if my syntax is like


Does the above syntax means to have the template applied to all the elements "Author"s under "Book"s in my source XML? If yes, what template is being applied here and where do we specify that.

To be more clear, if my XML is like



Now if I want to have my new transformed XML to highlight only Authors ignoring the rest of the elements with a red font,



Is my XSL correct?

What would happen, if I just say



Please advice.
 
Kumar Raja
Ranch Hand
Posts: 547
2
Hibernate Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Just to add more information,


Now my XSL is like this



Now when I tried to debug the transformation using Oxygen tool (XML Editor tool), I had set the breakpoint at <xsl:apply-templates select="businessinfo/businessline"/>

and I see that the control has immediately gone to <xsl:template match="businessline"> and the entire section of XML under businessline element in source XML has been selected, indicating that part of XML is being processed now. My question here is, why did control go to <xsl:template match="businessline">. I have not specified this in XSL. But why did it go?

Also, after this, when the execution reached <xsl:apply-templates select="businessinfo/errors"/>, the debugger took the control to



and nothing has been processed.

Please be advised that, there is exactly a similar version running in production in our project.
 
Kumar Raja
Ranch Hand
Posts: 547
2
Hibernate Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Any advice on this.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic