View | Details | Raw Unified | Return to bug 39277
Collapse All | Expand All

(-)src/modules/links/config/cocoon-xconf/resource-type-links.xconf (-1 / +2 lines)
Lines 29-35 Link Here
29
    </creator>
29
    </creator>
30
    <format name="xhtml" uri="cocoon://modules/links/xhtml.xml"/>
30
    <format name="xhtml" uri="cocoon://modules/links/xhtml.xml"/>
31
    <format name="luceneIndex" uri="cocoon://modules/xhtml/lucene-index.xml"/>
31
    <format name="luceneIndex" uri="cocoon://modules/xhtml/lucene-index.xml"/>
32
    <format name="webdavGET" uri="cocoon://modules/xhtml/davget.xml"/>
32
    <format name="webdavGEThtml" uri="cocoon://modules/xhtml/davget.html"/>
33
    <format name="webdavGETwordml" uri="cocoon://modules/xhtml/davget.wordml"/>
33
  </component-instance>
34
  </component-instance>
34
35
35
</xconf>
36
</xconf>
(-)src/modules/xhtml/config/cocoon-xconf/resource-type-xhtml.xconf (-1 / +2 lines)
Lines 30-36 Link Here
30
    </creator>
30
    </creator>
31
    <link-attribute xpath="//*[namespace-uri() = 'http://www.w3.org/1999/xhtml']/@href"/>
31
    <link-attribute xpath="//*[namespace-uri() = 'http://www.w3.org/1999/xhtml']/@href"/>
32
    <format name="xhtml" uri="cocoon://modules/xhtml/xhtml.xml"/>
32
    <format name="xhtml" uri="cocoon://modules/xhtml/xhtml.xml"/>
33
    <format name="webdavGET" uri="cocoon://modules/xhtml/davget.xml"/>
33
    <format name="webdavGEThtml" uri="cocoon://modules/xhtml/davget.html"/>
34
    <format name="webdavGETwordml" uri="cocoon://modules/xhtml/davget.wordml"/>
34
    <format name="luceneIndex" uri="cocoon://modules/xhtml/lucene-index.xml"/>
35
    <format name="luceneIndex" uri="cocoon://modules/xhtml/lucene-index.xml"/>
35
  </component-instance>
36
  </component-instance>
36
37
(-)src/modules/xhtml/sitemap.xmap (-96 / +111 lines)
Lines 1-96 Link Here
1
<?xml version="1.0" encoding="UTF-8"?>
1
<?xml version="1.0" encoding="UTF-8"?>
2
<!--
2
<!--
3
  Copyright 1999-2004 The Apache Software Foundation
3
  Copyright 1999-2004 The Apache Software Foundation
4
4
5
  Licensed under the Apache License, Version 2.0 (the "License");
5
  Licensed under the Apache License, Version 2.0 (the "License");
6
  you may not use this file except in compliance with the License.
6
  you may not use this file except in compliance with the License.
7
  You may obtain a copy of the License at
7
  You may obtain a copy of the License at
8
8
9
      http://www.apache.org/licenses/LICENSE-2.0
9
      http://www.apache.org/licenses/LICENSE-2.0
10
10
11
  Unless required by applicable law or agreed to in writing, software
11
  Unless required by applicable law or agreed to in writing, software
12
  distributed under the License is distributed on an "AS IS" BASIS,
12
  distributed under the License is distributed on an "AS IS" BASIS,
13
  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
  See the License for the specific language governing permissions and
14
  See the License for the specific language governing permissions and
15
  limitations under the License.
15
  limitations under the License.
16
-->
16
-->
17
17
18
<!-- $Id: doctypes.xmap 179488 2005-06-02 02:29:39Z gregor $ -->
18
<!-- $Id: doctypes.xmap 179488 2005-06-02 02:29:39Z gregor $ -->
19
19
20
<map:sitemap xmlns:map="http://apache.org/cocoon/sitemap/1.0">
20
<map:sitemap xmlns:map="http://apache.org/cocoon/sitemap/1.0">
21
21
22
<!-- =========================== Components ================================ -->
22
<!-- =========================== Components ================================ -->
23
23
24
  <map:components>
24
  <map:components>
25
  
25
  
26
    <map:serializers default="xhtml"> 
26
    <map:serializers default="xhtml"> 
27
      <map:serializer name="xml-get" src="org.apache.cocoon.serialization.XMLSerializer" mime-type="text/xml">
27
      <map:serializer name="html-get" src="org.apache.cocoon.serialization.XMLSerializer" mime-type="text/xml">
28
        <doctype-public>-//W3C//DTD XHTML 1.0 Strict//EN</doctype-public>
28
        <doctype-public>-//W3C//DTD XHTML 1.0 Transitional//EN</doctype-public>
29
        <doctype-system>http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd</doctype-system>
29
        <doctype-system>http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd</doctype-system>
30
        <encoding>UTF-8</encoding>
30
        <encoding>UTF-8</encoding>
31
      </map:serializer>
