Created XSLT Tooltips #243

Merged
widlam merged 1 commits from enhancement/create_XSLT_tooltips into master 2023-08-28 14:55:05 +02:00
9 changed files with 3063 additions and 29 deletions

View File

@@ -4,6 +4,9 @@
{
"category":"What is XPath",
"description":"XPath is a query language used for selecting nodes from XML and processing them. It may perform operations on strings, numbers and boolean values."
},
{
"category":"What's new in XPath?"
}
],
"VersionDiffs":
@@ -34,12 +37,11 @@
"version":"3.1",
"diffs":
[
"New operator for function chaining '=>' ",
"New operator for function chaining '=>'",
"Introduced maps that store data in pair 'key:value' - 'map{ key : value, key : value }'",
"Introduced arrays - they differ from sequences in that they can be nested 'array{1, 5, 7, (10 to 20)}'"
]
}
]

View File

@@ -0,0 +1,845 @@
[
{
"name": "Templates",
"entries": [
{
"name": "<xsl:template>",
"description": "Defines an output producing template. This element must have either the match attribute or the name attribute set.",
"attributes":
[
{
"type":"optional",
"name":"match",
"description":"Specifies a pattern that determines the elements for which this template should be used. It is a required attribute if there is no name attribute."
},
{
"type":"optional",
"name":"name",
"description":"Specifies a name for this template"
},
{
"type":"optional",
"name":"mode",
"description":"Specifies a particular mode for this template, which can be matched by an attribute of the <xsl:apply-templates> element"
},
{
"type":"optional",
"name":"priority",
"description":"Specifies a numeric priority for this template."
}
],
"examples": [],
"documentationReferenceURL": "https://developer.mozilla.org/en-US/docs/Web/XSLT/Element/template",
"output": "XML Tree"
},{
"name": "<xsl:apply-templates>",
"description": "Selects a set of nodes in the input tree and instructs the processor to apply the proper templates to them.",
"attributes":
[
{
"type":"optional",
"name":"mode",
"description":"Specifies a particular mode for this template, which can be matched by an attribute of the <xsl:apply-templates> element"
},
{
"type":"optional",
"name":"select",
"description":"XPath expression that specifies the nodes to be processed. If this attribute is not set, all child nodes of the current node are selected."
}
],
"examples": [],
"documentationReferenceURL": "https://developer.mozilla.org/en-US/docs/Web/XSLT/Element/apply-templates",
"output": "XML Nodes"
},{
"name": "<xsl:apply-imports/>",
"description": "Import precedence requires that template rules in main stylesheets have higher precedence than template rules in imported stylesheets",
"attributes":
[
],
"examples": [],
"documentationReferenceURL": "https://developer.mozilla.org/en-US/docs/Web/XSLT/Element/apply-imports",
"output": "Imported output from another XSLT"
},{
"name": "<xsl:call-template>",
"description": "Invokes a named template",
"attributes":
[
{
"type":"required",
"name":"name",
"description":"Specifies the name of the template you wish to invoke."
}
],
"examples": [],
"documentationReferenceURL": "https://developer.mozilla.org/en-US/docs/Web/XSLT/Element/call-template",
"output": "Called template XML"
}
]
},
{
"name":"Loops and conditional processing",
"entries":
[
{
"name": "<xsl:for-each>",
"description": "Selects a set of nodes and processes each of them in the same way",
"attributes":
[
{
"type":"required",
"name":"select",
"description":"XPath expression that specifies the nodes to be processed."
}
],
"examples": [],
"documentationReferenceURL": "https://developer.mozilla.org/en-US/docs/Web/XSLT/Element/for-each",
"output": "Processed set of nodes"
},
{
"name": "<xsl:if>",
"description": "Element contains a test attribute and a template. If the test evaluates to true, the template is processed.",
"attributes":
[
{
"type":"required",
"name":"test",
"description":"Contains an XPath expression that can be evaluated to a Boolean value."
}
],
"examples": [],
"documentationReferenceURL": "https://developer.mozilla.org/en-US/docs/Web/XSLT/Element/if",
"output": "Depending on test processed template or not."
},
{
"name": "<xsl:choose>",
"description": "Element defines a choice among a number of alternatives. It behaves like a switch statement in procedural languages.",
"attributes":
[
],
"examples": [],
"documentationReferenceURL": "https://developer.mozilla.org/en-US/docs/Web/XSLT/Element/choose",
"output": "Choosed XML template"
},
{
"name": "<xsl:when>",
"description": "Element always appears within an <xsl:choose> element, acting like a case statement.",
"attributes":
[
{
"type":"required",
"name":"test",
"description":"Boolean expression to be evaluated. If true, the contents of the element are processed; if false, they are ignored."
}
],
"examples": [],
"documentationReferenceURL": "https://developer.mozilla.org/en-US/docs/Web/XSLT/Element/when",
"output": "Processed or not XML Template"
},
{
"name": "<xsl:otherwise>",
"description": "Element is used to define the action that should be taken when none of the <xsl:when> conditions apply.",
"attributes":
[
],
"examples": [],
"documentationReferenceURL": "https://developer.mozilla.org/en-US/docs/Web/XSLT/Element/otherwise",
"output": "processed XML Template"
}
]
},
{
"name":"Creating Result Tree",
"entries":
[
{
"name": "<xsl:attribute>",
"description": "Creates an attribute in the output document, using any values that can be accessed from the stylesheet. The element must be defined before any other output document element inside the output document element for which it establishes attribute values",
"attributes":
[
{
"type":"required",
"name":"name",
"description":"Specifies the name of the attribute to be created in the output document."
} ,
{
"type":"optional",
"name":"namespace",
"description":"Defines the namespace URI for this attribute in the output document."
}
],
"examples": [],
"documentationReferenceURL": "https://developer.mozilla.org/en-US/docs/Web/XSLT/Element/attribute",
"output": "XML Element with provided attribute"
},{
"name": "<xsl:attribute-set>",
"description": "Creates a named set of attributes, which can then be applied as whole to the output document, in a manner similar to named styles in CSS",
"attributes":
[
{
"type":"required",
"name":"name",
"description":"Specifies the name of the attribute set."
} ,
{
"type":"optional",
"name":"use-attribute-sets",
"description":"Builds an attribute set from other attribute sets. The names of the contributing sets must be separated with whitespace characters"
}
],
"examples": [],
"documentationReferenceURL": "https://developer.mozilla.org/en-US/docs/Web/XSLT/Element/attribute-set",
"output": "Named set of attributes"
},{
"name": "<xsl:copy>",
"description": "Transfers a shallow copy (the node and any associated namespace node) of the current node to the output document.",
"attributes":
[
{
"type":"optional",
"name":"use-attribute-sets",
"description":"Lists attribute sets that should be applied to the output node, if it is an element"
}
],
"examples": [],
"documentationReferenceURL": "https://developer.mozilla.org/en-US/docs/Web/XSLT/Element/copy",
"output": "Copy of XML node"
},{
"name": "<xsl:number>",
"description": "Counts things sequentially. It can also be used to quickly format a number.",
"attributes":
[
{
"type":"optional",
"name":"count",
"description":"Specifies what in the source tree should be numbered sequentially. It uses an XPath expression."
},
{
"type":"optional",
"name":"level",
"description":"Defines how levels of the source tree should be considered in generating sequential numbers. It has three valid values: single, multiple, and any."
},
{
"type":"optional",
"name":"from",
"description":"Specifies where the numbering should start or start over."
},
{
"type":"optional",
"name":"value",
"description":"Applies a given format to a number."
},
{
"type":"optional",
"name":"format",
"description":"Defines the format of the generated number."
},
{
"type":"optional",
"name":"lang",
"description":"Specifies which language's alphabet should be used in letter-based numbering formats."
},
{
"type":"optional",
"name":"letter-value",
"description":"Disambiguates between numbering sequences that use letters. Some languages have more than one numbering system that use letters."
},
{
"type":"optional",
"name":"grouping-separator",
"description":"Specifies what character should be used as the group (e.g. thousands) separator."
},
{
"type":"optional",
"name":"grouping-size",
"description":"Indicates the number of digits that make up a numeric group."
}
],
"examples": [],
"documentationReferenceURL": "https://developer.mozilla.org/en-US/docs/Web/XSLT/Element/number",
"output": "Formatted number"
},{
"name": "<xsl:value-of>",
"description": "Evaluates an XPath expression, converts it to a string, and writes that string to the result tree.",
"attributes":
[
{
"type":"required",
"name":"select",
"description":"Specifies the XPath expression to be evaluated and written to the output tree."
},
{
"type":"optional",
"name":"disable-output-escaping",
"description":"Specifies whether special characters are escaped when written to the output."
}
],
"examples": [],
"documentationReferenceURL": "https://developer.mozilla.org/en-US/docs/Web/XSLT/Element/value-of",
"output": "Value from XML nodes"
},{
"name": "<xsl:text>",
"description": "Writes literal text to the output tree.",
"attributes":
[
{
"type":"optional",
"name":"disable-output-escaping",
"description":"Specifies whether special characters are escaped when written to the output."
}
],
"examples": [],
"documentationReferenceURL": "https://developer.mozilla.org/en-US/docs/Web/XSLT/Element/text",
"output": "XML Node with writed text"
},{
"name": "<xsl:comment>",
"description": "Writes a comment to the output document. It must include only text.",
"attributes":
[
],
"examples": [],
"documentationReferenceURL": "https://developer.mozilla.org/en-US/docs/Web/XSLT/Element/comment",
"output": "XML Node with writed comment"
},
{
"name": "<xsl:processing-instruction>",
"description": "Writes a processing instruction to the output document.",
"attributes":
[
{
"type":"required",
"name":"name",
"description":"Specifies the name of this processing instruction."
}
],
"examples": [],
"documentationReferenceURL": "https://developer.mozilla.org/en-US/docs/Web/XSLT/Element/processing-instruction",
"output": "XML Node with output of processed instruction"
},
{
"name": "<xsl:key>",
"description": "Declares a named key which can be used elsewhere in the stylesheet with the key( ) function.",
"attributes":
[
{
"type":"required",
"name":"name",
"description":"Specifies a name for this key. Must be a QName."
},
{
"type":"required",
"name":"match",
"description":"Defines the nodes for which this key is applicable."
},
{
"type":"required",
"name":"use",
"description":"Specifies an XPath expression that will be used to determine the value of the key for each of the applicable nodes."
}
],
"examples": [],
"documentationReferenceURL": "https://developer.mozilla.org/en-US/docs/Web/XSLT/Element/key",
"output": "key to use in stylesheet"
},
{
"name": "<xsl:decimal-format>",
"description": "Declares a named key which can be used elsewhere in the stylesheet with the key( ) function.",
"attributes":
[
{
"type":"optional",
"name":"name",
"description":"Specifies a name for this format."
},
{
"type":"optional",
"name":"decimal-separator",
"description":"Specifies the decimal point character."
},
{
"type":"optional",
"name":"grouping-separator",
"description":"Specifies the thousands separator character."
},
{
"type":"optional",
"name":"infinity",
"description":"Specifies the string used to represent infinity."
},
{
"type":"optional",
"name":"minus-sign",
"description":"Specifies the minus sign character."
},
{
"type":"optional",
"name":"NaN",
"description":"Specifies the string used when the value is not a number."
},
{
"type":"optional",
"name":"percent",
"description":"Specifies the percentage sign character."
},
{
"type":"optional",
"name":"per-mille",
"description":"Specifies the per thousand character."
},
{
"type":"optional",
"name":"zero-digit",
"description":"Specifies the digit zero character."
},
{
"type":"optional",
"name":"digit",
"description":"Specifies the character used in the format pattern to stand for a digit."
},
{
"type":"optional",
"name":"pattern-separator",
"description":"Specifies the character separating positive and negative subpatterns in a format pattern."
}
],
"examples": [],
"documentationReferenceURL": "https://developer.mozilla.org/en-US/docs/Web/XSLT/Element/decimal-format",
"output": "decimal format"
},
{
"name": "<xsl:preserve-space>",
"description": "Defines the elements in the source document for which whitespace should be preserved.",
"attributes":
[
{
"type":"required",
"name":"elements",
"description":"Specifies the elements for which whitespace should be preserved."
}
],
"examples": [],
"documentationReferenceURL": "https://developer.mozilla.org/en-US/docs/Web/XSLT/Element/preserve-space",
"output": "preserved space"
},
{
"name": "<xsl:strip-space>",
"description": "Defines the elements in the source document for which whitespace should be removed.",
"attributes":
[
{
"type":"required",
"name":"elements",
"description":"Specifies the elements for which whitespace should be preserved."
}
],
"examples": [],
"documentationReferenceURL": "https://developer.mozilla.org/en-US/docs/Web/XSLT/Element/strip-space",
"output": "elements with removed whitespace"
},
{
"name": "<xsl:sort>",
"description": "Defines a sort key for nodes selected by <xsl:apply-templates> or <xsl:for-each> and determines the order in which they are processed.",
"attributes":
[
{
"type":"optional",
"name":"select",
"description":"Uses an XPath expression to specify the nodes to be sorted."
},
{
"type":"optional",
"name":"order",
"description":"Specifies whether the nodes should be processed in \"ascending\" or \"descending\" order."
},
{
"type":"optional",
"name":"case-order",
"description":"Indicates whether upper- or lowercase letters are to be ordered first."
},
{
"type":"optional",
"name":"lang",
"description":"Specifies which language is to be used by the sort."
},
{
"type":"optional",
"name":"data-type",
"description":"Defines whether items are to be ordered alphabetically or numerically."
}
],
"examples": [],
"documentationReferenceURL": "https://developer.mozilla.org/en-US/docs/Web/XSLT/Element/sort",
"output": "sorted elements"
},
{
"name": "<xsl:output>",
"description": "Controls the characteristics of the output document.",
"attributes":
[
{
"type":"optional",
"name":"method",
"description":"Specifies output format."
},
{
"type":"optional",
"name":"version",
"description":"Specifies the value of the version attribute of the XML or HTML declaration in the output document."
},
{
"type":"optional",
"name":"encoding",
"description":"Specifies the value of the encoding attribute in the output document."
},
{
"type":"optional",
"name":"omit-xml-declaration",
"description":"Indicates whether or not to include an XML declaration in the output."
},
{
"type":"optional",
"name":"doctype-public",
"description":"Specifies the value of the PUBLIC attribute of the DOCTYPE declaration in the output document."
},
{
"type":"optional",
"name":"doctype-system",
"description":"Specifies the value of the SYSTEM attribute of the DOCTYPE declaration in the output document."
},
{
"type":"optional",
"name":"cdata-section-elements",
"description":"Lists elements whose text contents should be written as CDATA sections."
}
],
"examples": [],
"documentationReferenceURL": "https://developer.mozilla.org/en-US/docs/Web/XSLT/Element/output",
"output": "changed document prefix"
}
]
},
{
"name":"Stylesheet structure",
"entries":
[
{
"name": "<xsl:stylesheet>",
"description": "Is the outermost element of a stylesheet.",
"attributes":
[
{
"type":"required",
"name":"version",
"description":"Specifies the version of XSLT required by this stylesheet."
},
{
"type":"optional",
"name":"exclude-result-prefixes",
"description":"Specifies any namespace used in this document that should not be sent to the output document."
},
{
"type":"optional",
"name":"extension-element-prefixes",
"description":"Specifies a space-separated list of any namespace prefixes for extension elements in this document."
},
{
"type":"optional",
"name":"default-collation",
"description":"Specifies the default collation used by all XPath expressions appearing in attributes or text value templates that have the element as an ancestor"
},
{
"type":"optional",
"name":"default-mode",
"description":"Defines the default value for the mode attribute of all <xsl:template> and <xsl:apply-templates> elements within its scope."
},
{
"type":"optional",
"name":"default-validation",
"description":"Defines the default value of the validation attribute of all relevant instructions appearing within its scope."
},
{
"type":"optional",
"name":"expand-text",
"description":"Determines whether descendant text nodes of the element are treated as text value templates."
},
{
"type":"optional",
"name":"id",
"description":"Specifies an id for this stylesheet. This is most often used when the stylesheet is embedded in another XML document."
},
{
"type":"optional",
"name":"input-type-annotations",
"description":"Specifies whether type annotations are stripped from the element so the same results are produced whether the source documents have been validated against a schema or not."
},
{
"type":"optional",
"name":"use-when",
"description":"Determines whether the element and all the nodes that have it as ancestor are excluded from the stylesheet."
},
{
"type":"optional",
"name":"xpath-default-namespace",
"description":"Specifies the namespace that will be used if the element name is unprefixed or an unprefixed type name within an XPath expression."
}
],
"examples": [],
"documentationReferenceURL": "https://developer.mozilla.org/en-US/docs/Web/XSLT/Element/stylesheet",
"output": "XSLT Stylesheet"
},
{
"name": "<xsl:tranform>",
"description": "Exactly equivalent to the <xsl:stylesheet> element.",
"attributes":
[
{
"type":"required",
"name":"version",
"description":"Specifies the version of XSLT required by this stylesheet."
},
{
"type":"optional",
"name":"exclude-result-prefixes",
"description":"Specifies any namespace used in this document that should not be sent to the output document."
},
{
"type":"optional",
"name":"extension-element-prefixes",
"description":"Specifies a space-separated list of any namespace prefixes for extension elements in this document."
},
{
"type":"optional",
"name":"default-collation",
"description":"Specifies the default collation used by all XPath expressions appearing in attributes or text value templates that have the element as an ancestor"
},
{
"type":"optional",
"name":"default-mode",
"description":"Defines the default value for the mode attribute of all <xsl:template> and <xsl:apply-templates> elements within its scope."
},
{
"type":"optional",
"name":"default-validation",
"description":"Defines the default value of the validation attribute of all relevant instructions appearing within its scope."
},
{
"type":"optional",
"name":"expand-text",
"description":"Determines whether descendant text nodes of the element are treated as text value templates."
},
{
"type":"optional",
"name":"id",
"description":"Specifies an id for this stylesheet. This is most often used when the stylesheet is embedded in another XML document."
},
{
"type":"optional",
"name":"input-type-annotations",
"description":"Specifies whether type annotations are stripped from the element so the same results are produced whether the source documents have been validated against a schema or not."
},
{
"type":"optional",
"name":"use-when",
"description":"Determines whether the element and all the nodes that have it as ancestor are excluded from the stylesheet."
},
{
"type":"optional",
"name":"xpath-default-namespace",
"description":"Specifies the namespace that will be used if the element name is unprefixed or an unprefixed type name within an XPath expression."
}
],
"examples": [],
"documentationReferenceURL": "https://developer.mozilla.org/en-US/docs/Web/XSLT/Element/transform",
"output": "XSLT Stylesheet"
},
{
"name": "<xsl:import>",
"description": "Top-level element that serves to import the contents of one stylesheet into another stylesheet.",
"attributes":
[
{
"type":"required",
"name":"href",
"description":"Specifies the URI of the stylesheet to import."
}
],
"examples": [],
"documentationReferenceURL": "https://developer.mozilla.org/en-US/docs/Web/XSLT/Element/import",
"output": "XSLT Stylesheet from another file"
},
{
"name": "<xsl:include>",
"description": "Merges the contents of one stylesheet with another. Unlike the case of <xsl:import>, the contents of an included stylesheet have exactly the same precedence as the contents of the including stylesheet.",
"attributes":
[
{
"type":"required",
"name":"href",
"description":"Specifies the URI of the stylesheet to import."
}
],
"examples": [],
"documentationReferenceURL": "https://developer.mozilla.org/en-US/docs/Web/XSLT/Element/include",
"output": "XSLT Stylesheet with XSLT from another file."
},
{
"name": "<xsl:namespace-alias>",
"description": "Maps a namespace in the stylesheet to a different namespace in the output tree. The most common use for this element is in generating a stylesheet from another stylesheet.",
"attributes":
[
{
"type":"required",
"name":"stylesheet-prefix",
"description":"Specifies the temporary namespace."
},
{
"type":"required",
"name":"result-prefix",
"description":"Specifies the desired namespace for the output tree."
}
],
"examples": [],
"documentationReferenceURL": "https://developer.mozilla.org/en-US/docs/Web/XSLT/Element/namespace-alias",
"output": "XML Tree with changed namespaces"
},
{
"name": "<xsl:element>",
"description": "Creates an element in the output document.",
"attributes":
[
{
"type":"required",
"name":"name",
"description":"Specifies the desired name of the output element. The name must be a valid QName."
},
{
"type":"optional",
"name":"namespace",
"description":"Specifies the namespace of the output element."
},
{
"type":"optional",
"name":"use-attribute-sets",
"description":"A whitespace-separated list of attribute-set element names to be applied to the element element's output element."
}
],
"examples": [],
"documentationReferenceURL": "https://developer.mozilla.org/en-US/docs/Web/XSLT/Element/namespace-alias",
"output": "XML with provided element"
}
]
},
{
"name":"Variables and parameters",
"entries":
[
{
"name": "<xsl:param>",
"description": "Establishes a parameter by name and, optionally, a default value for that parameter. When used as a top-level element, the parameter is global. When used inside an <xsl:template> element, the parameter is local to that template.",
"attributes":
[
{
"type":"required",
"name":"name",
"description":"Names the parameter. This must be a QName."
},
{
"type":"optional",
"name":"select",
"description":"Uses an XPath expression to provide a default value if none is specified."
}
],
"examples": [],
"documentationReferenceURL": "https://developer.mozilla.org/en-US/docs/Web/XSLT/Element/param",
"output": "XML parameter"
},
{
"name": "<xsl:variable>",
"description": "Declares a global or local variable in a stylesheet and gives it a value.",
"attributes":
[
{
"type":"required",
"name":"name",
"description":"Gives the variable a name."
},
{
"type":"optional",
"name":"select",
"description":"Defines the value of the variable through an XPath expression. If the element contains a template, this attribute is ignored."
}
],
"examples": [],
"documentationReferenceURL": "https://developer.mozilla.org/en-US/docs/Web/XSLT/Element/variable",
"output": "XML Variable"
},
{
"name": "<xsl:with-param>",
"description": "Sets the value of a parameter to be passed into a template.",
"attributes":
[
{
"type":"required",
"name":"name",
"description":"Gives this parameter a name."
},
{
"type":"optional",
"name":"select",
"description":"Defines the value of the parameter through an XPath expression. If the element contains a template, this attribute is ignored."
}
],
"examples": [],
"documentationReferenceURL": "https://developer.mozilla.org/en-US/docs/Web/XSLT/Element/with-param",
"output": "XML Parameter"
},
{
"name": "<xsl:copy-of>",
"description": "Makes a deep copy (including descendant nodes) of whatever the select attribute specifies to the output document.",
"attributes":
[
{
"type":"required",
"name":"select",
"description":"Uses an XPath expression that specifies what is to be copied."
}
],
"examples": [],
"documentationReferenceURL": "https://developer.mozilla.org/en-US/docs/Web/XSLT/Element/copy-of",
"output": "Copy of Selected node"
}
]
},
{
"name":"Misc",
"entries":
[
{
"name": "<xsl:message>",
"description": "Outputs a message (to the JavaScript Console in NS) and optionally terminates execution of the stylesheet.",
"attributes":
[
{
"type":"optional",
"name":"terminate",
"description":"Set to \"yes\", indicates that execution should be terminated. The default value is \"no\", in which case the message is output and execution continues."
}
],
"examples": [],
"documentationReferenceURL": "https://developer.mozilla.org/en-US/docs/Web/XSLT/Element/message",
"output": "Message in console"
},
{
"name": "<xsl:fallback>",
"description": "specifies what template to use if a given extension (or, eventually, newer version) element is not supported.",
"attributes":
[
],
"examples": [],
"documentationReferenceURL": "https://developer.mozilla.org/en-US/docs/Web/XSLT/Element/fallback",
"output": "Fallbacks"
}
]
}
]

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,52 @@
{
"universalInfo":
[
{
"category":"What is XSLT",
"description":"XSLT (Extensible Stylesheet Language Transformations) is a language for converting and manipulating XML data into various formats. It uses rules defined in stylesheets to transform XML documents into HTML, XML, or other text-based outputs."
},
{
"category":"What's differences between XSLT versions"
}
],
"VersionDiffs":
[
{
"version":"2.0",
"diffs":
[
"Introduced a richer data model with support for various data types and sequences, allowing more flexible handling of data.",
"Added native support for regular expressions, making text processing and pattern matching more powerful.",
"Introduced the concept of higher-order functions, enabling functions to be used as arguments and returned as results, enhancing the language's functional capabilities.",
"Expanded the set of built-in string functions, making string manipulation and formatting more versatile.",
"Introduced the concept of sequences, where nodes could be processed without relying solely on their order in the source document.",
"Provided improved error handling and reporting mechanisms, making it easier to diagnose and fix issues in transformations.",
"Allowed variable and function parameters to have type annotations, enhancing clarity and enabling better optimization.",
"Refined the handling of namespaces and introduced features for dealing with namespaces more effectively.",
"Introduced more advanced grouping capabilities, allowing grouping based on multiple criteria.",
"Expanded sorting options, making it possible to sort data based on multiple keys and in different directions."
]
},
{
"version":"3.0",
"diffs":
[
"Extended the support for higher-order functions by introducing new functions like map and filter, enabling more functional programming patterns.",
"Introduced streaming capabilities, allowing processing of large documents without loading the entire document into memory, which improves performance and memory usage.",
"Introduced functions to parse and serialize JSON data, enabling transformations between XML and JSON formats.",
"Enhanced type annotations, allowing for more precise typing of variables and parameters, aiding both readability and optimization.",
"Introduced new standard functions, expanding the range of operations and calculations that can be performed within transformations.",
"Introduced a new data structure called maps, allowing for efficient key-value pair storage and manipulation.",
"Introduced tunnel parameters, which can pass data through templates without explicitly listing them in the template's parameter list",
"Introduced a try-catch construct for better error handling, allowing you to catch and handle errors more gracefully.",
"Introduced the ability to execute multiple templates concurrently, improving performance in multi-core environments.",
"Integrated new features from XPath 3.1, including support for higher-order functions and enhanced string manipulation functions.",
"Enhanced grouping capabilities, making it more powerful and flexible for complex grouping scenarios.",
"Allowed dynamic function calls using the xsl:evaluate element, enabling more dynamic transformations."
]
}
]
}

