In the above example greeting.xml is being transformed using greeting.xsl.
My confusion is in <xsl:apply-templates select="greeting"/>. When apply-templates is encountered, xsl will look for the element that is specified in the select and will apply ntemplate to that element. The template that is applied to it is the template below. Does the template below has to be named as "greeting" ? what happens if template below is named something diffrent (say, "hello" instead of greeting) ? will it sttill be applied to this element ?
If the template is named like this, will it still apply to the <xsl:apply-templates select="greeting"/> ? Is it required that whatever element is specified in tha apply-templates section has to be defined below ?
Please explain this, I did a lot of reading, bit did not find convincing answer to the basic confusion.
You didn't say what you read, or what you didn't understand about what you read. So it's pretty hard to explain that. The book I use is quite clear and gives some examples, but if you are learning XSL by googling for tutorials then I'm not surprised you are having trouble.
It appears you are confused by <xsl:template name="QName"> versus <xsl:template match="Pattern">, though. Only one of these forms has a name.
Joined: Apr 23, 2009
I was reading xslt , by O'Reilly. Usually these books are clear but this one is very confusing
I have seen <xsl:template match="/"> and <xsl:apply-templates select="template-name" > proper
I did not see <xsl:temaplte name="--" >
These things look confusing without proper explanation. Can you please expalin these syntax or the book which explains this properly ?