31
        <omit-xml-declaration>yes</omit-xml-declaration>
32
    </map:serializers>
32
      </map:serializer>
33
 
33
      
34
  </map:components>
34
      <map:serializer name="wordml-get" src="org.apache.cocoon.serialization.XMLSerializer" mime-type="text/xml">
35
35
        <encoding>UTF-8</encoding>
36
  <map:pipelines>
36
      </map:serializer>
37
37
    </map:serializers>
38
    <!-- search pipeline -->
38
 
39
    <map:pipeline>
39
  </map:components>
40
      <map:match pattern="lucene-index.xml">
40
41
        <map:aggregate element="cmsbody">
41
  <map:pipelines>
42
          <!-- TODO Use the standard pipeline for retrieving the document -->
42
43
          <!-- <map:part src="cocoon:/modules/{page-envelope:document-type}/view.xml"/> -->
43
    <!-- search pipeline -->
44
          <map:part src="fallback://content/{page-envelope:area}/{page-envelope:document-id}/index_{page-envelope:document-language}.xml.meta"/>
44
    <map:pipeline>
45
          <map:part src="fallback://content/{page-envelope:area}/{page-envelope:document-id}/index_{page-envelope:document-language}.xml"/>
45
      <map:match pattern="lucene-index.xml">
46
        </map:aggregate>
46
        <map:aggregate element="cmsbody">
47
  
47
          <!-- TODO Use the standard pipeline for retrieving the document -->
48
        <map:transform src="fallback://lenya/modules/xhtml/xslt/xhtml2index.xsl">
48
          <!-- <map:part src="cocoon:/modules/{page-envelope:document-type}/view.xml"/> -->
49
          <map:parameter name="url" value="{request:requestURI}"/>
49
          <map:part src="fallback://content/{page-envelope:area}/{page-envelope:document-id}/index_{page-envelope:document-language}.xml.meta"/>
50
        </map:transform>
50
          <map:part src="fallback://content/{page-envelope:area}/{page-envelope:document-id}/index_{page-envelope:document-language}.xml"/>
51
        
51
        </map:aggregate>
52
        <map:serialize type="xml"/>
52
  
53
      </map:match>
53
        <map:transform src="fallback://lenya/modules/xhtml/xslt/xhtml2index.xsl">
54
    </map:pipeline>
54
          <map:parameter name="url" value="{request:requestURI}"/>
55
    
55
        </map:transform>
56
    <map:pipeline>
56
        
57
      <!-- View Revision? -->
57
        <map:serialize type="xml"/>
58
      <map:match pattern="*.xml">
58
      </map:match>
59
        <map:match type="step" pattern="view-revision">
59
    </map:pipeline>
60
          <map:generate type="serverpages" src="fallback://lenya/content/rc/view.xsp">
60
    
61
          </map:generate>
61
    <map:pipeline>
62
          <map:transform src="fallback://lenya/xslt/rc/toDoc.xsl"/>
62
      <!-- View Revision? -->
63
          <map:transform src="fallback://lenya/modules/xhtml/xslt/xhtml2xhtml.xsl">
63
      <map:match pattern="*.xml">
64
            <map:parameter name="rendertype" value="{1}"/>
64
        <map:match type="step" pattern="view-revision">
65
            <map:parameter name="nodeid" value="{page-envelope:document-name}"/>
65
          <map:generate type="serverpages" src="fallback://lenya/content/rc/view.xsp">
66
            <map:parameter name="language" value="{page-envelope:document-language}"/>
66
          </map:generate>
67
          </map:transform>
67
          <map:transform src="fallback://lenya/xslt/rc/toDoc.xsl"/>
68
          <map:serialize type="xml"/>
68
          <map:transform src="fallback://lenya/modules/xhtml/xslt/xhtml2xhtml.xsl">
69
        </map:match>
69
            <map:parameter name="rendertype" value="{1}"/>
70
      </map:match>
70
            <map:parameter name="nodeid" value="{page-envelope:document-name}"/>
71
71
            <map:parameter name="language" value="{page-envelope:document-language}"/>
72
      <!-- webdav GET matcher -->
72
          </map:transform>
73
      <map:match pattern="davget.xml">
73
          <map:serialize type="xml"/>
74
        <map:act type="set-header">
74
        </map:match>
75
          <map:parameter name="Last-Modified" value="{date-iso8601-rfc822:{page-envelope:document-lastmodified}}" />
75
      </map:match>
76
          <map:generate src="lenyadoc:/{page-envelope:document-language}/{page-envelope:document-id}"/>
76
77
          <map:serialize type="xml-get"/>
77
      <!-- webdav HTML GET matcher -->
78
        </map:act>
78
      <map:match pattern="davget.html">
79
      </map:match>
79
        <map:act type="set-header">
80
80
          <map:parameter name="Last-Modified" value="{date-iso8601-rfc822:{page-envelope:document-lastmodified}}" />
81
      <!-- parametrized doctype matcher -->
