XSLT- conversion
XSLT is a language used to convert XML documents into XHTML documents or other XML documents. XPath is a language for navigating through XML documents.
Correct stylesheet declaration
Declare the document as the root element of the XSL stylesheet is or.
Note: and are completely synonymous and can be used!
According to the W3C XSLT standard, the correct way to declare an XSL stylesheet is:
Or:
To access the elements, attributes, and features of XSLT, we must declare the XSLT namespace at the top of the document.
The "xmlns:xsl=" http://www.w3.org/1999/XSL/Transform" points to the official W3C XSLT namespace. If you use this namespace, you must include the attribute version= "1. 0".
Start with an original XML document
We will now convert the following XML document ("cdcatalog.xml") to XHTML:
Empire BurlesqueBob DylanUSAColumbia10.901985..
View the XML file in Firefox and Internet Explorer: open the XML file (usually by clicking on a link)-the XML document displays the root and child elements in colored code. Click the plus sign (+) or minus sign (-) to the left of the element to expand or shrink the structure of the element. To view the original XML source file (without plus and minus signs), choose View Page Source Code or View Source Code from the browser menu.
View the XML file in Netscape 6: open the XML file, then right-click in the XML file and select View Page Source. The XML document displays the root element and child elements in a colored code.
View the XML file in Opera 7: open the XML file, then right-click in the XML file and select "frame" / "View Source Code". The XML document is displayed as plain text.
Create an XSL style sheet
Then create an XSL stylesheet ("cdcatalog.xsl") with the transformation template:
My CD CollectionTitleArtist links XSL stylesheets to XML documents
Add an XSL stylesheet reference to the XML document ("cdcatalog.xml"):
Empire BurlesqueBob DylanUSAColumbia10.901985..
If you are using a browser that is XSLT compliant, it will smoothly convert your XML to XHTML.
The original text is from: https://www.linuxprobe.com/linux-xslt-transform.html