Merge branch 'MDL-32442' of git://github.com/merrill-oakland/moodle
[moodle.git] / backup / bb / bb6_to_moodle.xsl
blob9074850538267568ada0b81e176f010ca622a781
1 <?xml version='1.0'?>
2 <xsl:stylesheet version="1.0"
3 xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
4 <xsl:output method="xml" encoding="UTF-8" />
5 <xsl:template match="/">
6 <MOODLE_BACKUP>
7 <INFO>
8 <NAME>backup-from-blackboard.zip</NAME>
9 <MOODLE_VERSION>2004083100</MOODLE_VERSION>
10 <MOODLE_RELEASE>1.4</MOODLE_RELEASE>
11 <BACKUP_VERSION>2004083100</BACKUP_VERSION>
12 <BACKUP_RELEASE>1.4</BACKUP_RELEASE>
13 <DATE>1094240862</DATE>
14 <ORIGINAL_WWWROOT>INSERT URL HERE</ORIGINAL_WWWROOT>
15 <DETAILS>
16 <MOD>
17 <NAME>assignment</NAME>
18 <INCLUDED>true</INCLUDED>
19 <USERINFO>true</USERINFO>
20 </MOD>
21 <MOD>
22 <NAME>chat</NAME>
23 <INCLUDED>true</INCLUDED>
24 <USERINFO>true</USERINFO>
25 </MOD>
26 <MOD>
27 <NAME>choice</NAME>
28 <INCLUDED>true</INCLUDED>
29 <USERINFO>true</USERINFO>
30 </MOD>
31 <MOD>
32 <NAME>forum</NAME>
33 <INCLUDED>true</INCLUDED>
34 <USERINFO>true</USERINFO>
35 </MOD>
36 <MOD>
37 <NAME>glossary</NAME>
38 <INCLUDED>true</INCLUDED>
39 <USERINFO>true</USERINFO>
40 </MOD>
41 <MOD>
42 <NAME>journal</NAME>
43 <INCLUDED>true</INCLUDED>
44 <USERINFO>true</USERINFO>
45 </MOD>
46 <MOD>
47 <NAME>label</NAME>
48 <INCLUDED>true</INCLUDED>
49 <USERINFO>true</USERINFO>
50 </MOD>
51 <MOD>
52 <NAME>lesson</NAME>
53 <INCLUDED>true</INCLUDED>
54 <USERINFO>true</USERINFO>
55 </MOD>
56 <MOD>
57 <NAME>quiz</NAME>
58 <INCLUDED>true</INCLUDED>
59 <USERINFO>true</USERINFO>
60 </MOD>
61 <MOD>
62 <NAME>resource</NAME>
63 <INCLUDED>true</INCLUDED>
64 <USERINFO>true</USERINFO>
65 </MOD>
66 <MOD>
67 <NAME>scorm</NAME>
68 <INCLUDED>true</INCLUDED>
69 <USERINFO>true</USERINFO>
70 </MOD>
71 <MOD>
72 <NAME>survey</NAME>
73 <INCLUDED>true</INCLUDED>
74 <USERINFO>true</USERINFO>
75 </MOD>
76 <MOD>
77 <NAME>wiki</NAME>
78 <INCLUDED>true</INCLUDED>
79 <USERINFO>true</USERINFO>
80 </MOD>
81 <MOD>
82 <NAME>workshop</NAME>
83 <INCLUDED>true</INCLUDED>
84 <USERINFO>true</USERINFO>
85 </MOD>
86 <USERS>course</USERS>
87 <LOGS>false</LOGS>
88 <USERFILES>true</USERFILES>
89 <COURSEFILES>true</COURSEFILES>
90 </DETAILS>
91 </INFO>
92 <COURSE>
93 <!-- Get course specific information -->
94 <xsl:apply-templates select="document('res00001.dat')//COURSE"/>
96 <xsl:call-template name="modules" />
98 <SECTIONS>
99 <!-- Create a title section -->
100 <xsl:for-each select="document('res00001.dat')" >
101 <xsl:call-template name="title_section" />
102 </xsl:for-each>
105 <!-- Create a topic for each top level Bb item and add section modules ONE folder deep -->
106 <xsl:for-each select="manifest/organizations/organization/item">
107 <xsl:variable name="section_number" select="position()"/>
108 <xsl:call-template name="sections">
109 <xsl:with-param name="section_number" select="$section_number"/>
110 <xsl:with-param name="recurse" >false</xsl:with-param>
111 </xsl:call-template>
112 </xsl:for-each>
114 <!-- Create a topic for each second level Bb item which is a folder, recursively make section modules -->
115 <xsl:for-each select="manifest/organizations/organization/item/item">
116 <xsl:sort order="descending" select="document(concat(@identifierref,'.dat'))/CONTENT/FLAGS/ISFOLDER/@value"/>
117 <xsl:if test="document(concat(@identifierref,'.dat'))/CONTENT/FLAGS/ISFOLDER/@value = 'true'">
118 <xsl:variable name="prev_sections" select="count(/manifest/organizations/tableofcontents/item)"/>
119 <xsl:variable name="section_number" select="position()+$prev_sections"/>
120 <xsl:call-template name="sections">
121 <xsl:with-param name="section_number" select="$section_number"/>
122 <xsl:with-param name="recurse" >true</xsl:with-param>
123 </xsl:call-template>
124 </xsl:if>
125 </xsl:for-each>
126 </SECTIONS>
128 </COURSE>
129 </MOODLE_BACKUP>
130 </xsl:template>
132 <xsl:template match="COURSE">
133 <HEADER>
134 <ID>2</ID>
135 <CATEGORY>
136 <ID></ID>
137 <NAME><xsl:value-of select="CATEGORIES/CATEGORY/@value"/></NAME>
138 </CATEGORY>
139 <PASSWORD></PASSWORD>
140 <IDNUMBER>4</IDNUMBER>
141 <FORMAT>topics</FORMAT>
142 <SHOWGRADES>1</SHOWGRADES>
143 <BLOCKINFO>participants,activity_modules,search_forums,admin,course_list:news_items,calendar_upcoming,recent_activity</BLOCKINFO>
144 <NEWSITEMS>5</NEWSITEMS>
145 <TEACHER>Teacher</TEACHER>
146 <TEACHERS>Teachers</TEACHERS>
147 <STUDENT>Student</STUDENT>
148 <STUDENTS>Students</STUDENTS>
149 <GUEST>0</GUEST>
150 <STARTDATE>1094270400</STARTDATE>
151 <ENROLPERIOD>0</ENROLPERIOD>
152 <NUMSECTIONS>10</NUMSECTIONS>
153 <MAXBYTES>2097152</MAXBYTES>
154 <SHOWREPORTS>0</SHOWREPORTS>
155 <GROUPMODE>0</GROUPMODE>
156 <GROUPMODEFORCE>0</GROUPMODEFORCE>
157 <LANG></LANG>
158 <COST></COST>
159 <MARKER>0</MARKER>
160 <VISIBLE>1</VISIBLE>
161 <HIDDENSECTIONS>0</HIDDENSECTIONS>
162 <TIMECREATED>1094240775</TIMECREATED>
163 <TIMEMODIFIED>1094240775</TIMEMODIFIED>
164 <SUMMARY><xsl:value-of select="DESCRIPTION"/></SUMMARY>
165 <SHORTNAME><xsl:value-of select="COURSEID/@value"/></SHORTNAME>
166 <FULLNAME><xsl:value-of select="TITLE/@value"/></FULLNAME>
167 </HEADER>
168 </xsl:template>
170 <xsl:template name="title_section" match="resource">
171 <SECTION>
172 <ID>0</ID>
173 <NUMBER>0</NUMBER>
174 <SUMMARY>&lt;div style="text-align: center;"&gt;&lt;font size="5" style="font-family: arial,helvetica,sans-serif;"&gt;<xsl:value-of select="COURSE/TITLE/@value"/>&lt;/font&gt;&lt;/div&gt;
175 <xsl:value-of select="COURSE/DESCRIPTION"/>
176 </SUMMARY>
177 <VISIBLE>1</VISIBLE>
178 <MODS>
179 </MODS>
180 </SECTION>
181 </xsl:template>
183 <xsl:template name="sections" match="resource">
184 <xsl:param name="section_number">1. </xsl:param>
185 <xsl:param name="recurse"/>
186 <SECTION>
187 <ID><xsl:value-of select="$section_number"/></ID>
188 <NUMBER><xsl:value-of select="$section_number"/></NUMBER>
189 <SUMMARY>&lt;span style="font-weight: bold;"&gt;<xsl:value-of select="title"/>&lt;/span&gt;</SUMMARY>
190 <VISIBLE>1</VISIBLE>
191 <MODS>
193 <xsl:if test="$recurse = 'true'">
194 <xsl:variable name="mod_number" select="substring-after(@identifierref,'res')"/>
195 <xsl:call-template name="item_recurse_files" >
196 <xsl:with-param name="mod_number" select="$mod_number"/>
197 <xsl:with-param name="indent" >0</xsl:with-param>
198 <xsl:with-param name="recurse" select="$recurse" />
199 </xsl:call-template>
201 </xsl:if>
203 <xsl:if test="$recurse = 'false'">
204 <xsl:for-each select="item">
205 <xsl:variable name="mod_number" select="substring-after(@identifierref,'res')"/>
206 <xsl:call-template name="item" >
207 <xsl:with-param name="mod_number" select="$mod_number"/>
208 <xsl:with-param name="indent" >0</xsl:with-param>
209 </xsl:call-template>
210 </xsl:for-each>
211 </xsl:if>
214 </MODS>
215 </SECTION>
216 </xsl:template>
218 <xsl:template name="item_recurse_files">
219 <xsl:param name="mod_number">1. </xsl:param>
220 <xsl:param name="indent">1. </xsl:param>
221 <xsl:param name="recurse"/>
224 <!-- Create one section-mod -->
225 <xsl:for-each select="document(concat(@identifierref,'.dat'))">
226 <xsl:call-template name="section_mod">
227 <xsl:with-param name="mod_number" select="$mod_number"/>
228 <xsl:with-param name="indent" select="$indent"/>
229 </xsl:call-template>
230 </xsl:for-each>
232 <!-- Depth first recursion to preserve order -->
233 <xsl:for-each select="item">
234 <xsl:variable name="m_number" select="substring-after(@identifierref,'res')"/>
235 <xsl:call-template name="item_recurse_files" >
236 <xsl:with-param name="mod_number" select="$m_number"/>
237 <xsl:with-param name="indent" select="$indent + 1"/>
238 </xsl:call-template>
239 </xsl:for-each>
241 </xsl:template>
243 <xsl:template name="item">
244 <xsl:param name="mod_number">1. </xsl:param>
245 <xsl:param name="indent">1. </xsl:param>
247 <GETHERE></GETHERE>
248 <xsl:if test="document(concat(@identifierref,'.dat'))/CONTENT/FLAGS/ISFOLDER/@value != 'true' or document(concat(@identifierref,'.dat'))/EXTERNALLINK/DESCRIPTION/FLAGS/ISHTML/@value ='true'">
249 <!-- Create one section-mod -->
250 <xsl:for-each select="document(concat(@identifierref,'.dat'))">
251 <xsl:call-template name="section_mod">
252 <xsl:with-param name="mod_number" select="$mod_number"/>
253 <xsl:with-param name="indent" select="$indent"/>
254 </xsl:call-template>
255 </xsl:for-each>
256 </xsl:if>
259 </xsl:template>
261 <!-- Determines the type of section mod entry and calls the appropriate creation template -->
262 <xsl:template name="section_mod" >
263 <xsl:param name="mod_number">1. </xsl:param>
264 <xsl:param name="contenttype" />
265 <xsl:param name="indent">1. </xsl:param>
267 <!-- Every file will have a label module describing it -->
268 <xsl:choose>
269 <!-- Detected a file -->
270 <xsl:when test="CONTENT/FILE/@id != '' or CONTENT/FILES/FILE/NAME != ''">
271 <!-- Create a label -->
272 <xsl:call-template name="section_mod_label">
273 <xsl:with-param name="mod_number" select="$mod_number"/>
274 <xsl:with-param name="indent" select="$indent"/>
275 </xsl:call-template>
277 <!-- Create a resource -->
278 <xsl:call-template name="section_mod_resource">
279 <xsl:with-param name="mod_number" select="$mod_number"/>
280 <xsl:with-param name="indent" select="$indent"/>
281 </xsl:call-template>
283 </xsl:when>
285 <!-- Detected a folder -->
286 <xsl:when test="CONTENT/FLAGS/ISFOLDER/@value = 'true'">
287 <MAKINGLABEL></MAKINGLABEL>
288 <!-- Create a label -->
289 <xsl:call-template name="section_mod_label">
290 <xsl:with-param name="mod_number" select="$mod_number"/>
291 <xsl:with-param name="indent" select="$indent"/>
292 </xsl:call-template>
293 </xsl:when>
295 <!-- Detected text -->
296 <xsl:when test="CONTENT/MAINDATA/FLAGS/ISHTML/@value = 'true' or CONTENT/BODY/TYPE/@value = 'H' ">
297 <MAKINGTEXT></MAKINGTEXT>
298 <!-- Create a resource -->
299 <xsl:call-template name="section_mod_resource">
300 <xsl:with-param name="mod_number" select="$mod_number"/>
301 <xsl:with-param name="indent" select="$indent"/>
302 </xsl:call-template>
303 </xsl:when>
305 <!-- Detected external link -->
306 <xsl:when test="EXTERNALLINK/TITLE/@value != '' ">
307 <!-- Create a label -->
308 <xsl:call-template name="section_mod_label">
309 <xsl:with-param name="mod_number" select="$mod_number"/>
310 <xsl:with-param name="indent" select="$indent"/>
311 </xsl:call-template>
313 <!-- Create a resource -->
314 <xsl:call-template name="section_mod_externallink">
315 <xsl:with-param name="mod_number" select="$mod_number"/>
316 <xsl:with-param name="indent" select="$indent"/>
317 </xsl:call-template>
318 </xsl:when>
319 <xsl:otherwise>
320 <UNKNOWN>
321 </UNKNOWN>
322 </xsl:otherwise>
324 </xsl:choose>
327 </xsl:template>
329 <!-- Creates one section-mod-label -->
330 <xsl:template name="section_mod_label" >
331 <xsl:param name="mod_number">1. </xsl:param>
332 <xsl:param name="indent">1. </xsl:param>
333 <MOD>
334 <ID>1<xsl:value-of select="$mod_number"/>0</ID>
335 <ZIBA_NAME>
336 <!-- BB5.5 -->
337 <xsl:value-of select="CONTENT/TITLE"/>
338 <!-- BB6 -->
339 <xsl:value-of select="CONTENT/TITLE/@value"/>
340 </ZIBA_NAME>
341 <TYPE>label</TYPE>
342 <INSTANCE><xsl:value-of select="$mod_number"/></INSTANCE>
343 <ADDED>1094240775</ADDED>
344 <DELETED>0</DELETED>
345 <SCORE>0</SCORE>
346 <INDENT><xsl:value-of select="$indent"/></INDENT>
347 <VISIBLE>1</VISIBLE>
348 <GROUPMODE>0</GROUPMODE>
349 </MOD>
351 </xsl:template>
353 <!-- Creates one section-mod-resource -->
354 <xsl:template name="section_mod_resource" >
355 <xsl:param name="mod_number">1. </xsl:param>
356 <xsl:param name="indent">1. </xsl:param>
357 <MOD>
358 <ID><xsl:value-of select="$mod_number"/>0</ID>
359 <ZIBA_NAME>
360 <!-- BB5.5 -->
361 <xsl:value-of select="CONTENT/TITLE"/>
362 <!-- BB6 -->
363 <xsl:value-of select="CONTENT/TITLE/@value"/>
364 </ZIBA_NAME>
365 <TYPE>resource</TYPE>
366 <INSTANCE><xsl:value-of select="$mod_number"/></INSTANCE>
367 <ADDED>1094240775</ADDED>
368 <DELETED>0</DELETED>
369 <SCORE>0</SCORE>
370 <INDENT><xsl:value-of select="$indent"/></INDENT>
371 <VISIBLE>1</VISIBLE>
372 <GROUPMODE>0</GROUPMODE>
373 </MOD>
375 </xsl:template>
377 <!-- Creates one section-mod-externallink -->
378 <xsl:template name="section_mod_externallink" >
379 <xsl:param name="mod_number">1. </xsl:param>
380 <xsl:param name="indent">1. </xsl:param>
381 <MOD>
382 <ID><xsl:value-of select="$mod_number"/>0</ID>
383 <ZIBA_NAME>
384 <xsl:value-of select="EXTERNALLINK/TITLE/@value"/>
385 </ZIBA_NAME>
386 <TYPE>resource</TYPE>
387 <INSTANCE><xsl:value-of select="$mod_number"/></INSTANCE>
388 <ADDED>1094240775</ADDED>
389 <DELETED>0</DELETED>
390 <SCORE>0</SCORE>
391 <INDENT><xsl:value-of select="$indent"/></INDENT>
392 <VISIBLE>1</VISIBLE>
393 <GROUPMODE>0</GROUPMODE>
394 </MOD>
396 </xsl:template>
398 <!-- Creates a module-label entry -->
399 <xsl:template name="module_label" >
400 <xsl:param name="mod_number">1. </xsl:param>
401 <MOD>
402 <ID><xsl:value-of select="$mod_number"/></ID>
403 <MODTYPE>label</MODTYPE>
404 <NAME>
405 <!-- for CONTENT text -->
406 <xsl:value-of select="TITLE"/>
407 <!-- for EXTERNALLINK text -->
408 <xsl:value-of select="TITLE/@value"/>
409 </NAME>
410 <CONTENT>
411 &lt;span style="font-style: italic;"&gt;
412 <!-- for CONTENT text -->
413 <xsl:value-of select="TITLE"/>
414 <!-- for EXTERNALLINK text -->
415 <xsl:value-of select="TITLE/@value"/>
416 :&lt;/span&gt;
417 <!-- for CONTENT text -->
418 <xsl:value-of select="MAINDATA/TEXT"/>
419 <!-- for EXTERNALLINK text -->
420 <xsl:value-of select="DESCRIPTION/TEXT"/>
421 <!-- for BB6 text -->
422 <xsl:value-of select="BODY/TEXT"/>
423 </CONTENT>
424 <TIMEMODIFIED>1094240775</TIMEMODIFIED>
425 </MOD>
426 </xsl:template>
428 <!-- Creates one module-file entry -->
429 <xsl:template name="module_file" >
430 <xsl:param name="mod_number">1. </xsl:param>
431 <xsl:param name="identifier"/>
432 <MOD>
433 <ID><xsl:value-of select="$mod_number"/></ID>
434 <MODTYPE>resource</MODTYPE>
435 <NAME>
436 <!-- BB5 -->
437 <xsl:value-of select="FILES/FILEREF/RELFILE/@value"/>
438 <!-- BB6 -->
439 <xsl:value-of select="FILES/FILE/NAME"/>
440 </NAME>
441 <TYPE>file</TYPE>
442 <REFERENCE><!-- BB5 --><xsl:value-of select="FILES/FILEREF/CONTENTID/@value"/><!-- BB6 --><xsl:value-of select="$identifier"/>/<!-- BB5 --><xsl:value-of select="FILES/FILEREF/RELFILE/@value"/><!-- BB6 --><xsl:value-of select="FILES/FILE/NAME"/></REFERENCE>
443 <SUMMARY>
444 <xsl:value-of select="MAINDATA/TEXT"/>
445 </SUMMARY>
446 <ALLTEXT></ALLTEXT>
447 <POPUP></POPUP>
448 <OPTIONS></OPTIONS>
449 <TIMEMODIFIED>1094240775</TIMEMODIFIED>
450 </MOD>
451 </xsl:template>
453 <!-- Creates one module-text entry -->
454 <xsl:template name="module_text" >
455 <xsl:param name="mod_number">1. </xsl:param>
456 <MOD>
457 <ID><xsl:value-of select="$mod_number"/></ID>
458 <MODTYPE>resource</MODTYPE>
459 <NAME>
460 <!-- BB5.5 -->
461 <xsl:value-of select="TITLE"/>
462 <!-- BB6 -->
463 <xsl:value-of select="TITLE/@value"/>
464 </NAME>
465 <TYPE>text</TYPE>
466 <REFERENCE></REFERENCE>
467 <SUMMARY>
468 <!-- BB5.5 -->
469 <xsl:value-of select="TITLE"/>
470 <!-- BB6 -->
471 <xsl:value-of select="TITLE/@value"/>
472 </SUMMARY>
473 <ALLTEXT>
474 <!-- BB5.5 -->
475 <xsl:value-of select="MAINDATA/TEXT"/>
476 <!-- BB6 -->
477 <xsl:value-of select="BODY/TEXT"/>
478 </ALLTEXT>
479 <POPUP></POPUP>
480 <OPTIONS></OPTIONS>
481 <TIMEMODIFIED>1094240775</TIMEMODIFIED>
482 </MOD>
483 </xsl:template>
485 <!-- Creates one module-link entry -->
486 <xsl:template name="module_link" >
487 <xsl:param name="mod_number">1. </xsl:param>
488 <MOD>
489 <ID><xsl:value-of select="$mod_number"/></ID>
490 <MODTYPE>resource</MODTYPE>
491 <NAME>
492 <xsl:value-of select="URL/@value"/>
493 </NAME>
494 <TYPE>file</TYPE>
495 <REFERENCE>
496 <xsl:value-of select="URL/@value"/>
497 </REFERENCE>
498 <SUMMARY>
499 <xsl:value-of select="TITLE/@value"/>&lt;br/&gt;
500 <xsl:value-of select="URL/@value"/>
501 </SUMMARY>
502 <ALLTEXT>
503 <xsl:value-of select="DESCRIPTION/TEXT"/>
504 </ALLTEXT>
505 <POPUP></POPUP>
506 <OPTIONS></OPTIONS>
507 <TIMEMODIFIED>1094240775</TIMEMODIFIED>
508 </MOD>
509 </xsl:template>
511 <!-- Create a CONTENT module entries -->
512 <xsl:template match="EXTERNALLINK">
513 <xsl:param name="mod_number">1. </xsl:param>
514 <!-- Every link module will have a label module describing it -->
515 <xsl:call-template name="module_label">
516 <xsl:with-param name="mod_number" select="$mod_number"/>
517 </xsl:call-template>
519 <xsl:call-template name="module_link">
520 <xsl:with-param name="mod_number" select="$mod_number"/>
521 </xsl:call-template>
523 </xsl:template>
525 <!-- Create a CONTENT module entries -->
526 <xsl:template match="CONTENT">
527 <xsl:param name="mod_number">1. </xsl:param>
528 <xsl:param name="identifier"/>
530 <xsl:choose>
531 <!-- Detected a file
533 <FILEFOUND></FILEFOUND>
535 <xsl:when test="FILES/FILE/@id != ''">
537 <!-- Every file module will have a label module describing it -->
538 <xsl:call-template name="module_label">
539 <xsl:with-param name="mod_number" select="$mod_number"/>
540 </xsl:call-template>
542 <xsl:call-template name="module_file">
543 <xsl:with-param name="mod_number" select="$mod_number"/>
544 <xsl:with-param name="identifier" select="$identifier"/>
545 </xsl:call-template>
547 </xsl:when>
549 <!-- Detected a folder
550 <FOLDERFOUND></FOLDERFOUND>
552 <xsl:when test="FLAGS/ISFOLDER/@value = 'true'">
554 <xsl:call-template name="module_label">
555 <xsl:with-param name="mod_number" select="$mod_number"/>
556 </xsl:call-template>
558 </xsl:when>
560 <!-- Detected text
561 <TEXTFOUND></TEXTFOUND>
563 <xsl:when test="MAINDATA/FLAGS/ISHTML/@value = 'true' or BODY/TYPE/@value = 'H' ">
565 <xsl:call-template name="module_text">
566 <xsl:with-param name="mod_number" select="$mod_number"/>
567 </xsl:call-template>
569 </xsl:when>
571 <xsl:otherwise>
572 <UNKNOWN>
573 <xsl:value-of select="TITLE"/>
574 </UNKNOWN>
575 </xsl:otherwise>
576 </xsl:choose>
578 </xsl:template>
581 <!-- Creates all module entries -->
582 <xsl:template name="modules" match="resource">
583 <MODULES>
584 <xsl:for-each select="//resource">
585 <xsl:variable name="mod_number" select="substring-after(@identifier,'res')"/>
586 <xsl:variable name="identifier" select="@identifier"/>
587 <xsl:for-each select="document(concat(@identifier,'.dat'))">
588 <xsl:apply-templates select="//FORUM">
589 <xsl:with-param name="mod_number" select="$mod_number"/>
590 </xsl:apply-templates>
591 <xsl:apply-templates select="//CONTENT">
592 <xsl:with-param name="mod_number" select="$mod_number"/>
593 <xsl:with-param name="identifier" select="$identifier"/>
594 </xsl:apply-templates>
595 <xsl:apply-templates select="//EXTERNALLINK">
596 <xsl:with-param name="mod_number" select="$mod_number"/>
597 </xsl:apply-templates>
598 </xsl:for-each>
599 </xsl:for-each>
600 </MODULES>
601 </xsl:template>
603 <!-- ############# Forum conversion ################# -->
605 <xsl:template match="FORUM">
606 <xsl:param name="mod_number">1. </xsl:param>
607 <MOD>
608 <ID><xsl:value-of select="$mod_number"/></ID>
609 <MODTYPE>forum</MODTYPE>
610 <TYPE>general</TYPE>
611 <NAME>
612 <xsl:value-of select="TITLE/@value"/>
613 </NAME>
614 <INTRO>
615 <xsl:value-of select="DESCRIPTION/TEXT"/>
616 </INTRO>
617 <OPEN>2</OPEN>
618 <ASSESSED>0</ASSESSED>
619 <ASSESSPUBLIC>0</ASSESSPUBLIC>
620 <ASSESSTIMESTART>0</ASSESSTIMESTART>
621 <ASSESSTIMEFINISH>0</ASSESSTIMEFINISH>
622 <MAXBYTES>0</MAXBYTES>
623 <SCALE>0</SCALE>
624 <FORCESUBSCRIBE>0</FORCESUBSCRIBE>
625 <RSSTYPE>0</RSSTYPE>
626 <RSSARTICLES>0</RSSARTICLES>
627 <TIMEMODIFIED></TIMEMODIFIED>
628 <!--
629 <DISCUSSIONS>
630 <xsl:for-each select="MESSAGETHREADS/MSG">
631 <xsl:variable name="discussion_id" select="position()"/>
632 <DISCUSSION>
633 <ID>
634 <xsl:value-of select="$mod_number"/>0<xsl:value-of select="$discussion_id"/>
635 </ID>
636 <NAME>
637 <xsl:value-of select="TITLE/@value"/>
638 </NAME>
639 <FIRSTPOST>2</FIRSTPOST>
640 <USERID>1</USERID>
641 <GROUPID>-1</GROUPID>
642 <ASSESSED>1</ASSESSED>
643 <TIMEMODIFIED>1094748430</TIMEMODIFIED>
644 <USERMODIFIED>1</USERMODIFIED>
645 <POSTS>
646 <xsl:call-template name="MSG">
647 <xsl:with-param name="parent" select="0"/>
648 <xsl:with-param name="post_id">
649 <xsl:value-of select="$mod_number"/>0<xsl:value-of select="$discussion_id"/>0<xsl:value-of select="position()"/>
650 </xsl:with-param>
651 </xsl:call-template>
652 </POSTS>
653 </DISCUSSION>
654 </xsl:for-each>
655 </DISCUSSIONS>
657 </MOD>
658 </xsl:template>
660 <xsl:template name="MSG" match="MSG">
661 <xsl:param name="parent" select="1"/>
662 <xsl:param name="post_id" select="1"/>
663 <POST>
664 <ID><xsl:value-of select="$post_id"/></ID>
665 <PARENT> <xsl:value-of select="$parent"/></PARENT>
666 <USERID>1</USERID>
667 <CREATED>1094748430</CREATED>
668 <MODIFIED>1094748430</MODIFIED>
669 <MAILED>1</MAILED>
670 <SUBJECT><xsl:value-of select="TITLE/@value"/></SUBJECT>
671 <MESSAGE><xsl:value-of select="MESSAGETEXT"/></MESSAGE>
672 <FORMAT>1</FORMAT>
673 <ATTACHMENT></ATTACHMENT>
674 <TOTALSCORE>0</TOTALSCORE>
675 </POST>
677 <xsl:for-each select="MSG">
678 <xsl:call-template name="MSG">
679 <xsl:with-param name="parent" select="$post_id"/>
680 <xsl:with-param name="post_id">
681 <xsl:value-of select="$post_id"/>0<xsl:value-of select="position()"/>
682 </xsl:with-param>
683 </xsl:call-template>
684 </xsl:for-each>
685 </xsl:template>
686 </xsl:stylesheet>