81
          <map:generate src="lenyadoc:/{page-envelope:document-language}/{page-envelope:document-id}"/>
82
      <!-- pattern="{rendertype}" -->
82
          <map:serialize type="html-get"/>
83
      <map:match pattern="*.xml">
83
        </map:act>
84
        <map:generate src="lenyadoc:/{page-envelope:document-language}/{page-envelope:document-id}"/>
84
      </map:match>
85
        <map:transform src="fallback://lenya/modules/xhtml/xslt/xhtml2xhtml.xsl">
85
      
86
          <map:parameter name="rendertype" value="{request-param:rendertype}"/>
86
      <!-- webdav WordML GET matcher -->
87
          <map:parameter name="nodeid" value="{page-envelope:document-name}"/>
87
      <map:match pattern="davget.wordml">
88
          <map:parameter name="language" value="{page-envelope:document-language}"/>
88
        <map:act type="set-header">
89
        </map:transform>
89
          <map:parameter name="Last-Modified" value="{date-iso8601-rfc822:{page-envelope:document-lastmodified}}" />
90
        <map:serialize type="xml"/>
90
          <map:generate src="lenyadoc:/{page-envelope:document-language}/{page-envelope:document-id}"/>
91
      </map:match>
91
          <map:transform src="fallback://lenya/modules/xhtml/xslt/xhtml2wordml.xsl" />
92
92
          <map:serialize type="wordml-get"/>
93
    </map:pipeline>
93
        </map:act>
94
    
94
      </map:match>
95
  </map:pipelines>
95
96
</map:sitemap>
96
      <!-- parametrized doctype matcher -->
97
      <!-- pattern="{rendertype}" -->
98
      <map:match pattern="*.xml">
99
        <map:generate src="lenyadoc:/{page-envelope:document-language}/{page-envelope:document-id}"/>
100
        <map:transform src="fallback://lenya/modules/xhtml/xslt/xhtml2xhtml.xsl">
101
          <map:parameter name="rendertype" value="{request-param:rendertype}"/>
102
          <map:parameter name="nodeid" value="{page-envelope:document-name}"/>
103
          <map:parameter name="language" value="{page-envelope:document-language}"/>
104
        </map:transform>
105
        <map:serialize type="xml"/>
106
      </map:match>
107
108
    </map:pipeline>
109
    
110
  </map:pipelines>
111
</map:sitemap>
(-)src/modules/xhtml/xslt/wordml2xhtml.xsl (+174 lines)
Line 0 Link Here
1
<xsl:stylesheet version="1.0"
2
    xmlns="http://www.w3.org/1999/xhtml"
3
    xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
4
    xmlns:w="http://schemas.microsoft.com/office/word/2003/wordml"
5
    xmlns:wx="http://schemas.microsoft.com/office/word/2003/auxHint"
6
    xmlns:o="urn:schemas-microsoft-com:office:office"
7
    xmlns:v="urn:schemas-microsoft-com:vml"
8
    exclude-result-prefixes="w wx o v">
9
10
  <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="yes"/>
11
12
  <xsl:template match="w:wordDocument">
13
    <html xmlns="http://www.w3.org/1999/xhtml" xmlns:lenya="http://apache.org/cocoon/lenya/page-envelope/1.0">
14
      <head>
15
        <title>Title</title>
16
      </head>
17
      <body>
18
        <xsl:apply-templates/>
19
      </body>
20
    </html>
21
  </xsl:template>
22
23
  <!-- Convert the w:body element to either a <div> elements or nothing -->
24
  <xsl:template match="w:body">
25
    <xsl:apply-templates/>
26
  </xsl:template>
27
28
  <!-- Convert <wx:sub-section> elements to <div> elements or nothing -->
29
  <xsl:template match="wx:sub-section">
30
    <xsl:apply-templates/>
31
  </xsl:template>
32
33
  <!-- Convert <w:p> paragraphs to <p> paragraphs -->
34
  <xsl:template match="w:p">
35
    <xsl:choose>
36
      <xsl:when test="w:pPr/w:listPr">
37
        <xsl:if test="not(preceding-sibling::w:p[1]/w:pPr/w:listPr)">
38
          <xsl:apply-templates select="." mode="list-begin"/>
39
        </xsl:if>
40
      </xsl:when>
41
      <xsl:otherwise>
42
        <p>
43
          <xsl:apply-templates mode="p"/>
44
        </p>
45
      </xsl:otherwise>
46
    </xsl:choose>
47
  </xsl:template>
48
  
49
  <!-- turn a run with the "Heading1" character style into <h1> -->
50
  <xsl:template match="w:p[w:pPr/w:pStyle/@w:val='Heading1']">
51
    <h1>
52
      <xsl:copy-of select="w:r/w:t/text()"/>
53
    </h1>
54
  </xsl:template>
55
  
56
  <!-- turn a run with the "Heading2" character style into <h2> -->
57
  <xsl:template match="w:p[w:pPr/w:pStyle/@w:val='Heading2']">
58
    <h2>
