find_ressources.xsl 1.64 KB
Newer Older
1
<!--find_ressources.xsl creates a ANT file get_ressources-->
Drain's avatar
Drain committed
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
<!--the ANT copies all audio files, images and objects used in the content to convert-->
<xsl:stylesheet
	version="2.0"
	xmlns:xsl="http://www.w3.org/1999/XSL/Transform" 
	xmlns:h="http://www.utc.fr/ics/hdoc/xhtml"
	xmlns:xs="http://www.w3.org/2001/XMLSchema">
	<xsl:output method="xml" indent="yes"/>
	
    <xsl:template match="h:html">
    	<project name="hdoc_to_optim" default="main">
			<target name="main">
				<xsl:apply-templates select="h:body"/>
			</target>
		</project>	
	</xsl:template>
	
	<xsl:template match="h:body">
		<xsl:apply-templates select="h:section"/>
	</xsl:template>
	
	<xsl:template match="h:section">
		<xsl:apply-templates select="h:div"/>
		<xsl:apply-templates select="h:section"/>
	</xsl:template>
		
	<xsl:template match="h:div">
		<xsl:apply-templates select="h:section"/>
		<xsl:apply-templates select="h:img"/>
		<xsl:apply-templates select="h:object"/>
		<xsl:apply-templates select="h:audio"/>
32
		<xsl:apply-templates select="h:video"/>
Drain's avatar
Drain committed
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
	</xsl:template>
	
	<xsl:template match="h:img">	
		<xsl:variable name="src" select="@src"/>
		<copy file="hdoc/{$src}" tofile="result/{$src}"/>
	</xsl:template>
	
	<xsl:template match="h:object">	
		<xsl:variable name="data" select="@data"/>
		<copy file="hdoc/{$data}" tofile="result/{$data}"/>
	</xsl:template>
	
	<xsl:template match="h:audio">	
		<xsl:variable name="src" select="@src"/>
		<copy file="hdoc/{$src}" tofile="result/{$src}"/>
	</xsl:template>
49
50
51
52
53
	
	<xsl:template match="h:video">	
		<xsl:variable name="src" select="@src"/>
		<copy file="hdoc/{$src}" tofile="result/{$src}"/>
	</xsl:template>
Drain's avatar
Drain committed
54
55
56
57
58
59
60
61
62
63
</xsl:stylesheet>