Initial commit

This commit is contained in:
irvine 2025-01-17 12:57:28 +01:00
commit 47da46d7de
5 changed files with 52 additions and 0 deletions

8
README.txt Normal file
View File

@ -0,0 +1,8 @@
Execute XsltConsoleApplication.exe in a command prompt.
The application expects (in the current working directory):
- an XML file (data.xml) and
- an XSLT style sheet (transform.xslt)
Source code is in "src"

BIN
XsltConsoleApplication.exe Normal file

Binary file not shown.

View File

@ -0,0 +1,22 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 14
VisualStudioVersion = 14.0.24720.0
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "XsltConsoleApplication", "XsltConsoleApplication\XsltConsoleApplication.csproj", "{06029950-2B39-4045-B308-08618769CFB1}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{06029950-2B39-4045-B308-08618769CFB1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{06029950-2B39-4045-B308-08618769CFB1}.Debug|Any CPU.Build.0 = Debug|Any CPU
{06029950-2B39-4045-B308-08618769CFB1}.Release|Any CPU.ActiveCfg = Release|Any CPU
{06029950-2B39-4045-B308-08618769CFB1}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
EndGlobal

11
data.xml Normal file
View File

@ -0,0 +1,11 @@
<?xml version="1.0" ?>
<fruits>
<fruit>
<name>Lemon</name>
<description>Yellow and sour</description>
</fruit>
<fruit>
<name>Watermelon</name>
<description>Round, green outside, red inside</description>
</fruit>
</fruits>

11
transform.xslt Normal file
View File

@ -0,0 +1,11 @@
<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="/fruits">
Fruits:
<!-- Loop for each fruit -->
<xsl:for-each select="fruit">
<!-- Print name: description -->
- <xsl:value-of select="name"/>: <xsl:value-of select="description"/>
</xsl:for-each>
</xsl:template>
</xsl:stylesheet>