59
      <xsl:copy-of select="w:r/w:t/text()"/>
60
    </h2>
61
  </xsl:template>
62
  
63
  <!-- turn a run with the "Heading3" character style into <h3> -->
64
  <xsl:template match="w:p[w:pPr/w:pStyle/@w:val='Heading3']">
65
    <h3>
66
      <xsl:copy-of select="w:r/w:t/text()"/>
67
    </h3>
68
  </xsl:template>
69
  
70
  <!-- turn a run with the "Heading4" character style into <h4> -->
71
  <xsl:template match="w:p[w:pPr/w:pStyle/@w:val='Heading4']">
72
    <h4>
73
      <xsl:copy-of select="w:r/w:t/text()"/>
74
    </h4>
75
  </xsl:template>
76
  
77
  <!-- turn a run with the "Heading5" character style into <h5> -->
78
  <xsl:template match="w:p[w:pPr/w:pStyle/@w:val='Heading5']">
79
    <h5>
80
      <xsl:copy-of select="w:r/w:t/text()"/>
81
    </h5>
82
  </xsl:template>
83
  
84
  <!-- turn a run with the "Heading6" character style into <h6> -->
85
  <xsl:template match="w:p[w:pPr/w:pStyle/@w:val='Heading6']">
86
    <h6>
87
      <xsl:copy-of select="w:r/w:t/text()"/>
88
    </h6>
89
  </xsl:template>
90
91
  <!-- Don't copy text nodes except when explicitly requested (see below) -->
92
  <xsl:template match="text()"/>
93
  <xsl:template match="text()" mode="p"/>
94
95
  <!-- default behavior for text runs; copy the text through -->
96
  <xsl:template match="w:r" mode="p">
97
    <xsl:copy-of select="w:t/text()"/>
98
    <!-- <xsl:apply-templates select="w:pict"/> -->
99
  </xsl:template>
100
  
101
  <!-- turn a run with the "Emphasis" character style into <emphasis> -->
102
  <xsl:template match="w:r[w:rPr/w:rStyle/@w:val='Emphasis']"
103
      mode="p">
104
    <em>
105
      <xsl:copy-of select="w:t/text()"/>
106
    </em>
107
  </xsl:template>
108
109
  <!-- turn a run with the "Strong" character style into <strong> -->
110
  <xsl:template match="w:r[w:rPr/w:rStyle/@w:val='Strong']"
111
      mode="p">
112
    <strong>
113
      <xsl:copy-of select="w:t/text()"/>
114
    </strong>
115
  </xsl:template>
116
117
  <!-- Turn a w:hlink element into an HTML-style hyperlink -->
118
  <xsl:template match="w:hlink" mode="p">
119
    <a href="{@w:dest}">
120
      <xsl:apply-templates mode="p"/>
121
    </a>
122
  </xsl:template>
123
  
124
  <!-- Tables -->
125
126
  <xsl:template match="w:tbl">
127
    <table>
128
      <xsl:apply-templates select="w:tr"/>
129
    </table>
130
  </xsl:template>
131
132
  <xsl:template match="w:tr">
133
    <tr>
134
      <xsl:apply-templates select="w:tc"/>
135
    </tr>
136
  </xsl:template>
137
138
  <xsl:template match="w:tc">
139
    <td>
140
      <xsl:if test="w:tcPr/w:gridSpan/@w:val">
141
        <xsl:attribute name="colspan">
142
          <xsl:value-of select="w:tcPr/w:gridSpan/@w:val"/>
143
        </xsl:attribute>
144
      </xsl:if>
145
      <xsl:apply-templates select="w:p"/>
146
    </td>
147
  </xsl:template>
148
149
  <!-- Lists -->
150
151
  <xsl:template match="w:p" mode="list-begin">
152
    <ol>
153
      <xsl:apply-templates select="." mode="list-item-next"/>
154
    </ol>
155
  </xsl:template>
156
157
  <xsl:template match="w:p" mode="list-item-next">
158
    <li>
159
      <xsl:apply-templates mode="p"/>
160
    </li>
161
    <xsl:variable name="next" select="following-sibling::w:p[1]"/>
162
    <xsl:if test="$next/w:pPr/w:listPr">
163
      <xsl:apply-templates select="$next" mode="list-item-next"/>
164
    </xsl:if>
165
  </xsl:template>
166
167
  <!-- Images -->
168
<!-- 
169
  <xsl:template match="w:pict">
170
    <img alt="{v:shape/v:imagedata/@o:title}" src="{substring-after(v:shape/v:imagedata/@src, 'wordml://')}"/>
171
  </xsl:template>
172
 -->
173
174
</xsl:stylesheet>
0
  + native
175
  + native
(-)src/modules/xhtml/xslt/xhtml2wordml.xsl (+310 lines)
Line 0 Link Here
1
<xsl:stylesheet version="1.0"
2
  xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
3
  xmlns:xhtml="http://www.w3.org/1999/xhtml"
4
  xmlns:w="http://schemas.microsoft.com/office/word/2003/wordml"
