### XPath Expression Example Source: https://github.com/ballsteve/xrust/blob/main/README.md Demonstrates an XPath expression that evaluates a boolean condition. This expression will be compiled into the same internal format as an equivalent XSLT if statement. ```xpath if $a then "a is true" else "" ``` -------------------------------- ### XSLT If Statement Example Source: https://github.com/ballsteve/xrust/blob/main/README.md An XSLT if statement that achieves the same result as the XPath expression. Both syntaxes are mapped to a common internal χrust transformation representation. ```xml a is true ``` -------------------------------- ### Identity XSLT Stylesheet Source: https://github.com/ballsteve/xrust/wiki/IdentityXSLT This stylesheet copies all elements and attributes from the source XML document to the result document, creating an exact replica. ```XSLT ``` -------------------------------- ### XSLT Stylesheet for Pretty Printing XML Source: https://github.com/ballsteve/xrust/wiki/Pretty-Print This XSLT stylesheet indents XML output and strips insignificant whitespace. Use it when you need to format XML for human readability. ```XSLT ``` -------------------------------- ### Second XML Canonical Form Grammar Source: https://github.com/ballsteve/xrust/blob/main/tests/conformance/xml/xmlconf/sun/cxml.html Extends the Canonical XML grammar to include DTDs with notation declarations. Literals are required to be surrounded by single quotes. ```xml CanonXML2 ::= DTD2? CanonXML DTD2 ::= '' #xA )* ``` -------------------------------- ### Empty XSLT Stylesheet for Stripping Markup Source: https://github.com/ballsteve/xrust/wiki/Strip-Markup This is the most basic XSLT 3.0 stylesheet. When applied, it effectively removes all markup, preserving only the character data from the input document. No specific imports are needed as it utilizes built-in XSLT templates. ```XSLT ``` -------------------------------- ### Third XML Canonical Form Grammar Source: https://github.com/ballsteve/xrust/blob/main/tests/conformance/xml/xmlconf/sun/cxml.html Extends the Second XML Canonical Form grammar to include DTDs with unparsed entity declarations for attribute values. This form accounts for whitespace in element content and external identifiers for unparsed entities. ```xml CanonXML3 ::= DTD3? CanonXML DTD3 ::= '' #xA )* ``` -------------------------------- ### Canonical XML Grammar Source: https://github.com/ballsteve/xrust/blob/main/tests/conformance/xml/xmlconf/sun/cxml.html Defines the grammar for the First XML Canonical Form, also known as Canonical XML. It specifies the structure of elements, attributes, processing instructions, and data characters, encoded in UTF-8. ```xml CanonXML ::= Pi* element Pi* element ::= Stag (Datachar | Pi | element)* Etag Stag ::= '<' Name Atts '>' Etag ::= '' Pi ::= '' Char*)) '?>' Atts ::= (' ' Name '=' '"' Datachar* '"')* Datachar ::= '&' | '<' | '>' | '"' | ' '| ' '| ' ' | (Char - ('&' | '<' | '>' | '"' | #x9 | #xA | #xD)) Name ::= (see XML spec) Char ::= (see XML spec) S ::= (see XML spec) ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.