Till KTH:s startsida Till KTH:s startsida

Lecture: XSLT

Tid: Onsdag 6 november 2013 kl 15:00 - 17:00 2013-11-06T15:00:00 2013-11-06T17:00:00

Kungliga Tekniska högskolan
HT 2013 xmlpub13

Plats: D41

Aktivitet: Föreläsning

Lärare: Björn Hedin ()

Studentgrupper: CMETE3INMT, CMETE3TRK, TMETM2-IM, TMETM2-TK

Info:

Prepare for the lecture by reading this

XSLT is a technology for transforming XML documents belonging to a vocabulary to new XML documents that can belong to the same or an entirely different vocabulary.
A program called an XSLT processor takes as input an XML document (input tree) and an XSLT document. The basic principle is that the XSLT processor starts to go through the input tree from the top down. The node that is being processed is called the context node. Processor looking for patterns ("patterns") of the input tree and see if there is a rule in the XSLT document matches the pattern for context node. If so, the rule can add content to the result tree, and give instructions on which nodes next to be context nodes.

The patterns and rules about what will happen when the processor finds a certain pattern, described by the element "template" that is defined in the XSLT namespace belongs. The element template has an attribute "match" containing an xpath expression with which to describe the different parts of an XML tree. The content of the template element is then added to the result tree. Content can also include instructions about which nodes will then be contextual nodes. One common case is to allow all or some child nodes become context-nodes by xslt element apply-templates:

<xsl:apply-templates select="ett-xpath-uttryck"/>

Here is a complete example of a template

<xsl:template match="/party/toastmaster/firstname">
  <h1> Name: <xsl:apply-templates select="*"/> </ h1>
</ xsl: template>

The example matches all elements "first name" which is a child element to the "toast master" which in turn is a child element to the "party". If the XSLT processor, in the revision of the input tree, encounters such an element, the first add "<h1> Förnmamn:" the result tree, then go through all the child nodes of the element and see if any rules are applicable to these , to finally close it began h1 element with "</ h1>".

----

Here are the  slides from last year's lecture about XSLT . They might be updated.

Schemahandläggare skapade händelsen 14 augusti 2013
Lärare Björn Hedin redigerade 14 augusti 2013

FöreläsningLecture: XSLT

Prepare yourself by reading this XSLT is a technology for transforming XML documents belonging to a vocabulary to new XML documents that can belong to the same or an entirely different vocabulary.A program called an XSLT processor takes as input an XML document (input tree) and an XSLT document. The basic principle is that the XSLT processor starts to go through the input tree from the top down. The node that is being processed is called the context node. Processor looking for patterns ("patterns") of the input tree and see if there is a rule in the XSLT document matches the pattern for context node. If so, the rule can add content to the result tree, and give instructions on which nodes next to be context nodes.¶

The patterns and rules about what will happen when the processor finds a certain pattern, described by the element "template" that is defined in the XSLT namespace belongs. The element template has an attribute "match" containing an xpath expression with which to describe the different parts of an XML tree. The content of the template element is then added to the result tree. Content can also include instructions about which nodes will then be contextual nodes. One common case is to allow all or some child nodes become context-nodes by xslt element apply-templates:¶

<xsl:apply-templates select="ett-xpath-uttryck"/> Here is a complete example of a template¶

<xsl:template match="/party/toastmaster/firstname">  <h1> Name: <xsl:apply-templates select="*"/> </ h1></ xsl: template> The example matches all elements "first name" which is a child element to the "toast master" which in turn is a child element to the "party". If the XSLT processor, in the revision of the input tree, encounters such an element, the first add "<h1> Förnmamn:" the result tree, then go through all the child nodes of the element and see if any rules are applicable to these , to finally close it began h1 element with "</ h1>".¶

Lärare Björn Hedin redigerade 14 augusti 2013

Prepare yourselffor the lecture by reading this XSLT is a technology for transforming XML documents belonging to a vocabulary to new XML documents that can belong to the same or an entirely different vocabulary.A program called an XSLT processor takes as input an XML document (input tree) and an XSLT document. The basic principle is that the XSLT processor starts to go through the input tree from the top down. The node that is being processed is called the context node. Processor looking for patterns ("patterns") of the input tree and see if there is a rule in the XSLT document matches the pattern for context node. If so, the rule can add content to the result tree, and give instructions on which nodes next to be context nodes.

The patterns and rules about what will happen when the processor finds a certain pattern, described by the element "template" that is defined in the XSLT namespace belongs. The element template has an attribute "match" containing an xpath expression with which to describe the different parts of an XML tree. The content of the template element is then added to the result tree. Content can also include instructions about which nodes will then be contextual nodes. One common case is to allow all or some child nodes become context-nodes by xslt element apply-templates:

<xsl:apply-templates select="ett-xpath-uttryck"/> Here is a complete example of a template

<xsl:template match="/party/toastmaster/firstname">  <h1> Name: <xsl:apply-templates select="*"/> </ h1></ xsl: template> The example matches all elements "first name" which is a child element to the "toast master" which in turn is a child element to the "party". If the XSLT processor, in the revision of the input tree, encounters such an element, the first add "<h1> Förnmamn:" the result tree, then go through all the child nodes of the element and see if any rules are applicable to these , to finally close it began h1 element with "</ h1>".

Lärare Björn Hedin redigerade 15 augusti 2013

Prepare for the lecture by reading this XSLT is a technology for transforming XML documents belonging to a vocabulary to new XML documents that can belong to the same or an entirely different vocabulary.A program called an XSLT processor takes as input an XML document (input tree) and an XSLT document. The basic principle is that the XSLT processor starts to go through the input tree from the top down. The node that is being processed is called the context node. Processor looking for patterns ("patterns") of the input tree and see if there is a rule in the XSLT document matches the pattern for context node. If so, the rule can add content to the result tree, and give instructions on which nodes next to be context nodes.

The patterns and rules about what will happen when the processor finds a certain pattern, described by the element "template" that is defined in the XSLT namespace belongs. The element template has an attribute "match" containing an xpath expression with which to describe the different parts of an XML tree. The content of the template element is then added to the result tree. Content can also include instructions about which nodes will then be contextual nodes. One common case is to allow all or some child nodes become context-nodes by xslt element apply-templates:

<xsl:apply-templates select="ett-xpath-uttryck"/> Here is a complete example of a template

<xsl:template match="/party/toastmaster/firstname">  <h1> Name: <xsl:apply-templates select="*"/> </ h1></ xsl: template> The example matches all elements "first name" which is a child element to the "toast master" which in turn is a child element to the "party". If the XSLT processor, in the revision of the input tree, encounters such an element, the first add "<h1> Förnmamn:" the result tree, then go through all the child nodes of the element and see if any rules are applicable to these , to finally close it began h1 element with "</ h1>".

----¶

Here are the  slides from last year's lecture about XSLT . They might be updated.¶

Schemahandläggare redigerade 31 augusti 2013

[u'CMETE3INMT', u'CMETE3TRK', u'TMETM2-TK', u'IM, TMETM2-IM']TK

Schemahandläggare redigerade 14 september 2013

[u'CMETE3INMT', u'CMETE3TRK', u'TMETM2-IM, TK', u'TMETM2-TKIM']

Schemahandläggare ställde in händelsen 14 december 2013

Hela världen får läsa.

Senast ändrad 2013-12-14 01:18

Taggar: Saknas än så länge.