View File

@@ -7,6 +7,8 @@ import xpath1 from '@/assets/tooltips/xpath/xpath1.json';
import xpath2 from '@/assets/tooltips/xpath/xpath2.json';
import xpath3 from '@/assets/tooltips/xpath/xpath3.json';
import xpath31 from '@/assets/tooltips/xpath/xpath31.json';
import xslt1 from '@/assets/tooltips/xslt/xslt1.json';
import xslt3 from '@/assets/tooltips/xslt/xslt3.json'
import TooltipDiffsComponent from './TooltipDiffsComponent.vue';
@@ -14,13 +16,18 @@ const props = defineProps({
version: {
type: String,
required: true
},
toolType: {
type: String,
required: true
}
})
const areTooltipsHidden = ref(true)
function selectXPathVersion() {
switch(props.version) {
function selectTooltip() {
if(props.toolType == "xpath"){
switch(props.version) {
case "1.0":
return xpath1;
case "2.0":
@@ -31,6 +38,17 @@ function selectXPathVersion() {
default:
return xpath31;
}
} else {
switch(props.version){
case "1.0":{
return xslt1;
}
case "3.0":{
return xslt3;
}
}
}
}
function toggleTooltips() {
@@ -45,10 +63,10 @@ function toggleTooltips() {
T<br/>o<br/>o<br/>l<br/>t<br/>i<br/>p<br/>s
</button>
<div id="content" :class="{'hidden' : areTooltipsHidden}" class="w-full flex flex-col gap-4 p-2 overflow-scroll rounded-xl dark:text-white bg-indigo-50 dark:bg-slate-800" >
<TooltipDiffsComponent tool-name="XPath" :tool-version="props.version"></TooltipDiffsComponent>
<TooltipDiffsComponent :tool-name="toolType" :tool-version="props.version"></TooltipDiffsComponent>
<div class="w-full h-2"> </div>
<tooltipCategoryComponent v-for="category in selectXPathVersion()" :name="category.name">
<tooltipEntryComponent v-for="entry in category.entries" :entry-data="entry"></tooltipEntryComponent>
<tooltipCategoryComponent v-for="category in selectTooltip()" :key="category.name" :name="category.name">
<tooltipEntryComponent :tool="toolType" v-for="entry in category.entries" :key="entry.name" :entry-data="entry"></tooltipEntryComponent>
</tooltipCategoryComponent>
</div>
</div>

View File

@@ -1,12 +1,17 @@
<script setup lang="ts">
import xpathDiffs from '@/assets/tooltips/xpath/xpathdiffs.json';
import { ref } from 'vue';
import xsltDiffs from '@/assets/tooltips/xslt/xsltdiffs.json';
import TooltipCategoryComponent from './TooltipCategoryComponent.vue';
const isEntryHidden = ref(true)
const props = defineProps({
toolName: {type: String, required: true},
toolVersion: {type: String, required: true}
})
function getDiffEntry(toolVersion : String) : string[] {
switch(toolVersion){
if ( props.toolName == "xpath" ){
switch(toolVersion){
case "2.0" : {
return xpathDiffs.VersionDiffs[0].diffs
}
@@ -17,32 +22,49 @@ function getDiffEntry(toolVersion : String) : string[] {
return xpathDiffs.VersionDiffs[2].diffs
}
default: {
return xpathDiffs.VersionDiffs[0].diffs
return xpathDiffs.VersionDiffs[2].diffs
}
}
} else if (props.toolName == "xslt") {
return ["XSLT 2.0"].concat(xsltDiffs.VersionDiffs[0].diffs).concat(["XSLT 3.0"]).concat(xsltDiffs.VersionDiffs[1].diffs) ;
} else{
return ["foo"]
}
}
function getInfo(num : number ){
if(props.toolName == "xslt"){
return xsltDiffs.universalInfo[num]
} else{
return xpathDiffs.universalInfo[num]
}
}
const props = defineProps({
toolName: {type: String, required: true},
toolVersion: {type: String, required: true}
})
</script>
<template>
<TooltipCategoryComponent :name="xpathDiffs.universalInfo[0].category">
<TooltipCategoryComponent :name="getInfo(0).category">
<span class="text-center">
{{ xpathDiffs.universalInfo[0].description }}
{{ getInfo(0).description }}
</span>
</TooltipCategoryComponent>
<TooltipCategoryComponent v-if="toolVersion !== '1.0'" :name="'What\'s new in ' + toolName + ' ' + toolVersion ">
<TooltipCategoryComponent v-if="toolVersion !== '1.0'" :name="getInfo(1).category">
<span v-for=" diff in getDiffEntry(toolVersion)" v-bind:key="diff" class=" text-justify" >
* {{ diff }}
<div class="w-full h-4 text-center" v-if="diff.includes('XSLT')">
------------ {{ diff }} ------------
</div>
<span v-else>
* {{ diff }}
</span>
</span>
</TooltipCategoryComponent>

View File

@@ -3,7 +3,8 @@ import { ref } from 'vue';
const isEntryHidden = ref(true)
const props = defineProps({
entryData: {type: Object, required: true}
entryData: {type: Object, required: true},
tool:{type: String, required:true}
})
function toggleTooltips() {
@@ -11,7 +12,11 @@ function toggleTooltips() {
}
function entryHasArguments() {
return props.entryData.arguments.length > 0;
if("attributes" in props.entryData){
return props.entryData.attributes.length > 0;
} else if("arguments" in props.entryData){
return props.entryData.arguments.length > 0;
}
}
function entryHasExamples() {
@@ -50,18 +55,36 @@ function interpretXPathIndicators( elementType:string ):string {
{{ props.entryData.description }}
</p>
</span>
<h4 class="text-xl mt-4 mb-2 font-bold">Args and Output</h4>
<div id="xpathArgTooltip" v-if="tool == 'xpath'">
<h4 class="text-xl mt-4 mb-2 font-bold">Args and Output</h4>
<table v-if="entryHasArguments()" class="w-full">
<tr>
<th>Type</th>
<th>Description</th>
</tr>
<tr v-for="arg in props.entryData.arguments">
<tr v-for="arg in props.entryData.arguments" :key="arg">
<td class="text-center">{{ interpretXPathIndicators( arg.type ) }}</td>
<td class="text-center">{{ arg.description }}</td>
</tr>
</table>
</div>
<div id="xsltAttrTooltip" v-if="tool == 'xslt'">
<h4 class="text-xl mt-4 mb-2 font-bold"> Attributes</h4>
<table v-if="entryHasArguments()" class="w-full">
<tr>
<th>Name</th>
<th>Type</th>
<th>Description</th>
</tr>
<tr v-for="attr in props.entryData.attributes" :key="attr">
<td class="text-center p-2">{{ attr.name }}</td>
<td class="text-center p-2">{{ interpretXPathIndicators( attr.type ) }}</td>
<td class="text-center p-2">{{ attr.description }}</td>
</tr>
</table>
</div>
<div class="mt-2">
<strong>Output: </strong>{{ interpretXPathIndicators(props.entryData.output) }}
</div>
@@ -73,13 +96,13 @@ function interpretXPathIndicators( elementType:string ):string {
<th>Command</th>
<th>Output</th>
</tr>
<tr v-for="ex in props.entryData.examples">
<tr v-for="ex in props.entryData.examples" :key="ex">
<td class="text-center"><code>{{ ex.command }}</code></td>
<td class="text-center">{{ ex.output }}</td>
</tr>
</table>
<div class="mt-2">
<a :href="props.entryData.documentationReferenceURL" class="underline" target="_blank" rel="noreferrer noopener">W3C Documentation Reference</a>
<a :href="props.entryData.documentationReferenceURL" class="underline" target="_blank" rel="noreferrer noopener">Documentation Reference</a>
</div>
</div>

View File

@@ -24,6 +24,6 @@ function updateVersion(newVersion: string) {
</div>
<xmlOutputFieldComponent tool="xpath" :xml="xml" :query="query" @update="(version) => updateVersion(version)"></xmlOutputFieldComponent>
</div>
<tooltipComponent :version="version"></tooltipComponent>
<tooltipComponent tool-type="xpath" :version="version"></tooltipComponent>
</div>
</template>

View File

@@ -1,20 +1,28 @@
<script setup lang="ts">
import xmlInputFieldComponent from '@/components/xml/XmlInputFieldComponent.vue';
import xmlOutputFieldComponent from '@/components/xml/XmlOutputFieldComponent.vue';
import TooltipComponent from '@/components/xml/tooltips/TooltipComponent.vue';
import { ref } from 'vue';
const xml = ref('');
const query = ref('');
const version = ref('');
function updateVersion(newVersion: string) {
version.value = newVersion;
}
</script>
<template>
<div id="layout" class="flex flex-col lg:flex-row w-full h-full">
<div class="flex flex-col w-full lg:w-1/2 h-2/3 lg:h-full flex-none items-center">
<div class="flex flex-col lg:flex-row w-full lg:w-7/12 grow overflow-hide px-2">
<div class="flex flex-col w-full lg:w-1/2 h-2/3 lg:h-full flex-none items-center">
<xmlInputFieldComponent stylized-name="XML" @update="(data) => {xml = data}"></xmlInputFieldComponent>
<xmlInputFieldComponent stylized-name="XSLT" @update="(data) => {query = data}"></xmlInputFieldComponent>
</div>
<xmlOutputFieldComponent tool="xslt" :xml="xml" :query="query"></xmlOutputFieldComponent>
<xmlOutputFieldComponent tool="xslt" :xml="xml" :query="query" @update="(version) => updateVersion(version)"></xmlOutputFieldComponent>
</div>
<TooltipComponent tool-type="xslt" :version="version"></TooltipComponent>
</div>
</template>