Skip to main content

Home/ PSI_ESEI_08/ Group items tagged XPATH

Rss Feed Group items tagged

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()<3]
  • [@lang]
  • [@lang='eng']
  • [price>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

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

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

XPath Operators - 0 views

David Gelpi Fleta

XPath Nodes - 0 views

  • In XPath, there are seven kinds of nodes: element, attribute, text, namespace, processing-instruction, comment, and document (root) nodes.
  • XML documents are treated as trees of nodes. The root of the tree is called the document node (or root node).
  • Atomic values Atomic values are nodes with no children or parent.
  • ...5 more annotations...
  • Children Element nodes may have zero, one or more children.
  • Relationship of Nodes Parent Each element and attribute has one parent.
  • Siblings Nodes that have the same parent.
  • Ancestors A node's parent, parent's parent, etc.
  • Descendants A node's children, children's children, etc.
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

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!
1 - 9 of 9
Showing 20 items per page