5
  xmlns:wx="http://schemas.microsoft.com/office/word/2003/auxHint"
6
  exclude-result-prefixes="xhtml">
7
8
  <!-- Create the root element for this WordprocessingML document -->
9
  <xsl:template match="xhtml:html">
10
    <xsl:processing-instruction name="mso-application">
11
      <xsl:text>progid="Word.Document"</xsl:text>
12
    </xsl:processing-instruction>
13
    <w:wordDocument>
14
      <xsl:attribute name="xml:space">preserve</xsl:attribute>
15
      <xsl:copy-of select="$styles-element"/>
16
      <w:docPr>
17
        <w:documentProtection w:formatting="on" w:enforcement="on"/>
18
      </w:docPr>
19
      <w:body>
20
        <xsl:apply-templates/>
21
      </w:body>
22
    </w:wordDocument>
23
  </xsl:template>
24
25
  <!-- Convert <h1> to "Heading 1" paragraph -->
26
  <xsl:template match="xhtml:h1">
27
    <w:p>
28
      <w:pPr>
29
        <w:pStyle w:val="Heading1"/>
30
      </w:pPr>
31
      <xsl:apply-templates/>
32
    </w:p>
33
  </xsl:template>
34
  
35
  <!-- Convert <h2> to "Heading 2" paragraph -->
36
  <xsl:template match="xhtml:h2">
37
    <w:p>
38
      <w:pPr>
39
        <w:pStyle w:val="Heading2"/>
40
      </w:pPr>
41
      <xsl:apply-templates/>
42
    </w:p>
43
  </xsl:template>
44
  
45
  <!-- Convert <h3> to "Heading 3" paragraph -->
46
  <xsl:template match="xhtml:h3">
47
    <w:p>
48
      <w:pPr>
49
        <w:pStyle w:val="Heading3"/>
50
      </w:pPr>
51
      <xsl:apply-templates/>
52
    </w:p>
53
  </xsl:template>
54
  
55
  <!-- Convert <h4> to "Heading 4" paragraph -->
56
  <xsl:template match="xhtml:h4">
57
    <w:p>
58
      <w:pPr>
59
        <w:pStyle w:val="Heading4"/>
60
      </w:pPr>
61
      <xsl:apply-templates/>
62
    </w:p>
63
  </xsl:template>
64
  
65
  <!-- Convert <h5> to "Heading 5" paragraph -->
66
  <xsl:template match="xhtml:h5">
67
    <w:p>
68
      <w:pPr>
69
        <w:pStyle w:val="Heading5"/>
70
      </w:pPr>
71
      <xsl:apply-templates/>
72
    </w:p>
73
  </xsl:template>
74
  
75
  <!-- Convert <h6> to "Heading 6" paragraph -->
76
  <xsl:template match="xhtml:h6">
77
    <w:p>
78
      <w:pPr>
79
        <w:pStyle w:val="Heading6"/>
80
      </w:pPr>
81
      <xsl:apply-templates/>
82
    </w:p>
83
  </xsl:template>
84
85
  <!-- Convert <p> elements to regular Word paragraphs ("Normal" style) -->
86
  <xsl:template match="xhtml:p">
87
    <w:p>
88
      <xsl:apply-templates/>
89
    </w:p>
90
  </xsl:template>
91
92
  <!-- Don't automatically copy text nodes. Do explicit value-of's instead -->
93
  <xsl:template match="text()"/>
94
95
  <!-- For plain p or heading text, just create a run of unformatted text -->
96
  <xsl:template match="xhtml:p/text() | xhtml:h1/text() | xhtml:h2/text() | xhtml:h3/text()
97
   | xhtml:h4/text() | xhtml:h5/text() | xhtml:h6/text()">
98
    <w:r>
99
      <w:t>
100
        <xsl:value-of select="normalize-space(.)"/>
101
      </w:t>
102
    </w:r>
103
  </xsl:template>
104
105
  <!-- For text in <em>, apply the "Emphasis" character style -->
106
  <xsl:template match="xhtml:em/text()">
107
    <w:r>
108
      <w:rPr>
109
        <w:rStyle w:val="Emphasis"/>
110
      </w:rPr>
111
      <w:t>
112
        <xsl:value-of select="normalize-space(.)"/>
113
      </w:t>
114
    </w:r>
115
  </xsl:template>
116
117
  <!-- For text in <strong>, apply the "Strong" character style -->
118
  <xsl:template match="xhtml:strong/text()">
119
    <w:r>
120
      <w:rPr>
121
        <w:rStyle w:val="Strong"/>
122
      </w:rPr>
123
      <w:t>
124
        <xsl:value-of select="normalize-space(.)"/>
125
      </w:t>
126
    </w:r>
127
  </xsl:template>
128
129
  <!-- Turn the HTML-style <a> tag to the <w:hlink> hyperlink tag -->
130
  <xsl:template match="xhtml:a">
131
    <w:hlink w:dest="{@href}">
