Initial commit
This commit is contained in:
commit
47da46d7de
8
README.txt
Normal file
8
README.txt
Normal 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
BIN
XsltConsoleApplication.exe
Normal file
Binary file not shown.
22
XsltConsoleApplication.sln
Normal file
22
XsltConsoleApplication.sln
Normal 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
11
data.xml
Normal 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
11
transform.xslt
Normal 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>
|
||||||
Loading…
Reference in New Issue
Block a user