Skip to content

Commit

Permalink
Group XSLT docs into Guides and Reference (#37825)
Browse files Browse the repository at this point in the history
* Move references

* Move guides

* Clean up listing pages

* Apply code review suggestions

* Use front matter sidebar

* Remove local listing-page type

* Use manual reference description

---------

Co-authored-by: Brian Smith <brian@smith.berlin>
Co-authored-by: Ruth John <Rumyra@users.noreply.github.com>
  • Loading branch information
3 people authored Jan 31, 2025
1 parent ab4090c commit 968a812
Show file tree
Hide file tree
Showing 95 changed files with 669 additions and 782 deletions.
525 changes: 283 additions & 242 deletions files/en-us/_redirects.txt

Large diffs are not rendered by default.

200 changes: 100 additions & 100 deletions files/en-us/_wikihistory.json

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ This section lists `page-type` values for pages under [Web/XPath](/en-US/docs/We

This section lists `page-type` values for pages under [Web/XSLT](/en-US/docs/Web/XSLT). Every page in that part of the tree must have a `page-type`, and its value must be one of those listed below or one of the [generic page type](#generic_page_types) values.

- `xslt-element`: an element of XSLT, like [`<xsl:message>`](/en-US/docs/Web/XSLT/Element/message).
- `xslt-element`: an element of XSLT, like [`<xsl:message>`](/en-US/docs/Web/XSLT/Reference/Element/message).

### EXSLT page types

Expand Down
2 changes: 1 addition & 1 deletion files/en-us/web/exslt/math/max/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ page-type: exslt-function

`math:max()` returns the maximum value of a node-set.

To compute the maximum value of the node-set, the node set is sorted into descending order as it would be using [`xsl:sort()`](/en-US/docs/Web/XSLT/Element/sort) with a data type of `number`. The maximum value is then the first node in the sorted list, converted into a number.
To compute the maximum value of the node-set, the node set is sorted into descending order as it would be using [`xsl:sort()`](/en-US/docs/Web/XSLT/Reference/Element/sort) with a data type of `number`. The maximum value is then the first node in the sorted list, converted into a number.

## Syntax

Expand Down
2 changes: 1 addition & 1 deletion files/en-us/web/exslt/math/min/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ page-type: exslt-function

`math:min()` returns the minimum value of a node-set.

To compute the minimum value of the node-set, the node set is sorted into ascending order as it would be using [`xsl:sort()`](/en-US/docs/Web/XSLT/Element/sort) with a data type of `number`. The minimum value is then the first node in the sorted list, converted into a number.
To compute the minimum value of the node-set, the node set is sorted into ascending order as it would be using [`xsl:sort()`](/en-US/docs/Web/XSLT/Reference/Element/sort) with a data type of `number`. The minimum value is then the first node in the sorted list, converted into a number.

## Syntax

Expand Down
5 changes: 2 additions & 3 deletions files/en-us/web/xpath/axes/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,12 @@
title: Axes
slug: Web/XPath/Axes
page-type: landing-page
sidebar: xsltsidebar
---

{{XsltSidebar}}

There are thirteen different axes in the [XPath](/en-US/docs/Web/XPath) specification. An axis represents a relationship to the context node, and is used to locate nodes relative to that node on the tree.

For further information on using XPath expressions, please see the [For Further Reading](/en-US/docs/Web/XSLT/Transforming_XML_with_XSLT#for_further_reading) section at the end of [Transforming XML with XSLT](/en-US/docs/Web/XSLT/Transforming_XML_with_XSLT) document. Also see the ['axes' section in the xpath spec](https://www.w3.org/TR/xpath-30/#axes).
For further information on using XPath expressions, please see the [For Further Reading](/en-US/docs/Web/XSLT/Guides/Transforming_XML_with_XSLT/For_Further_Reading) section of the [Transforming XML with XSLT](/en-US/docs/Web/XSLT/Guides/Transforming_XML_with_XSLT) guide. Also see the ['axes' section in the xpath spec](https://www.w3.org/TR/xpath-30/#axes).

- `ancestor`
- : Indicates all the ancestors of the context node beginning with the parent node and traveling through to the root node.
Expand Down
3 changes: 1 addition & 2 deletions files/en-us/web/xpath/comparison_with_css_selectors/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,9 @@
title: Comparison of CSS Selectors and XPath
slug: Web/XPath/Comparison_with_CSS_selectors
page-type: guide
sidebar: xsltsidebar
---

{{XsltSidebar}}

This article seeks to document the difference between CSS Selectors and XPath for web developers to be able to better choose the right tool for the right job.

| [XPath feature](/en-US/docs/Web/XPath) | [CSS equivalent](/en-US/docs/Web/CSS/CSS_selectors) |
Expand Down
3 changes: 1 addition & 2 deletions files/en-us/web/xpath/functions/boolean/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,9 @@
title: boolean
slug: Web/XPath/Functions/boolean
page-type: xpath-function
sidebar: xsltsidebar
---

{{XsltSidebar}}

The `boolean` function evaluates an expression and returns true or false.

## Syntax
Expand Down
3 changes: 1 addition & 2 deletions files/en-us/web/xpath/functions/ceiling/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,9 @@
title: ceiling
slug: Web/XPath/Functions/ceiling
page-type: xpath-function
sidebar: xsltsidebar
---

{{XsltSidebar}}

The `ceiling` function evaluates a decimal number and returns the smallest integer greater than or equal to the decimal number.

## Syntax
Expand Down
3 changes: 1 addition & 2 deletions files/en-us/web/xpath/functions/choose/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,9 @@
title: choose
slug: Web/XPath/Functions/choose
page-type: xpath-function
sidebar: xsltsidebar
---

{{XsltSidebar}}

The `choose` function returns one of the specified objects based on a boolean parameter.

> [!NOTE]
Expand Down
3 changes: 1 addition & 2 deletions files/en-us/web/xpath/functions/concat/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,9 @@
title: concat
slug: Web/XPath/Functions/concat
page-type: xpath-function
sidebar: xsltsidebar
---

{{XsltSidebar}}

The `concat` function concatenates two or more strings and returns the resulting string.

## Syntax
Expand Down
3 changes: 1 addition & 2 deletions files/en-us/web/xpath/functions/contains/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,9 @@
title: contains
slug: Web/XPath/Functions/contains
page-type: xpath-function
sidebar: xsltsidebar
---

{{XsltSidebar}}

The `contains` function determines whether the first argument string contains the second argument string and returns boolean true or false.

## Syntax
Expand Down
3 changes: 1 addition & 2 deletions files/en-us/web/xpath/functions/count/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,9 @@
title: count
slug: Web/XPath/Functions/count
page-type: xpath-function
sidebar: xsltsidebar
---

{{XsltSidebar}}

The `count` function counts the number of nodes in a node-set and returns an integer.

## Syntax
Expand Down
3 changes: 1 addition & 2 deletions files/en-us/web/xpath/functions/current/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,9 @@
title: current
slug: Web/XPath/Functions/current
page-type: xpath-function
sidebar: xsltsidebar
---

{{XsltSidebar}}

The `current` function can be used to get the context node in an XSLT instruction.

## Syntax
Expand Down
3 changes: 1 addition & 2 deletions files/en-us/web/xpath/functions/document/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,9 @@
title: document
slug: Web/XPath/Functions/document
page-type: xpath-function
sidebar: xsltsidebar
---

{{XsltSidebar}}

The `document` finds a node-set in an external document, or multiple external documents, and returns the resulting node-set.

## Syntax
Expand Down
3 changes: 1 addition & 2 deletions files/en-us/web/xpath/functions/element-available/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,9 @@
title: element-available
slug: Web/XPath/Functions/element-available
page-type: xpath-function
sidebar: xsltsidebar
---

{{XsltSidebar}}

The `element-available` function determines if an element is available and returns true or false.

## Syntax
Expand Down
3 changes: 1 addition & 2 deletions files/en-us/web/xpath/functions/false/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,9 @@
title: "false"
slug: Web/XPath/Functions/false
page-type: xpath-function
sidebar: xsltsidebar
---

{{XsltSidebar}}

The `false` function returns boolean false.

## Syntax
Expand Down
3 changes: 1 addition & 2 deletions files/en-us/web/xpath/functions/floor/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,9 @@
title: floor
slug: Web/XPath/Functions/floor
page-type: xpath-function
sidebar: xsltsidebar
---

{{XsltSidebar}}

The `floor` function evaluates a decimal number and returns the largest integer less than or equal to the decimal number.

## Syntax
Expand Down
5 changes: 2 additions & 3 deletions files/en-us/web/xpath/functions/format-number/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,9 @@
title: format-number
slug: Web/XPath/Functions/format-number
page-type: xpath-function
sidebar: xsltsidebar
---

{{XsltSidebar}}

The `format-number` function evaluates a number and returns a string representing the number in a given format.

## Syntax
Expand All @@ -22,7 +21,7 @@ format-number(number, pattern, decimalFormat)
- `pattern`
- : A string in the format of the Java [DecimalFormat](https://docs.oracle.com/javase/8/docs/api/java/text/DecimalFormat.html) class.
- `decimalFormat` (optional)
- : The name of an [`xsl:decimal-format`](/en-US/docs/Web/XSLT/Element/decimal-format) element that defines the number format to be used. If omitted, the default decimal-format will be used.
- : The name of an [`xsl:decimal-format`](/en-US/docs/Web/XSLT/Reference/Element/decimal-format) element that defines the number format to be used. If omitted, the default decimal-format will be used.

### Return value

Expand Down
3 changes: 1 addition & 2 deletions files/en-us/web/xpath/functions/function-available/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,9 @@
title: function-available
slug: Web/XPath/Functions/function-available
page-type: xpath-function
sidebar: xsltsidebar
---

{{XsltSidebar}}

The `function-available` function determines if a given function is available and returns boolean true or false.

## Syntax
Expand Down
3 changes: 1 addition & 2 deletions files/en-us/web/xpath/functions/generate-id/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,9 @@
title: generate-id
slug: Web/XPath/Functions/generate-id
page-type: xpath-function
sidebar: xsltsidebar
---

{{XsltSidebar}}

The `generate-id` function generates a unique id for the first node in a given node-set and returns a string containing that id.

## Syntax
Expand Down
3 changes: 1 addition & 2 deletions files/en-us/web/xpath/functions/id/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,9 @@
title: id
slug: Web/XPath/Functions/id
page-type: xpath-function
sidebar: xsltsidebar
---

{{XsltSidebar}}

The `id` function finds nodes matching the given ids and returns a node-set containing the identified nodes.

## Syntax
Expand Down
5 changes: 2 additions & 3 deletions files/en-us/web/xpath/functions/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,10 @@
title: Functions
slug: Web/XPath/Functions
page-type: guide
sidebar: xsltsidebar
---

{{XsltSidebar}}

The following is an annotated list of core [XPath](/en-US/docs/Web/XPath) functions and [XSLT](/en-US/docs/Web/XSLT)-specific additions to XPath, including a description, syntax, a list of arguments, result-type, source in the appropriate W3C Recommendation. For further information on using XPath/XSLT functions, please see the [For Further Reading](/en-US/docs/Web/XSLT/Transforming_XML_with_XSLT) page.
The following is an annotated list of core [XPath](/en-US/docs/Web/XPath) functions and [XSLT](/en-US/docs/Web/XSLT)-specific additions to XPath, including a description, syntax, a list of arguments, result-type, source in the appropriate W3C Recommendation. For further information on using XPath/XSLT functions, please see the [For Further Reading](/en-US/docs/Web/XSLT/Guides/Transforming_XML_with_XSLT) page.

- [boolean()](/en-US/docs/Web/XPath/Functions/boolean)
- [ceiling()](/en-US/docs/Web/XPath/Functions/ceiling)
Expand Down
7 changes: 3 additions & 4 deletions files/en-us/web/xpath/functions/key/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,9 @@
title: key
slug: Web/XPath/Functions/key
page-type: xpath-function
sidebar: xsltsidebar
---

{{XsltSidebar}}

The `key` function returns a node-set of nodes that have the given value for the given key.

## Syntax
Expand All @@ -17,7 +16,7 @@ key( keyname, value )
### Parameters

- `keyname`
- : A string containing the name of the [`xsl:key`](/en-US/docs/Web/XSLT/Element/key) element to be used.
- : A string containing the name of the [`xsl:key`](/en-US/docs/Web/XSLT/Reference/Element/key) element to be used.
- `value`
- : The returned node-set will contain every node that has this value for the given key.

Expand All @@ -27,7 +26,7 @@ A node set.

## Description

- The [`xsl:key`](/en-US/docs/Web/XSLT/Element/key) element defines what attribute on what given elements will be used to match the key.
- The [`xsl:key`](/en-US/docs/Web/XSLT/Reference/Element/key) element defines what attribute on what given elements will be used to match the key.

This function is an XSLT-specific addition to XPath. It is not a part of the core XPath function library.

Expand Down
3 changes: 1 addition & 2 deletions files/en-us/web/xpath/functions/lang/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,9 @@
title: lang
slug: Web/XPath/Functions/lang
page-type: xpath-function
sidebar: xsltsidebar
---

{{XsltSidebar}}

The `lang` function determines whether the context node matches the given language and returns boolean true or false.

## Syntax
Expand Down
3 changes: 1 addition & 2 deletions files/en-us/web/xpath/functions/last/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,9 @@
title: last
slug: Web/XPath/Functions/last
page-type: xpath-function
sidebar: xsltsidebar
---

{{XsltSidebar}}

The `last` function returns a number equal to the context size from the expression evaluation context.

## Syntax
Expand Down
3 changes: 1 addition & 2 deletions files/en-us/web/xpath/functions/local-name/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,9 @@
title: local-name
slug: Web/XPath/Functions/local-name
page-type: xpath-function
sidebar: xsltsidebar
---

{{XsltSidebar}}

The `local-name` function returns a string representing the local name of the first node in a given node-set.

## Syntax
Expand Down
3 changes: 1 addition & 2 deletions files/en-us/web/xpath/functions/name/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,9 @@
title: name
slug: Web/XPath/Functions/name
page-type: xpath-function
sidebar: xsltsidebar
---

{{XsltSidebar}}

The `name` function returns a string representing the QName of the first node in a given node-set.

## Syntax
Expand Down
3 changes: 1 addition & 2 deletions files/en-us/web/xpath/functions/namespace-uri/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,9 @@
title: namespace-uri
slug: Web/XPath/Functions/namespace-uri
page-type: xpath-function
sidebar: xsltsidebar
---

{{XsltSidebar}}

The `namespace-uri` function returns a string representing the namespace URI of the first node in a given node-set.

## Syntax
Expand Down
3 changes: 1 addition & 2 deletions files/en-us/web/xpath/functions/normalize-space/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,9 @@
title: normalize-space
slug: Web/XPath/Functions/normalize-space
page-type: xpath-function
sidebar: xsltsidebar
---

{{XsltSidebar}}

The `normalize-space` function strips leading and trailing white-space from a string, replaces sequences of whitespace characters by a single space, and returns the resulting string.

## Syntax
Expand Down
3 changes: 1 addition & 2 deletions files/en-us/web/xpath/functions/not/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,9 @@
title: not
slug: Web/XPath/Functions/not
page-type: xpath-function
sidebar: xsltsidebar
---

{{XsltSidebar}}

The `not` function evaluates a boolean expression and returns the opposite value.

## Syntax
Expand Down
3 changes: 1 addition & 2 deletions files/en-us/web/xpath/functions/number/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,9 @@
title: number
slug: Web/XPath/Functions/number
page-type: xpath-function
sidebar: xsltsidebar
---

{{XsltSidebar}}

The `number` function converts an object to a number and returns the number.

## Syntax
Expand Down
3 changes: 1 addition & 2 deletions files/en-us/web/xpath/functions/position/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,9 @@
title: position
slug: Web/XPath/Functions/position
page-type: xpath-function
sidebar: xsltsidebar
---

{{XsltSidebar}}

The `position` function returns a number equal to the context position from the expression evaluation context.

## Syntax
Expand Down
Loading

0 comments on commit 968a812

Please sign in to comment.