132
      <xsl:apply-templates/>
133
    </w:hlink>
134
  </xsl:template>
135
136
  <!-- For text in <a>, apply the "Hyperlink" character style -->
137
  <xsl:template match="xhtml:a/text()">
138
    <w:r>
139
      <w:rPr>
140
        <w:rStyle w:val="Hyperlink"/>
141
      </w:rPr>
142
      <w:t>
143
        <xsl:value-of select="normalize-space(.)" />
144
      </w:t>
145
    </w:r>
146
  </xsl:template>
147
148
  <!-- Copy of all the style definitions used in this document -->
149
  <xsl:variable name="styles-element">
150
    <w:styles>
151
      <w:versionOfBuiltInStylenames w:val="4"/>
152
      <w:latentStyles w:defLockedState="on" w:latentStyleCount="156">
153
        <w:lsdException w:name="Normal" w:locked="off"/>
154
        <w:lsdException w:name="heading 1" w:locked="off"/>
155
        <w:lsdException w:name="heading 2" w:locked="off"/>
156
        <w:lsdException w:name="heading 3" w:locked="off"/>
157
        <w:lsdException w:name="heading 4" w:locked="off"/>
158
        <w:lsdException w:name="heading 5" w:locked="off"/>
159
        <w:lsdException w:name="heading 6" w:locked="off"/>
160
        <w:lsdException w:name="heading 7" w:locked="off"/>
161
        <w:lsdException w:name="heading 8" w:locked="off"/>
162
        <w:lsdException w:name="heading 9" w:locked="off"/>
163
        <w:lsdException w:name="Default Paragraph Font" w:locked="off"/>
164
        <w:lsdException w:name="Hyperlink" w:locked="off"/>
165
        <w:lsdException w:name="Strong" w:locked="off"/>
166
        <w:lsdException w:name="Emphasis" w:locked="off"/>
167
        <w:lsdException w:name="HTML Top of Form" w:locked="off"/>
168
        <w:lsdException w:name="HTML Bottom of Form" w:locked="off"/>
169
        <w:lsdException w:name="Normal Table" w:locked="off"/>
170
        <w:lsdException w:name="No List" w:locked="off"/>
171
      </w:latentStyles>
172
      <w:style w:type="paragraph" w:default="on" w:styleId="Normal">
173
        <w:name w:val="Normal"/>
174
        <w:rsid w:val="00664EF3"/>
175
        <w:pPr>
176
          <w:spacing w:after="360"/>
177
        </w:pPr>
178
        <w:rPr>
179
          <wx:font wx:val="Times New Roman"/>
180
          <w:sz w:val="24"/>
181
          <w:sz-cs w:val="24"/>
182
          <w:lang w:val="EN-US" w:fareast="EN-US" w:bidi="AR-SA"/>
183
        </w:rPr>
184
      </w:style>
185
      <w:style w:type="paragraph" w:styleId="Heading1">
186
        <w:name w:val="heading 1"/>
187
        <wx:uiName wx:val="Heading 1"/>
188
        <w:basedOn w:val="Normal"/>
189
        <w:next w:val="Normal"/>
190
        <w:rsid w:val="00664EF3"/>
191
        <w:pPr>
192
          <w:pStyle w:val="Heading1"/>
193
          <w:keepNext/>
194
          <w:spacing w:before="240" w:after="60"/>
195
          <w:outlineLvl w:val="0"/>
196
        </w:pPr>
197
        <w:rPr>
198
          <w:rFonts w:ascii="Arial" w:h-ansi="Arial" w:cs="Arial"/>
199
          <wx:font wx:val="Arial"/>
200
          <w:b/>
201
          <w:b-cs/>
202
          <w:kern w:val="32"/>
203
          <w:sz w:val="32"/>
204
          <w:sz-cs w:val="32"/>
205
        </w:rPr>
206
      </w:style>
207
      <w:style w:type="paragraph" w:styleId="Heading2">
208
        <w:name w:val="heading 2"/>
209
        <wx:uiName wx:val="Heading 2"/>
210
        <w:basedOn w:val="Normal"/>
211
        <w:next w:val="Normal"/>
212
        <w:rsid w:val="00664EF3"/>
213
        <w:pPr>
214
          <w:pStyle w:val="Heading2"/>
215
          <w:keepNext/>
216
          <w:spacing w:before="240" w:after="60"/>
217
          <w:outlineLvl w:val="1"/>
218
        </w:pPr>
219
        <w:rPr>
220
          <w:rFonts w:ascii="Arial" w:h-ansi="Arial" w:cs="Arial"/>
221
          <wx:font wx:val="Arial"/>
222
          <w:b/>
223
          <w:b-cs/>
224
          <w:i/>
225
          <w:i-cs/>
226
          <w:sz w:val="28"/>
227
          <w:sz-cs w:val="28"/>
228
        </w:rPr>
229
      </w:style>
230
      <w:style w:type="paragraph" w:styleId="Heading3">
231
        <w:name w:val="heading 3"/>
