Skip to content

Commit

Permalink
Started XML/XSLT cheatsheet
Browse files Browse the repository at this point in the history
  • Loading branch information
simshadows committed Jul 8, 2024
1 parent 752c378 commit 78f49c8
Show file tree
Hide file tree
Showing 2 changed files with 51 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/pages/_index-links.astro
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ const {
<li><a href="/c/cheatsheets/javascript-typescript/"><b>Javascript/Typescript</b></a></li>
<li><a href="/c/cheatsheets/python/"><b>Python</b></a></li>
{showWIP && <li><a href="/c/cheatsheets/sql/"><b>SQL and Common Relational DBMS Features</b></a> <Wip /></li>}
{showWIP && <li><a href="/c/cheatsheets/xml-xslt/"><b>XML and XSLT</b></a> <Wip /></li>}
</ul>
</li>
<li><b>Notes</b>
Expand Down
50 changes: 50 additions & 0 deletions src/pages/c/cheatsheets/xml-xslt.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
---
layout: "@layouts/MDLayout.astro"
title: XML and XSLT Cheatsheet
description: My XML and XSLT cheatsheet because I forget names and syntax a lot.
keywords: ["programming", "xml", "xslt", "extensible stylesheet language transformations", "cheatsheet"]
---


## Resources

References:

- [**MDN Web Docs - XSLT**](https://developer.mozilla.org/en-US/docs/Web/XSLT) `(developer.mozilla.org)`
- [**w3schools - XML**](https://www.w3schools.com/xml/) `(w3schools.com)`
- [XSLT](https://www.w3schools.com/xml/xsl_intro.asp)


## XSLT: Basic Features

A possible starting template:

```xml
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:fo="http://www.w3.org/1999/XSL/Format">

<xsl:output method="xml" version="1.0" encoding="UTF-8" indent="yes" />

<xsl:template match="node()|@*">
<xsl:copy>
<xsl:apply-templates select="node()|@*" />
</xsl:copy>
</xsl:template>

<xsl:template match="FooBar">
Do things here!
</xsl:template>

</xsl:stylesheet>
```


## XSLT: XPaths

(TODO)


## XSLT: XQuerys

(TODO)

0 comments on commit 78f49c8

Please sign in to comment.