Skip to main content

Home/ PSI_ESEI_08/ Group items tagged XSLT

Rss Feed Group items tagged

David Gelpi Fleta

Introduction to XSLT - 0 views

  • How Does it Work? In the transformation process, XSLT uses XPath to define parts of the source document that should match one or more predefined templates. When a match is found, XSLT will transform the matching part of the source document into the result document.
  • XSLT Uses XPath XSLT uses XPath to find information in an XML document. XPath is used to navigate through elements and attributes in XML documents.
  • A common way to describe the transformation process is to say that XSLT transforms an XML source-tree into an XML result-tree.
  • ...2 more annotations...
  • XSLT is used to transform an XML document into another XML document, or another type of document that is recognized by a browser, like HTML and XHTML. Normally XSLT does this by transforming each XML element into an (X)HTML element.
  • What is XSLT? XSLT stands for XSL Transformations XSLT is the most important part of XSL XSLT transforms an XML document into another XML document XSLT uses XPath to navigate in XML documents XSLT is a W3C Recommendation
David Gelpi Fleta

Ampliación del plazo de entrega de la práctica. - 76 views

La entrega de la segunda parte de la práctica consta de los siguientes documentos (impresos y en CD): - Hoja de estilos XSLT. - Una o varias instancias XML ejemplo con el juego de documentos...

practica

David Gelpi Fleta

XSLT Transformation - 0 views

  • xmlns:xsl="http://www.w3.org/1999/XSL/Transform" points to the official W3C XSLT namespace.
  • Link the XSL Style Sheet to the XML Document Add the XSL style sheet reference to your XML document
  • <xsl:transform version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
  • ...3 more annotations...
  • <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
  • orrect Style Sheet Declaration The root element that declares the document to be an XSL style sheet is <xsl:stylesheet> or <xsl:transform>.
  • Example study: How to transform XML into XHTML using XSLT.
David Gelpi Fleta

XSLT Tutorial - 0 views

  • XSL stands for EXtensible Stylesheet Language.
  • there was a need for an XML-based style sheet language.
  • XSLT stands for XSL Transformations.
David Gelpi Fleta

XSL Transformations (XSLT) - 0 views

shared by David Gelpi Fleta on 12 Jan 09 - Cached
  • In the absence of a select attribute, the xsl:apply-templates instruction processes all of the children of the current node, including text nodes
  • <xsl:template   match = pattern   name = qname   priority = number   mode = qname>
  • <xsl:call-template   name = qname>
  • ...2 more annotations...
  • Templates can be invoked by name.
  • An xsl:call-template element invokes a template by name; it has a required name attribute that identifies the template to be invoked
David Gelpi Fleta

XSLT <xsl:template> Element - 0 views

  • The content inside the &lt;xsl:template&gt; element defines some HTML to write to the output.
  • &lt;xsl:template match="/"&gt; &lt;html&gt;
  • &lt;xsl:stylesheet&gt;, defines that this document is an XSLT style sheet document
  • ...3 more annotations...
  • &lt;xsl:template&gt; element is used to build templates. The match attribute is used to associate a template with an XML element. The match attribute can also be used to define a template for the entire XML document. The value of the match attribute is an XPath expression (i.e. match="/" defines the whole document).
  • Since an XSL style sheet is an XML document itself, it always begins with the XML declaration: &lt;?xml version="1.0" encoding="ISO-8859-1"?&gt;
  • An XSL style sheet consists of one or more set of rules that are called templates. Each template contains rules to apply when a specified node is matched.
David Gelpi Fleta

XSLT <xsl:apply-templates> Element - 0 views

  • If we add a select attribute to the &lt;xsl:apply-templates&gt; element it will process only the child element that matches the value of the attribute
  • The &lt;xsl:apply-templates&gt; element applies a template to the current element or to the current element's child nodes.
David Gelpi Fleta

XSLT <xsl:choose> Element - 0 views

  • &lt;xsl:choose&gt; &lt;xsl:when test="expression"&gt; ... some output ... &lt;/xsl:when&gt; &lt;xsl:otherwise&gt; ... some output .... &lt;/xsl:otherwise&gt; &lt;/xsl:choose&gt;
  • The &lt;xsl:choose&gt; element is used in conjunction with &lt;xsl:when&gt; and &lt;xsl:otherwise&gt; to express multiple conditional tests.