232
        <wx:uiName wx:val="Heading 3"/>
233
        <w:basedOn w:val="Normal"/>
234
        <w:next w:val="Normal"/>
235
        <w:rsid w:val="00664EF3"/>
236
        <w:pPr>
237
          <w:pStyle w:val="Heading3"/>
238
          <w:keepNext/>
239
          <w:spacing w:before="240" w:after="60"/>
240
          <w:outlineLvl w:val="2"/>
241
        </w:pPr>
242
        <w:rPr>
243
          <w:rFonts w:ascii="Arial" w:h-ansi="Arial" w:cs="Arial"/>
244
          <wx:font wx:val="Arial"/>
245
          <w:b/>
246
          <w:b-cs/>
247
          <w:sz w:val="26"/>
248
          <w:sz-cs w:val="26"/>
249
        </w:rPr>
250
      </w:style>
251
      <w:style w:type="character" w:default="on" w:styleId="DefaultParagraphFont">
252
        <w:name w:val="Default Paragraph Font"/>
253
        <w:semiHidden/>
254
      </w:style>
255
      <w:style w:type="table" w:default="on" w:styleId="TableNormal">
256
        <w:name w:val="Normal Table"/>
257
        <wx:uiName wx:val="Table Normal"/>
258
        <w:semiHidden/>
259
        <w:rPr>
260
          <wx:font wx:val="Times New Roman"/>
261
        </w:rPr>
262
        <w:tblPr>
263
          <w:tblInd w:w="0" w:type="dxa"/>
264
          <w:tblCellMar>
265
            <w:top w:w="0" w:type="dxa"/>
266
            <w:left w:w="108" w:type="dxa"/>
267
            <w:bottom w:w="0" w:type="dxa"/>
268
            <w:right w:w="108" w:type="dxa"/>
269
          </w:tblCellMar>
270
        </w:tblPr>
271
      </w:style>
272
      <w:style w:type="list" w:default="on" w:styleId="NoList">
273
        <w:name w:val="No List"/>
274
        <w:semiHidden/>
275
      </w:style>
276
      <w:style w:type="character" w:styleId="Emphasis">
277
        <w:name w:val="Emphasis"/>
278
        <w:basedOn w:val="DefaultParagraphFont"/>
279
        <w:rsid w:val="00664EF3"/>
280
        <w:rPr>
281
          <w:i/>
282
          <w:i-cs/>
283
        </w:rPr>
284
      </w:style>
285
      <w:style w:type="character" w:styleId="Strong">
286
        <w:name w:val="Strong"/>
287
        <w:basedOn w:val="DefaultParagraphFont"/>
288
        <w:rsid w:val="00664EF3"/>
289
        <w:rPr>
290
          <w:b/>
291
          <w:b-cs/>
292
        </w:rPr>
293
      </w:style>
294
      <w:style w:type="character" w:styleId="Hyperlink">
295
        <w:name w:val="Hyperlink"/>
296
        <w:basedOn w:val="DefaultParagraphFont"/>
297
        <w:rsid w:val="00664EF3"/>
298
        <w:rPr>
299
          <w:color w:val="0000FF"/>
300
          <w:u w:val="single"/>
301
        </w:rPr>
302
      </w:style>
303
    </w:styles>
304
  </xsl:variable>
305
  
306
  <xsl:template match="@*|node()">
307
    <xsl:apply-templates select="@*|node()"/>
308
  </xsl:template>
309
310
</xsl:stylesheet>
0
  + native
311
  + native
(-)src/modules/webdav/sitemap.xmap (-5 / +18 lines)
Lines 100-106 Link Here
100
          | you can do that here. This is the pipeline that will
100
          | you can do that here. This is the pipeline that will
101
          | generate the input for the PUT method.
101
          | generate the input for the PUT method.
102
          + -->
102
          + -->
103
<!--      <map:match pattern="request/PUT/xml">
103
      <!-- PUT HTML -->
104
      <map:match pattern="request/PUT/html">
104
        <map:generate type="stream">
105
        <map:generate type="stream">
105
          <map:parameter name="defaultContentType" value="text/xml" />
106
          <map:parameter name="defaultContentType" value="text/xml" />
106
        </map:generate>
107
        </map:generate>
Lines 109-116 Link Here
109
        </map:act>
110
        </map:act>
110
        <map:transform src="fallback://lenya/xslt/util/strip_namespaces.xsl"/>
111
        <map:transform src="fallback://lenya/xslt/util/strip_namespaces.xsl"/>
111
        <map:serialize type="xml" />
112
        <map:serialize type="xml" />
112
      </map:match>-->
113
      </map:match>
113
114
      
115
      <!-- PUT WordML -->
116
      <map:match pattern="request/PUT/wordml">
117
        <map:generate type="stream">
118
          <map:parameter name="defaultContentType" value="text/xml" />
119
        </map:generate>
120
        <map:act type="resource-exists" src="{fallback://lenya/modules/{page-envelope:document-type}/xslt/wordml2{page-envelope:document-type}.xsl}">
121
          <map:transform src="{fallback://lenya/modules/{page-envelope:document-type}/xslt/wordml2{page-envelope:document-type}.xsl}"/>        
122
        </map:act>
123
        <map:transform src="fallback://lenya/xslt/util/strip_namespaces.xsl"/>
124
        <map:serialize type="xml" />
125
      </map:match>
126
      
114
      <!-- Read the request for binaries PUT -->
127
      <!-- Read the request for binaries PUT -->
115
      <map:match pattern="request/PUT/*">
128
      <map:match pattern="request/PUT/*">
116
        <map:read type="request"/>
129
        <map:read type="request"/>
Lines 148-156 Link Here
148
        </map:call>
161
        </map:call>
149
      </map:match>        
162
      </map:match>        
150
      
163
      
151
      <map:match pattern="GET/**">
164
      <map:match pattern="GET/**.*">
152
        <map:call function="get">
165
        <map:call function="get">
153
          <map:parameter name="forward" value="{resource-type:format-webdavGET}"/>
166
          <map:parameter name="forward" value="{resource-type:format-webdavGET{2}}"/>
154
        </map:call>
167
        </map:call>
155
      </map:match>
168
      </map:match>
156
169
(-)src/modules/webdav/usecases/webdav/propfind.jx (+33 lines)
Lines 89-94 Link Here
89
            <D:status>HTTP/1.1 200 OK</D:status>
89
            <D:status>HTTP/1.1 200 OK</D:status>
90
          </D:propstat>
90
          </D:propstat>
91
        </D:response>
91
        </D:response>
92
        <!-- create an additional wordml file for each xml document, the href is the path to the file and the 
93
            display name is what will appear in the webdav folder -->
94
        <jx:if test="${doc.getSourceExtension().equals('xml')}">
95
          <jx:set var="fileExtension" value="wordml"/>
96
            <D:response>
97
              <D:href>/${doc.getPublication().getId()}/webdav${doc.getId()}_${doc.getLanguage()}.${fileExtension}</D:href>
98
              <D:propstat>
99
                <D:prop>
100
                  <D:displayname>${doc.getName()}_${doc.getLanguage()}.${fileExtension}</D:displayname>
101
                  <D:getlastmodified>${dateFormat.format(doc.getLastModified())}</D:getlastmodified>
102
                  <D:creationdate/>
103
                  <D:getcontenttype>application/xml</D:getcontenttype>
104
                  <D:getcontentlength>${doc.getFile().length()}</D:getcontentlength>
105
                  <D:resourcetype/>
106
                  <D:lockdiscovery>
107
                  <jx:if test="${checkedOut[status.index] != null}">
108
                    <D:activelock>
109
                      <D:locktype><D:write/></D:locktype>
110
                      <D:lockscope><D:exclusive/></D:lockscope>
111
                      <D:depth>0</D:depth>
112
                      <D:owner><D:href>${checkedOut[status.index].getIdentity()}</D:href></D:owner>
113
                      <D:timeout>Infinite</D:timeout>
114
                      <D:locktoken>
115
                        <D:href>${usecase.getParameter('sourceURL')}</D:href>
116
                      </D:locktoken>
117
                    </D:activelock>
118
                    </jx:if>
119
                  </D:lockdiscovery>
120
                </D:prop>
121
                <D:status>HTTP/1.1 200 OK</D:status>
122
              </D:propstat>
123
            </D:response>
124
        </jx:if>
92
      </jx:if>
125
      </jx:if>
93
    </jx:forEach>
126
    </jx:forEach>
94
    <jx:forEach var="asset" items="${usecase.getParameter('assets')}">
127
    <jx:forEach var="asset" items="${usecase.getParameter('assets')}">
(-)src/pubs/default/modules/homepage/config/cocoon-xconf/resource-type-homepage.xconf (-1 / +2 lines)
Lines 29-35 Link Here
29
    <link-attribute xpath="//*[namespace-uri() = 'http://www.w3.org/1999/xhtml']/@href"/>
29
    <link-attribute xpath="//*[namespace-uri() = 'http://www.w3.org/1999/xhtml']/@href"/>
30
    <format name="xhtml" uri="cocoon://modules/homepage/xhtml.xml"/>
30
    <format name="xhtml" uri="cocoon://modules/homepage/xhtml.xml"/>
31
    <format name="luceneIndex" uri="cocoon://modules/xhtml/lucene-index.xml"/>
31
    <format name="luceneIndex" uri="cocoon://modules/xhtml/lucene-index.xml"/>
32
    <format name="webdavGET" uri="cocoon://modules/xhtml/davget.xml"/>
32
    <format name="webdavGEThtml" uri="cocoon://modules/xhtml/davget.html"/>
33
    <format name="webdavGETwordml" uri="cocoon://modules/xhtml/davget.wordml"/>
33
  </component-instance>
34
  </component-instance>
34
35
35
</xconf>
36
</xconf>

Return to bug 39277