David Gelpi Fleta

XSLT <xsl:sort> Element - 0 views

  • &lt;xsl:for-each select="catalog/cd"&gt; &lt;xsl:sort select="artist"/&gt;
  • To sort the output, simply add an &lt;xsl:sort&gt; element inside the &lt;xsl:for-each&gt; element in the XSL file:
David Gelpi Fleta

XSLT <xsl:value-of> Element - 0 views

  • he value of the select attribute is an XPath expression. An XPath expression works like navigating a file system; where a forward slash (/) selects subdirectories.
  • &lt;xsl:value-of select="catalog/cd/title"/&gt;
  • The &lt;xsl:value-of&gt; element is used to extract the value of a selected node.
David Gelpi Fleta

XPath Axes - 0 views

David Gelpi Fleta

XSLT <xsl:if> Element - 0 views

  • &lt;xsl:for-each select="catalog/cd"&gt; &lt;xsl:if test="price &amp;gt; 10"&gt;
  • &lt;xsl:if test="expression"&gt; ... ...some output if the expression is true... ... &lt;/xsl:if&gt;
  • add the &lt;xsl:if&gt; element inside the &lt;xsl:for-each&gt; element
David Gelpi Fleta

XPath Operators - 0 views

David Gelpi Fleta

Introduction to XPath - 0 views

  • XPath is a language for finding information in an XML document
  • What is XPath? XPath is a syntax for defining parts of an XML document XPath uses path expressions to navigate in XML documents XPath contains a library of standard functions XPath is a major element in XSLT XPath is a W3C recommendation
David Gelpi Fleta

XPath Syntax - 0 views

  • Selecting Nodes XPath uses path expressions to select nodes in an XML document.
  • Expression Description nodename Selects all child nodes of the named node / Selects from the root node // Selects nodes in the document from the current node that match the selection no matter where they are . Selects the current node .. Selects the parent of the current node @ Selects attributes
  • Predicates Predicates are used to find a specific node or a node that contains a specific value.
  • ...9 more annotations...
  • Predicates are always embedded in square brackets.
  • [1]
  • [last()]
  • [position()&lt;3]
  • [@lang]
  • [@lang='eng']
  • [price&gt;35.00]
  • Wildcard Description * Matches any element node @* Matches any attribute node node() Matches any node of any kind
  • Selecting Several Paths By using the | operator in an XPath expression you can select several paths.
David Gelpi Fleta

XSL Languages - 0 views

  • XSL stands for EXtensible Stylesheet Language.
  • XSL consists of three parts: XSLT - a language for transforming XML documents XPath - a language for navigating in XML documents XSL-FO - a language for formatting XML documents
  • XSL describes how the XML document should be displayed!
David Gelpi Fleta

Why Use XML Schemas? - 0 views

  • XML Schemas Support Data Types
  • It is easier to describe allowable document content It is easier to validate the correctness of data It is easier to work with data from a database It is easier to define data facets (restrictions on data) It is easier to define data patterns (data formats) It is easier to convert data between different data types
  • XML Schemas use XML Syntax
  • ...4 more annotations...
  • You don't have to learn a new language You can use your XML editor to edit your Schema files You can use your XML parser to parse your Schema files You can manipulate your Schema with the XML DOM You can transform your Schema with XSLT
  • XML Schemas are Extensible
  • Reuse your Schema in other Schemas Create your own data types derived from the standard types Reference multiple schemas in the same document
  • Well-Formed is not Enough
David Gelpi Fleta

XSLT <xsl:for-each> Element - 0 views

  • Legal filter operators are: =&nbsp; (equal) != (not equal) &amp;lt; less than &amp;gt; greater than
  • We can also filter the output from the XML file by adding a criterion to the select attribute in the &lt;xsl:for-each&gt; element.
  • &lt;xsl:for-each select="catalog/cd"&gt;
  • ...1 more annotation...
  • The &lt;xsl:for-each&gt; Element The XSL &lt;xsl:for-each&gt; element can be used to select every XML element of a specified node-set:
1 - 18 of 18
Showing 20 items per page