Imported Upstream version 3.3
Samuel Thibault
14 years ago
141 | 141 | |
142 | 142 | <target name="dist" depends="compile,copy-resources" description="build platform-neutral distribution files"> |
143 | 143 | <mkdir dir="${dist-pc}/lib"/> |
144 | <jar jarfile="${dist-pc}/lib/Jaxe.jar" basedir="${build.classes}"> | |
144 | <jar destfile="${dist-pc}/lib/Jaxe.jar" basedir="${build.classes}"> | |
145 | 145 | <manifest> |
146 | 146 | <attribute name="Built-By" value="${user.name}"/> |
147 | 147 | <attribute name="Main-Class" value="jaxe.Jaxe"/> |
171 | 171 | <mkdir dir="${dist-mac}/Jaxe.app/Contents/Resources/ru.lproj"/> |
172 | 172 | <mkdir dir="${dist-mac}/Jaxe.app/Contents/Resources/es.lproj"/> |
173 | 173 | <mkdir dir="${dist-mac}/Jaxe.app/Contents/Resources/Java"/> |
174 | <jar jarfile="${dist-mac}/Jaxe.app/Contents/Resources/Java/Jaxe.jar" basedir="${build.classes}"/> | |
174 | <jar destfile="${dist-mac}/Jaxe.app/Contents/Resources/Java/Jaxe.jar" basedir="${build.classes}"/> | |
175 | 175 | <copy todir="${dist-mac}/Jaxe.app/Contents/Resources/Java"> |
176 | 176 | <fileset dir="source/lib"/> |
177 | 177 | </copy> |
664 | 664 | <DOCUMENTATION> |
665 | 665 | Titre et documentation pour une action d'export |
666 | 666 | </DOCUMENTATION> |
667 | <STRINGS_ATTRIBUT attribut="export"> | |
668 | <TITRE>export</TITRE> | |
669 | <DOCUMENTATION> | |
670 | Le nom de l'export | |
671 | </DOCUMENTATION> | |
672 | </STRINGS_ATTRIBUT> | |
667 | 673 | </STRINGS_ELEMENT> |
668 | 674 | </STRINGS> |
669 | 675 | |
1189 | 1195 | <DOCUMENTATION> |
1190 | 1196 | Title and documentation for an export action |
1191 | 1197 | </DOCUMENTATION> |
1198 | <STRINGS_ATTRIBUT attribut="export"> | |
1199 | <TITRE>export</TITRE> | |
1200 | <DOCUMENTATION> | |
1201 | The export name | |
1202 | </DOCUMENTATION> | |
1203 | </STRINGS_ATTRIBUT> | |
1204 | </STRINGS_ELEMENT> | |
1205 | </STRINGS> | |
1206 | ||
1207 | ||
1208 | ||
1209 | <STRINGS langue="ru"> | |
1210 | <DESCRIPTION_CONFIG>Конфигурация Jaxe</DESCRIPTION_CONFIG> | |
1211 | ||
1212 | <STRINGS_MENU menu="Langage"> | |
1213 | <TITRE>Язык</TITRE> | |
1214 | <DOCUMENTATION> | |
1215 | Информация о языке XML, который определяется в данном конфигурационном файле. | |
1216 | </DOCUMENTATION> | |
1217 | </STRINGS_MENU> | |
1218 | <STRINGS_MENU menu="Schéma simple"> | |
1219 | <TITRE>Простая schema</TITRE> | |
1220 | <DOCUMENTATION> | |
1221 | Определение элементов, когда вместо внешнего файла XML schema | |
1222 | используется встроенная упрощенная версия (для серьезных задач | |
1223 | лучше использовать W3C стандарт) | |
1224 | </DOCUMENTATION> | |
1225 | </STRINGS_MENU> | |
1226 | <STRINGS_MENU menu="Enregistrement"> | |
1227 | <TITRE>Сохранение</TITRE> | |
1228 | <DOCUMENTATION> | |
1229 | Опции, определяющие, как будет сохраняться документ. | |
1230 | </DOCUMENTATION> | |
1231 | </STRINGS_MENU> | |
1232 | <STRINGS_MENU menu="Menus"> | |
1233 | <TITRE>Меню</TITRE> | |
1234 | <DOCUMENTATION> | |
1235 | Во время редактирования файла меню элементов стрится динамически | |
1236 | на основании настроек в файле конфигурации. | |
1237 | </DOCUMENTATION> | |
1238 | </STRINGS_MENU> | |
1239 | <STRINGS_MENU menu="Affichage"> | |
1240 | <TITRE>Вид элементов</TITRE> | |
1241 | <DOCUMENTATION> | |
1242 | Здесь возможно настроить внешний вид элементов в самом окне текста. | |
1243 | </DOCUMENTATION> | |
1244 | </STRINGS_MENU> | |
1245 | <STRINGS_MENU menu="Exports"> | |
1246 | <TITRE>Экспорт</TITRE> | |
1247 | <DOCUMENTATION> | |
1248 | Пункты, определяющие экспорт документа, используя преобразование XSLT. | |
1249 | </DOCUMENTATION> | |
1250 | </STRINGS_MENU> | |
1251 | <STRINGS_MENU menu="Textes"> | |
1252 | <TITRE>Описания</TITRE> | |
1253 | <DOCUMENTATION> | |
1254 | Описания используются, чтобы показывать пользователю документацию, | |
1255 | называния меню и элементов в локализованном виде. | |
1256 | </DOCUMENTATION> | |
1257 | </STRINGS_MENU> | |
1258 | ||
1259 | <STRINGS_ELEMENT element="CONFIG_JAXE"> | |
1260 | <TITRE>Конфигурация Jaxe</TITRE> | |
1261 | <DOCUMENTATION> | |
1262 | Корень конфигурации | |
1263 | </DOCUMENTATION> | |
1264 | </STRINGS_ELEMENT> | |
1265 | <STRINGS_ELEMENT element="LANGAGE"> | |
1266 | <TITRE>Язык</TITRE> | |
1267 | <DOCUMENTATION> | |
1268 | Информация о языке XML | |
1269 | </DOCUMENTATION> | |
1270 | </STRINGS_ELEMENT> | |
1271 | <STRINGS_ELEMENT element="FICHIER_SCHEMA"> | |
1272 | <TITRE>Файл W3C schema</TITRE> | |
1273 | <DOCUMENTATION> | |
1274 | Внешний файл W3C schema, определяющий структуру языка XML. | |
1275 | </DOCUMENTATION> | |
1276 | <STRINGS_ATTRIBUT attribut="nom"> | |
1277 | <TITRE>Имя/путь</TITRE> | |
1278 | <DOCUMENTATION> | |
1279 | Путь до файла схемы относительного файла конфигурации. | |
1280 | </DOCUMENTATION> | |
1281 | </STRINGS_ATTRIBUT> | |
1282 | </STRINGS_ELEMENT> | |
1283 | <STRINGS_ELEMENT element="SCHEMA_SIMPLE"> | |
1284 | <TITRE>Простая schema</TITRE> | |
1285 | <DOCUMENTATION> | |
1286 | Очень упрощенная XML schema. Является альтернативой, когда нет | |
1287 | необходимости в сложности W3C schema. | |
1288 | </DOCUMENTATION> | |
1289 | </STRINGS_ELEMENT> | |
1290 | <STRINGS_ELEMENT element="ELEMENT"> | |
1291 | <TITRE>Элемент</TITRE> | |
1292 | <DOCUMENTATION> | |
1293 | Определение элемента XML | |
1294 | </DOCUMENTATION> | |
1295 | <STRINGS_ATTRIBUT attribut="nom"> | |
1296 | <TITRE>Имя</TITRE> | |
1297 | <DOCUMENTATION> | |
1298 | Имя элемента | |
1299 | </DOCUMENTATION> | |
1300 | </STRINGS_ATTRIBUT> | |
1301 | <STRINGS_ATTRIBUT attribut="texte"> | |
1302 | <TITRE>Текст</TITRE> | |
1303 | <DOCUMENTATION> | |
1304 | Определяет может элемент содержать текст или нет | |
1305 | </DOCUMENTATION> | |
1306 | <TITRE_VALEUR valeur="interdit">Запрещено</TITRE_VALEUR> | |
1307 | <TITRE_VALEUR valeur="autorise">Разрешено</TITRE_VALEUR> | |
1308 | </STRINGS_ATTRIBUT> | |
1309 | </STRINGS_ELEMENT> | |
1310 | <STRINGS_ELEMENT element="SOUS-ELEMENT"> | |
1311 | <TITRE>Подэлемент</TITRE> | |
1312 | <DOCUMENTATION> | |
1313 | Определяет возможные подэлементы | |
1314 | </DOCUMENTATION> | |
1315 | <STRINGS_ATTRIBUT attribut="element"> | |
1316 | <TITRE>Элемент</TITRE> | |
1317 | <DOCUMENTATION> | |
1318 | Имя подэлемента. Сам элемент должен быть определен отдельно. | |
1319 | </DOCUMENTATION> | |
1320 | </STRINGS_ATTRIBUT> | |
1321 | </STRINGS_ELEMENT> | |
1322 | <STRINGS_ELEMENT element="SOUS-ENSEMBLE"> | |
1323 | <TITRE>Поднабор</TITRE> | |
1324 | <DOCUMENTATION> | |
1325 | Определяет множество возможных подэлементов. | |
1326 | </DOCUMENTATION> | |
1327 | <STRINGS_ATTRIBUT attribut="ensemble"> | |
1328 | <TITRE>Набор</TITRE> | |
1329 | <DOCUMENTATION> | |
1330 | Имя набора подэлементов. Сам набор должен быть определен отдельно. | |
1331 | </DOCUMENTATION> | |
1332 | </STRINGS_ATTRIBUT> | |
1333 | </STRINGS_ELEMENT> | |
1334 | <STRINGS_ELEMENT element="ATTRIBUT"> | |
1335 | <TITRE>Атрибут</TITRE> | |
1336 | <DOCUMENTATION> | |
1337 | Определение атрибута элемента | |
1338 | </DOCUMENTATION> | |
1339 | <STRINGS_ATTRIBUT attribut="nom"> | |
1340 | <TITRE>Имя</TITRE> | |
1341 | <DOCUMENTATION> | |
1342 | Имя атрибута | |
1343 | </DOCUMENTATION> | |
1344 | </STRINGS_ATTRIBUT> | |
1345 | <STRINGS_ATTRIBUT attribut="presence"> | |
1346 | <TITRE>Обязательность</TITRE> | |
1347 | <TITRE_VALEUR valeur="obligatoire">Требуется</TITRE_VALEUR> | |
1348 | <TITRE_VALEUR valeur="optionelle">Опционально</TITRE_VALEUR> | |
1349 | </STRINGS_ATTRIBUT> | |
1350 | </STRINGS_ELEMENT> | |
1351 | <STRINGS_ELEMENT element="VALEUR"> | |
1352 | <TITRE>Значение</TITRE> | |
1353 | <DOCUMENTATION> | |
1354 | Возможное значение | |
1355 | </DOCUMENTATION> | |
1356 | </STRINGS_ELEMENT> | |
1357 | <STRINGS_ELEMENT element="ENSEMBLE"> | |
1358 | <TITRE>Набор</TITRE> | |
1359 | <DOCUMENTATION> | |
1360 | Набор элементов | |
1361 | </DOCUMENTATION> | |
1362 | <STRINGS_ATTRIBUT attribut="nom"> | |
1363 | <TITRE>Имя</TITRE> | |
1364 | <DOCUMENTATION> | |
1365 | Имя набора | |
1366 | </DOCUMENTATION> | |
1367 | </STRINGS_ATTRIBUT> | |
1368 | </STRINGS_ELEMENT> | |
1369 | <STRINGS_ELEMENT element="RACINE"> | |
1370 | <TITRE>Кореневой элемент</TITRE> | |
1371 | <DOCUMENTATION> | |
1372 | Корневой элемент для настраиваемого языка XML. | |
1373 | </DOCUMENTATION> | |
1374 | <STRINGS_ATTRIBUT attribut="element"> | |
1375 | <TITRE>Элемент</TITRE> | |
1376 | <DOCUMENTATION> | |
1377 | Имя корневого элемента | |
1378 | </DOCUMENTATION> | |
1379 | </STRINGS_ATTRIBUT> | |
1380 | </STRINGS_ELEMENT> | |
1381 | <STRINGS_ELEMENT element="AUTRE_CONFIG"> | |
1382 | <TITRE>Доп. конфиги</TITRE> | |
1383 | <DOCUMENTATION> | |
1384 | Дополнительные конфигурационные файлы, которые Jaxe будет | |
1385 | использовать вместе с этим. | |
1386 | </DOCUMENTATION> | |
1387 | <STRINGS_ATTRIBUT attribut="nom"> | |
1388 | <TITRE>Имя/путь</TITRE> | |
1389 | <DOCUMENTATION> | |
1390 | Путь к конфигурационному файлу относительно файла конфигурации. | |
1391 | </DOCUMENTATION> | |
1392 | </STRINGS_ATTRIBUT> | |
1393 | </STRINGS_ELEMENT> | |
1394 | <STRINGS_ELEMENT element="ENREGISTREMENT"> | |
1395 | <TITRE>Опции сохранения</TITRE> | |
1396 | <DOCUMENTATION> | |
1397 | Опции, определяющие, как будет сохраняться XML документ в соответствии с | |
1398 | этим файлом конфигурации. | |
1399 | </DOCUMENTATION> | |
1400 | </STRINGS_ELEMENT> | |
1401 | <STRINGS_ELEMENT element="ENCODAGE"> | |
1402 | <TITRE>Кодировка</TITRE> | |
1403 | <DOCUMENTATION> | |
1404 | Кодировка для новых документов. По умолчанию используется ISO-8859-1. | |
1405 | </DOCUMENTATION> | |
1406 | </STRINGS_ELEMENT> | |
1407 | <STRINGS_ELEMENT element="DOCTYPE"> | |
1408 | <TITRE>DOCTYPE документа</TITRE> | |
1409 | <DOCUMENTATION> | |
1410 | Определение DOCTYPE для документов, сформированных с помощью данного | |
1411 | файла конфигурации. | |
1412 | </DOCUMENTATION> | |
1413 | <STRINGS_ATTRIBUT attribut="publicId"> | |
1414 | <TITRE>publicId</TITRE> | |
1415 | </STRINGS_ATTRIBUT> | |
1416 | <STRINGS_ATTRIBUT attribut="systemId"> | |
1417 | <TITRE>systemId</TITRE> | |
1418 | </STRINGS_ATTRIBUT> | |
1419 | </STRINGS_ELEMENT> | |
1420 | <STRINGS_ELEMENT element="PREFIXE_ESPACE"> | |
1421 | <TITRE>Префикс пространства имен</TITRE> | |
1422 | <DOCUMENTATION> | |
1423 | Определить префикс пространства имен, который будет присвоен ко всем файлам, | |
1424 | сформированным с помощью данного файла конфигурации. | |
1425 | </DOCUMENTATION> | |
1426 | <STRINGS_ATTRIBUT attribut="prefixe"> | |
1427 | <TITRE>Префикс</TITRE> | |
1428 | <DOCUMENTATION> | |
1429 | Prefix to use | |
1430 | </DOCUMENTATION> | |
1431 | </STRINGS_ATTRIBUT> | |
1432 | <STRINGS_ATTRIBUT attribut="uri"> | |
1433 | <TITRE>uri</TITRE> | |
1434 | <DOCUMENTATION> | |
1435 | The corresponding namespace | |
1436 | </DOCUMENTATION> | |
1437 | </STRINGS_ATTRIBUT> | |
1438 | </STRINGS_ELEMENT> | |
1439 | <STRINGS_ELEMENT element="MENUS"> | |
1440 | <TITRE>Опции меню</TITRE> | |
1441 | <DOCUMENTATION> | |
1442 | Определение опций для меню, с помощью которого пользователь сможет вставлять | |
1443 | элементы в формируемый документ и вызывать кастомизированные функции. | |
1444 | </DOCUMENTATION> | |
1445 | </STRINGS_ELEMENT> | |
1446 | <STRINGS_ELEMENT element="MENU"> | |
1447 | <TITRE>Доб. элемент</TITRE> | |
1448 | <DOCUMENTATION> | |
1449 | Добавление нового элемента и других узлов. | |
1450 | </DOCUMENTATION> | |
1451 | <STRINGS_ATTRIBUT attribut="nom"> | |
1452 | <TITRE>Имя</TITRE> | |
1453 | <DOCUMENTATION> | |
1454 | Menu name, used to refer to the menu when a title is defined. | |
1455 | The name is used as a title if no title is defined. | |
1456 | Beware to avoid using element names, to avoid ambiguities in the menu titles. | |
1457 | </DOCUMENTATION> | |
1458 | </STRINGS_ATTRIBUT> | |
1459 | </STRINGS_ELEMENT> | |
1460 | <STRINGS_ELEMENT element="MENU_INSERTION"> | |
1461 | <TITRE>Insertion menu</TITRE> | |
1462 | <DOCUMENTATION> | |
1463 | Menu to insert a node into the document (XML elements, | |
1464 | processing instructions, or XML comments) | |
1465 | </DOCUMENTATION> | |
1466 | <STRINGS_ATTRIBUT attribut="nom"> | |
1467 | <TITRE>Имя</TITRE> | |
1468 | <DOCUMENTATION> | |
1469 | The name of the node. Is also used as a reference to define a title. | |
1470 | The name is used as a title if no title is defined. | |
1471 | </DOCUMENTATION> | |
1472 | </STRINGS_ATTRIBUT> | |
1473 | <STRINGS_ATTRIBUT attribut="type_noeud"> | |
1474 | <TITRE>Тип узла</TITRE> | |
1475 | <DOCUMENTATION> | |
1476 | Тип узла XML | |
1477 | </DOCUMENTATION> | |
1478 | <TITRE_VALEUR valeur="element">Элемент</TITRE_VALEUR> | |
1479 | <TITRE_VALEUR valeur="instruction">Инструкция</TITRE_VALEUR> | |
1480 | <TITRE_VALEUR valeur="commentaire">Комментарий</TITRE_VALEUR> | |
1481 | </STRINGS_ATTRIBUT> | |
1482 | <STRINGS_ATTRIBUT attribut="raccourci"> | |
1483 | <TITRE>Комбинация клавиш</TITRE> | |
1484 | <DOCUMENTATION> | |
1485 | Клавишная комбинация быстрого вызова, приводящая к вызову этого пункта меню. | |
1486 | </DOCUMENTATION> | |
1487 | </STRINGS_ATTRIBUT> | |
1488 | </STRINGS_ELEMENT> | |
1489 | <STRINGS_ELEMENT element="MENU_FONCTION"> | |
1490 | <TITRE>Доб. вызов функции</TITRE> | |
1491 | <DOCUMENTATION> | |
1492 | Добавление пункта меню, при выборе которого будет вызываться функция, | |
1493 | определенная как плагин. | |
1494 | </DOCUMENTATION> | |
1495 | <STRINGS_ATTRIBUT attribut="nom"> | |
1496 | <TITRE>Имя</TITRE> | |
1497 | <DOCUMENTATION> | |
1498 | The function name. Used as a reference to define a title. | |
1499 | The name is used as a title if no title is defined. | |
1500 | Beware to avoid using element names, to avoid ambiguities in the menu titles. | |
1501 | </DOCUMENTATION> | |
1502 | </STRINGS_ATTRIBUT> | |
1503 | <STRINGS_ATTRIBUT attribut="classe"> | |
1504 | <TITRE>Класс</TITRE> | |
1505 | <DOCUMENTATION> | |
1506 | Java класс функции | |
1507 | </DOCUMENTATION> | |
1508 | </STRINGS_ATTRIBUT> | |
1509 | <STRINGS_ATTRIBUT attribut="raccourci"> | |
1510 | <TITRE>Комбинация клавиш</TITRE> | |
1511 | <DOCUMENTATION> | |
1512 | Клавишная комбинация быстрого вызова, приводящая к вызову этого пункта меню. | |
1513 | </DOCUMENTATION> | |
1514 | </STRINGS_ATTRIBUT> | |
1515 | </STRINGS_ELEMENT> | |
1516 | <STRINGS_ELEMENT element="PARAMETRE"> | |
1517 | <TITRE>Параметр</TITRE> | |
1518 | <DOCUMENTATION> | |
1519 | Параметр в виде пары имя/значение | |
1520 | </DOCUMENTATION> | |
1521 | <STRINGS_ATTRIBUT attribut="nom"> | |
1522 | <TITRE>Имя</TITRE> | |
1523 | </STRINGS_ATTRIBUT> | |
1524 | <STRINGS_ATTRIBUT attribut="valeur"> | |
1525 | <TITRE>Значение</TITRE> | |
1526 | </STRINGS_ATTRIBUT> | |
1527 | </STRINGS_ELEMENT> | |
1528 | <STRINGS_ELEMENT element="SEPARATEUR"> | |
1529 | <TITRE>Разделитель</TITRE> | |
1530 | <DOCUMENTATION> | |
1531 | С помощью разделителя можно добавить черту между пунктами меню. | |
1532 | </DOCUMENTATION> | |
1533 | </STRINGS_ELEMENT> | |
1534 | <STRINGS_ELEMENT element="AFFICHAGE_NOEUDS"> | |
1535 | <TITRE>Опции вида</TITRE> | |
1536 | <DOCUMENTATION> | |
1537 | Опции, которые будут определять, как пользователь увидит элементы | |
1538 | во время редактирования документа. | |
1539 | </DOCUMENTATION> | |
1540 | </STRINGS_ELEMENT> | |
1541 | <STRINGS_ELEMENT element="AFFICHAGE_ELEMENT"> | |
1542 | <TITRE>Вид элемента</TITRE> | |
1543 | <DOCUMENTATION> | |
1544 | Определяет, как будет выглядеть XML элемент в Jaxe. | |
1545 | Пожалуйста обратитесь к документации, чтобы понять, с какими типами | |
1546 | какие параметры могут применяться. | |
1547 | </DOCUMENTATION> | |
1548 | <STRINGS_ATTRIBUT attribut="element"> | |
1549 | <TITRE>Имя</TITRE> | |
1550 | <DOCUMENTATION> | |
1551 | Имя элемента. Сам элемент должен быть определен в схеме. | |
1552 | </DOCUMENTATION> | |
1553 | </STRINGS_ATTRIBUT> | |
1554 | <STRINGS_ATTRIBUT attribut="type"> | |
1555 | <TITRE>Тип</TITRE> | |
1556 | <DOCUMENTATION> | |
1557 | Определяет тип элемента. | |
1558 | Для ряда типов необходимо указать параметры. Обратитесь пожалуйста | |
1559 | к документации, чтобы понять, какие параметры, какому типу соответствуют. | |
1560 | </DOCUMENTATION> | |
1561 | <TITRE_VALEUR valeur="division">division</TITRE_VALEUR> | |
1562 | <TITRE_VALEUR valeur="zone">area</TITRE_VALEUR> | |
1563 | <TITRE_VALEUR valeur="string">string</TITRE_VALEUR> | |
1564 | <TITRE_VALEUR valeur="vide">empty</TITRE_VALEUR> | |
1565 | <TITRE_VALEUR valeur="tableau">table</TITRE_VALEUR> | |
1566 | <TITRE_VALEUR valeur="tabletexte">text table</TITRE_VALEUR> | |
1567 | <TITRE_VALEUR valeur="typesimple">simple type</TITRE_VALEUR> | |
1568 | <TITRE_VALEUR valeur="style">style</TITRE_VALEUR> | |
1569 | <TITRE_VALEUR valeur="fichier">file</TITRE_VALEUR> | |
1570 | <TITRE_VALEUR valeur="symbole">symbol</TITRE_VALEUR> | |
1571 | <TITRE_VALEUR valeur="liste">list</TITRE_VALEUR> | |
1572 | <TITRE_VALEUR valeur="item">item</TITRE_VALEUR> | |
1573 | <TITRE_VALEUR valeur="equation">equation</TITRE_VALEUR> | |
1574 | <TITRE_VALEUR valeur="formulaire">form</TITRE_VALEUR> | |
1575 | <TITRE_VALEUR valeur="plugin">plugin</TITRE_VALEUR> | |
1576 | </STRINGS_ATTRIBUT> | |
1577 | </STRINGS_ELEMENT> | |
1578 | <STRINGS_ELEMENT element="VALEUR_SUGGEREE"> | |
1579 | <TITRE>Значения по-умолчанию</TITRE> | |
1580 | <DOCUMENTATION> | |
1581 | То значение из всех возможных, которое будет первым предложено пользователю. | |
1582 | </DOCUMENTATION> | |
1583 | </STRINGS_ELEMENT> | |
1584 | <STRINGS_ELEMENT element="AFFICHAGE_ATTRIBUT"> | |
1585 | <TITRE>Вид атрибута</TITRE> | |
1586 | <DOCUMENTATION> | |
1587 | Определяет, как будет выглядеть атрибут. | |
1588 | Currently, only supports attribute values that can be suggested when | |
1589 | the values are not fixed by the schema. | |
1590 | </DOCUMENTATION> | |
1591 | <STRINGS_ATTRIBUT attribut="attribut"> | |
1592 | <TITRE>Атрибут</TITRE> | |
1593 | <DOCUMENTATION> | |
1594 | Имя атрибута (должно быть определено в схеме). | |
1595 | </DOCUMENTATION> | |
1596 | </STRINGS_ATTRIBUT> | |
1597 | </STRINGS_ELEMENT> | |
1598 | <STRINGS_ELEMENT element="PLUGIN_INSTRUCTION"> | |
1599 | <TITRE>Jaxe Plugin</TITRE> | |
1600 | <DOCUMENTATION> | |
1601 | Иногда видов стандартных элементов, поставляемых Jaxe-ом оказывается | |
1602 | недостаточно. В такой ситуации у разработчика есть возможность создать | |
1603 | свои особые виды в форме класса, отнаследованного от "jaxe.Elements". | |
1604 | Подключается такой вид с помощью данной инструкции. | |
1605 | </DOCUMENTATION> | |
1606 | <STRINGS_ATTRIBUT attribut="cible"> | |
1607 | <TITRE>target</TITRE> | |
1608 | <DOCUMENTATION> | |
1609 | Processing instruction target (name of the node) | |
1610 | </DOCUMENTATION> | |
1611 | </STRINGS_ATTRIBUT> | |
1612 | </STRINGS_ELEMENT> | |
1613 | <STRINGS_ELEMENT element="PLUGIN_COMMENTAIRE"> | |
1614 | <TITRE>XML comment plugin</TITRE> | |
1615 | <DOCUMENTATION> | |
1616 | Plugin to use to display XML comments | |
1617 | </DOCUMENTATION> | |
1618 | </STRINGS_ELEMENT> | |
1619 | <STRINGS_ELEMENT element="EXPORTS"> | |
1620 | <TITRE>Опции экспорта</TITRE> | |
1621 | <DOCUMENTATION> | |
1622 | A set of export methods, to XML or HTML documents, | |
1623 | using XSLT transforms. | |
1624 | </DOCUMENTATION> | |
1625 | </STRINGS_ELEMENT> | |
1626 | <STRINGS_ELEMENT element="EXPORT"> | |
1627 | <TITRE>Export</TITRE> | |
1628 | <DOCUMENTATION> | |
1629 | Informations to display an HTML preview or export to another XML language, | |
1630 | with a list of successive XSLT transforms. The output can also be a PDF file | |
1631 | if XSL-FO is used in the last XSLT transform. | |
1632 | </DOCUMENTATION> | |
1633 | <STRINGS_ATTRIBUT attribut="nom"> | |
1634 | <TITRE>name</TITRE> | |
1635 | <DOCUMENTATION> | |
1636 | Export name. Used as a title if no title is defined. | |
1637 | </DOCUMENTATION> | |
1638 | </STRINGS_ATTRIBUT> | |
1639 | <STRINGS_ATTRIBUT attribut="sortie"> | |
1640 | <TITRE>output</TITRE> | |
1641 | </STRINGS_ATTRIBUT> | |
1642 | </STRINGS_ELEMENT> | |
1643 | <STRINGS_ELEMENT element="FICHIER_XSL"> | |
1644 | <TITRE>Файл XSL</TITRE> | |
1645 | <DOCUMENTATION> | |
1646 | Файл XSL преобразования. | |
1647 | </DOCUMENTATION> | |
1648 | <STRINGS_ATTRIBUT attribut="nom"> | |
1649 | <TITRE>Имя/путь</TITRE> | |
1650 | <DOCUMENTATION> | |
1651 | Путь до XSL файла, начиная от файла конфигурации. | |
1652 | </DOCUMENTATION> | |
1653 | </STRINGS_ATTRIBUT> | |
1654 | </STRINGS_ELEMENT> | |
1655 | <STRINGS_ELEMENT element="STRINGS"> | |
1656 | <TITRE>Опции описания</TITRE> | |
1657 | <DOCUMENTATION> | |
1658 | Все локализованные описания меню, заголовков, подсказок и т.п. | |
1659 | </DOCUMENTATION> | |
1660 | <STRINGS_ATTRIBUT attribut="langue"> | |
1661 | <TITRE>Язык</TITRE> | |
1662 | <DOCUMENTATION> | |
1663 | Код языка для описаний в формате ISO-639 (2 символа в нижнем регистре) | |
1664 | </DOCUMENTATION> | |
1665 | </STRINGS_ATTRIBUT> | |
1666 | <STRINGS_ATTRIBUT attribut="pays"> | |
1667 | <TITRE>Страна</TITRE> | |
1668 | <DOCUMENTATION> | |
1669 | Код страны в формате ISO-3166 (2 символа в вернем регистре) | |
1670 | </DOCUMENTATION> | |
1671 | </STRINGS_ATTRIBUT> | |
1672 | </STRINGS_ELEMENT> | |
1673 | <STRINGS_ELEMENT element="DESCRIPTION_CONFIG"> | |
1674 | <TITRE>Описание файла настроек</TITRE> | |
1675 | <DOCUMENTATION> | |
1676 | Краткое описание, на которое будет ориентироваться пользователь, при | |
1677 | выборе настроек для нового документа. | |
1678 | </DOCUMENTATION> | |
1679 | </STRINGS_ELEMENT> | |
1680 | <STRINGS_ELEMENT element="STRINGS_MENU"> | |
1681 | <TITRE>Описание меню</TITRE> | |
1682 | <DOCUMENTATION> | |
1683 | Заголовок и документация для меню. Если таковые не определены, то в | |
1684 | качестве заголовка и документации будут использованы соответствующие | |
1685 | из описания элемента. | |
1686 | </DOCUMENTATION> | |
1687 | <STRINGS_ATTRIBUT attribut="menu"> | |
1688 | <TITRE>Меню</TITRE> | |
1689 | <DOCUMENTATION> | |
1690 | Имя меню | |
1691 | </DOCUMENTATION> | |
1692 | </STRINGS_ATTRIBUT> | |
1693 | </STRINGS_ELEMENT> | |
1694 | <STRINGS_ELEMENT element="TITRE"> | |
1695 | <TITRE>Заголовок</TITRE> | |
1696 | <DOCUMENTATION> | |
1697 | Title | |
1698 | </DOCUMENTATION> | |
1699 | </STRINGS_ELEMENT> | |
1700 | <STRINGS_ELEMENT element="DOCUMENTATION"> | |
1701 | <TITRE>Документация</TITRE> | |
1702 | <DOCUMENTATION> | |
1703 | Небольшое текстовое описание, которое будет использоваться | |
1704 | в качестве online подсказки. | |
1705 | </DOCUMENTATION> | |
1706 | </STRINGS_ELEMENT> | |
1707 | <STRINGS_ELEMENT element="STRINGS_ELEMENT"> | |
1708 | <TITRE>Описание элемента</TITRE> | |
1709 | <DOCUMENTATION> | |
1710 | Заголовок и документация для элемента. Это описание используется как для | |
1711 | элемента, так и для меню, в случае, если в меню оно не переопределено. | |
1712 | </DOCUMENTATION> | |
1713 | <STRINGS_ATTRIBUT attribut="element"> | |
1714 | <TITRE>Элемент</TITRE> | |
1715 | <DOCUMENTATION> | |
1716 | Имя элемента | |
1717 | </DOCUMENTATION> | |
1718 | </STRINGS_ATTRIBUT> | |
1719 | </STRINGS_ELEMENT> | |
1720 | <STRINGS_ELEMENT element="STRINGS_ATTRIBUT"> | |
1721 | <TITRE>Описание атрибута</TITRE> | |
1722 | <DOCUMENTATION> | |
1723 | Title and documentation for an attribute. | |
1724 | Titles can also be defined for attribute values. | |
1725 | </DOCUMENTATION> | |
1726 | <STRINGS_ATTRIBUT attribut="attribut"> | |
1727 | <TITRE>Атрибут</TITRE> | |
1728 | <DOCUMENTATION> | |
1729 | Имя атрибута | |
1730 | </DOCUMENTATION> | |
1731 | </STRINGS_ATTRIBUT> | |
1732 | </STRINGS_ELEMENT> | |
1733 | <STRINGS_ELEMENT element="TITRE_VALEUR"> | |
1734 | <TITRE>Текст значения</TITRE> | |
1735 | <DOCUMENTATION> | |
1736 | Текст, который будет виден для соответствующего значения атрибута или элемента | |
1737 | </DOCUMENTATION> | |
1738 | </STRINGS_ELEMENT> | |
1739 | <STRINGS_ELEMENT element="STRINGS_EXPORT"> | |
1740 | <TITRE>Описание экспорта</TITRE> | |
1741 | <DOCUMENTATION> | |
1742 | Заголовок и описание для действия экспорта. | |
1743 | </DOCUMENTATION> | |
1744 | <STRINGS_ATTRIBUT attribut="export"> | |
1745 | <TITRE>Экспорт</TITRE> | |
1746 | <DOCUMENTATION> | |
1747 | Имя экспорта | |
1748 | </DOCUMENTATION> | |
1749 | </STRINGS_ATTRIBUT> | |
1192 | 1750 | </STRINGS_ELEMENT> |
1193 | 1751 | </STRINGS> |
1194 | 1752 | </CONFIG_JAXE>⏎ |
7 | 7 | <!-- it features what Jaxe understands of XML schemas --> |
8 | 8 | <!-- but keeps about compatible (this simplified schema is actually a valid XML schema) --> |
9 | 9 | |
10 | <xs:schema targetNamespace="http://www.w3.org/2001/XMLSchema" version="1.0" xmlns:xs="http://www.w3.org/2001/XMLSchema" xml:lang="EN"> | |
10 | <xs:schema targetNamespace="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" version="1.0" xmlns:xs="http://www.w3.org/2001/XMLSchema" xml:lang="EN"> | |
11 | 11 | |
12 | 12 | <!-- <xs:import namespace="http://www.w3.org/XML/1998/namespace" schemaLocation="http://www.w3.org/2001/xml.xsd"> --> |
13 | 13 | <xs:import namespace="http://www.w3.org/XML/1998/namespace" schemaLocation="xml.xsd"> |
93 | 93 | </xs:complexType> |
94 | 94 | </xs:element> |
95 | 95 | |
96 | <xs:simpleType name="allNNI"> | |
97 | <xs:annotation><xs:documentation> | |
98 | for maxOccurs</xs:documentation></xs:annotation> | |
99 | <xs:union memberTypes="xs:nonNegativeInteger"> | |
100 | <xs:simpleType> | |
101 | <xs:restriction base="xs:NMTOKEN"> | |
102 | <xs:enumeration value="unbounded"/> | |
103 | </xs:restriction> | |
104 | </xs:simpleType> | |
105 | </xs:union> | |
106 | </xs:simpleType> | |
107 | ||
96 | 108 | <xs:attributeGroup name="occurs"> |
97 | 109 | <xs:annotation><xs:documentation> |
98 | 110 | for all particles</xs:documentation></xs:annotation> |
99 | 111 | <xs:attribute name="minOccurs" type="xs:nonNegativeInteger" use="optional" default="1"/> |
100 | <xs:attribute name="maxOccurs" type="xs:string" use="optional" default="1"/> | |
112 | <xs:attribute name="maxOccurs" type="xs:allNNI" use="optional" default="1"/> | |
101 | 113 | </xs:attributeGroup> |
102 | 114 | |
103 | 115 | <xs:attributeGroup name="defRef"> |
104 | 116 | <xs:annotation><xs:documentation> |
105 | 117 | for element, group and attributeGroup, |
106 | 118 | which both define and reference</xs:documentation></xs:annotation> |
107 | <xs:attribute name="name" type="xs:string"/> | |
108 | <xs:attribute name="ref" type="xs:string"/> | |
119 | <xs:attribute name="name" type="xs:NCName"/> | |
120 | <xs:attribute name="ref" type="xs:QName"/> | |
109 | 121 | </xs:attributeGroup> |
110 | 122 | |
111 | 123 | <xs:group name="typeDefParticle"> |
113 | 125 | <xs:documentation> |
114 | 126 | 'complexType' uses this</xs:documentation></xs:annotation> |
115 | 127 | <xs:choice> |
116 | <xs:element ref="xs:group"/> | |
128 | <xs:element name="group" type="xs:groupRef"/> | |
117 | 129 | <xs:element ref="xs:choice"/> |
118 | 130 | <xs:element ref="xs:sequence"/> |
119 | 131 | </xs:choice> |
120 | 132 | </xs:group> |
121 | 133 | |
122 | 134 | |
135 | <xs:group name="nestedParticle"> | |
136 | <xs:choice> | |
137 | <xs:element name="element" type="xs:localElement"/> | |
138 | <xs:element name="group" type="xs:groupRef"/> | |
139 | <xs:element ref="xs:choice"/> | |
140 | <xs:element ref="xs:sequence"/> | |
141 | <xs:element ref="xs:any"/> | |
142 | </xs:choice> | |
143 | </xs:group> | |
144 | ||
123 | 145 | <xs:group name="particle"> |
124 | 146 | <xs:choice> |
125 | <xs:element ref="xs:element"/> | |
126 | <xs:element ref="xs:group"/> | |
147 | <xs:element name="element" type="xs:localElement"/> | |
148 | <xs:element name="group" type="xs:groupRef"/> | |
127 | 149 | <xs:element ref="xs:choice"/> |
128 | 150 | <xs:element ref="xs:sequence"/> |
151 | <xs:element ref="xs:any"/> | |
129 | 152 | </xs:choice> |
130 | 153 | </xs:group> |
131 | 154 | |
155 | <xs:complexType name="attribute"> | |
156 | <xs:complexContent> | |
157 | <xs:extension base="xs:annotated"> | |
158 | <xs:sequence> | |
159 | <xs:element name="simpleType" minOccurs="0" type="xs:localSimpleType"/> | |
160 | </xs:sequence> | |
161 | <xs:attributeGroup ref="xs:defRef"/> | |
162 | <xs:attribute name="type" type="xs:QName"/> | |
163 | <xs:attribute name="use" use="optional" default="optional"> | |
164 | <xs:simpleType> | |
165 | <xs:restriction base="xs:NMTOKEN"> | |
166 | <xs:enumeration value="prohibited"/> | |
167 | <xs:enumeration value="optional"/> | |
168 | <xs:enumeration value="required"/> | |
169 | </xs:restriction> | |
170 | </xs:simpleType> | |
171 | </xs:attribute> | |
172 | <xs:attribute name="default" type="xs:string"/> | |
173 | <xs:attribute name="fixed" type="xs:string"/> | |
174 | </xs:extension> | |
175 | </xs:complexContent> | |
176 | </xs:complexType> | |
177 | ||
178 | <xs:complexType name="topLevelAttribute"> | |
179 | <xs:complexContent> | |
180 | <xs:restriction base="xs:attribute"> | |
181 | <xs:sequence> | |
182 | <xs:element ref="xs:annotation" minOccurs="0"/> | |
183 | <xs:element name="simpleType" minOccurs="0" type="xs:localSimpleType"/> | |
184 | </xs:sequence> | |
185 | <xs:attribute name="ref" use="prohibited"/> | |
186 | <xs:attribute name="use" use="prohibited"/> | |
187 | <xs:attribute name="name" use="required" type="xs:NCName"/> | |
188 | </xs:restriction> | |
189 | </xs:complexContent> | |
190 | </xs:complexType> | |
191 | ||
132 | 192 | <xs:group name="attrDecls"> |
133 | 193 | <xs:sequence> |
134 | 194 | <xs:choice minOccurs="0" maxOccurs="unbounded"> |
135 | <xs:element ref="xs:attribute"/> | |
136 | <xs:element ref="xs:attributeGroup"/> | |
195 | <xs:element name="attribute" type="xs:attribute"/> | |
196 | <xs:element name="attributeGroup" type="xs:attributeGroupRef"/> | |
137 | 197 | </xs:choice> |
138 | 198 | </xs:sequence> |
139 | 199 | </xs:group> |
149 | 209 | </xs:choice> |
150 | 210 | </xs:group> |
151 | 211 | |
152 | <xs:element name="extension"> | |
153 | <xs:annotation> | |
154 | <xs:documentation source="http://www.w3.org/TR/xmlschema-1/#element-complexContent"/> | |
155 | </xs:annotation> | |
156 | <xs:complexType> | |
212 | <xs:complexType name="complexType" abstract="true"> | |
213 | <xs:complexContent> | |
214 | <xs:extension base="xs:annotated"> | |
215 | <xs:group ref="xs:complexTypeModel"/> | |
216 | <xs:attribute name="name" type="xs:NCName"> | |
217 | <xs:annotation> | |
218 | <xs:documentation> | |
219 | Will be restricted to required or forbidden</xs:documentation> | |
220 | </xs:annotation> | |
221 | </xs:attribute> | |
222 | <xs:attribute name="mixed" type="xs:boolean" use="optional" default="false"> | |
223 | <xs:annotation> | |
224 | <xs:documentation> | |
225 | Not allowed if simpleContent child is chosen. | |
226 | May be overriden by setting on complexContent child.</xs:documentation> | |
227 | </xs:annotation> | |
228 | </xs:attribute> | |
229 | <xs:attribute name="abstract" type="xs:boolean" use="optional" default="false"/> | |
230 | </xs:extension> | |
231 | </xs:complexContent> | |
232 | </xs:complexType> | |
233 | ||
234 | <xs:complexType name="topLevelComplexType"> | |
235 | <xs:complexContent> | |
236 | <xs:restriction base="xs:complexType"> | |
237 | <xs:sequence> | |
238 | <xs:element ref="xs:annotation" minOccurs="0"/> | |
239 | <xs:group ref="xs:complexTypeModel"/> | |
240 | </xs:sequence> | |
241 | <xs:attribute name="name" type="xs:NCName" use="required"/> | |
242 | </xs:restriction> | |
243 | </xs:complexContent> | |
244 | </xs:complexType> | |
245 | ||
246 | <xs:complexType name="localComplexType"> | |
247 | <xs:complexContent> | |
248 | <xs:restriction base="xs:complexType"> | |
249 | <xs:sequence> | |
250 | <xs:element ref="xs:annotation" minOccurs="0"/> | |
251 | <xs:group ref="xs:complexTypeModel"/> | |
252 | </xs:sequence> | |
253 | <xs:attribute name="name" use="prohibited"/> | |
254 | <xs:attribute name="abstract" use="prohibited"/> | |
255 | </xs:restriction> | |
256 | </xs:complexContent> | |
257 | </xs:complexType> | |
258 | ||
259 | <xs:complexType name="restrictionType"> | |
260 | <xs:complexContent> | |
261 | <xs:extension base="xs:annotated"> | |
262 | <xs:sequence> | |
263 | <xs:choice minOccurs="0"> | |
264 | <xs:group ref="xs:typeDefParticle"/> | |
265 | <xs:group ref="xs:simpleRestrictionModel"/> | |
266 | </xs:choice> | |
267 | <xs:group ref="xs:attrDecls"/> | |
268 | </xs:sequence> | |
269 | <xs:attribute name="base" type="xs:QName" use="required"/> | |
270 | </xs:extension> | |
271 | </xs:complexContent> | |
272 | </xs:complexType> | |
273 | ||
274 | <xs:complexType name="complexRestrictionType"> | |
275 | <xs:complexContent> | |
276 | <xs:restriction base="xs:restrictionType"> | |
277 | <xs:sequence> | |
278 | <xs:element ref="xs:annotation" minOccurs="0"/> | |
279 | <xs:choice minOccurs="0"> | |
280 | <xs:annotation> | |
281 | <xs:documentation>This choice is added simply to | |
282 | make this a valid restriction per the REC</xs:documentation> | |
283 | </xs:annotation> | |
284 | <xs:group ref="xs:typeDefParticle"/> | |
285 | </xs:choice> | |
286 | <xs:group ref="xs:attrDecls"/> | |
287 | </xs:sequence> | |
288 | </xs:restriction> | |
289 | </xs:complexContent> | |
290 | </xs:complexType> | |
291 | ||
292 | <xs:complexType name="extensionType"> | |
157 | 293 | <xs:complexContent> |
158 | 294 | <xs:extension base="xs:annotated"> |
159 | 295 | <xs:sequence> |
160 | 296 | <xs:group ref="xs:typeDefParticle" minOccurs="0"/> |
161 | 297 | <xs:group ref="xs:attrDecls"/> |
162 | 298 | </xs:sequence> |
163 | <xs:attribute name="base" type="xs:string" use="required"/> | |
299 | <xs:attribute name="base" type="xs:QName" use="required"/> | |
164 | 300 | </xs:extension> |
165 | </xs:complexContent> | |
166 | </xs:complexType> | |
167 | </xs:element> | |
301 | </xs:complexContent> | |
302 | </xs:complexType> | |
168 | 303 | |
169 | 304 | <xs:element name="complexContent"> |
170 | 305 | <xs:annotation> |
173 | 308 | <xs:complexType> |
174 | 309 | <xs:complexContent> |
175 | 310 | <xs:extension base="xs:annotated"> |
176 | <xs:sequence> | |
177 | <xs:element ref="xs:extension"/> | |
178 | </xs:sequence> | |
311 | <xs:choice> | |
312 | <xs:element name="restriction" type="xs:complexRestrictionType"/> | |
313 | <xs:element name="extension" type="xs:extensionType"/> | |
314 | </xs:choice> | |
179 | 315 | <xs:attribute name="mixed" type="xs:boolean"> |
180 | 316 | <xs:annotation> |
181 | 317 | <xs:documentation> |
186 | 322 | </xs:complexContent> |
187 | 323 | </xs:complexType> |
188 | 324 | </xs:element> |
325 | ||
326 | <xs:complexType name="simpleRestrictionType"> | |
327 | <xs:complexContent> | |
328 | <xs:restriction base="xs:restrictionType"> | |
329 | <xs:sequence> | |
330 | <xs:element ref="xs:annotation" minOccurs="0"/> | |
331 | <xs:choice minOccurs="0"> | |
332 | <xs:annotation> | |
333 | <xs:documentation>This choice is added simply to | |
334 | make this a valid restriction per the REC</xs:documentation> | |
335 | </xs:annotation> | |
336 | <xs:group ref="xs:simpleRestrictionModel"/> | |
337 | </xs:choice> | |
338 | <xs:group ref="xs:attrDecls"/> | |
339 | </xs:sequence> | |
340 | </xs:restriction> | |
341 | </xs:complexContent> | |
342 | </xs:complexType> | |
343 | ||
344 | <xs:complexType name="simpleExtensionType"> | |
345 | <xs:complexContent> | |
346 | <xs:restriction base="xs:extensionType"> | |
347 | <xs:sequence> | |
348 | <xs:annotation> | |
349 | <xs:documentation> | |
350 | No typeDefParticle group reference</xs:documentation> | |
351 | </xs:annotation> | |
352 | <xs:element ref="xs:annotation" minOccurs="0"/> | |
353 | <xs:group ref="xs:attrDecls"/> | |
354 | </xs:sequence> | |
355 | </xs:restriction> | |
356 | </xs:complexContent> | |
357 | </xs:complexType> | |
189 | 358 | |
190 | 359 | <xs:element name="simpleContent"> |
191 | 360 | <xs:annotation> |
195 | 364 | <xs:complexContent> |
196 | 365 | <xs:extension base="xs:annotated"> |
197 | 366 | <xs:choice> |
198 | <xs:element ref="xs:extension"/> | |
367 | <xs:element name="restriction" type="xs:simpleRestrictionType"/> | |
368 | <xs:element name="extension" type="xs:simpleExtensionType"/> | |
199 | 369 | </xs:choice> |
200 | 370 | </xs:extension> |
201 | 371 | </xs:complexContent> |
202 | 372 | </xs:complexType> |
203 | 373 | </xs:element> |
204 | 374 | |
205 | <xs:element name="complexType"> | |
375 | <xs:element name="complexType" type="xs:topLevelComplexType"> | |
206 | 376 | <xs:annotation> |
207 | 377 | <xs:documentation source="http://www.w3.org/TR/xmlschema-1/#element-complexType"/> |
208 | 378 | </xs:annotation> |
209 | <xs:complexType> | |
379 | </xs:element> | |
380 | ||
381 | <xs:complexType name="element" abstract="true"> | |
382 | <xs:annotation> | |
383 | <xs:documentation> | |
384 | The element element can be used either | |
385 | at the top level to define an element-type binding globally, | |
386 | or within a content model to either reference a globally-defined | |
387 | element or type or declare an element-type binding locally. | |
388 | The ref form is not allowed at the top level.</xs:documentation> | |
389 | </xs:annotation> | |
390 | ||
210 | 391 | <xs:complexContent> |
211 | 392 | <xs:extension base="xs:annotated"> |
212 | <xs:group ref="xs:complexTypeModel"/> | |
213 | <xs:attribute name="name" type="xs:string"> | |
214 | <xs:annotation> | |
215 | <xs:documentation> | |
216 | Will be restricted to required or forbidden</xs:documentation> | |
217 | </xs:annotation> | |
218 | </xs:attribute> | |
219 | <xs:attribute name="mixed" type="xs:boolean" use="optional" default="false"> | |
220 | <xs:annotation> | |
221 | <xs:documentation> | |
222 | Not allowed if simpleContent child is chosen. | |
223 | May be overriden by setting on complexContent child.</xs:documentation> | |
224 | </xs:annotation> | |
225 | </xs:attribute> | |
226 | </xs:extension> | |
227 | </xs:complexContent> | |
228 | </xs:complexType> | |
229 | </xs:element> | |
230 | ||
231 | ||
232 | <xs:element name="element"> | |
233 | <xs:annotation> | |
234 | <xs:documentation source="http://www.w3.org/TR/xmlschema-1/#element-element"/> | |
235 | </xs:annotation> | |
236 | <xs:complexType> | |
237 | <xs:complexContent> | |
238 | <xs:extension base="xs:annotated"> | |
239 | 393 | <xs:sequence> |
240 | 394 | <xs:choice minOccurs="0"> |
241 | <xs:element ref="xs:simpleType"/> | |
242 | <xs:element ref="xs:complexType"/> | |
395 | <xs:element name="simpleType" type="xs:localSimpleType"/> | |
396 | <xs:element name="complexType" type="xs:localComplexType"/> | |
243 | 397 | </xs:choice> |
244 | 398 | </xs:sequence> |
245 | 399 | <xs:attributeGroup ref="xs:defRef"/> |
246 | <xs:attribute name="type" type="xs:string"/> | |
400 | <xs:attribute name="type" type="xs:QName"/> | |
401 | <xs:attribute name="substitutionGroup" type="xs:QName"/> | |
247 | 402 | <xs:attributeGroup ref="xs:occurs"/> |
248 | 403 | <xs:attribute name="default" type="xs:string"/> |
249 | 404 | <xs:attribute name="fixed" type="xs:string"/> |
405 | <xs:attribute name="abstract" type="xs:boolean" use="optional" default="false"/> | |
406 | <xs:attribute name="form" type="xs:formChoice"/> | |
250 | 407 | </xs:extension> |
251 | 408 | </xs:complexContent> |
252 | 409 | </xs:complexType> |
410 | ||
411 | <xs:complexType name="topLevelElement"> | |
412 | <xs:complexContent> | |
413 | <xs:restriction base="xs:element"> | |
414 | <xs:sequence> | |
415 | <xs:element ref="xs:annotation" minOccurs="0"/> | |
416 | <xs:choice minOccurs="0"> | |
417 | <xs:element name="simpleType" type="xs:localSimpleType"/> | |
418 | <xs:element name="complexType" type="xs:localComplexType"/> | |
419 | </xs:choice> | |
420 | </xs:sequence> | |
421 | <xs:attribute name="name" use="required" type="xs:NCName"/> | |
422 | <xs:attribute name="ref" use="prohibited"/> | |
423 | <xs:attribute name="form" use="prohibited"/> | |
424 | <xs:attribute name="minOccurs" use="prohibited"/> | |
425 | <xs:attribute name="maxOccurs" use="prohibited"/> | |
426 | </xs:restriction> | |
427 | </xs:complexContent> | |
428 | </xs:complexType> | |
429 | ||
430 | <xs:complexType name="localElement"> | |
431 | <xs:complexContent> | |
432 | <xs:restriction base="xs:element"> | |
433 | <xs:sequence> | |
434 | <xs:element ref="xs:annotation" minOccurs="0"/> | |
435 | <xs:choice minOccurs="0"> | |
436 | <xs:element name="simpleType" type="xs:localSimpleType"/> | |
437 | <xs:element name="complexType" type="xs:localComplexType"/> | |
438 | </xs:choice> | |
439 | </xs:sequence> | |
440 | <xs:attribute name="substitutionGroup" use="prohibited"/> | |
441 | <xs:attribute name="abstract" use="prohibited"/> | |
442 | </xs:restriction> | |
443 | </xs:complexContent> | |
444 | </xs:complexType> | |
445 | ||
446 | <xs:element name="element" type="xs:topLevelElement"> | |
447 | <xs:annotation> | |
448 | <xs:documentation source="http://www.w3.org/TR/xmlschema-1/#element-element"/> | |
449 | </xs:annotation> | |
253 | 450 | </xs:element> |
254 | 451 | |
255 | <xs:complexType name="explicitGroup"> | |
452 | <xs:complexType name="group" abstract="true"> | |
256 | 453 | <xs:annotation> |
257 | 454 | <xs:documentation> |
258 | group type for the three kinds of group</xs:documentation> | |
455 | group type for explicit groups, named top-level groups and | |
456 | group references</xs:documentation> | |
259 | 457 | </xs:annotation> |
260 | 458 | <xs:complexContent> |
261 | 459 | <xs:extension base="xs:annotated"> |
262 | 460 | <xs:group ref="xs:particle" minOccurs="0" maxOccurs="unbounded"/> |
263 | <xs:attributeGroup ref="xs:occurs"/> | |
264 | </xs:extension> | |
265 | </xs:complexContent> | |
266 | </xs:complexType> | |
267 | ||
268 | <xs:element name="choice" type="xs:explicitGroup"> | |
269 | <xs:annotation> | |
270 | <xs:documentation source="http://www.w3.org/TR/xmlschema-1/#element-choice"/> | |
271 | </xs:annotation> | |
272 | </xs:element> | |
273 | ||
274 | <xs:element name="sequence" type="xs:explicitGroup"> | |
275 | <xs:annotation> | |
276 | <xs:documentation source="http://www.w3.org/TR/xmlschema-1/#element-sequence"/> | |
277 | </xs:annotation> | |
278 | </xs:element> | |
279 | ||
280 | <xs:element name="group"> | |
281 | <xs:annotation> | |
282 | <xs:documentation source="http://www.w3.org/TR/xmlschema-1/#element-group"/> | |
283 | </xs:annotation> | |
284 | <xs:complexType> | |
285 | <xs:complexContent> | |
286 | <xs:extension base="xs:annotated"> | |
287 | <xs:choice minOccurs="0" maxOccurs="1"> | |
288 | <xs:element ref="xs:choice"/> | |
289 | <xs:element ref="xs:sequence"/> | |
290 | </xs:choice> | |
291 | 461 | <xs:attributeGroup ref="xs:defRef"/> |
292 | 462 | <xs:attributeGroup ref="xs:occurs"/> |
293 | 463 | </xs:extension> |
294 | 464 | </xs:complexContent> |
295 | 465 | </xs:complexType> |
466 | ||
467 | <xs:complexType name="realGroup"> | |
468 | <xs:complexContent> | |
469 | <xs:restriction base="xs:group"> | |
470 | <xs:sequence> | |
471 | <xs:element ref="xs:annotation" minOccurs="0"/> | |
472 | <xs:choice minOccurs="0" maxOccurs="1"> | |
473 | <xs:element ref="xs:choice"/> | |
474 | <xs:element ref="xs:sequence"/> | |
475 | </xs:choice> | |
476 | </xs:sequence> | |
477 | </xs:restriction> | |
478 | </xs:complexContent> | |
479 | </xs:complexType> | |
480 | ||
481 | <xs:complexType name="namedGroup"> | |
482 | <xs:complexContent> | |
483 | <xs:restriction base="xs:realGroup"> | |
484 | <xs:sequence> | |
485 | <xs:element ref="xs:annotation" minOccurs="0"/> | |
486 | <xs:choice minOccurs="1" maxOccurs="1"> | |
487 | <xs:element name="choice" type="xs:simpleExplicitGroup"/> | |
488 | <xs:element name="sequence" type="xs:simpleExplicitGroup"/> | |
489 | </xs:choice> | |
490 | </xs:sequence> | |
491 | <xs:attribute name="name" use="required" type="xs:NCName"/> | |
492 | <xs:attribute name="ref" use="prohibited"/> | |
493 | <xs:attribute name="minOccurs" use="prohibited"/> | |
494 | <xs:attribute name="maxOccurs" use="prohibited"/> | |
495 | </xs:restriction> | |
496 | </xs:complexContent> | |
497 | </xs:complexType> | |
498 | ||
499 | <xs:complexType name="groupRef"> | |
500 | <xs:complexContent> | |
501 | <xs:restriction base="xs:realGroup"> | |
502 | <xs:sequence> | |
503 | <xs:element ref="xs:annotation" minOccurs="0"/> | |
504 | </xs:sequence> | |
505 | <xs:attribute name="ref" use="required" type="xs:QName"/> | |
506 | <xs:attribute name="name" use="prohibited"/> | |
507 | </xs:restriction> | |
508 | </xs:complexContent> | |
509 | </xs:complexType> | |
510 | ||
511 | <xs:complexType name="explicitGroup"> | |
512 | <xs:annotation> | |
513 | <xs:documentation> | |
514 | group type for the three kinds of group</xs:documentation> | |
515 | </xs:annotation> | |
516 | <xs:complexContent> | |
517 | <xs:restriction base="xs:group"> | |
518 | <xs:sequence> | |
519 | <xs:element ref="xs:annotation" minOccurs="0"/> | |
520 | <xs:group ref="xs:nestedParticle" minOccurs="0" maxOccurs="unbounded"/> | |
521 | </xs:sequence> | |
522 | <xs:attribute name="name" type="xs:NCName" use="prohibited"/> | |
523 | <xs:attribute name="ref" type="xs:QName" use="prohibited"/> | |
524 | </xs:restriction> | |
525 | </xs:complexContent> | |
526 | </xs:complexType> | |
527 | ||
528 | <xs:complexType name="simpleExplicitGroup"> | |
529 | <xs:complexContent> | |
530 | <xs:restriction base="xs:explicitGroup"> | |
531 | <xs:sequence> | |
532 | <xs:element ref="xs:annotation" minOccurs="0"/> | |
533 | <xs:group ref="xs:nestedParticle" minOccurs="0" maxOccurs="unbounded"/> | |
534 | </xs:sequence> | |
535 | <xs:attribute name="minOccurs" use="prohibited"/> | |
536 | <xs:attribute name="maxOccurs" use="prohibited"/> | |
537 | </xs:restriction> | |
538 | </xs:complexContent> | |
539 | </xs:complexType> | |
540 | ||
541 | <xs:element name="choice" type="xs:explicitGroup"> | |
542 | <xs:annotation> | |
543 | <xs:documentation source="http://www.w3.org/TR/xmlschema-1/#element-choice"/> | |
544 | </xs:annotation> | |
296 | 545 | </xs:element> |
297 | 546 | |
547 | <xs:element name="sequence" type="xs:explicitGroup"> | |
548 | <xs:annotation> | |
549 | <xs:documentation source="http://www.w3.org/TR/xmlschema-1/#element-sequence"/> | |
550 | </xs:annotation> | |
551 | </xs:element> | |
552 | ||
553 | <xs:element name="group" type="xs:namedGroup"> | |
554 | <xs:annotation> | |
555 | <xs:documentation source="http://www.w3.org/TR/xmlschema-1/#element-group"/> | |
556 | </xs:annotation> | |
557 | </xs:element> | |
558 | ||
298 | 559 | <xs:complexType name="wildcard"> |
299 | 560 | <xs:complexContent> |
300 | 561 | <xs:extension base="xs:annotated"> |
301 | <xs:attribute name="namespace" type="xs:string" use="optional" default="##any"/> | |
562 | <xs:attribute name="namespace" type="xs:namespaceList" use="optional" default="##any"/> | |
302 | 563 | <xs:attribute name="processContents" use="optional" default="strict"> |
303 | 564 | <xs:simpleType> |
304 | 565 | <xs:restriction base="xs:NMTOKEN"> |
311 | 572 | </xs:extension> |
312 | 573 | </xs:complexContent> |
313 | 574 | </xs:complexType> |
314 | ||
575 | ||
315 | 576 | <xs:element name="any"> |
316 | 577 | <xs:annotation> |
317 | 578 | <xs:documentation source="http://www.w3.org/TR/xmlschema-1/#element-any"/> |
324 | 585 | </xs:complexContent> |
325 | 586 | </xs:complexType> |
326 | 587 | </xs:element> |
327 | ||
328 | <xs:element name="attribute"> | |
588 | ||
589 | <xs:annotation> | |
590 | <xs:documentation> | |
591 | simple type for the value of the 'namespace' attr of | |
592 | 'any' and 'anyAttribute'</xs:documentation> | |
593 | </xs:annotation> | |
594 | <xs:annotation> | |
595 | <xs:documentation> | |
596 | Value is | |
597 | ##any - - any non-conflicting WFXML/attribute at all | |
598 | ||
599 | ##other - - any non-conflicting WFXML/attribute from | |
600 | namespace other than targetNS | |
601 | ||
602 | ##local - - any unqualified non-conflicting WFXML/attribute | |
603 | ||
604 | one or - - any non-conflicting WFXML/attribute from | |
605 | more URI the listed namespaces | |
606 | references | |
607 | (space separated) | |
608 | ||
609 | ##targetNamespace or ##local may appear in the above list, to | |
610 | refer to the targetNamespace of the enclosing | |
611 | schema or an absent targetNamespace respectively</xs:documentation> | |
612 | </xs:annotation> | |
613 | ||
614 | <xs:simpleType name="namespaceList"> | |
615 | <xs:annotation> | |
616 | <xs:documentation> | |
617 | A utility type, not for public use</xs:documentation> | |
618 | </xs:annotation> | |
619 | <xs:union> | |
620 | <xs:simpleType> | |
621 | <xs:restriction base="xs:token"> | |
622 | <xs:enumeration value="##any"/> | |
623 | <xs:enumeration value="##other"/> | |
624 | </xs:restriction> | |
625 | </xs:simpleType> | |
626 | <xs:simpleType> | |
627 | <xs:list> | |
628 | <xs:simpleType> | |
629 | <xs:union memberTypes="xs:anyURI"> | |
630 | <xs:simpleType> | |
631 | <xs:restriction base="xs:token"> | |
632 | <xs:enumeration value="##targetNamespace"/> | |
633 | <xs:enumeration value="##local"/> | |
634 | </xs:restriction> | |
635 | </xs:simpleType> | |
636 | </xs:union> | |
637 | </xs:simpleType> | |
638 | </xs:list> | |
639 | </xs:simpleType> | |
640 | </xs:union> | |
641 | </xs:simpleType> | |
642 | ||
643 | <xs:element name="attribute" type="xs:topLevelAttribute"> | |
329 | 644 | <xs:annotation> |
330 | 645 | <xs:documentation source="http://www.w3.org/TR/xmlschema-1/#element-attribute"/> |
331 | 646 | </xs:annotation> |
332 | <xs:complexType> | |
333 | <xs:complexContent> | |
334 | <xs:extension base="xs:annotated"> | |
335 | <xs:sequence> | |
336 | <xs:element ref="xs:simpleType" minOccurs="0"/> | |
337 | </xs:sequence> | |
338 | <xs:attributeGroup ref="xs:defRef"/> | |
339 | <xs:attribute name="type" type="xs:string"/> | |
340 | <xs:attribute name="use" use="optional" default="optional"> | |
341 | <xs:simpleType> | |
342 | <xs:restriction base="xs:NMTOKEN"> | |
343 | <xs:enumeration value="optional"/> | |
344 | <xs:enumeration value="required"/> | |
345 | </xs:restriction> | |
346 | </xs:simpleType> | |
347 | </xs:attribute> | |
348 | <xs:attribute name="default" type="xs:string"/> | |
349 | <xs:attribute name="fixed" type="xs:string"/> | |
350 | </xs:extension> | |
351 | </xs:complexContent> | |
352 | </xs:complexType> | |
353 | </xs:element> | |
354 | ||
355 | <xs:element name="attributeGroup"> | |
356 | <xs:annotation> | |
357 | <xs:documentation source="http://www.w3.org/TR/xmlschema-1/#element-attributeGroup"/> | |
358 | </xs:annotation> | |
359 | <xs:complexType> | |
647 | </xs:element> | |
648 | ||
649 | <xs:complexType name="attributeGroup" abstract="true"> | |
360 | 650 | <xs:complexContent> |
361 | 651 | <xs:extension base="xs:annotated"> |
362 | 652 | <xs:group ref="xs:attrDecls"/> |
364 | 654 | </xs:extension> |
365 | 655 | </xs:complexContent> |
366 | 656 | </xs:complexType> |
657 | ||
658 | <xs:complexType name="namedAttributeGroup"> | |
659 | <xs:complexContent> | |
660 | <xs:restriction base="xs:attributeGroup"> | |
661 | <xs:sequence> | |
662 | <xs:element ref="xs:annotation" minOccurs="0"/> | |
663 | <xs:group ref="xs:attrDecls"/> | |
664 | </xs:sequence> | |
665 | <xs:attribute name="name" use="required" type="xs:NCName"/> | |
666 | <xs:attribute name="ref" use="prohibited"/> | |
667 | </xs:restriction> | |
668 | </xs:complexContent> | |
669 | </xs:complexType> | |
670 | ||
671 | <xs:complexType name="attributeGroupRef"> | |
672 | <xs:complexContent> | |
673 | <xs:restriction base="xs:attributeGroup"> | |
674 | <xs:sequence> | |
675 | <xs:element ref="xs:annotation" minOccurs="0"/> | |
676 | </xs:sequence> | |
677 | <xs:attribute name="ref" use="required" type="xs:QName"/> | |
678 | <xs:attribute name="name" use="prohibited"/> | |
679 | </xs:restriction> | |
680 | </xs:complexContent> | |
681 | </xs:complexType> | |
682 | ||
683 | <xs:element name="attributeGroup" type="xs:namedAttributeGroup"> | |
684 | <xs:annotation> | |
685 | <xs:documentation source="http://www.w3.org/TR/xmlschema-1/#element-attributeGroup"/> | |
686 | </xs:annotation> | |
367 | 687 | </xs:element> |
368 | ||
688 | ||
369 | 689 | <xs:element name="include"> |
370 | 690 | <xs:annotation> |
371 | 691 | <xs:documentation source="http://www.w3.org/TR/xmlschema-1/#element-include"/> |
386 | 706 | <xs:complexType> |
387 | 707 | <xs:complexContent> |
388 | 708 | <xs:extension base="xs:annotated"> |
389 | <xs:attribute name="namespace" type="xs:string"/> | |
709 | <xs:attribute name="namespace" type="xs:anyURI"/> | |
390 | 710 | <xs:attribute name="schemaLocation" type="xs:anyURI"/> |
391 | 711 | </xs:extension> |
392 | 712 | </xs:complexContent> |
414 | 734 | </xs:complexType> |
415 | 735 | </xs:element> |
416 | 736 | |
417 | <!-- xerces does not accept xs:anySimpleType here, so we have to comment it out, | |
418 | but JETypeSimple supports these types --> | |
419 | <!-- | |
737 | ||
420 | 738 | <xs:simpleType name="string"> |
421 | 739 | <xs:annotation> |
422 | 740 | <xs:documentation |
631 | 949 | </xs:restriction> |
632 | 950 | </xs:simpleType> |
633 | 951 | |
952 | <xs:simpleType name="IDREFS"> | |
953 | <xs:annotation> | |
954 | <xs:documentation | |
955 | source="http://www.w3.org/TR/xmlschema-2/#IDREFS"/> | |
956 | </xs:annotation> | |
957 | <xs:restriction> | |
958 | <xs:simpleType> | |
959 | <xs:list itemType="xs:IDREF"/> | |
960 | </xs:simpleType> | |
961 | <xs:minLength value="1"/> | |
962 | </xs:restriction> | |
963 | </xs:simpleType> | |
964 | ||
965 | <xs:simpleType name="ENTITIES"> | |
966 | <xs:annotation> | |
967 | <xs:documentation | |
968 | source="http://www.w3.org/TR/xmlschema-2/#ENTITIES"/> | |
969 | </xs:annotation> | |
970 | <xs:restriction> | |
971 | <xs:simpleType> | |
972 | <xs:list itemType="xs:ENTITY"/> | |
973 | </xs:simpleType> | |
974 | <xs:minLength value="1"/> | |
975 | </xs:restriction> | |
976 | </xs:simpleType> | |
977 | ||
634 | 978 | <xs:simpleType name="NMTOKEN"> |
635 | 979 | <xs:annotation> |
636 | 980 | <xs:documentation |
648 | 992 | </xs:restriction> |
649 | 993 | </xs:simpleType> |
650 | 994 | |
995 | <xs:simpleType name="NMTOKENS"> | |
996 | <xs:annotation> | |
997 | <xs:documentation | |
998 | source="http://www.w3.org/TR/xmlschema-2/#NMTOKENS"/> | |
999 | </xs:annotation> | |
1000 | <xs:restriction> | |
1001 | <xs:simpleType> | |
1002 | <xs:list itemType="xs:NMTOKEN"/> | |
1003 | </xs:simpleType> | |
1004 | <xs:minLength value="1"/> | |
1005 | </xs:restriction> | |
1006 | </xs:simpleType> | |
1007 | ||
651 | 1008 | <xs:simpleType name="Name"> |
652 | 1009 | <xs:annotation> |
653 | 1010 | <xs:documentation |
682 | 1039 | </xs:restriction> |
683 | 1040 | </xs:simpleType> |
684 | 1041 | |
1042 | <xs:simpleType name="ID"> | |
1043 | <xs:annotation> | |
1044 | <xs:documentation | |
1045 | source="http://www.w3.org/TR/xmlschema-2/#ID"/> | |
1046 | </xs:annotation> | |
1047 | <xs:restriction base="xs:NCName"/> | |
1048 | </xs:simpleType> | |
1049 | ||
1050 | <xs:simpleType name="IDREF"> | |
1051 | <xs:annotation> | |
1052 | <xs:documentation | |
1053 | source="http://www.w3.org/TR/xmlschema-2/#IDREF"/> | |
1054 | </xs:annotation> | |
1055 | <xs:restriction base="xs:NCName"/> | |
1056 | </xs:simpleType> | |
1057 | ||
1058 | <xs:simpleType name="ENTITY"> | |
1059 | <xs:annotation> | |
1060 | <xs:documentation | |
1061 | source="http://www.w3.org/TR/xmlschema-2/#ENTITY"/> | |
1062 | </xs:annotation> | |
1063 | <xs:restriction base="xs:NCName"/> | |
1064 | </xs:simpleType> | |
1065 | ||
685 | 1066 | <xs:simpleType name="integer"> |
686 | 1067 | <xs:annotation> |
687 | 1068 | <xs:documentation |
815 | 1196 | <xs:minInclusive value="1"/> |
816 | 1197 | </xs:restriction> |
817 | 1198 | </xs:simpleType> |
818 | --> | |
819 | <xs:element name="simpleType"> | |
820 | <xs:annotation> | |
821 | <xs:documentation | |
822 | source="http://www.w3.org/TR/xmlschema-2/#element-simpleType"/> | |
823 | </xs:annotation> | |
824 | <xs:complexType> | |
1199 | ||
1200 | <xs:group name="simpleDerivation"> | |
1201 | <xs:choice> | |
1202 | <xs:element ref="xs:restriction"/> | |
1203 | <xs:element ref="xs:list"/> | |
1204 | <xs:element ref="xs:union"/> | |
1205 | </xs:choice> | |
1206 | </xs:group> | |
1207 | ||
1208 | <xs:complexType name="simpleType" abstract="true"> | |
825 | 1209 | <xs:complexContent> |
826 | 1210 | <xs:extension base="xs:annotated"> |
827 | <xs:sequence> | |
828 | <xs:element ref="xs:restriction"/> | |
829 | </xs:sequence> | |
1211 | <xs:group ref="xs:simpleDerivation"/> | |
830 | 1212 | <xs:attribute name="name" type="xs:NCName"> |
831 | 1213 | <xs:annotation> |
832 | 1214 | <xs:documentation> |
837 | 1219 | </xs:extension> |
838 | 1220 | </xs:complexContent> |
839 | 1221 | </xs:complexType> |
1222 | ||
1223 | <xs:complexType name="topLevelSimpleType"> | |
1224 | <xs:complexContent> | |
1225 | <xs:restriction base="xs:simpleType"> | |
1226 | <xs:sequence> | |
1227 | <xs:element ref="xs:annotation" minOccurs="0"/> | |
1228 | <xs:group ref="xs:simpleDerivation"/> | |
1229 | </xs:sequence> | |
1230 | <xs:attribute name="name" use="required" | |
1231 | type="xs:NCName"> | |
1232 | <xs:annotation> | |
1233 | <xs:documentation> | |
1234 | Required at the top level | |
1235 | </xs:documentation> | |
1236 | </xs:annotation> | |
1237 | </xs:attribute> | |
1238 | </xs:restriction> | |
1239 | </xs:complexContent> | |
1240 | </xs:complexType> | |
1241 | ||
1242 | <xs:complexType name="localSimpleType"> | |
1243 | <xs:complexContent> | |
1244 | <xs:restriction base="xs:simpleType"> | |
1245 | <xs:sequence> | |
1246 | <xs:element ref="xs:annotation" minOccurs="0"/> | |
1247 | <xs:group ref="xs:simpleDerivation"/> | |
1248 | </xs:sequence> | |
1249 | <xs:attribute name="name" use="prohibited"> | |
1250 | <xs:annotation> | |
1251 | <xs:documentation> | |
1252 | Forbidden when nested | |
1253 | </xs:documentation> | |
1254 | </xs:annotation> | |
1255 | </xs:attribute> | |
1256 | </xs:restriction> | |
1257 | </xs:complexContent> | |
1258 | </xs:complexType> | |
1259 | ||
1260 | <xs:element name="simpleType" type="xs:topLevelSimpleType"> | |
1261 | <xs:annotation> | |
1262 | <xs:documentation | |
1263 | source="http://www.w3.org/TR/xmlschema-2/#element-simpleType"/> | |
1264 | </xs:annotation> | |
840 | 1265 | </xs:element> |
841 | 1266 | |
842 | 1267 | <xs:group name="facets"> |
864 | 1289 | |
865 | 1290 | <xs:group name="simpleRestrictionModel"> |
866 | 1291 | <xs:sequence> |
867 | <xs:element ref="xs:simpleType" minOccurs="0"/> | |
1292 | <xs:element name="simpleType" type="xs:localSimpleType" minOccurs="0"/> | |
868 | 1293 | <xs:group ref="xs:facets" minOccurs="0" maxOccurs="unbounded"/> |
869 | 1294 | </xs:sequence> |
870 | 1295 | </xs:group> |
887 | 1312 | </xs:complexType> |
888 | 1313 | </xs:element> |
889 | 1314 | |
1315 | <xs:element name="list"> | |
1316 | <xs:complexType> | |
1317 | <xs:annotation> | |
1318 | <xs:documentation | |
1319 | source="http://www.w3.org/TR/xmlschema-2/#element-list"> | |
1320 | itemType attribute and simpleType child are mutually | |
1321 | exclusive, but one or other is required | |
1322 | </xs:documentation> | |
1323 | </xs:annotation> | |
1324 | <xs:complexContent> | |
1325 | <xs:extension base="xs:annotated"> | |
1326 | <xs:sequence> | |
1327 | <xs:element name="simpleType" type="xs:localSimpleType" | |
1328 | minOccurs="0"/> | |
1329 | </xs:sequence> | |
1330 | <xs:attribute name="itemType" type="xs:QName" use="optional"/> | |
1331 | </xs:extension> | |
1332 | </xs:complexContent> | |
1333 | </xs:complexType> | |
1334 | </xs:element> | |
1335 | ||
1336 | <xs:element name="union"> | |
1337 | <xs:complexType> | |
1338 | <xs:annotation> | |
1339 | <xs:documentation | |
1340 | source="http://www.w3.org/TR/xmlschema-2/#element-union"> | |
1341 | memberTypes attribute must be non-empty or there must be | |
1342 | at least one simpleType child | |
1343 | </xs:documentation> | |
1344 | </xs:annotation> | |
1345 | <xs:complexContent> | |
1346 | <xs:extension base="xs:annotated"> | |
1347 | <xs:sequence> | |
1348 | <xs:element name="simpleType" type="xs:localSimpleType" | |
1349 | minOccurs="0" maxOccurs="unbounded"/> | |
1350 | </xs:sequence> | |
1351 | <xs:attribute name="memberTypes" use="optional"> | |
1352 | <xs:simpleType> | |
1353 | <xs:list itemType="xs:QName"/> | |
1354 | </xs:simpleType> | |
1355 | </xs:attribute> | |
1356 | </xs:extension> | |
1357 | </xs:complexContent> | |
1358 | </xs:complexType> | |
1359 | </xs:element> | |
1360 | ||
890 | 1361 | <xs:complexType name="facet"> |
891 | 1362 | <xs:complexContent> |
892 | 1363 | <xs:extension base="xs:annotated"> |
923 | 1394 | </xs:annotation> |
924 | 1395 | </xs:element> |
925 | 1396 | |
926 | <xs:element name="totalDigits" type="xs:facet"> | |
1397 | <xs:complexType name="numFacet"> | |
1398 | <xs:complexContent> | |
1399 | <xs:restriction base="xs:facet"> | |
1400 | <xs:sequence> | |
1401 | <xs:element ref="xs:annotation" minOccurs="0"/> | |
1402 | </xs:sequence> | |
1403 | <xs:attribute name="value" type="xs:nonNegativeInteger" use="required"/> | |
1404 | </xs:restriction> | |
1405 | </xs:complexContent> | |
1406 | </xs:complexType> | |
1407 | ||
1408 | <xs:element name="totalDigits" type="xs:numFacet"> | |
927 | 1409 | <xs:annotation> |
928 | 1410 | <xs:documentation |
929 | 1411 | source="http://www.w3.org/TR/xmlschema-2/#element-totalDigits"/> |
930 | 1412 | </xs:annotation> |
931 | 1413 | </xs:element> |
932 | <xs:element name="fractionDigits" type="xs:facet"> | |
1414 | <xs:element name="fractionDigits" type="xs:numFacet"> | |
933 | 1415 | <xs:annotation> |
934 | 1416 | <xs:documentation |
935 | 1417 | source="http://www.w3.org/TR/xmlschema-2/#element-fractionDigits"/> |
936 | 1418 | </xs:annotation> |
937 | 1419 | </xs:element> |
938 | 1420 | |
939 | <xs:element name="length" type="xs:facet"> | |
1421 | <xs:element name="length" type="xs:numFacet"> | |
940 | 1422 | <xs:annotation> |
941 | 1423 | <xs:documentation |
942 | 1424 | source="http://www.w3.org/TR/xmlschema-2/#element-length"/> |
943 | 1425 | </xs:annotation> |
944 | 1426 | </xs:element> |
945 | <xs:element name="minLength" type="xs:facet"> | |
1427 | <xs:element name="minLength" type="xs:numFacet"> | |
946 | 1428 | <xs:annotation> |
947 | 1429 | <xs:documentation |
948 | 1430 | source="http://www.w3.org/TR/xmlschema-2/#element-minLength"/> |
949 | 1431 | </xs:annotation> |
950 | 1432 | </xs:element> |
951 | <xs:element name="maxLength" type="xs:facet"> | |
1433 | <xs:element name="maxLength" type="xs:numFacet"> | |
952 | 1434 | <xs:annotation> |
953 | 1435 | <xs:documentation |
954 | 1436 | source="http://www.w3.org/TR/xmlschema-2/#element-maxLength"/> |
37 | 37 | <MENU_INSERTION nom="cite" type_noeud="element"/> |
38 | 38 | <MENU_INSERTION nom="code" type_noeud="element"/> |
39 | 39 | <MENU_INSERTION nom="style" type_noeud="element"/> |
40 | <MENU_INSERTION nom="commentaire" type_noeud="commentaire"/> | |
40 | 41 | </MENU> |
41 | 42 | <MENU nom="listes_tables"> |
42 | 43 | <MENU_INSERTION nom="ul" type_noeud="element"/> |
271 | 272 | <STRINGS_MENU menu="style"> |
272 | 273 | <TITRE>style</TITRE> |
273 | 274 | </STRINGS_MENU> |
275 | <STRINGS_MENU menu="commentaire"> | |
276 | <TITRE>XML comment</TITRE> | |
277 | </STRINGS_MENU> | |
274 | 278 | |
275 | 279 | <STRINGS_MENU menu="listes_tables"> |
276 | 280 | <TITRE>Lists and Tables</TITRE> |
337 | 341 | </STRINGS_MENU> |
338 | 342 | <STRINGS_MENU menu="normal"> |
339 | 343 | <TITRE>standard</TITRE> |
344 | <DOCUMENTATION> | |
345 | Removes all the styles in the selected text | |
346 | </DOCUMENTATION> | |
340 | 347 | </STRINGS_MENU> |
341 | 348 | <STRINGS_MENU menu="sup"> |
342 | 349 | <TITRE>superscript</TITRE> |
448 | 455 | <STRINGS_MENU menu="style"> |
449 | 456 | <TITRE>Style (style)</TITRE> |
450 | 457 | </STRINGS_MENU> |
458 | <STRINGS_MENU menu="commentaire"> | |
459 | <TITRE>Commentaire XML</TITRE> | |
460 | </STRINGS_MENU> | |
451 | 461 | |
452 | 462 | <STRINGS_MENU menu="listes_tables"> |
453 | 463 | <TITRE>Listes/Tables</TITRE> |
514 | 524 | </STRINGS_MENU> |
515 | 525 | <STRINGS_MENU menu="normal"> |
516 | 526 | <TITRE>Sans style</TITRE> |
527 | <DOCUMENTATION> | |
528 | Retire tous les styles du texte sélectionné, le transformant en texte normal | |
529 | </DOCUMENTATION> | |
517 | 530 | </STRINGS_MENU> |
518 | 531 | <STRINGS_MENU menu="sup"> |
519 | 532 | <TITRE>Exposant (sup)</TITRE> |
30 | 30 | </MENU> |
31 | 31 | <MENU nom="types"> |
32 | 32 | <MENU_INSERTION nom="restriction" type_noeud="element"/> |
33 | <MENU_INSERTION nom="list"/> | |
34 | <MENU_INSERTION nom="union"/> | |
33 | 35 | <MENU_INSERTION nom="enumeration" type_noeud="element"/> |
34 | 36 | <MENU_INSERTION nom="minExclusive" type_noeud="element"/> |
35 | 37 | <MENU_INSERTION nom="minInclusive" type_noeud="element"/> |
99 | 101 | <AFFICHAGE_ELEMENT element="restriction" type="zone"> |
100 | 102 | <PARAMETRE nom="attributsVisibles" valeur="true"/> |
101 | 103 | </AFFICHAGE_ELEMENT> |
104 | <AFFICHAGE_ELEMENT element="list" type="zone"> | |
105 | <PARAMETRE nom="attributsVisibles" valeur="true"/> | |
106 | </AFFICHAGE_ELEMENT> | |
107 | <AFFICHAGE_ELEMENT element="union" type="zone"> | |
108 | <PARAMETRE nom="attributsVisibles" valeur="true"/> | |
109 | </AFFICHAGE_ELEMENT> | |
102 | 110 | <AFFICHAGE_ELEMENT element="enumeration" type="vide"> |
103 | 111 | <PARAMETRE nom="attributsVisibles" valeur="true"/> |
104 | 112 | </AFFICHAGE_ELEMENT> |
221 | 229 | <STRINGS_ELEMENT element="restriction"> |
222 | 230 | <TITRE>Restriction</TITRE> |
223 | 231 | </STRINGS_ELEMENT> |
232 | <STRINGS_ELEMENT element="list"> | |
233 | <TITRE>List</TITRE> | |
234 | </STRINGS_ELEMENT> | |
235 | <STRINGS_ELEMENT element="union"> | |
236 | <TITRE>Union</TITRE> | |
237 | </STRINGS_ELEMENT> | |
224 | 238 | <STRINGS_ELEMENT element="enumeration"> |
225 | 239 | <TITRE>Enumeration</TITRE> |
226 | 240 | </STRINGS_ELEMENT> |
333 | 347 | <STRINGS_ELEMENT element="restriction"> |
334 | 348 | <TITRE>Restriction</TITRE> |
335 | 349 | </STRINGS_ELEMENT> |
350 | <STRINGS_ELEMENT element="list"> | |
351 | <TITRE>Liste</TITRE> | |
352 | </STRINGS_ELEMENT> | |
353 | <STRINGS_ELEMENT element="union"> | |
354 | <TITRE>Union</TITRE> | |
355 | </STRINGS_ELEMENT> | |
336 | 356 | <STRINGS_ELEMENT element="enumeration"> |
337 | 357 | <TITRE>Enumération</TITRE> |
338 | 358 | </STRINGS_ELEMENT> |
30 | 30 | <xs:choice maxOccurs="unbounded"> |
31 | 31 | <xs:element ref="PAGE"/> |
32 | 32 | <xs:element ref="REFXPAGES"/> |
33 | <xs:element ref="XPAGES"/> | |
33 | 34 | </xs:choice> |
34 | 35 | </xs:sequence> |
35 | 36 | </xs:complexType> |
119 | 120 | </xs:complexType> |
120 | 121 | </xs:element> |
121 | 122 | |
122 | <xs:element name="INTERFACE"> | |
123 | <xs:element name="INTERFACE" type="xs:string"> | |
123 | 124 | <xs:annotation> |
124 | 125 | <xs:documentation> |
125 | 126 | Interface des pages. |
126 | 127 | </xs:documentation> |
127 | 128 | </xs:annotation> |
128 | <xs:simpleType> | |
129 | <xs:restriction base="xs:string"> | |
130 | <xs:enumeration value="bois"/> | |
131 | <xs:enumeration value="etoiles"/> | |
132 | <xs:enumeration value="marbre"/> | |
133 | <xs:enumeration value="parchemin"/> | |
134 | <xs:enumeration value="peinture"/> | |
135 | </xs:restriction> | |
136 | </xs:simpleType> | |
137 | 129 | </xs:element> |
138 | 130 | |
139 | 131 | <xs:element name="LANGUE"> |
187 | 179 | <xs:element ref="APPLET"/> |
188 | 180 | <xs:element ref="FLASH"/> |
189 | 181 | <xs:element ref="COMMENTAIRE"/> |
182 | <xs:element ref="CODE"/> | |
183 | <xs:element ref="EXERCICE"/> | |
184 | <xs:element ref="QCM"/> | |
190 | 185 | </xs:choice> |
191 | 186 | <xs:attribute name="label" type="typeLabel" use="required"> |
192 | 187 | <xs:annotation> |
229 | 224 | <xs:element ref="APPLET"/> |
230 | 225 | <xs:element ref="FLASH"/> |
231 | 226 | <xs:element ref="COMMENTAIRE"/> |
227 | <xs:element ref="CODE"/> | |
228 | <xs:element ref="EXERCICE"/> | |
229 | <xs:element ref="QCM"/> | |
232 | 230 | </xs:choice> |
233 | 231 | <xs:attribute name="titre" type="xs:string" use="optional"> |
234 | 232 | <xs:annotation> |
277 | 275 | </xs:annotation> |
278 | 276 | <xs:complexType> |
279 | 277 | <xs:sequence> |
280 | <xs:choice maxOccurs="unbounded"> | |
281 | <xs:element ref="LIENPAGE"/> | |
282 | <xs:element ref="LIENWEB"/> | |
283 | <xs:element ref="FICHIER"/> | |
284 | </xs:choice> | |
278 | <xs:element ref="FICHIER" maxOccurs="unbounded"/> | |
285 | 279 | <xs:element minOccurs="0" ref="LEGENDE"/> |
286 | 280 | <xs:element minOccurs="0" ref="CREDIT"/> |
287 | 281 | </xs:sequence> |
309 | 303 | </xs:restriction> |
310 | 304 | </xs:simpleType> |
311 | 305 | </xs:attribute> |
306 | <xs:attribute name="label" type="typeLabel" use="optional"> | |
307 | <xs:annotation> | |
308 | <xs:documentation> | |
309 | Label permettant de faire un lien vers l'image. | |
310 | </xs:documentation> | |
311 | </xs:annotation> | |
312 | </xs:attribute> | |
312 | 313 | </xs:complexType> |
313 | 314 | </xs:element> |
314 | 315 | |
315 | 316 | <xs:element name="LEGENDE"> |
316 | 317 | <xs:annotation> |
317 | 318 | <xs:documentation> |
318 | Légende d'un tableau ou d'une figure | |
319 | Légende | |
319 | 320 | </xs:documentation> |
320 | 321 | </xs:annotation> |
321 | 322 | <xs:complexType mixed="true"> |
334 | 335 | il est nécessaire de passer par l'élément ENVIMAGE. |
335 | 336 | </xs:documentation> |
336 | 337 | </xs:annotation> |
337 | <xs:complexType mixed="true"> | |
338 | <xs:complexType> | |
338 | 339 | <xs:attribute name="nom" type="xs:string" use="required"/> |
339 | 340 | </xs:complexType> |
340 | 341 | </xs:element> |
492 | 493 | <xs:element name="ITEM"> |
493 | 494 | <xs:annotation> |
494 | 495 | <xs:documentation> |
495 | Elément d'une liste à points ou numérotée | |
496 | Elément d'une liste | |
496 | 497 | </xs:documentation> |
497 | 498 | </xs:annotation> |
498 | 499 | <xs:complexType mixed="true"> |
665 | 666 | </xs:element> |
666 | 667 | |
667 | 668 | |
669 | <!-- Exercices --> | |
670 | ||
671 | <xs:element name="EXERCICE"> | |
672 | <xs:annotation> | |
673 | <xs:documentation> | |
674 | Exercice de type questions-réponses | |
675 | </xs:documentation> | |
676 | </xs:annotation> | |
677 | <xs:complexType> | |
678 | <xs:sequence> | |
679 | <xs:element ref="ENONCE" minOccurs="0"/> | |
680 | <xs:element ref="DIFFICULTE" minOccurs="0"/> | |
681 | <xs:element ref="TEMPS" minOccurs="0"/> | |
682 | <xs:element ref="QUESTION" maxOccurs="unbounded"/> | |
683 | </xs:sequence> | |
684 | <xs:attribute name="titre" type="xs:string" use="optional"/> | |
685 | <xs:attribute name="type" use="optional" default="évaluation"> | |
686 | <xs:annotation> | |
687 | <xs:documentation> | |
688 | Type d'exercice. Les solutions des exercices de type "évaluation" ne sont | |
689 | affichées qu'avec la sortie "solutions", alors que les solutions des exercices | |
690 | de type "auto-évaluation" sont toujours affichées. | |
691 | </xs:documentation> | |
692 | </xs:annotation> | |
693 | <xs:simpleType> | |
694 | <xs:restriction base="xs:string"> | |
695 | <xs:enumeration value="évaluation"/> | |
696 | <xs:enumeration value="auto-évaluation"/> | |
697 | </xs:restriction> | |
698 | </xs:simpleType> | |
699 | </xs:attribute> | |
700 | </xs:complexType> | |
701 | </xs:element> | |
702 | ||
703 | <xs:element name="ENONCE"> | |
704 | <xs:annotation> | |
705 | <xs:documentation> | |
706 | Enoncé d'un exercice ou d'une question | |
707 | </xs:documentation> | |
708 | </xs:annotation> | |
709 | <xs:complexType> | |
710 | <xs:choice minOccurs="0" maxOccurs="unbounded"> | |
711 | <xs:element ref="SECTION"/> | |
712 | <xs:element ref="PARAGRAPHE"/> | |
713 | <xs:element ref="LISTE"/> | |
714 | <xs:element ref="TABLEAU"/> | |
715 | <xs:element ref="ENVIMAGE"/> | |
716 | <xs:element ref="APPLET"/> | |
717 | <xs:element ref="FLASH"/> | |
718 | </xs:choice> | |
719 | </xs:complexType> | |
720 | </xs:element> | |
721 | ||
722 | <xs:element name="DIFFICULTE"> | |
723 | <xs:annotation> | |
724 | <xs:documentation> | |
725 | indication du niveau de difficulté : | |
726 | * : facile, ou application directe du cours | |
727 | ** : moyen | |
728 | *** : difficile | |
729 | </xs:documentation> | |
730 | </xs:annotation> | |
731 | <xs:simpleType> | |
732 | <xs:restriction base="xs:string"> | |
733 | <xs:enumeration value="*"/> | |
734 | <xs:enumeration value="**"/> | |
735 | <xs:enumeration value="***"/> | |
736 | </xs:restriction> | |
737 | </xs:simpleType> | |
738 | </xs:element> | |
739 | ||
740 | <xs:element name="TEMPS" type="xs:string"> | |
741 | <xs:annotation> | |
742 | <xs:documentation> | |
743 | temps indicatif nécessaire pour résoudre l'exercice | |
744 | </xs:documentation> | |
745 | </xs:annotation> | |
746 | </xs:element> | |
747 | ||
748 | <xs:element name="QUESTION"> | |
749 | <xs:annotation> | |
750 | <xs:documentation> | |
751 | Question d'un exercice, avec un énoncé, éventuellement des aides, une solution, | |
752 | et éventuellement des points. | |
753 | </xs:documentation> | |
754 | </xs:annotation> | |
755 | <xs:complexType> | |
756 | <xs:sequence> | |
757 | <xs:element ref="ENONCE"/> | |
758 | <xs:element ref="AIDE" minOccurs="0" maxOccurs="unbounded"/> | |
759 | <xs:element ref="SOLUTION" minOccurs="0"/> | |
760 | <xs:element ref="POINTS" minOccurs="0"/> | |
761 | </xs:sequence> | |
762 | </xs:complexType> | |
763 | </xs:element> | |
764 | ||
765 | <xs:element name="SOLUTION"> | |
766 | <xs:complexType> | |
767 | <xs:choice minOccurs="0" maxOccurs="unbounded"> | |
768 | <xs:element ref="SECTION"/> | |
769 | <xs:element ref="PARAGRAPHE"/> | |
770 | <xs:element ref="LISTE"/> | |
771 | <xs:element ref="TABLEAU"/> | |
772 | <xs:element ref="ENVIMAGE"/> | |
773 | <xs:element ref="APPLET"/> | |
774 | <xs:element ref="FLASH"/> | |
775 | </xs:choice> | |
776 | </xs:complexType> | |
777 | </xs:element> | |
778 | ||
779 | <xs:element name="POINTS" type="xs:float"> | |
780 | <xs:annotation> | |
781 | <xs:documentation> | |
782 | Nombre de points gagnés si la réponse est correcte. | |
783 | </xs:documentation> | |
784 | </xs:annotation> | |
785 | </xs:element> | |
786 | ||
787 | <xs:element name="QCM"> | |
788 | <xs:annotation> | |
789 | <xs:documentation> | |
790 | Questionnaire à choix multiples, avec des commentaires affichés | |
791 | après le choix de l'utilisateur. | |
792 | </xs:documentation> | |
793 | </xs:annotation> | |
794 | <xs:complexType> | |
795 | <xs:sequence> | |
796 | <xs:element ref="ENONCE" minOccurs="0"/> | |
797 | <xs:element ref="DIFFICULTE" minOccurs="0"/> | |
798 | <xs:element ref="TEMPS" minOccurs="0"/> | |
799 | <xs:element ref="QUESTIONQCM" maxOccurs="unbounded"/> | |
800 | </xs:sequence> | |
801 | <xs:attribute name="titre" type="xs:string" use="optional"/> | |
802 | </xs:complexType> | |
803 | </xs:element> | |
804 | ||
805 | <xs:element name="AIDE"> | |
806 | <xs:annotation> | |
807 | <xs:documentation> | |
808 | Aide d'un exercice. | |
809 | </xs:documentation> | |
810 | </xs:annotation> | |
811 | <xs:complexType> | |
812 | <xs:choice minOccurs="0" maxOccurs="unbounded"> | |
813 | <xs:element ref="PARAGRAPHE"/> | |
814 | <xs:element ref="LISTE"/> | |
815 | <xs:element ref="TABLEAU"/> | |
816 | <xs:element ref="ENVIMAGE"/> | |
817 | <xs:element ref="APPLET"/> | |
818 | <xs:element ref="FLASH"/> | |
819 | </xs:choice> | |
820 | </xs:complexType> | |
821 | </xs:element> | |
822 | ||
823 | <xs:element name="QUESTIONQCM"> | |
824 | <xs:annotation> | |
825 | <xs:documentation> | |
826 | Question d'un QCM, avec un énoncé, éventuellement des aides, | |
827 | et les réponses possibles. | |
828 | </xs:documentation> | |
829 | </xs:annotation> | |
830 | <xs:complexType> | |
831 | <xs:sequence> | |
832 | <xs:element ref="ENONCEQCM"/> | |
833 | <xs:element ref="AIDE" minOccurs="0" maxOccurs="unbounded"/> | |
834 | <xs:element ref="REPONSEQCM" maxOccurs="unbounded"/> | |
835 | </xs:sequence> | |
836 | </xs:complexType> | |
837 | </xs:element> | |
838 | ||
839 | <xs:element name="ENONCEQCM"> | |
840 | <xs:annotation> | |
841 | <xs:documentation> | |
842 | Enoncé d'un QCM (texte très court) | |
843 | </xs:documentation> | |
844 | </xs:annotation> | |
845 | <xs:complexType mixed="true"> | |
846 | <xs:choice maxOccurs="unbounded" minOccurs="0"> | |
847 | <xs:group ref="texte"/> | |
848 | </xs:choice> | |
849 | </xs:complexType> | |
850 | </xs:element> | |
851 | ||
852 | <xs:element name="REPONSEQCM"> | |
853 | <xs:annotation> | |
854 | <xs:documentation> | |
855 | Réponse possible à un QCM. | |
856 | Contient le texte de la réponse (TEXTEREP) | |
857 | et un commentaire (COMMENTAIREREP) à afficher si la réponse donnée est incorrecte. | |
858 | L'attribut bonne indique si la réponse est bonne ou pas. | |
859 | </xs:documentation> | |
860 | </xs:annotation> | |
861 | <xs:complexType> | |
862 | <xs:sequence> | |
863 | <xs:element ref="TEXTEREP"/> | |
864 | <xs:element ref="COMMENTAIREREP" minOccurs="0"/> | |
865 | </xs:sequence> | |
866 | <xs:attribute use="required" name="bonne"> | |
867 | <xs:simpleType> | |
868 | <xs:restriction base="xs:string"> | |
869 | <xs:enumeration value="non"/> | |
870 | <xs:enumeration value="oui"/> | |
871 | </xs:restriction> | |
872 | </xs:simpleType> | |
873 | </xs:attribute> | |
874 | </xs:complexType> | |
875 | </xs:element> | |
876 | ||
877 | <xs:element name="TEXTEREP"> | |
878 | <xs:annotation> | |
879 | <xs:documentation> | |
880 | Texte de la réponse | |
881 | </xs:documentation> | |
882 | </xs:annotation> | |
883 | <xs:complexType mixed="true"> | |
884 | <xs:choice minOccurs="0" maxOccurs="unbounded"> | |
885 | <xs:group ref="texte"/> | |
886 | </xs:choice> | |
887 | </xs:complexType> | |
888 | </xs:element> | |
889 | ||
890 | <xs:element name="COMMENTAIREREP" type="xs:string"> | |
891 | <xs:annotation> | |
892 | <xs:documentation> | |
893 | Commentaire à afficher si la réponse donnée est incorrecte | |
894 | </xs:documentation> | |
895 | </xs:annotation> | |
896 | </xs:element> | |
897 | ||
898 | ||
668 | 899 | <!-- Eléments mélangés à du texte --> |
669 | 900 | |
670 | 901 | <xs:group name="texte"> |
676 | 907 | <xs:choice> |
677 | 908 | <xs:element ref="LIENPAGE"/> |
678 | 909 | <xs:element ref="LIENWEB"/> |
910 | <xs:element ref="LIENIMAGE"/> | |
679 | 911 | <xs:element ref="FICHIER"/> |
912 | <xs:element ref="SYMBOLE"/> | |
680 | 913 | <xs:element ref="EQUATION"/> |
681 | 914 | <xs:element ref="EQUATEX"/> |
682 | 915 | <xs:element ref="GLOSSAIRE"/> |
712 | 945 | <xs:element ref="FICHIER"/> |
713 | 946 | <xs:element ref="EM"/> |
714 | 947 | </xs:choice> |
715 | <xs:attribute name="contribution" type="xs:string" use="optional"> | |
948 | <xs:attribute name="contribution" type="typeLabel" use="optional"> | |
716 | 949 | <xs:annotation> |
717 | 950 | <xs:documentation> |
718 | 951 | Le label de la contribution. Vide si on veut faire un lien vers la même contribution. |
719 | 952 | </xs:documentation> |
720 | 953 | </xs:annotation> |
721 | 954 | </xs:attribute> |
722 | <xs:attribute name="page" type="xs:string" use="optional"> | |
955 | <xs:attribute name="page" type="typeLabel" use="optional"> | |
723 | 956 | <xs:annotation> |
724 | 957 | <xs:documentation> |
725 | 958 | Le label de la page. Vide si on veut faire un lien vers la première page de la contribution. |
748 | 981 | </xs:documentation> |
749 | 982 | </xs:annotation> |
750 | 983 | </xs:attribute> |
984 | </xs:complexType> | |
985 | </xs:element> | |
986 | ||
987 | <xs:element name="LIENIMAGE"> | |
988 | <xs:annotation> | |
989 | <xs:documentation> | |
990 | Lien vers un environnement d'image dans la même page. | |
991 | Doit contenir du texte ou un fichier sur lequel sera placé le lien. | |
992 | </xs:documentation> | |
993 | </xs:annotation> | |
994 | <xs:complexType mixed="true"> | |
995 | <xs:choice maxOccurs="unbounded" minOccurs="0"> | |
996 | <xs:element ref="FICHIER"/> | |
997 | <xs:element ref="EM"/> | |
998 | </xs:choice> | |
999 | <xs:attribute name="label" type="typeLabel" use="required"> | |
1000 | <xs:annotation> | |
1001 | <xs:documentation> | |
1002 | Label de l'environnement d'image (qui doit se trouver dans la même page). | |
1003 | </xs:documentation> | |
1004 | </xs:annotation> | |
1005 | </xs:attribute> | |
1006 | </xs:complexType> | |
1007 | </xs:element> | |
1008 | ||
1009 | <xs:element name="SYMBOLE"> | |
1010 | <xs:annotation> | |
1011 | <xs:documentation> | |
1012 | Lettre grecque ou petite image à incorporer dans le texte, parmi | |
1013 | les symboles de Jaxe. | |
1014 | </xs:documentation> | |
1015 | </xs:annotation> | |
1016 | <xs:complexType> | |
1017 | <xs:attribute name="nom" type="xs:string" use="required"/> | |
751 | 1018 | </xs:complexType> |
752 | 1019 | </xs:element> |
753 | 1020 | |
814 | 1081 | </xs:complexType> |
815 | 1082 | </xs:element> |
816 | 1083 | |
817 | <xs:element name="EM" type="xs:string"> | |
1084 | <xs:element name="EM"> | |
818 | 1085 | <xs:annotation> |
819 | 1086 | <xs:documentation> |
820 | 1087 | Emphase (généralement transformé en italique à l'affichage) |
821 | 1088 | </xs:documentation> |
822 | 1089 | </xs:annotation> |
1090 | <xs:complexType mixed="true"> | |
1091 | <xs:choice maxOccurs="unbounded" minOccurs="0"> | |
1092 | <xs:element ref="SUP"/> | |
1093 | <xs:element ref="SUB"/> | |
1094 | </xs:choice> | |
1095 | </xs:complexType> | |
823 | 1096 | </xs:element> |
824 | 1097 | |
825 | 1098 | <xs:element name="CODE" type="xs:string"> |
16 | 16 | |
17 | 17 | <xsl:variable name="uri-chemin-xml"><xsl:call-template name="rep-uri"><xsl:with-param name="chemin" select="$jaxe-uri-xml"/></xsl:call-template></xsl:variable> |
18 | 18 | |
19 | <xsl:template match="XPAGES"> | |
20 | <xsl:variable name="contribution"><xsl:choose> | |
21 | <xsl:when test="parent::XPAGES">non</xsl:when> | |
22 | <xsl:otherwise>oui</xsl:otherwise> | |
23 | </xsl:choose></xsl:variable> | |
24 | <xsl:variable name="labelfichiers"><xsl:choose> | |
25 | <xsl:when test="parent::XPAGES"><xsl:value-of select="ancestor::XPAGES[count(parent::XPAGES)=0]/INFORMATIONS/LABEL"/></xsl:when> | |
26 | <xsl:otherwise><xsl:value-of select="INFORMATIONS/LABEL"/></xsl:otherwise> | |
27 | </xsl:choose></xsl:variable> | |
28 | <XPAGES contribution="{$contribution}" labelfichiers="{$labelfichiers}"> | |
29 | <xsl:apply-templates/> | |
30 | </XPAGES> | |
31 | </xsl:template> | |
32 | ||
19 | 33 | <xsl:template match="REFXPAGES"> |
20 | 34 | <xsl:variable name="contrib" select="concat($uri-chemin-xml, $sep, '..', $sep, @label, $sep, @label, '.xml')"/> |
21 | <XPAGES> | |
35 | <XPAGES contribution="oui" labelfichiers="{@label}"> | |
22 | 36 | <xsl:for-each select="document($contrib)/*"> |
23 | 37 | <xsl:apply-templates/> |
24 | 38 | </xsl:for-each> |
6 | 6 | |
7 | 7 | <xsl:param name="jaxe-fichier-xml"/> |
8 | 8 | <xsl:param name="jaxe-fichier-xsl"/> |
9 | <xsl:param name="jaxe-fichier-destination"/> | |
10 | <xsl:param name="jaxe-uri-destination"/> | |
9 | 11 | |
10 | 12 | <!-- Recopie du fichier XML, copie des fichiers, réduction des images, création de images.xml --> |
11 | 13 | <!-- (on ne peut pas faire ça dans XPAGES3.xsl à cause de la valeur différente pour output method) --> |
23 | 25 | <xsl:variable name="chemin-xsl"><xsl:call-template name="rep-fichier"><xsl:with-param name="chemin" select="$jaxe-fichier-xsl"/></xsl:call-template></xsl:variable> |
24 | 26 | |
25 | 27 | <!-- chemin du répertoire dans lequel les fichiers HTML seront générés --> |
26 | <xsl:param name="chemin-site"><xsl:value-of select="concat($chemin-xml, $sep, 'site')"/></xsl:param> | |
28 | <xsl:param name="chemin-site"><xsl:choose> | |
29 | <xsl:when test="$jaxe-fichier-destination!=''"><xsl:call-template name="rep-fichier"><xsl:with-param name="chemin" select="$jaxe-fichier-destination"/></xsl:call-template></xsl:when> | |
30 | <xsl:otherwise><xsl:value-of select="$chemin-xml"/></xsl:otherwise> | |
31 | </xsl:choose><xsl:value-of select="concat($sep, 'site')"/></xsl:param> | |
27 | 32 | |
28 | 33 | <!-- chemin du répertoire contribXML (dans lequel se trouvent toutes les contributions) --> |
29 | 34 | <xsl:variable name="chemin-contrib"><xsl:call-template name="rep-fichier"><xsl:with-param name="chemin" select="$chemin-xml"/></xsl:call-template></xsl:variable> |
63 | 68 | <xsl:template name="copier-fichiers-contrib"> |
64 | 69 | <xsl:if test="function-available('faire-images:copierDossierContrib')"> |
65 | 70 | <xsl:for-each select="//XPAGES"> |
66 | <xsl:variable name="label-ensemble" select="INFORMATIONS/LABEL"/> | |
67 | <xsl:if test="$label-ensemble!=''"> | |
68 | <xsl:variable name="res" select="faire-images:copierDossierContrib(string(concat($chemin-contrib, $sep, $label-ensemble)), string($chemin-site))"/> | |
71 | <xsl:variable name="label-fichiers" select="@labelfichiers"/> | |
72 | <xsl:if test="$label-fichiers!='' and not(preceding-sibling::XPAGES/@labelfichiers=$label-fichiers)"> | |
73 | <xsl:variable name="res" select="faire-images:copierDossierContrib(string(concat($chemin-contrib, $sep, $label-fichiers)), string($chemin-site))"/> | |
69 | 74 | <xsl:if test="$res!='ok'"> |
70 | <xsl:message>Erreur à la copie du dossier contrib <xsl:value-of select="$label-ensemble"/></xsl:message> | |
75 | <xsl:message>Erreur à la copie du dossier contrib <xsl:value-of select="$label-fichiers"/></xsl:message> | |
71 | 76 | </xsl:if> |
72 | 77 | </xsl:if> |
73 | 78 | </xsl:for-each> |
100 | 105 | </xsl:text> |
101 | 106 | <xsl:for-each select="//FICHIER[@nom!='']|//LOGO[@fichier!='']"> |
102 | 107 | <xsl:variable name="label-ensemble" select="ancestor::XPAGES[1]/INFORMATIONS/LABEL"/> |
108 | <xsl:variable name="label-fichiers" select="ancestor::XPAGES[1]/@labelfichiers"/> | |
103 | 109 | <xsl:variable name="localisation"><xsl:choose> |
104 | 110 | <xsl:when test="parent::ENVIMAGE and ../@localisation!=''"><xsl:value-of select="../@localisation"/></xsl:when> |
105 | 111 | <xsl:otherwise>texte</xsl:otherwise> |
106 | 112 | </xsl:choose></xsl:variable> |
107 | <xsl:variable name="dossierfichier" select="concat($chemin-contrib, $sep, $label-ensemble)"/> | |
108 | <xsl:variable name="dossier-res" select="concat($chemin-site, '/pages_', $label-ensemble)"/> | |
113 | <xsl:variable name="dossierfichier" select="concat($chemin-contrib, $sep, $label-fichiers)"/> | |
114 | <xsl:variable name="dossier-res" select="concat($chemin-site, '/pages_', $label-fichiers)"/> | |
109 | 115 | <xsl:variable name="res" select="faire-images:transfo(string($dossierfichier), string(@nom|@fichier), string($localisation), string($dossier-res))"/> |
110 | 116 | <xsl:if test="faire-images:resok($res)='erreur'"> |
111 | <xsl:message>Erreur à la réduction de l'image <xsl:value-of select="@nom|@fichier"/> de la contrib <xsl:value-of select="$label-ensemble"/></xsl:message> | |
117 | <xsl:message>Erreur à la réduction de l'image <xsl:value-of select="@nom|@fichier"/> de la contrib <xsl:value-of select="$label-fichiers"/></xsl:message> | |
112 | 118 | </xsl:if> |
113 | 119 | <xsl:variable name="redim"><xsl:choose> |
114 | 120 | <xsl:when test="faire-images:resok($res)='réduit'">oui</xsl:when> |
115 | 121 | <xsl:otherwise>non</xsl:otherwise> |
116 | 122 | </xsl:choose></xsl:variable> |
117 | <IMAGE nom="{@nom|@fichier}" contrib="{$label-ensemble}" localisation="{$localisation}" redim="{$redim}" largeur1="{faire-images:largeur1($res)}" hauteur1="{faire-images:hauteur1($res)}"> | |
123 | <IMAGE nom="{@nom|@fichier}" contrib="{$label-fichiers}" localisation="{$localisation}" redim="{$redim}" largeur1="{faire-images:largeur1($res)}" hauteur1="{faire-images:hauteur1($res)}"> | |
118 | 124 | <xsl:if test="$redim='oui'"> |
119 | 125 | <xsl:attribute name="largeur2"><xsl:value-of select="faire-images:largeur2($res)"/></xsl:attribute> |
120 | 126 | <xsl:attribute name="hauteur2"><xsl:value-of select="faire-images:hauteur2($res)"/></xsl:attribute> |
121 | 127 | </xsl:if> |
122 | 128 | </IMAGE><xsl:text> |
123 | 129 | </xsl:text> |
130 | <!-- réduction pour l'impression (localisation: texte) --> | |
131 | <xsl:if test="$localisation!='texte'"> | |
132 | <xsl:variable name="res2" select="faire-images:transfo(string($dossierfichier), string(@nom|@fichier), string('texte'), string($dossier-res))"/> | |
133 | <xsl:if test="faire-images:resok($res2)='erreur'"> | |
134 | <xsl:message>Erreur à la réduction pour l'impression de l'image <xsl:value-of select="@nom|@fichier"/> de la contrib <xsl:value-of select="$label-fichiers"/></xsl:message> | |
135 | </xsl:if> | |
136 | <xsl:variable name="redim2"><xsl:choose> | |
137 | <xsl:when test="faire-images:resok($res2)='réduit'">oui</xsl:when> | |
138 | <xsl:otherwise>non</xsl:otherwise> | |
139 | </xsl:choose></xsl:variable> | |
140 | <IMAGE nom="{@nom|@fichier}" contrib="{$label-fichiers}" localisation="texte" redim="{$redim2}" largeur1="{faire-images:largeur1($res2)}" hauteur1="{faire-images:hauteur1($res2)}"> | |
141 | <xsl:if test="$redim2='oui'"> | |
142 | <xsl:attribute name="largeur2"><xsl:value-of select="faire-images:largeur2($res2)"/></xsl:attribute> | |
143 | <xsl:attribute name="hauteur2"><xsl:value-of select="faire-images:hauteur2($res2)"/></xsl:attribute> | |
144 | </xsl:if> | |
145 | </IMAGE><xsl:text> | |
146 | </xsl:text> | |
147 | </xsl:if> | |
124 | 148 | </xsl:for-each> |
125 | 149 | </IMAGES> |
126 | 150 | </xsl:with-param> |
133 | 157 | <xsl:for-each select="//EQUATION | //EQUATEX"> |
134 | 158 | <xsl:variable name="label-ensemble" select="ancestor::XPAGES[1]/INFORMATIONS/LABEL"/> |
135 | 159 | <xsl:variable name="numero"><xsl:number from="XPAGES" count="EQUATION|EQUATEX" level="any"/></xsl:variable> |
136 | <xsl:variable name="dossier-res" select="concat($chemin-site, '/pages_', $label-ensemble)"/> | |
160 | <xsl:variable name="dossier-res" select="concat($chemin-site, '/pages_', ancestor::XPAGES[1]/@labelfichiers)"/> | |
137 | 161 | <xsl:variable name="res" select="faire-images:creerImageEquation(string(.), string($numero), string($label-ensemble), string($dossier-res))"/> |
138 | 162 | <xsl:if test="$res!='ok'"> |
139 | 163 | <xsl:message>Erreur à la copie du dossier contrib <xsl:value-of select="$label-ensemble"/></xsl:message> |
6 | 6 | <xsl:param name="jaxe-fichier-xml"/> |
7 | 7 | <xsl:param name="jaxe-fichier-xsl"/> |
8 | 8 | <xsl:param name="jaxe-uri-xml"/> |
9 | <xsl:param name="affichage">web</xsl:param> <!-- web / impression --> | |
9 | <xsl:param name="jaxe-fichier-destination"/> | |
10 | <xsl:param name="jaxe-uri-destination"/> | |
11 | ||
12 | <xsl:param name="sortie">public</xsl:param> <!-- public|production --> | |
13 | <!-- les solutions des exercices d'évaluation et les commentaires sont affichées si sortie=production --> | |
10 | 14 | |
11 | 15 | <!-- séparateur de chemins ( / ou \ ) --> |
12 | 16 | <xsl:variable name="sep"><xsl:choose> |
22 | 26 | <xsl:variable name="chemin-xsl"><xsl:call-template name="rep-fichier"><xsl:with-param name="chemin" select="$jaxe-fichier-xsl"/></xsl:call-template></xsl:variable> |
23 | 27 | |
24 | 28 | <!-- chemin du répertoire dans lequel les fichiers HTML seront générés --> |
25 | <xsl:param name="chemin-site"><xsl:value-of select="concat($chemin-xml, $sep, 'site')"/></xsl:param> | |
26 | <xsl:param name="uri-site"><xsl:value-of select="concat($uri-chemin-xml, '/site')"/></xsl:param> | |
29 | <xsl:param name="chemin-site"><xsl:choose> | |
30 | <xsl:when test="$jaxe-fichier-destination!=''"><xsl:call-template name="rep-fichier"><xsl:with-param name="chemin" select="$jaxe-fichier-destination"/></xsl:call-template></xsl:when> | |
31 | <xsl:otherwise><xsl:value-of select="$chemin-xml"/></xsl:otherwise> | |
32 | </xsl:choose><xsl:value-of select="concat($sep, 'site')"/></xsl:param> | |
33 | <xsl:param name="uri-site"><xsl:choose> | |
34 | <xsl:when test="$jaxe-uri-destination!=''"><xsl:call-template name="rep-uri"><xsl:with-param name="chemin" select="$jaxe-uri-destination"/></xsl:call-template></xsl:when> | |
35 | <xsl:otherwise><xsl:value-of select="$uri-chemin-xml"/></xsl:otherwise> | |
36 | </xsl:choose>/site</xsl:param> | |
37 | ||
38 | <xsl:param name="rubriques">oui</xsl:param> <!-- oui/non --> | |
27 | 39 | |
28 | 40 | <!-- chemin du répertoire contribXML (dans lequel se trouvent toutes les contributions) --> |
29 | 41 | <xsl:variable name="chemin-contrib"><xsl:call-template name="rep-fichier"><xsl:with-param name="chemin" select="$chemin-xml"/></xsl:call-template></xsl:variable> |
30 | 42 | |
31 | <xsl:variable name="feuille-de-style"><xsl:choose> | |
32 | <xsl:when test="$affichage='web'">style.css</xsl:when> | |
33 | <xsl:otherwise>style_impression.css</xsl:otherwise> <!-- à faire --> | |
34 | </xsl:choose></xsl:variable> | |
43 | <xsl:variable name="feuille-de-style">style.css</xsl:variable> | |
35 | 44 | |
36 | 45 | <xsl:variable name="interface_par_defaut">peinture</xsl:variable> |
37 | 46 | |
44 | 53 | <xsl:variable name="messages" select="document(concat($chemin-xsl, '/XPAGES_messages_', $langue, '.xml'))/messages"/> |
45 | 54 | |
46 | 55 | |
47 | ||
56 | ||
48 | 57 | <xsl:template match="/"> |
49 | 58 | |
50 | 59 | <!-- nom du fichier XML (qui doit être égal au label de l'ensemble) --> |
63 | 72 | |
64 | 73 | <xsl:call-template name="infos-erreurs"/> |
65 | 74 | |
75 | <xsl:call-template name="fichier-index"/> | |
76 | ||
77 | <xsl:if test="$nomrep = XPAGES/INFORMATIONS/LABEL and $nomfichierxml = concat($nomrep, '.xml')"> | |
78 | ||
79 | <xsl:apply-templates/> | |
80 | ||
81 | <p><a href="site/index.html"><xsl:value-of select="$messages/message[@label='aller à la page d_accueil du site']"/></a></p> | |
82 | <p><a href="site/pages_{XPAGES/INFORMATIONS/LABEL}/sommaire.html"><xsl:value-of select="$messages/message[@label='aller au sommaire']"/></a></p> | |
83 | <p><a href="site/pages_{XPAGES/INFORMATIONS/LABEL}/impression.html"><xsl:value-of select="$messages/message[@label='aller à la page d_impression']"/></a></p> | |
84 | </xsl:if> | |
85 | ||
86 | </body> | |
87 | </html> | |
88 | ||
89 | <xsl:if test="$sortie='production'"> | |
90 | <xsl:call-template name="mauvais-liens"/> | |
91 | <xsl:call-template name="labels"/> | |
92 | <xsl:call-template name="commentaires"/> | |
93 | <xsl:call-template name="credits"/> | |
94 | </xsl:if> | |
95 | </xsl:template> | |
96 | ||
97 | ||
98 | <xsl:template name="infos-erreurs"> | |
99 | <!-- nom du fichier XML (qui doit être égal au label de l'ensemble) --> | |
100 | <xsl:variable name="nomfichierxml"><xsl:call-template name="nom-fichier"> | |
101 | <xsl:with-param name="chemin" select="$jaxe-fichier-xml"/> | |
102 | </xsl:call-template></xsl:variable> | |
103 | ||
104 | <!-- nom du répertoire du fichier XML (qui doit être égal au label de l'ensemble) --> | |
105 | <xsl:variable name="nomrep"><xsl:call-template name="nom-fichier"><xsl:with-param name="chemin" select="$chemin-xml"/></xsl:call-template></xsl:variable> | |
106 | ||
107 | <xsl:choose> | |
108 | <xsl:when test="count(/XPAGES/INFORMATIONS) = 0"> | |
109 | <p><b><xsl:value-of select="$messages/message[@label='Attention !']"/></b> <xsl:value-of select="$messages/message[@label='L_élément INFORMATIONS est obligatoire sous la racine XPAGE. C_est un élément à insérer en premier dans le document, et qui permet de spécifier son label et son titre.']"/></p> | |
110 | </xsl:when> | |
111 | ||
112 | <xsl:when test="count(/XPAGES/INFORMATIONS/LABEL) = 0"> | |
113 | <p><b><xsl:value-of select="$messages/message[@label='Attention !']"/></b> <xsl:value-of select="$messages/message[@label='Le label est obligatoire dans les informations. Il permet d_identifier le document, et de faire des liens vers ce document depuis d_autres documents XPAGES. Ce label doit correspondre au nom du fichier XML et au nom du dossier parent.']"/></p> | |
114 | </xsl:when> | |
115 | ||
116 | <xsl:when test="$nomrep != /XPAGES/INFORMATIONS/LABEL or $nomfichierxml != concat($nomrep, '.xml')"> | |
117 | <p><b><xsl:value-of select="$messages/message[@label='Attention !']"/></b> <xsl:value-of select="$messages/message[@label='Le nom du dossier doit être égal au label du document, et le nom du fichier XML doit être le label avec l_extension .xml.']"/></p> | |
118 | <p><xsl:value-of select="$messages/message[@label='Actuellement, le nom du dossier est']"/> <tt><xsl:value-of select="$nomrep"/></tt><xsl:value-of select="$messages/message[@label=', le label du document est']"/> <tt><xsl:value-of select="/XPAGES/INFORMATIONS/LABEL"/></tt><xsl:value-of select="$messages/message[@label=', et le nom du fichier est']"/> <tt><xsl:value-of select="$nomfichierxml"/></tt></p> | |
119 | </xsl:when> | |
120 | </xsl:choose> | |
121 | </xsl:template> | |
122 | ||
123 | ||
124 | <xsl:template name="fichier-index"> | |
66 | 125 | <!-- fichier site/index.html --> |
67 | 126 | <xsl:for-each select="/XPAGES"> |
68 | 127 | <xsl:choose> |
86 | 145 | </xsl:otherwise> |
87 | 146 | </xsl:choose> |
88 | 147 | </xsl:for-each> |
89 | ||
90 | <xsl:if test="$nomrep = XPAGES/INFORMATIONS/LABEL and $nomfichierxml = concat($nomrep, '.xml')"> | |
91 | ||
92 | <xsl:apply-templates/> | |
93 | ||
94 | <xsl:choose> | |
95 | <xsl:when test="$affichage='web'"> | |
96 | <p><a href="site/index.html"><xsl:value-of select="$messages/message[@label='aller à la page d_accueil du site']"/></a></p> | |
97 | <p><a href="site/pages_{XPAGES/INFORMATIONS/LABEL}/sommaire.html"><xsl:value-of select="$messages/message[@label='aller au sommaire']"/></a></p> | |
98 | </xsl:when> | |
99 | <xsl:otherwise> | |
100 | <p><a href="site/pages_{XPAGES/INFORMATIONS/LABEL}/impression.html"><xsl:value-of select="$messages/message[@label='aller à la page d_impression']"/></a></p> | |
101 | </xsl:otherwise> | |
102 | </xsl:choose> | |
103 | </xsl:if> | |
104 | ||
105 | </body> | |
106 | </html> | |
107 | </xsl:template> | |
108 | ||
109 | ||
110 | <xsl:template name="infos-erreurs"> | |
111 | <!-- nom du fichier XML (qui doit être égal au label de l'ensemble) --> | |
112 | <xsl:variable name="nomfichierxml"><xsl:call-template name="nom-fichier"> | |
113 | <xsl:with-param name="chemin" select="$jaxe-fichier-xml"/> | |
114 | </xsl:call-template></xsl:variable> | |
115 | ||
116 | <!-- nom du répertoire du fichier XML (qui doit être égal au label de l'ensemble) --> | |
117 | <xsl:variable name="nomrep"><xsl:call-template name="nom-fichier"><xsl:with-param name="chemin" select="$chemin-xml"/></xsl:call-template></xsl:variable> | |
118 | ||
119 | <xsl:choose> | |
120 | <xsl:when test="count(/XPAGES/INFORMATIONS) = 0"> | |
121 | <p><b><xsl:value-of select="$messages/message[@label='Attention !']"/></b> <xsl:value-of select="$messages/message[@label='L_élément INFORMATIONS est obligatoire sous la racine XPAGE. C_est un élément à insérer en premier dans le document, et qui permet de spécifier son label et son titre.']"/></p> | |
122 | </xsl:when> | |
123 | ||
124 | <xsl:when test="count(/XPAGES/INFORMATIONS/LABEL) = 0"> | |
125 | <p><b><xsl:value-of select="$messages/message[@label='Attention !']"/></b> <xsl:value-of select="$messages/message[@label='Le label est obligatoire dans les informations. Il permet d_identifier le document, et de faire des liens vers ce document depuis d_autres documents XPAGES. Ce label doit correspondre au nom du fichier XML et au nom du dossier parent.']"/></p> | |
126 | </xsl:when> | |
127 | ||
128 | <xsl:when test="$nomrep != /XPAGES/INFORMATIONS/LABEL or $nomfichierxml != concat($nomrep, '.xml')"> | |
129 | <p><b><xsl:value-of select="$messages/message[@label='Attention !']"/></b> <xsl:value-of select="$messages/message[@label='Le nom du dossier doit être égal au label du document, et le nom du fichier XML doit être le label avec l_extension .xml.']"/></p> | |
130 | <p><xsl:value-of select="$messages/message[@label='Actuellement, le nom du dossier est']"/> <tt><xsl:value-of select="$nomrep"/></tt><xsl:value-of select="$messages/message[@label=', le label du document est']"/> <tt><xsl:value-of select="/XPAGES/INFORMATIONS/LABEL"/></tt><xsl:value-of select="$messages/message[@label=', et le nom du fichier est']"/> <tt><xsl:value-of select="$nomfichierxml"/></tt></p> | |
131 | </xsl:when> | |
132 | </xsl:choose> | |
133 | 148 | </xsl:template> |
134 | 149 | |
135 | 150 | |
136 | 151 | <xsl:template match="XPAGES"> |
137 | 152 | |
138 | 153 | <xsl:variable name="prefixe">../</xsl:variable> |
139 | <xsl:variable name="interface"><xsl:value-of select="$prefixe"/>interface/<xsl:choose> | |
154 | <xsl:variable name="interface">interface/<xsl:choose> | |
140 | 155 | <xsl:when test="count(ancestor-or-self::XPAGES[INFORMATIONS/INTERFACE!='']) > 0"><xsl:value-of select="ancestor-or-self::XPAGES[INFORMATIONS/INTERFACE!=''][1]/INFORMATIONS/INTERFACE"/></xsl:when> |
141 | 156 | <xsl:otherwise><xsl:value-of select="$interface_par_defaut"/></xsl:otherwise> |
142 | 157 | </xsl:choose></xsl:variable> |
143 | 158 | |
144 | <xsl:choose> | |
145 | <xsl:when test="$affichage='web'"> | |
146 | ||
159 | <xsl:variable name="nom-fichier-index"><xsl:choose> | |
160 | <xsl:when test="@contribution='oui'">index.html</xsl:when> | |
161 | <xsl:otherwise><xsl:value-of select="INFORMATIONS/LABEL"/>_index.html</xsl:otherwise> | |
162 | </xsl:choose></xsl:variable> | |
163 | <xsl:if test="@contribution!='oui' or count(PAGE[@label='index'])=0"> | |
164 | <xsl:call-template name="ecrire-fichier"> | |
165 | <xsl:with-param name="fichier" select="concat($chemin-site, $sep, 'pages_', @labelfichiers, $sep, $nom-fichier-index)"/> | |
166 | <xsl:with-param name="contenu"> | |
167 | <xsl:call-template name="page-index"> | |
168 | <xsl:with-param name="interface"><xsl:value-of select="$interface"/></xsl:with-param> | |
169 | </xsl:call-template> | |
170 | </xsl:with-param> | |
171 | </xsl:call-template> | |
172 | </xsl:if> | |
173 | ||
174 | <xsl:apply-templates select="PAGE|XPAGES"/> | |
175 | ||
176 | <xsl:for-each select="PAGE//EXERCICE | PAGE//QCM"> | |
177 | <xsl:call-template name="fichiers-aide"> | |
178 | <xsl:with-param name="interface"><xsl:value-of select="$interface"/></xsl:with-param> | |
179 | </xsl:call-template> | |
180 | </xsl:for-each> | |
181 | ||
182 | <xsl:if test="count(ancestor::XPAGES)=0"> | |
183 | <xsl:call-template name="ecrire-fichier"> | |
184 | <xsl:with-param name="fichier" select="concat($chemin-site, $sep, 'pages_', INFORMATIONS/LABEL, $sep, 'sommaire.html')"/> | |
185 | <xsl:with-param name="contenu"> | |
186 | <xsl:call-template name="page-sommaire"> | |
187 | <xsl:with-param name="interface"><xsl:value-of select="$interface"/></xsl:with-param> | |
188 | </xsl:call-template> | |
189 | </xsl:with-param> | |
190 | </xsl:call-template> | |
191 | ||
192 | <xsl:if test="//GLOSSAIRE"> | |
147 | 193 | <xsl:call-template name="ecrire-fichier"> |
148 | <xsl:with-param name="fichier" select="concat($chemin-site, $sep, 'pages_', INFORMATIONS/LABEL, $sep, 'index.html')"/> | |
194 | <xsl:with-param name="fichier" select="concat($chemin-site, $sep, 'pages_', INFORMATIONS/LABEL, $sep, 'glossaire.html')"/> | |
149 | 195 | <xsl:with-param name="contenu"> |
150 | <xsl:call-template name="page-index"> | |
196 | <xsl:call-template name="page-glossaire"> | |
151 | 197 | <xsl:with-param name="interface"><xsl:value-of select="$interface"/></xsl:with-param> |
152 | 198 | </xsl:call-template> |
153 | 199 | </xsl:with-param> |
154 | 200 | </xsl:call-template> |
155 | ||
156 | <xsl:apply-templates select="PAGE[@label!='index']|XPAGES"/> | |
157 | ||
158 | <xsl:call-template name="ecrire-fichier"> | |
159 | <xsl:with-param name="fichier" select="concat($chemin-site, $sep, 'pages_', INFORMATIONS/LABEL, $sep, 'sommaire.html')"/> | |
160 | <xsl:with-param name="contenu"> | |
161 | <xsl:call-template name="page-sommaire"/> | |
162 | </xsl:with-param> | |
201 | </xsl:if> | |
202 | </xsl:if> | |
203 | ||
204 | <xsl:for-each select="PAGE//ENVIMAGE/FICHIER"> | |
205 | <xsl:variable name="label-fichiers" select="ancestor::XPAGES[1]/@labelfichiers"/> | |
206 | <xsl:variable name="nomfichier" select="@nom"/> | |
207 | <xsl:variable name="localisation" select="../@localisation"/> | |
208 | <xsl:variable name="largeur1" select="document(concat($uri-site, '/images.xml'))/IMAGES/IMAGE[@contrib=$label-fichiers and @nom=$nomfichier and @localisation=$localisation]/@largeur1"/> | |
209 | <xsl:variable name="hauteur1" select="document(concat($uri-site, '/images.xml'))/IMAGES/IMAGE[@contrib=$label-fichiers and @nom=$nomfichier and @localisation=$localisation]/@hauteur1"/> | |
210 | <xsl:variable name="redim" select="document(concat($uri-site, '/images.xml'))/IMAGES/IMAGE[@contrib=$label-fichiers and @nom=$nomfichier and @localisation=$localisation]/@redim"/> | |
211 | <xsl:if test="($redim='oui' or $localisation='icône') and count(preceding::FICHIER[@nom=$nomfichier and ancestor::XPAGES[1]/@labelfichiers=$label-fichiers])=0"> | |
212 | <!-- les vidéos ne peuvent pas être redimensionnées mais il faut un fichier HTML si elles sont en icône --> | |
213 | <xsl:call-template name="html-figure"> | |
214 | <xsl:with-param name="interface" select="$interface"/> | |
215 | <xsl:with-param name="largeur1" select="$largeur1"/> | |
216 | <xsl:with-param name="hauteur1" select="$hauteur1"/> | |
163 | 217 | </xsl:call-template> |
164 | ||
165 | <xsl:if test="//GLOSSAIRE"> | |
166 | <xsl:call-template name="ecrire-fichier"> | |
167 | <xsl:with-param name="fichier" select="concat($chemin-site, $sep, 'pages_', INFORMATIONS/LABEL, $sep, 'glossaire.html')"/> | |
168 | <xsl:with-param name="contenu"> | |
169 | <xsl:call-template name="page-glossaire"/> | |
170 | </xsl:with-param> | |
171 | </xsl:call-template> | |
172 | </xsl:if> | |
173 | ||
174 | <xsl:if test="count(ancestor::XPAGES)=0"> | |
175 | <xsl:for-each select="//ENVIMAGE/FICHIER[1]"> | |
176 | <xsl:variable name="label-ensemble" select="ancestor::XPAGES[1]/INFORMATIONS/LABEL"/> | |
177 | <xsl:variable name="nomfichier" select="@nom"/> | |
178 | <xsl:variable name="localisation" select="../@localisation"/> | |
179 | <xsl:variable name="largeur1" select="document(concat($uri-site, '/images.xml'))/IMAGES/IMAGE[@contrib=$label-ensemble and @nom=$nomfichier and @localisation=$localisation]/@largeur1"/> | |
180 | <xsl:variable name="hauteur1" select="document(concat($uri-site, '/images.xml'))/IMAGES/IMAGE[@contrib=$label-ensemble and @nom=$nomfichier and @localisation=$localisation]/@hauteur1"/> | |
181 | <xsl:variable name="redim" select="document(concat($uri-site, '/images.xml'))/IMAGES/IMAGE[@contrib=$label-ensemble and @nom=$nomfichier and @localisation=$localisation]/@redim"/> | |
182 | <xsl:if test="($redim='oui' or $localisation='icône') and count(preceding::FICHIER[@nom=$nomfichier and ancestor::XPAGES[1]/INFORMATIONS/LABEL=$label-ensemble])=0"> | |
183 | <!-- les vidéos ne peuvent pas être redimensionnées mais il faut un fichier HTML si elles sont en icône --> | |
184 | <xsl:call-template name="html-figure"> | |
185 | <xsl:with-param name="largeur1" select="$largeur1"/> | |
186 | <xsl:with-param name="hauteur1" select="$hauteur1"/> | |
187 | </xsl:call-template> | |
188 | </xsl:if> | |
189 | </xsl:for-each> | |
190 | </xsl:if> | |
191 | </xsl:when> | |
192 | ||
193 | <xsl:otherwise> | |
194 | <xsl:choose> | |
195 | <xsl:when test="count(ancestor::XPAGES)=0"> | |
196 | <xsl:call-template name="ecrire-fichier"> | |
197 | <xsl:with-param name="fichier" select="concat($chemin-site, $sep, 'pages_', INFORMATIONS/LABEL, $sep, 'impression.html')"/> | |
198 | <xsl:with-param name="contenu"> | |
199 | <html> | |
200 | <head> | |
201 | <title><xsl:value-of select="$messages/message[@label='Page pour l_impression']"/></title> | |
202 | <link type="text/css" rel="stylesheet" href="{$interface}/{$feuille-de-style}"/> | |
203 | </head> | |
204 | <body> | |
205 | <xsl:apply-templates select="PAGE|XPAGES"/> | |
206 | </body> | |
207 | </html> | |
208 | </xsl:with-param> | |
209 | </xsl:call-template> | |
210 | </xsl:when> | |
211 | <xsl:otherwise> | |
212 | <xsl:apply-templates select="PAGE|XPAGES"/> | |
213 | </xsl:otherwise> | |
214 | </xsl:choose> | |
215 | </xsl:otherwise> | |
216 | </xsl:choose> | |
218 | </xsl:if> | |
219 | </xsl:for-each> | |
220 | ||
221 | <xsl:variable name="nom-fichier-impression"><xsl:choose> | |
222 | <xsl:when test="@contribution='oui'">impression.html</xsl:when> | |
223 | <xsl:otherwise><xsl:value-of select="INFORMATIONS/LABEL"/>_impression.html</xsl:otherwise> | |
224 | </xsl:choose></xsl:variable> | |
225 | <xsl:call-template name="ecrire-fichier"> | |
226 | <xsl:with-param name="fichier" select="concat($chemin-site, $sep, 'pages_', @labelfichiers, $sep, $nom-fichier-impression)"/> | |
227 | <xsl:with-param name="contenu"> | |
228 | <xsl:call-template name="contenu-impression"> | |
229 | <xsl:with-param name="interface"><xsl:value-of select="$interface"/></xsl:with-param> | |
230 | </xsl:call-template> | |
231 | </xsl:with-param> | |
232 | </xsl:call-template> | |
217 | 233 | |
218 | 234 | </xsl:template> |
219 | 235 | |
258 | 274 | <xsl:if test="INFORMATIONS/TITRE!=''"> |
259 | 275 | <title><xsl:value-of select="INFORMATIONS/TITRE"/></title> |
260 | 276 | </xsl:if> |
261 | <link type="text/css" rel="stylesheet" href="{$interface}/{$feuille-de-style}"/> | |
277 | <link type="text/css" rel="stylesheet" href="{$prefixe}{$interface}/{$feuille-de-style}"/> | |
262 | 278 | <xsl:for-each select="preceding::PAGE[1]"> |
263 | <link rel="Prev" href="{$prefixe}pages_{../INFORMATIONS/LABEL}/{@label}.html"/> | |
279 | <link rel="Prev" href="{$prefixe}pages_{ancestor::XPAGES[1]/@labelfichiers}/{@label}.html"/> | |
264 | 280 | </xsl:for-each> |
265 | 281 | <xsl:variable name="nb" select="count(ancestor-or-self::XPAGES)"/> |
266 | 282 | <link rel="Contents" href="{$prefixe}pages_{ancestor-or-self::XPAGES[$nb]/INFORMATIONS/LABEL}/sommaire.html"/> |
267 | 283 | <link rel="Start" href="{PAGE[1]/@label}.html"/> |
268 | 284 | <xsl:for-each select="PAGE[1]"> |
269 | <link rel="Next" href="{$prefixe}pages_{../INFORMATIONS/LABEL}/{@label}.html"/> | |
285 | <link rel="Next" href="{$prefixe}pages_{ancestor::XPAGES[1]/@labelfichiers}/{@label}.html"/> | |
270 | 286 | </xsl:for-each> |
271 | 287 | <xsl:choose> |
272 | 288 | <xsl:when test="count(ancestor::XPAGES) > 1"> |
273 | <link rel="Up" href="{$prefixe}pages_{ancestor::XPAGES[1]/INFORMATIONS/LABEL}/index.html"/> | |
289 | <xsl:for-each select="ancestor::XPAGES[1]"> | |
290 | <xsl:variable name="nom-fichier-index"><xsl:choose> | |
291 | <xsl:when test="@contribution='oui'">index.html</xsl:when> | |
292 | <xsl:otherwise><xsl:value-of select="INFORMATIONS/LABEL"/>_index.html</xsl:otherwise> | |
293 | </xsl:choose></xsl:variable> | |
294 | <link rel="Up" href="{$prefixe}pages_{INFORMATIONS/LABEL}/{$nom-fichier-index}"/> | |
295 | </xsl:for-each> | |
274 | 296 | </xsl:when> |
275 | 297 | <xsl:otherwise> |
276 | 298 | <link rel="Up" href="{$prefixe}index.html"/> |
278 | 300 | </xsl:choose> |
279 | 301 | </head> |
280 | 302 | <body class="page"> |
281 | <xsl:call-template name="contenu-body"/> | |
303 | <xsl:call-template name="contenu-body"> | |
304 | <xsl:with-param name="interface" select="$interface"/> | |
305 | </xsl:call-template> | |
282 | 306 | </body> |
283 | 307 | </html> |
284 | 308 | </xsl:template> |
297 | 321 | </xsl:choose></a> |
298 | 322 | </xsl:when> |
299 | 323 | <xsl:when test="self::XPAGES"> |
300 | <a href="{$prefixe}pages_{INFORMATIONS/LABEL}/{PAGE[1]/@label}.html" class="lien"><xsl:value-of select="INFORMATIONS/TITRE"/></a> | |
324 | <xsl:choose> | |
325 | <xsl:when test="*[self::PAGE|self::XPAGES][1][self::PAGE]"> | |
326 | <a href="{$prefixe}pages_{@labelfichiers}/{PAGE[1]/@label}.html" class="lien"><xsl:value-of select="INFORMATIONS/TITRE"/></a> | |
327 | </xsl:when> | |
328 | <xsl:otherwise> | |
329 | <xsl:variable name="nom-fichier-index"><xsl:choose> | |
330 | <xsl:when test="@contribution='oui'">index.html</xsl:when> | |
331 | <xsl:otherwise><xsl:value-of select="INFORMATIONS/LABEL"/>_index.html</xsl:otherwise> | |
332 | </xsl:choose></xsl:variable> | |
333 | <a href="{$prefixe}pages_{ancestor-or-self::XPAGES[1]/@labelfichiers}/{$nom-fichier-index}" class="lien"><xsl:value-of select="INFORMATIONS/TITRE"/></a> | |
334 | </xsl:otherwise> | |
335 | </xsl:choose> | |
301 | 336 | </xsl:when> |
302 | 337 | </xsl:choose> |
303 | 338 | </li> |
307 | 342 | |
308 | 343 | |
309 | 344 | <xsl:template match="PAGE"> |
310 | <xsl:choose> | |
311 | <xsl:when test="$affichage='web'"> | |
312 | <xsl:call-template name="ecrire-fichier"> | |
313 | <xsl:with-param name="fichier" select="concat($chemin-site, $sep, 'pages_', ../INFORMATIONS/LABEL, $sep, @label,'.html')"/> | |
314 | <xsl:with-param name="contenu"> | |
315 | <xsl:call-template name="contenu-page"/> | |
316 | </xsl:with-param> | |
317 | </xsl:call-template> | |
318 | </xsl:when> | |
319 | <xsl:otherwise> | |
320 | <xsl:call-template name="contenu-body"/> | |
321 | <div style="page-break-after: always"/> <!-- pour les navigateurs comprenant CSS 2 --> | |
322 | </xsl:otherwise> | |
323 | </xsl:choose> | |
345 | <xsl:variable name="label-contrib" select="ancestor::XPAGES[1]/@labelfichiers"/> | |
346 | <xsl:call-template name="ecrire-fichier"> | |
347 | <xsl:with-param name="fichier" select="concat($chemin-site, $sep, 'pages_', $label-contrib, $sep, @label,'.html')"/> | |
348 | <xsl:with-param name="contenu"> | |
349 | <xsl:call-template name="contenu-page"/> | |
350 | </xsl:with-param> | |
351 | </xsl:call-template> | |
324 | 352 | </xsl:template> |
325 | 353 | |
326 | 354 | |
327 | 355 | <xsl:template name="contenu-page"> |
328 | 356 | <xsl:variable name="prefixe">../</xsl:variable> |
329 | <xsl:variable name="interface"><xsl:value-of select="$prefixe"/>interface/<xsl:choose> | |
357 | <xsl:variable name="interface">interface/<xsl:choose> | |
330 | 358 | <xsl:when test="count(ancestor-or-self::XPAGES[INFORMATIONS/INTERFACE!='']) > 0"><xsl:value-of select="ancestor-or-self::XPAGES[INFORMATIONS/INTERFACE!=''][1]/INFORMATIONS/INTERFACE"/></xsl:when> |
331 | 359 | <xsl:otherwise><xsl:value-of select="$interface_par_defaut"/></xsl:otherwise> |
332 | 360 | </xsl:choose></xsl:variable> |
340 | 368 | <title>page <xsl:value-of select="position()"/></title> |
341 | 369 | </xsl:otherwise> |
342 | 370 | </xsl:choose> |
343 | <link type="text/css" rel="stylesheet" href="{$interface}/{$feuille-de-style}"/> | |
344 | <xsl:for-each select="preceding::PAGE[1]"> | |
345 | <link rel="Prev" href="{$prefixe}pages_{../INFORMATIONS/LABEL}/{@label}.html"/> | |
371 | <link type="text/css" rel="stylesheet" href="{$prefixe}{$interface}/{$feuille-de-style}"/> | |
372 | <xsl:for-each select="preceding::PAGE[1][@label!='index' or count(ancestor::XPAGES) > 1]"> | |
373 | <link rel="Prev" href="{$prefixe}pages_{ancestor::XPAGES[1]/@labelfichiers}/{@label}.html"/> | |
346 | 374 | </xsl:for-each> |
347 | <link rel="Contents" href="index.html"/> | |
348 | <xsl:for-each select="following::PAGE[1]"> | |
349 | <link rel="Next" href="{$prefixe}pages_{../INFORMATIONS/LABEL}/{@label}.html"/> | |
375 | <xsl:variable name="nom-fichier-index-parent"><xsl:choose> | |
376 | <xsl:when test="../@contribution='oui'">index.html</xsl:when> | |
377 | <xsl:otherwise><xsl:value-of select="../INFORMATIONS/LABEL"/>_index.html</xsl:otherwise> | |
378 | </xsl:choose></xsl:variable> | |
379 | <link rel="Contents" href="{$nom-fichier-index-parent}"/> | |
380 | <xsl:for-each select="descendant::PAGE[1] | following::PAGE[1]"> | |
381 | <link rel="Next" href="{$prefixe}pages_{ancestor::XPAGES[1]/@labelfichiers}/{@label}.html"/> | |
350 | 382 | </xsl:for-each> |
351 | 383 | <xsl:choose> |
352 | 384 | <xsl:when test="count(ancestor::XPAGES) > 1"> |
353 | <link rel="Up" href="{$prefixe}pages_{ancestor::XPAGES[1]/INFORMATIONS/LABEL}/index.html"/> | |
385 | <link rel="Up" href="{$nom-fichier-index-parent}"/> | |
354 | 386 | </xsl:when> |
355 | 387 | <xsl:otherwise> |
356 | 388 | <link rel="Up" href="{$prefixe}index.html"/> |
358 | 390 | </xsl:choose> |
359 | 391 | <!-- ce meta est ajouté automatiquement --> |
360 | 392 | <!--<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"/>--> |
393 | <xsl:if test=".//QCM"> | |
394 | <xsl:call-template name="script-qcm"/> | |
395 | </xsl:if> | |
396 | <xsl:if test=".//ENVIMAGE[@localisation='page']"> | |
397 | <xsl:call-template name="script-imagettes"> | |
398 | <xsl:with-param name="interface" select="$interface"/> | |
399 | </xsl:call-template> | |
400 | </xsl:if> | |
361 | 401 | </head> |
362 | 402 | <body class="page"> |
363 | <xsl:call-template name="contenu-body"/> | |
403 | <xsl:call-template name="contenu-body"> | |
404 | <xsl:with-param name="interface" select="$interface"/> | |
405 | </xsl:call-template> | |
364 | 406 | </body> |
365 | 407 | </html> |
366 | 408 | </xsl:template> |
379 | 421 | </xsl:template> |
380 | 422 | |
381 | 423 | |
424 | <xsl:template name="zone_sommaire"> | |
425 | <xsl:param name="interface">interface/<xsl:value-of select="$interface_par_defaut"/></xsl:param> | |
426 | <xsl:param name="prefixe">../</xsl:param> | |
427 | <div class="zone_sommaire"> | |
428 | <div class="zone_mininav"> | |
429 | <table width="100%"><tr> | |
430 | <xsl:variable name="nb" select="count(ancestor-or-self::XPAGES)"/> | |
431 | <td align="center"> | |
432 | <a href="{$prefixe}index.html" title="{$messages/message[@label='Entrée du site']}"><img src="{$prefixe}{$interface}/home.gif" width="25" height="25" alt="{$messages/message[@label='Entrée du site']}" border="0"/></a> | |
433 | </td> | |
434 | <td align="center"> | |
435 | <a href="{$prefixe}pages_{ancestor-or-self::XPAGES[$nb]/INFORMATIONS/LABEL}/sommaire.html" title="{$messages/message[@label='Sommaire']}"><img src="{$prefixe}{$interface}/sommaire_petit.gif" width="25" height="25" border="0" alt="{$messages/message[@label='Sommaire']}"/></a> | |
436 | </td> | |
437 | <xsl:if test="//GLOSSAIRE"> | |
438 | <td align="center"> | |
439 | <a href="{$prefixe}pages_{ancestor-or-self::XPAGES[$nb]/INFORMATIONS/LABEL}/glossaire.html" title="{$messages/message[@label='Glossaire']}"><img src="{$prefixe}{$interface}/glossaire_petit.gif" width="25" height="25" border="0" alt="{$messages/message[@label='Glossaire']}"/></a> | |
440 | </td> | |
441 | </xsl:if> | |
442 | <td align="center"> | |
443 | <xsl:for-each select="ancestor-or-self::XPAGES[1]"> | |
444 | <xsl:variable name="nom-fichier-impression"><xsl:choose> | |
445 | <xsl:when test="@contribution='oui'">impression.html</xsl:when> | |
446 | <xsl:otherwise><xsl:value-of select="INFORMATIONS/LABEL"/>_impression.html</xsl:otherwise> | |
447 | </xsl:choose></xsl:variable> | |
448 | <a href="{$prefixe}pages_{@labelfichiers}/{$nom-fichier-impression}" title="{INFORMATIONS/TITRE} : {$messages/message[@label='Page pour l_impression']}" target="_blank"><img src="{$prefixe}{$interface}/impression.gif" width="25" height="25" border="0" alt="{$messages/message[@label='Page pour l_impression']}"/></a> | |
449 | </xsl:for-each> | |
450 | </td> | |
451 | <td align="center"> | |
452 | <xsl:for-each select="preceding::PAGE[1][@label!='index' or count(ancestor::XPAGES) > 1]"> | |
453 | <a href="{$prefixe}pages_{ancestor::XPAGES[1]/@labelfichiers}/{@label}.html" accesskey="j" title="{$messages/message[@label='Page précédente']}"><img src="{$prefixe}{$interface}/petiteflechegauche.gif" width="25" height="16" alt="<-" border="0"/></a> | |
454 | </xsl:for-each> | |
455 | </td> | |
456 | <td align="center"> | |
457 | <xsl:for-each select="./descendant::PAGE[1] | following::PAGE[current()/self::PAGE and position()=1]"> | |
458 | <a href="{$prefixe}pages_{ancestor::XPAGES[1]/@labelfichiers}/{@label}.html" accesskey="l" title="{$messages/message[@label='Page suivante']}"><img src="{$prefixe}{$interface}/petiteflechedroite.gif" width="25" height="16" alt="->" border="0"/></a> | |
459 | </xsl:for-each> | |
460 | </td> | |
461 | </tr></table> | |
462 | </div> | |
463 | ||
464 | <xsl:call-template name="sommaire-page"> | |
465 | <xsl:with-param name="interface" select="$interface"/> | |
466 | </xsl:call-template> | |
467 | </div> | |
468 | </xsl:template> | |
469 | ||
470 | ||
471 | <xsl:template name="zone_titre"> | |
472 | <div class="zone_titre"> | |
473 | <xsl:variable name="titre"><xsl:choose> | |
474 | <xsl:when test="self::XPAGES"><xsl:value-of select="INFORMATIONS/TITRE"/></xsl:when> | |
475 | <xsl:otherwise><xsl:value-of select="@titre"/></xsl:otherwise> | |
476 | </xsl:choose></xsl:variable> | |
477 | <table cellspacing="0" cellpadding="0"><tr> | |
478 | <td><h1><xsl:value-of select="$titre"/></h1></td> | |
479 | </tr></table> | |
480 | </div> | |
481 | </xsl:template> | |
482 | ||
483 | ||
382 | 484 | <xsl:template name="contenu-body"> |
485 | <xsl:param name="interface">interface/<xsl:value-of select="$interface_par_defaut"/></xsl:param> | |
383 | 486 | |
384 | 487 | <!-- |
385 | 488 | Organisation des divs: |
400 | 503 | --> |
401 | 504 | |
402 | 505 | <xsl:variable name="prefixe">../</xsl:variable> |
403 | <xsl:variable name="interface"><xsl:value-of select="$prefixe"/>interface/<xsl:choose> | |
404 | <xsl:when test="count(ancestor-or-self::XPAGES[INFORMATIONS/INTERFACE!='']) > 0"><xsl:value-of select="ancestor-or-self::XPAGES[INFORMATIONS/INTERFACE!=''][1]/INFORMATIONS/INTERFACE"/></xsl:when> | |
405 | <xsl:otherwise><xsl:value-of select="$interface_par_defaut"/></xsl:otherwise> | |
406 | </xsl:choose></xsl:variable> | |
407 | 506 | |
408 | 507 | <xsl:call-template name="zone_logo"/> |
409 | 508 | |
410 | 509 | <xsl:call-template name="zone_bandeau"/> |
411 | 510 | |
412 | <xsl:if test="count(ancestor-or-self::XPAGES[last()]/XPAGES) > 1"> | |
511 | <xsl:if test="count(ancestor-or-self::XPAGES[last()]/XPAGES) > 1 and $rubriques='oui'"> | |
413 | 512 | <xsl:call-template name="zone_rubriques"/> |
414 | 513 | </xsl:if> |
415 | 514 | |
416 | <div class="zone_sommaire"> | |
417 | <div class="zone_mininav"> | |
418 | <table width="100%"><tr> | |
419 | <xsl:variable name="nb" select="count(ancestor-or-self::XPAGES)"/> | |
420 | <td align="center"> | |
421 | <a href="{$prefixe}index.html" title="{$messages/message[@label='entrée du site']}"><img src="{$interface}/home.gif" width="25" height="25" alt="{$messages/message[@label='entrée du site']}" border="0"/></a> | |
422 | </td> | |
423 | <td align="center"> | |
424 | <a href="{$prefixe}pages_{ancestor-or-self::XPAGES[$nb]/INFORMATIONS/LABEL}/sommaire.html" title="{$messages/message[@label='Sommaire']}"><img src="{$interface}/sommaire_petit.gif" width="25" height="25" border="0" alt="{$messages/message[@label='Sommaire']}"/></a> | |
425 | </td> | |
426 | <xsl:if test="//GLOSSAIRE"> | |
427 | <td align="center"> | |
428 | <a href="{$prefixe}pages_{ancestor-or-self::XPAGES[$nb]/INFORMATIONS/LABEL}/glossaire.html" title="{$messages/message[@label='Glossaire']}"><img src="{$interface}/glossaire_petit.gif" width="25" height="25" border="0" alt="{$messages/message[@label='Glossaire']}"/></a> | |
429 | </td> | |
430 | </xsl:if> | |
431 | <td align="center"> | |
432 | <xsl:for-each select="preceding::PAGE[1][@label!='index']"> | |
433 | <a href="{$prefixe}pages_{../INFORMATIONS/LABEL}/{@label}.html" accesskey="j" title="{$messages/message[@label='Page précédente']}"><img src="{$interface}/petiteflechegauche.gif" width="25" height="16" alt="<-" border="0"/></a> | |
434 | </xsl:for-each> | |
435 | </td> | |
436 | ||
437 | <td align="center"> | |
438 | <xsl:for-each select="PAGE[1] | following::PAGE[current()/self::PAGE and position()=1]"> | |
439 | <a href="{$prefixe}pages_{../INFORMATIONS/LABEL}/{@label}.html" accesskey="l" title="{$messages/message[@label='Page suivante']}"><img src="{$interface}/petiteflechedroite.gif" width="25" height="16" alt="->" border="0"/></a> | |
440 | </xsl:for-each> | |
441 | </td> | |
442 | </tr></table> | |
443 | </div> | |
444 | ||
445 | <xsl:call-template name="sommaire-page"/> | |
446 | </div> | |
447 | ||
448 | <div class="zone_titre"> | |
449 | <xsl:variable name="titre"><xsl:choose> | |
450 | <xsl:when test="self::XPAGES"><xsl:value-of select="INFORMATIONS/TITRE"/></xsl:when> | |
451 | <xsl:otherwise><xsl:value-of select="@titre"/></xsl:otherwise> | |
452 | </xsl:choose></xsl:variable> | |
453 | <table cellspacing="0" cellpadding="0"><tr> | |
454 | <td><h1><xsl:value-of select="$titre"/></h1></td> | |
455 | </tr></table> | |
456 | </div> | |
515 | <xsl:call-template name="zone_sommaire"> | |
516 | <xsl:with-param name="interface" select="$interface"/> | |
517 | </xsl:call-template> | |
518 | ||
519 | <xsl:call-template name="zone_titre"/> | |
457 | 520 | |
458 | 521 | <div class="zone_contenu"> |
459 | 522 | |
475 | 538 | <xsl:if test=".//ENVIMAGE[@localisation='page']"> |
476 | 539 | <xsl:call-template name="figures-page"> |
477 | 540 | <xsl:with-param name="prefixe"><xsl:value-of select="$prefixe"/></xsl:with-param> |
541 | <xsl:with-param name="interface" select="$interface"/> | |
478 | 542 | </xsl:call-template> |
479 | 543 | </xsl:if> |
480 | 544 | <div class="zone_texte"> |
481 | <xsl:apply-templates/> | |
545 | <xsl:apply-templates> | |
546 | <xsl:with-param name="affichage" select="'web'"/> | |
547 | <xsl:with-param name="interface" select="$interface"/> | |
548 | </xsl:apply-templates> | |
482 | 549 | </div> |
483 | 550 | </xsl:otherwise> |
484 | 551 | </xsl:choose> |
488 | 555 | <div class="zone_liens"> |
489 | 556 | <table width="100%"><tr> |
490 | 557 | <td> |
491 | <xsl:for-each select="preceding::PAGE[1][@label!='index']"> | |
492 | <a href="{$prefixe}pages_{../INFORMATIONS/LABEL}/{@label}.html" title="{$messages/message[@label='Page précédente']}"><img src="{$interface}/flechegauche.gif" width="48" height="31" alt="{$messages/message[@label='Page précédente']}" border="0"/></a> | |
558 | <xsl:for-each select="preceding::PAGE[1][@label!='index' or count(ancestor::XPAGES) > 1]"> | |
559 | <a href="{$prefixe}pages_{ancestor::XPAGES[1]/@labelfichiers}/{@label}.html" title="{$messages/message[@label='Page précédente']}"><img src="{$prefixe}{$interface}/flechegauche.gif" width="48" height="31" alt="{$messages/message[@label='Page précédente']}" border="0"/></a> | |
493 | 560 | </xsl:for-each> |
494 | 561 | </td> |
495 | 562 | <td align="right"> |
496 | <xsl:for-each select="PAGE[1] | following::PAGE[current()/self::PAGE and position()=1]"> | |
497 | <a href="{$prefixe}pages_{../INFORMATIONS/LABEL}/{@label}.html" title="{$messages/message[@label='Page suivante']}"><img src="{$interface}/flechedroite.gif" width="48" height="31" alt="{$messages/message[@label='Page suivante']}" border="0"/></a> | |
563 | <xsl:for-each select="./descendant::PAGE[1] | following::PAGE[current()/self::PAGE and position()=1]"> | |
564 | <a href="{$prefixe}pages_{ancestor::XPAGES[1]/@labelfichiers}/{@label}.html" title="{$messages/message[@label='Page suivante']}"><img src="{$prefixe}{$interface}/flechedroite.gif" width="48" height="31" alt="{$messages/message[@label='Page suivante']}" border="0"/></a> | |
498 | 565 | </xsl:for-each> |
499 | 566 | </td> |
500 | 567 | </tr></table> |
501 | 568 | </div> |
502 | 569 | </div> |
570 | </xsl:template> | |
571 | ||
572 | ||
573 | <xsl:template name="contenu-impression"> | |
574 | <xsl:param name="interface"/> | |
575 | <xsl:variable name="prefixe">../</xsl:variable> | |
576 | ||
577 | <html> | |
578 | <head> | |
579 | <title><xsl:value-of select="concat(INFORMATIONS/TITRE, ' : ', $messages/message[@label='Page pour l_impression'])"/></title> | |
580 | <link type="text/css" rel="stylesheet" href="{$prefixe}{$interface}/{$feuille-de-style}"/> | |
581 | </head> | |
582 | <body> | |
583 | <h1><xsl:value-of select="INFORMATIONS/TITRE"/></h1> | |
584 | <xsl:if test="count(INFORMATIONS/AUTEUR) > 0"> | |
585 | <div class="auteurs"> | |
586 | <xsl:call-template name="auteurs"/> | |
587 | </div> | |
588 | </xsl:if> | |
589 | <ul> | |
590 | <xsl:apply-templates select="PAGE[@label!='index']|XPAGES" mode="sommaire-impression"/> | |
591 | </ul> | |
592 | <hr/> | |
593 | <div style="page-break-after: always"/> | |
594 | <xsl:for-each select=".//*[self::XPAGES|self::PAGE]"> | |
595 | <xsl:choose> | |
596 | <xsl:when test="self::XPAGES"> | |
597 | <h1><xsl:value-of select="INFORMATIONS/TITRE"/></h1> | |
598 | ||
599 | <xsl:if test="count(INFORMATIONS/AUTEUR) > 0"> | |
600 | <div class="auteurs"> | |
601 | <xsl:call-template name="auteurs"/> | |
602 | </div> | |
603 | </xsl:if> | |
604 | <hr/> | |
605 | </xsl:when> | |
606 | <xsl:otherwise> | |
607 | <h1><xsl:value-of select="@titre"/></h1> | |
608 | ||
609 | <div class="zone_texte"> | |
610 | <xsl:apply-templates> | |
611 | <xsl:with-param name="affichage" select="'impression'"/> | |
612 | <xsl:with-param name="interface" select="$interface"/> | |
613 | </xsl:apply-templates> | |
614 | </div> | |
615 | ||
616 | <div class="spacer"></div> | |
617 | <xsl:if test="position()!=last()"> | |
618 | <hr/> | |
619 | <xsl:if test="count(following-sibling::PAGE)=0"> | |
620 | <div style="page-break-after: always"/> <!-- pour les navigateurs comprenant CSS 2 --> | |
621 | </xsl:if> | |
622 | </xsl:if> | |
623 | </xsl:otherwise> | |
624 | </xsl:choose> | |
625 | </xsl:for-each> | |
626 | ||
627 | <xsl:if test=".//QCM"> | |
628 | <hr/> | |
629 | <div style="page-break-after: always"/> | |
630 | ||
631 | <h2>Réponses aux QCM</h2> | |
632 | <xsl:for-each select=".//QCM"> | |
633 | <tt>page <xsl:value-of select="ancestor::XPAGES[1]/INFORMATIONS/LABEL"/>/<xsl:value-of select="ancestor::PAGE/@label"/></tt><br/> | |
634 | <b>QCM | |
635 | <xsl:if test="@titre!=''"> | |
636 | <xsl:text> </xsl:text>'<xsl:value-of select="@titre"/>' | |
637 | </xsl:if> | |
638 | </b> | |
639 | <ul> | |
640 | <xsl:for-each select="QUESTIONQCM"> | |
641 | <li>Question <xsl:value-of select="position()"/><br/> | |
642 | <xsl:for-each select="REPONSEQCM[@bonne='oui']"> | |
643 | <i>Solution : </i> réponse <xsl:number from="QCM" count="REPONSEQCM"/>) | |
644 | <xsl:if test="COMMENTAIREREP!=''"> | |
645 | <xsl:text> </xsl:text>(<xsl:value-of select="COMMENTAIREREP"/>) | |
646 | </xsl:if> | |
647 | <br/> | |
648 | </xsl:for-each> | |
649 | </li> | |
650 | </xsl:for-each> | |
651 | </ul> | |
652 | </xsl:for-each> | |
653 | </xsl:if> | |
654 | ||
655 | <xsl:if test=".//EXERCICE[@type='auto-évaluation'] or (.//EXERCICE and $sortie='production') or .//EXERCICE/QUESTION/AIDE"> | |
656 | <hr/> | |
657 | <div style="page-break-after: always"/> | |
658 | ||
659 | <h2>Réponses aux exercices</h2> | |
660 | <xsl:for-each select=".//EXERCICE[count(QUESTION/AIDE) > 0 or ((@type='auto-évaluation' or $sortie='production') and count(QUESTION/SOLUTION) > 0)]"> | |
661 | <xsl:if test="position() > 1"> | |
662 | <hr/> | |
663 | </xsl:if> | |
664 | <tt>page <xsl:value-of select="ancestor::XPAGES[1]/INFORMATIONS/LABEL"/>/<xsl:value-of select="ancestor::PAGE/@label"/></tt><br/> | |
665 | <h3>Exercice | |
666 | <xsl:if test="@titre!=''"> | |
667 | <xsl:text> </xsl:text>'<xsl:value-of select="@titre"/>' | |
668 | </xsl:if> | |
669 | </h3> | |
670 | <ul> | |
671 | <xsl:for-each select="QUESTION"> | |
672 | <li><b>Question <xsl:value-of select="position()"/></b><br/> | |
673 | <xsl:for-each select="AIDE"> | |
674 | <i>Aide : </i> <xsl:apply-templates/><br/> | |
675 | </xsl:for-each> | |
676 | <xsl:if test="../@type='auto-évaluation' or $sortie='production'"> | |
677 | <xsl:for-each select="SOLUTION"> | |
678 | <i>Solution : </i> <xsl:apply-templates/><br/> | |
679 | </xsl:for-each> | |
680 | </xsl:if> | |
681 | </li> | |
682 | </xsl:for-each> | |
683 | </ul> | |
684 | </xsl:for-each> | |
685 | </xsl:if> | |
686 | </body> | |
687 | </html> | |
688 | </xsl:template> | |
689 | ||
690 | <xsl:template match="XPAGES" mode="sommaire-impression"> | |
691 | <li> | |
692 | <xsl:value-of select="INFORMATIONS/TITRE"/> | |
693 | <ul> | |
694 | <xsl:apply-templates select="PAGE[@label!='index']|XPAGES" mode="sommaire-impression"/> | |
695 | </ul> | |
696 | </li> | |
697 | </xsl:template> | |
698 | ||
699 | <xsl:template match="PAGE" mode="sommaire-impression"> | |
700 | <li><xsl:value-of select="@titre"/></li> | |
503 | 701 | </xsl:template> |
504 | 702 | |
505 | 703 | |
518 | 716 | </xsl:call-template> |
519 | 717 | </xsl:when> |
520 | 718 | <xsl:when test="$pos > 1"> |
521 | <img height="11" width="11" alt="-" border="0" src="{$interface}/listeactive.gif"/> | |
522 | <xsl:for-each select="ancestor-or-self::XPAGES[$pos]"> | |
523 | <a href="{$prefixe}pages_{INFORMATIONS/LABEL}/{PAGE[1]/@label}.html" class="sommaire2"> <xsl:value-of select="INFORMATIONS/TITRE"/></a> | |
719 | <img height="11" width="11" alt="-" border="0" src="{$prefixe}{$interface}/listeactive.gif"/> | |
720 | <xsl:for-each select="ancestor-or-self::XPAGES[position()=$pos]"> | |
721 | <xsl:choose> | |
722 | <xsl:when test="*[self::PAGE|self::XPAGES][1][self::PAGE]"> | |
723 | <a href="{$prefixe}pages_{@labelfichiers}/{PAGE[1]/@label}.html" class="sommaire2"> <xsl:value-of select="INFORMATIONS/TITRE"/></a> | |
724 | </xsl:when> | |
725 | <xsl:otherwise> | |
726 | <xsl:variable name="nom-fichier-index"><xsl:choose> | |
727 | <xsl:when test="@contribution='oui'">index.html</xsl:when> | |
728 | <xsl:otherwise><xsl:value-of select="INFORMATIONS/LABEL"/>_index.html</xsl:otherwise> | |
729 | </xsl:choose></xsl:variable> | |
730 | <a href="{$prefixe}pages_{@labelfichiers}/{$nom-fichier-index}" class="sommaire2"> <xsl:value-of select="INFORMATIONS/TITRE"/></a> | |
731 | </xsl:otherwise> | |
732 | </xsl:choose> | |
524 | 733 | </xsl:for-each> |
525 | 734 | <div class="divsommaire"> |
526 | 735 | <xsl:call-template name="sous-sommaire"> |
531 | 740 | </xsl:when> |
532 | 741 | <xsl:when test="self::XPAGES"> |
533 | 742 | <div class="fondsel1sommaire"> |
534 | <img height="11" width="11" alt="-" border="0" src="{$interface}/listeactive.gif"/> <span class="sommaire2select"><xsl:value-of select="INFORMATIONS/TITRE"/></span> | |
743 | <img height="11" width="11" alt="-" border="0" src="{$prefixe}{$interface}/listeactive.gif"/> <span class="sommaire2select"><xsl:value-of select="INFORMATIONS/TITRE"/></span> | |
535 | 744 | <div class="divsommaire"> |
536 | 745 | <xsl:for-each select="PAGE|XPAGES"> |
537 | 746 | <xsl:call-template name="element-sommaire"> |
544 | 753 | <xsl:otherwise> |
545 | 754 | <div class="fondsel1sommaire"> |
546 | 755 | <xsl:for-each select="ancestor::XPAGES[2]"> |
547 | <a href="{$prefixe}pages_{INFORMATIONS/LABEL}/{PAGE[1]/@label}.html"><img height="11" width="11" alt="-" border="0" src="{$interface}/listeactive.gif"/></a> | |
756 | <xsl:choose> | |
757 | <xsl:when test="*[self::PAGE|self::XPAGES][1][self::PAGE]"> | |
758 | <a href="{$prefixe}pages_{@labelfichiers}/{PAGE[1]/@label}.html"><img height="11" width="11" alt="-" border="0" src="{$prefixe}{$interface}/listeactive.gif"/></a> | |
759 | </xsl:when> | |
760 | <xsl:otherwise> | |
761 | <xsl:variable name="nom-fichier-index"><xsl:choose> | |
762 | <xsl:when test="@contribution='oui'">index.html</xsl:when> | |
763 | <xsl:otherwise><xsl:value-of select="INFORMATIONS/LABEL"/>_index.html</xsl:otherwise> | |
764 | </xsl:choose></xsl:variable> | |
765 | <a href="{$prefixe}pages_{@labelfichiers}/{$nom-fichier-index}"><img height="11" width="11" alt="-" border="0" src="{$prefixe}{$interface}/listeactive.gif"/></a> | |
766 | </xsl:otherwise> | |
767 | </xsl:choose> | |
548 | 768 | </xsl:for-each> |
549 | <span class="sommaire2"> <xsl:value-of select="../INFORMATIONS/TITRE"/></span> | |
769 | <a href="{$prefixe}pages_{../@labelfichiers}/{../PAGE[1]/@label}.html" class="sommaire2"> <xsl:value-of select="../INFORMATIONS/TITRE"/></a> | |
550 | 770 | <div class="divsommaire"> |
551 | 771 | <xsl:variable name="labelpage" select="@label"/> |
552 | <xsl:for-each select="../*[self::PAGE or self::XPAGES]"> | |
772 | <xsl:for-each select="../*[(self::PAGE and @label!='index') or self::XPAGES]"> | |
553 | 773 | <xsl:call-template name="element-sommaire"> |
554 | 774 | <xsl:with-param name="labelpage"><xsl:value-of select="$labelpage"/></xsl:with-param> |
555 | 775 | <xsl:with-param name="interface"><xsl:value-of select="$interface"/></xsl:with-param> |
573 | 793 | </div> |
574 | 794 | </xsl:when> |
575 | 795 | <xsl:when test="self::XPAGES"> |
576 | <div class="fondsel1sommaire"><img src="{$interface}/listeinactive.gif" border="0" alt="+" width="11" height="11"/> | |
577 | <a href="{$prefixe}pages_{INFORMATIONS/LABEL}/{PAGE[1]/@label}.html" class="sommaire2"> <xsl:value-of select="INFORMATIONS/TITRE"/></a></div> | |
796 | <div class="fondsel1sommaire"><img src="{$prefixe}{$interface}/listeinactive.gif" border="0" alt="+" width="11" height="11"/> | |
797 | <xsl:choose> | |
798 | <xsl:when test="*[self::PAGE|self::XPAGES][1][self::PAGE]"> | |
799 | <a href="{$prefixe}pages_{@labelfichiers}/{PAGE[1]/@label}.html" class="sommaire3"> <xsl:value-of select="INFORMATIONS/TITRE"/></a> | |
800 | </xsl:when> | |
801 | <xsl:otherwise> | |
802 | <a href="{$prefixe}pages_{INFORMATIONS/LABEL}/index.html" class="sommaire3"> <xsl:value-of select="INFORMATIONS/TITRE"/></a> | |
803 | </xsl:otherwise> | |
804 | </xsl:choose> | |
805 | </div> | |
578 | 806 | </xsl:when> |
579 | 807 | <xsl:otherwise> |
580 | 808 | <div class="fondsel1sommaire"> |
581 | <a href="{$prefixe}pages_{../INFORMATIONS/LABEL}/{@label}.html" class="sommairepage">• <xsl:value-of select="@titre"/></a> | |
809 | <a href="{$prefixe}pages_{ancestor::XPAGES[1]/@labelfichiers}/{@label}.html" class="sommairepage">• <xsl:value-of select="@titre"/></a> | |
582 | 810 | </div> |
583 | 811 | </xsl:otherwise> |
584 | 812 | </xsl:choose> |
585 | 813 | </xsl:template> |
586 | 814 | |
587 | 815 | <xsl:template name="sommaire-page"> |
588 | <xsl:variable name="prefixe">../</xsl:variable> | |
589 | <xsl:variable name="interface"><xsl:value-of select="$prefixe"/>interface/<xsl:choose> | |
590 | <xsl:when test="count(ancestor-or-self::XPAGES[INFORMATIONS/INTERFACE!='']) > 0"><xsl:value-of select="ancestor-or-self::XPAGES[INFORMATIONS/INTERFACE!=''][1]/INFORMATIONS/INTERFACE"/></xsl:when> | |
591 | <xsl:otherwise><xsl:value-of select="$interface_par_defaut"/></xsl:otherwise> | |
592 | </xsl:choose></xsl:variable> | |
816 | <xsl:param name="interface"/> | |
593 | 817 | <div class="sommaire"> |
594 | 818 | <xsl:call-template name="sous-sommaire"> |
595 | 819 | <xsl:with-param name="pos"><xsl:value-of select="count(ancestor::XPAGES)"/></xsl:with-param> |
605 | 829 | </xsl:template> |
606 | 830 | |
607 | 831 | <xsl:template match="TITRE"> |
832 | <!-- template inutilisé --> | |
608 | 833 | <h1><xsl:value-of select="."/></h1> |
609 | 834 | </xsl:template> |
610 | 835 | |
612 | 837 | <xsl:for-each select="ancestor-or-self::XPAGES[1]/INFORMATIONS"> |
613 | 838 | <xsl:choose> |
614 | 839 | <xsl:when test="count(AUTEUR)=1"> |
615 | <xsl:value-of select="$messages/message[@label='Auteur:']"/> <em><xsl:value-of select="AUTEUR"/></em><br/> | |
840 | <xsl:value-of select="$messages/message[@label='Auteur:']"/><xsl:text> </xsl:text> | |
841 | <em><xsl:value-of select="AUTEUR"/></em><br/> | |
616 | 842 | </xsl:when> |
617 | 843 | <xsl:when test="count(AUTEUR)>1"> |
618 | <xsl:value-of select="$messages/message[@label='Auteurs:']"/> | |
844 | <xsl:value-of select="$messages/message[@label='Auteurs:']"/><xsl:text> </xsl:text> | |
619 | 845 | <em><xsl:for-each select="AUTEUR"><xsl:value-of select="."/><xsl:if test="position()!=last()">, </xsl:if></xsl:for-each></em><br/> |
620 | 846 | </xsl:when> |
621 | 847 | </xsl:choose> |
634 | 860 | <!-- Eléments de bloc --> |
635 | 861 | |
636 | 862 | <xsl:template match="SECTION"> |
863 | <xsl:param name="affichage">web</xsl:param> | |
864 | <xsl:param name="interface">interface/<xsl:value-of select="$interface_par_defaut"/></xsl:param> | |
637 | 865 | <xsl:variable name="classe"><xsl:choose> |
638 | 866 | <xsl:when test="(@role='introduction' or @role='conclusion' or @role='exercice') and @importance='grande'"><xsl:value-of select="@role"/></xsl:when> |
639 | 867 | <xsl:when test="@importance='grande'">section_cadre</xsl:when> |
647 | 875 | <xsl:when test="ancestor::PAGE[@label='index']"></xsl:when> |
648 | 876 | <xsl:otherwise>../</xsl:otherwise> |
649 | 877 | </xsl:choose></xsl:variable> |
650 | <xsl:variable name="interface"><xsl:value-of select="$prefixe"/>interface/<xsl:choose> | |
651 | <xsl:when test="count(ancestor-or-self::XPAGES[INFORMATIONS/INTERFACE!='']) > 0"><xsl:value-of select="ancestor-or-self::XPAGES[INFORMATIONS/INTERFACE!=''][1]/INFORMATIONS/INTERFACE"/></xsl:when> | |
652 | <xsl:otherwise><xsl:value-of select="$interface_par_defaut"/></xsl:otherwise> | |
653 | </xsl:choose></xsl:variable> | |
654 | <img src="{$interface}/icones_sections/{@role}.png" width="40" height="40" alt="{@role}" class="icone_section"/> | |
878 | <img src="{$prefixe}{$interface}/icones_sections/{@role}.png" width="40" height="40" alt="{@role}" class="icone_section"/> | |
655 | 879 | </xsl:if> |
656 | 880 | <xsl:value-of select="@titre"/> |
657 | 881 | </xsl:element> |
658 | 882 | </xsl:if> |
659 | <xsl:apply-templates/> | |
883 | <xsl:apply-templates> | |
884 | <xsl:with-param name="affichage" select="$affichage"/> | |
885 | <xsl:with-param name="interface"><xsl:value-of select="$interface"/></xsl:with-param> | |
886 | </xsl:apply-templates> | |
660 | 887 | </div> |
661 | 888 | </xsl:template> |
662 | 889 | |
717 | 944 | |
718 | 945 | |
719 | 946 | <xsl:template match="ENVIMAGE"> |
947 | <xsl:param name="affichage">web</xsl:param> | |
948 | <xsl:param name="interface">interface/<xsl:value-of select="$interface_par_defaut"/></xsl:param> | |
720 | 949 | <xsl:variable name="prefixe"><xsl:choose> |
721 | 950 | <xsl:when test="ancestor::PAGE[@label='index']"></xsl:when> |
722 | 951 | <xsl:otherwise>../</xsl:otherwise> |
723 | 952 | </xsl:choose></xsl:variable> |
724 | <xsl:variable name="interface"><xsl:value-of select="$prefixe"/>interface/<xsl:choose> | |
725 | <xsl:when test="count(ancestor-or-self::XPAGES[INFORMATIONS/INTERFACE!='']) > 0"><xsl:value-of select="ancestor-or-self::XPAGES[INFORMATIONS/INTERFACE!=''][1]/INFORMATIONS/INTERFACE"/></xsl:when> | |
726 | <xsl:otherwise><xsl:value-of select="$interface_par_defaut"/></xsl:otherwise> | |
727 | </xsl:choose></xsl:variable> | |
728 | 953 | <xsl:choose> |
729 | <xsl:when test="@localisation='icône'"> | |
954 | <xsl:when test="@localisation='icône' and $affichage='web'"> | |
730 | 955 | <xsl:for-each select="FICHIER[1]"> |
731 | <xsl:variable name="label-ensemble" select="ancestor::XPAGES[1]/INFORMATIONS/LABEL"/> | |
732 | <xsl:variable name="largeur1" select="document(concat($uri-site, '/images.xml'))/IMAGES/IMAGE[@contrib=$label-ensemble and @nom=current()/@nom]/@largeur1"/> | |
733 | <xsl:variable name="hauteur1" select="document(concat($uri-site, '/images.xml'))/IMAGES/IMAGE[@contrib=$label-ensemble and @nom=current()/@nom]/@hauteur1"/> | |
734 | <xsl:variable name="fichierhtml" select="concat('html_images/', translate(@nom, '/\\', '__'), '.html')"/> | |
956 | <xsl:variable name="label-fichiers" select="ancestor::XPAGES[1]/@labelfichiers"/> | |
957 | <xsl:variable name="largeur1" select="document(concat($uri-site, '/images.xml'))/IMAGES/IMAGE[@contrib=$label-fichiers and @nom=current()/@nom]/@largeur1"/> | |
958 | <xsl:variable name="hauteur1" select="document(concat($uri-site, '/images.xml'))/IMAGES/IMAGE[@contrib=$label-fichiers and @nom=current()/@nom]/@hauteur1"/> | |
959 | <xsl:variable name="fichierhtml" select="concat($prefixe,'pages_', $label-fichiers, '/', 'html_images/', translate(@nom, '/\\', '__'), '.html')"/> | |
735 | 960 | <xsl:variable name="format"><xsl:call-template name="format-fichier"> |
736 | 961 | <xsl:with-param name="nom" select="@nom"/> |
737 | 962 | </xsl:call-template></xsl:variable> |
738 | 963 | <xsl:choose> |
739 | 964 | <xsl:when test="$format='PNG' or $format='GIF' or $format='JPEG'"> |
740 | <a href="{$fichierhtml}" target="blank" onclick="window.open('{$fichierhtml}', '', 'scrollbars=yes,scrolling=auto,toolbar=no,directories=no,menubar=no,status=no,resizable=no,width={$largeur1+35},height={$hauteur1+200}'); return false"><img alt="{@nom}" src="{$prefixe}pages_{$label-ensemble}/images_icone/{@nom}" align="right" border="0" class="iconeimage"/></a> | |
965 | <xsl:variable name="largeur2" select="document(concat($uri-site, '/images.xml'))/IMAGES/IMAGE[@contrib=$label-fichiers and @nom=current()/@nom]/@largeur2"/> | |
966 | <xsl:variable name="hauteur2" select="document(concat($uri-site, '/images.xml'))/IMAGES/IMAGE[@contrib=$label-fichiers and @nom=current()/@nom]/@hauteur2"/> | |
967 | <a href="{$fichierhtml}" target="_blank" onclick="window.open('{$fichierhtml}', '', 'scrollbars=yes,scrolling=auto,toolbar=no,directories=no,menubar=no,status=no,resizable=no,width={$largeur1+35},height={$hauteur1+200}'); return false"><img alt="{@nom}" src="{$prefixe}pages_{$label-fichiers}/images_icone/{@nom}" width="{$largeur2}" height="{$hauteur2}" align="right" border="0" class="iconeimage"/></a> | |
741 | 968 | </xsl:when> |
742 | <xsl:when test="$format='MPEG'"> | |
743 | <a href="{$fichierhtml}" target="blank" onclick="window.open('{$fichierhtml}', '', 'scrollbars=yes,scrolling=auto,toolbar=no,directories=no,menubar=no,status=no, width={$largeur1+35},height={$hauteur1+200}'); return false"><img src="{$interface}/video.gif" width="50" height="50" alt="vidéo MPEG" align="right" border="0"/></a> | |
969 | <xsl:when test="$format='MPEG' or $format='OGG'"> | |
970 | <a href="{$fichierhtml}" target="_blank" onclick="window.open('{$fichierhtml}', '', 'scrollbars=yes,scrolling=auto,toolbar=no,directories=no,menubar=no,status=no, width={$largeur1+35},height={$hauteur1+200}'); return false"><img src="{$prefixe}{$interface}/video.gif" width="50" height="50" alt="vidéo" align="right" border="0"/></a> | |
744 | 971 | </xsl:when> |
745 | 972 | <xsl:otherwise><xsl:value-of select="$messages/message[@label='format inconnu (vérifier l_extension du nom du fichier)']"/></xsl:otherwise> |
746 | 973 | </xsl:choose> |
747 | 974 | <!-- html-figure est maintenant appelé plus haut pour éviter les imbrications de ecrire-fichier --> |
748 | 975 | </xsl:for-each> |
749 | 976 | </xsl:when> |
750 | <xsl:when test="@localisation!='page'"> | |
977 | <xsl:when test="@localisation!='page' or $affichage='impression'"> | |
978 | <xsl:call-template name="contenu-envimage"> | |
979 | <xsl:with-param name="affichage" select="$affichage"/> | |
980 | <xsl:with-param name="prefixe"><xsl:value-of select="$prefixe"/></xsl:with-param> | |
981 | <xsl:with-param name="interface"><xsl:value-of select="$interface"/></xsl:with-param> | |
982 | </xsl:call-template> | |
983 | </xsl:when> | |
984 | </xsl:choose> | |
985 | </xsl:template> | |
986 | ||
987 | ||
988 | <xsl:template name="script-imagettes"> | |
989 | <xsl:param name="interface">interface/<xsl:value-of select="$interface_par_defaut"/></xsl:param> | |
990 | <xsl:param name="prefixe">../</xsl:param> | |
991 | <script type="text/javascript" language="JavaScript"> | |
992 | <xsl:comment> | |
993 | function imagette(n) { | |
994 | var imagettes = document.getElementById('imagettes'); | |
995 | if (imagettes != null) { | |
996 | var liste = imagettes.getElementsByTagName('a'); | |
997 | for (var i=0; i < liste.length; i++) { | |
998 | if (i+1 == n) { | |
999 | var img = liste[i].getElementsByTagName('img')[0]; | |
1000 | img.src = '<xsl:value-of select="concat($prefixe, $interface)"/>/imagesel.gif'; | |
1001 | var div = document.getElementById('figure'+(i+1)); | |
1002 | div.style.display = 'block'; | |
1003 | } else { | |
1004 | var img = liste[i].getElementsByTagName('img')[0]; | |
1005 | img.src = '<xsl:value-of select="concat($prefixe, $interface)"/>/image.gif'; | |
1006 | var div = document.getElementById('figure'+(i+1)); | |
1007 | div.style.display='none'; | |
1008 | } | |
1009 | } | |
1010 | } | |
1011 | } | |
1012 | //</xsl:comment> | |
1013 | </script> | |
1014 | </xsl:template> | |
1015 | ||
1016 | ||
1017 | <!-- création de l'encart pour la figure en page, appelé par contenu-body --> | |
1018 | <xsl:template name="figures-page"> | |
1019 | <xsl:param name="prefixe">../</xsl:param> | |
1020 | <xsl:param name="interface">interface/<xsl:value-of select="$interface_par_defaut"/></xsl:param> | |
1021 | <div class="zone_figure"> | |
1022 | <xsl:if test="count(.//ENVIMAGE[@localisation='page']) > 1"> | |
1023 | <div id="imagettes"> | |
1024 | <xsl:for-each select=".//ENVIMAGE[@localisation='page']"> | |
1025 | <a href="#" onclick="imagette({position()}); return false;"><xsl:choose> | |
1026 | <xsl:when test="position()=1"> | |
1027 | <img src="{$prefixe}{$interface}/imagesel.gif" width="59" height="52" alt="image {position()}" border="0"/> | |
1028 | </xsl:when> | |
1029 | <xsl:otherwise> | |
1030 | <img src="{$prefixe}{$interface}/image.gif" width="59" height="52" alt="image {position()}" border="0"/> | |
1031 | </xsl:otherwise> | |
1032 | </xsl:choose></a> | |
1033 | </xsl:for-each> | |
1034 | </div> | |
1035 | </xsl:if> | |
1036 | <xsl:for-each select=".//ENVIMAGE[@localisation='page']"> | |
751 | 1037 | <xsl:call-template name="contenu-envimage"> |
752 | 1038 | <xsl:with-param name="prefixe"><xsl:value-of select="$prefixe"/></xsl:with-param> |
753 | 1039 | </xsl:call-template> |
754 | </xsl:when> | |
755 | </xsl:choose> | |
756 | </xsl:template> | |
757 | ||
758 | ||
759 | <!-- création de l'encart pour la figure en page, appelé par contenu-body --> | |
760 | <xsl:template name="figures-page"> | |
1040 | </xsl:for-each> | |
1041 | </div> | |
1042 | </xsl:template> | |
1043 | ||
1044 | <xsl:template name="contenu-envimage"> | |
1045 | <xsl:param name="affichage">web</xsl:param> | |
761 | 1046 | <xsl:param name="prefixe">../</xsl:param> |
762 | <xsl:for-each select=".//ENVIMAGE[@localisation='page']"> | |
763 | <div class="zone_figure"> | |
764 | <xsl:call-template name="contenu-envimage"> | |
765 | <xsl:with-param name="prefixe"><xsl:value-of select="$prefixe"/></xsl:with-param> | |
766 | </xsl:call-template> | |
767 | </div> | |
768 | </xsl:for-each> | |
769 | </xsl:template> | |
770 | ||
771 | <xsl:template name="contenu-envimage"> | |
772 | <xsl:param name="prefixe">../</xsl:param> | |
1047 | <xsl:param name="interface">interface/<xsl:value-of select="$interface_par_defaut"/></xsl:param> | |
773 | 1048 | <xsl:variable name="classe-div"><xsl:choose> |
774 | <xsl:when test="@localisation='page'">cadre_zone_figure</xsl:when> | |
1049 | <xsl:when test="@localisation='page' and $affichage='web'">cadre_zone_figure</xsl:when> | |
775 | 1050 | <xsl:otherwise>cadre_figure_texte</xsl:otherwise> |
776 | 1051 | </xsl:choose></xsl:variable> |
1052 | <xsl:if test="$classe-div='cadre_figure_texte' and @label!=''"> | |
1053 | <a name="{@label}"/> | |
1054 | </xsl:if> | |
777 | 1055 | <div class="{$classe-div}"> |
1056 | <xsl:if test="@localisation='page' and $affichage='web'"> | |
1057 | <xsl:attribute name="id">figure<xsl:value-of select="count(preceding-sibling::ENVIMAGE[@localisation='page'])+1"/></xsl:attribute> | |
1058 | <xsl:if test="count(preceding-sibling::ENVIMAGE[@localisation='page']) > 0"> | |
1059 | <xsl:attribute name="style">display:none;</xsl:attribute> | |
1060 | </xsl:if> | |
1061 | </xsl:if> | |
778 | 1062 | <xsl:if test="@titre!=''"> |
779 | 1063 | <div class="titrefigure"><xsl:value-of select="@titre"/></div> |
780 | 1064 | </xsl:if> |
781 | 1065 | |
782 | <xsl:variable name="label-ensemble" select="ancestor::XPAGES[1]/INFORMATIONS/LABEL"/> | |
1066 | <xsl:variable name="label-fichiers" select="ancestor::XPAGES[1]/@labelfichiers"/> | |
783 | 1067 | <xsl:for-each select="FICHIER"> |
784 | 1068 | <xsl:variable name="nomfichier" select="@nom"/> |
785 | <xsl:variable name="localisation" select="../@localisation"/> | |
786 | <xsl:variable name="largeur1" select="document(concat($uri-site, '/images.xml'))/IMAGES/IMAGE[@contrib=$label-ensemble and @nom=$nomfichier and @localisation=$localisation]/@largeur1"/> | |
787 | <xsl:variable name="hauteur1" select="document(concat($uri-site, '/images.xml'))/IMAGES/IMAGE[@contrib=$label-ensemble and @nom=$nomfichier and @localisation=$localisation]/@hauteur1"/> | |
788 | <xsl:variable name="redim" select="document(concat($uri-site, '/images.xml'))/IMAGES/IMAGE[@contrib=$label-ensemble and @nom=$nomfichier and @localisation=$localisation]/@redim"/> | |
1069 | <xsl:variable name="localisation"><xsl:choose> | |
1070 | <xsl:when test="$affichage='impression'">texte</xsl:when> | |
1071 | <xsl:otherwise><xsl:value-of select="../@localisation"/></xsl:otherwise> | |
1072 | </xsl:choose></xsl:variable> | |
1073 | <xsl:variable name="largeur1" select="document(concat($uri-site, '/images.xml'))/IMAGES/IMAGE[@contrib=$label-fichiers and @nom=$nomfichier and @localisation=$localisation]/@largeur1"/> | |
1074 | <xsl:variable name="hauteur1" select="document(concat($uri-site, '/images.xml'))/IMAGES/IMAGE[@contrib=$label-fichiers and @nom=$nomfichier and @localisation=$localisation]/@hauteur1"/> | |
1075 | <xsl:variable name="redim" select="document(concat($uri-site, '/images.xml'))/IMAGES/IMAGE[@contrib=$label-fichiers and @nom=$nomfichier and @localisation=$localisation]/@redim"/> | |
789 | 1076 | <xsl:variable name="format"><xsl:call-template name="format-fichier"> |
790 | 1077 | <xsl:with-param name="nom" select="@nom"/> |
791 | 1078 | </xsl:call-template></xsl:variable> |
792 | 1079 | <xsl:choose> |
793 | 1080 | <xsl:when test="$redim='oui'"> |
794 | <xsl:variable name="largeur2" select="document(concat($uri-site, '/images.xml'))/IMAGES/IMAGE[@contrib=$label-ensemble and @nom=$nomfichier and @localisation=$localisation]/@largeur2"/> | |
795 | <xsl:variable name="hauteur2" select="document(concat($uri-site, '/images.xml'))/IMAGES/IMAGE[@contrib=$label-ensemble and @nom=$nomfichier and @localisation=$localisation]/@hauteur2"/> | |
796 | <xsl:variable name="href" select="concat('html_images/', translate($nomfichier, '/\\', '__'), '.html')"/> | |
1081 | <xsl:variable name="largeur2" select="document(concat($uri-site, '/images.xml'))/IMAGES/IMAGE[@contrib=$label-fichiers and @nom=$nomfichier and @localisation=$localisation]/@largeur2"/> | |
1082 | <xsl:variable name="hauteur2" select="document(concat($uri-site, '/images.xml'))/IMAGES/IMAGE[@contrib=$label-fichiers and @nom=$nomfichier and @localisation=$localisation]/@hauteur2"/> | |
1083 | <xsl:variable name="href" select="concat($prefixe, 'pages_', $label-fichiers, '/', 'html_images/', translate($nomfichier, '/\\', '__'), '.html')"/> | |
797 | 1084 | <xsl:choose> |
798 | 1085 | <xsl:when test="$format='PNG' or $format='GIF' or $format='JPEG'"> |
799 | <a href="{$href}" target="blank" onclick="window.open('{$href}', '', 'scrollbars=yes,scrolling=auto,toolbar=no,directories=no,menubar=no,status=no,resizable=no,width={$largeur1+35},height={$hauteur1+200}'); return false"><img alt="{$nomfichier}" src="{$prefixe}pages_{$label-ensemble}/images_{$localisation}/{$nomfichier}" width="{$largeur2}" height="{$hauteur2}" border="0"/></a> | |
1086 | <a href="{$href}" target="_blank" onclick="window.open('{$href}', '', 'scrollbars=yes,scrolling=auto,toolbar=no,directories=no,menubar=no,status=no,resizable=no,width={$largeur1+35},height={$hauteur1+200}'); return false"><img alt="{$nomfichier}" src="{$prefixe}pages_{$label-fichiers}/images_{$localisation}/{$nomfichier}" width="{$largeur2}" height="{$hauteur2}" border="0"/></a> | |
800 | 1087 | </xsl:when> |
801 | 1088 | <xsl:when test="$format='MPEG'"> |
802 | <embed src="{$prefixe}pages_{$label-ensemble}/images_{$localisation}/{$nomfichier}" width="{$largeur2}" height="{$hauteur2}"> | |
1089 | <embed src="{$prefixe}pages_{$label-fichiers}/images_{$localisation}/{$nomfichier}" width="{$largeur2}" height="{$hauteur2}"> | |
803 | 1090 | <noembed><xsl:value-of select="$messages/message[@label='Erreur: ce navigateur ne gère pas EMBED']"/></noembed> |
804 | 1091 | </embed> |
805 | 1092 | </xsl:when> |
809 | 1096 | <xsl:otherwise> |
810 | 1097 | <xsl:choose> |
811 | 1098 | <xsl:when test="$format='PNG' or $format='GIF' or $format='JPEG'"> |
812 | <img alt="{$nomfichier}" src="{$prefixe}pages_{$label-ensemble}/{$nomfichier}" width="{$largeur1}" height="{$hauteur1}"/> | |
1099 | <img alt="{$nomfichier}" src="{$prefixe}pages_{$label-fichiers}/{$nomfichier}" width="{$largeur1}" height="{$hauteur1}"/> | |
813 | 1100 | </xsl:when> |
814 | 1101 | <xsl:when test="$format='MPEG'"> |
815 | <embed src="{$prefixe}pages_{$label-ensemble}/{$nomfichier}" width="{$largeur1}" height="{$hauteur1}"> | |
816 | <noembed><xsl:value-of select="$messages/message[@label='Erreur: ce navigateur ne gère pas EMBED']"/></noembed> | |
817 | </embed> | |
1102 | <xsl:choose> | |
1103 | <xsl:when test="$affichage='web'"> | |
1104 | <embed src="{$prefixe}pages_{$label-fichiers}/{$nomfichier}" width="{$largeur1}" height="{$hauteur1}"> | |
1105 | <noembed><xsl:value-of select="$messages/message[@label='Erreur: ce navigateur ne gère pas EMBED']"/></noembed> | |
1106 | </embed> | |
1107 | </xsl:when> | |
1108 | <xsl:otherwise> | |
1109 | <p><img src="{$prefixe}{$interface}/video.gif" width="50" height="50" alt="vidéo MPEG" border="0"/></p> | |
1110 | </xsl:otherwise> | |
1111 | </xsl:choose> | |
1112 | </xsl:when> | |
1113 | <xsl:when test="$format='OGG'"> | |
1114 | <xsl:choose> | |
1115 | <xsl:when test="$affichage='web'"> | |
1116 | <applet code="com.fluendo.player.Cortado.class" width="{$largeur1}" height="{$hauteur1 + 16}" codebase="{$prefixe}" archive="interface/applets/cortado.jar"> | |
1117 | <param name="url" value="{$prefixe}pages_{$label-fichiers}/{$nomfichier}"/> | |
1118 | <param name="seekable" value="false"/> | |
1119 | <param name="autoPlay" value="false"/> | |
1120 | <param name="showStatus" value="show"/> | |
1121 | <param name="statusHeight" value="16"/> | |
1122 | <xsl:value-of select="$messages/message[@label='Java n_est pas activé.']"/> | |
1123 | </applet> | |
1124 | </xsl:when> | |
1125 | <xsl:otherwise> | |
1126 | <p><img src="{$prefixe}{$interface}/video.gif" width="50" height="50" alt="vidéo OGG" border="0"/></p> | |
1127 | </xsl:otherwise> | |
1128 | </xsl:choose> | |
818 | 1129 | </xsl:when> |
819 | 1130 | <xsl:otherwise><xsl:value-of select="$messages/message[@label='format inconnu (vérifier l_extension du nom du fichier)']"/></xsl:otherwise> |
820 | 1131 | </xsl:choose> |
827 | 1138 | |
828 | 1139 | <!-- création du fichier HTML pour la grande image --> |
829 | 1140 | <xsl:template name="html-figure"> |
1141 | <xsl:param name="interface"/> | |
830 | 1142 | <xsl:param name="largeur1"/> |
831 | 1143 | <xsl:param name="hauteur1"/> |
832 | <xsl:variable name="interface">../../interface/<xsl:choose> | |
833 | <xsl:when test="count(ancestor-or-self::XPAGES[INFORMATIONS/INTERFACE!='']) > 0"><xsl:value-of select="ancestor-or-self::XPAGES[INFORMATIONS/INTERFACE!=''][1]/INFORMATIONS/INTERFACE"/></xsl:when> | |
834 | <xsl:otherwise><xsl:value-of select="$interface_par_defaut"/></xsl:otherwise> | |
835 | </xsl:choose></xsl:variable> | |
1144 | <xsl:variable name="prefixe">../../</xsl:variable> | |
836 | 1145 | <xsl:variable name="cheminfichier" select="@nom"/> |
837 | 1146 | <xsl:variable name="nomfichier"><xsl:call-template name="nom-fichier"> |
838 | 1147 | <xsl:with-param name="chemin" select="$cheminfichier"/> |
840 | 1149 | <xsl:variable name="format"><xsl:call-template name="format-fichier"> |
841 | 1150 | <xsl:with-param name="nom" select="$nomfichier"/> |
842 | 1151 | </xsl:call-template></xsl:variable> |
1152 | <xsl:variable name="label-fichiers" select="ancestor::XPAGES[1]/@labelfichiers"/> | |
843 | 1153 | <xsl:call-template name="ecrire-fichier"> |
844 | <xsl:with-param name="fichier" select="concat($chemin-site, $sep, 'pages_', ancestor::XPAGES[1]/INFORMATIONS/LABEL, $sep, 'html_images', $sep, translate($cheminfichier, '/\\', '__'), '.html')"/> | |
1154 | <xsl:with-param name="fichier" select="concat($chemin-site, $sep, 'pages_', $label-fichiers, $sep, 'html_images', $sep, translate($cheminfichier, '/\\', '__'), '.html')"/> | |
845 | 1155 | <xsl:with-param name="contenu"> |
846 | 1156 | <html> |
847 | 1157 | <head> |
848 | 1158 | <title><xsl:value-of select="../@titre"/></title> |
849 | <link type="text/css" rel="stylesheet" href="{$interface}/{$feuille-de-style}"/> | |
1159 | <link type="text/css" rel="stylesheet" href="{$prefixe}{$interface}/{$feuille-de-style}"/> | |
850 | 1160 | </head> |
851 | <body bgcolor="#FFFFFF" text="#000000"> | |
1161 | <body> | |
852 | 1162 | <div align="center"> |
853 | 1163 | <xsl:if test="../@titre!=''"> |
854 | 1164 | <div class="titrefigure"><xsl:value-of select="../@titre"/></div> |
864 | 1174 | </xsl:when> |
865 | 1175 | <xsl:otherwise><xsl:value-of select="$messages/message[@label='format inconnu (vérifier l_extension du nom du fichier)']"/></xsl:otherwise> |
866 | 1176 | </xsl:choose> |
867 | <xsl:apply-templates select="../LEGENDE|../CREDIT"/> | |
1177 | <xsl:apply-templates select="../LEGENDE"> | |
1178 | <xsl:with-param name="prefixe">../../</xsl:with-param> | |
1179 | </xsl:apply-templates> | |
1180 | <xsl:apply-templates select="../CREDIT"/> | |
868 | 1181 | </div> |
869 | 1182 | </body> |
870 | 1183 | </html> |
878 | 1191 | <xsl:when test="ancestor::PAGE[@label='index']"></xsl:when> |
879 | 1192 | <xsl:otherwise>../</xsl:otherwise> |
880 | 1193 | </xsl:choose></xsl:variable> |
881 | <xsl:variable name="label-ensemble" select="ancestor::XPAGES[1]/INFORMATIONS/LABEL"/> | |
882 | <img alt="{@nom}" src="{$prefixe}pages_{$label-ensemble}/{@nom}"/> | |
1194 | <xsl:variable name="label-fichiers" select="ancestor::XPAGES[1]/@labelfichiers"/> | |
1195 | <img alt="{@nom}" src="{$prefixe}pages_{$label-fichiers}/{@nom}"/> | |
883 | 1196 | </xsl:template> |
884 | 1197 | |
885 | 1198 | |
886 | 1199 | <xsl:template match="LEGENDE"> |
1200 | <xsl:param name="prefixe"><xsl:choose> | |
1201 | <xsl:when test="ancestor::PAGE[@label='index']"></xsl:when> | |
1202 | <xsl:otherwise>../</xsl:otherwise> | |
1203 | </xsl:choose></xsl:param> | |
887 | 1204 | <div class="legende"> |
888 | <xsl:apply-templates/> | |
1205 | <xsl:apply-templates> | |
1206 | <xsl:with-param name="prefixe" select="$prefixe"/> | |
1207 | </xsl:apply-templates> | |
889 | 1208 | </div> |
890 | 1209 | </xsl:template> |
891 | 1210 | |
896 | 1215 | |
897 | 1216 | |
898 | 1217 | <xsl:template match="APPLET|FLASH"> |
1218 | <xsl:param name="affichage">web</xsl:param> | |
1219 | <xsl:param name="interface">interface/<xsl:value-of select="$interface_par_defaut"/></xsl:param> | |
899 | 1220 | <xsl:variable name="prefixe"><xsl:choose> |
900 | 1221 | <xsl:when test="ancestor::PAGE[@label='index']"></xsl:when> |
901 | 1222 | <xsl:otherwise>../</xsl:otherwise> |
902 | 1223 | </xsl:choose></xsl:variable> |
903 | <xsl:variable name="interface"><xsl:value-of select="$prefixe"/>interface/<xsl:choose> | |
904 | <xsl:when test="count(ancestor-or-self::XPAGES[INFORMATIONS/INTERFACE!='']) > 0"><xsl:value-of select="ancestor-or-self::XPAGES[INFORMATIONS/INTERFACE!=''][1]/INFORMATIONS/INTERFACE"/></xsl:when> | |
905 | <xsl:otherwise><xsl:value-of select="$interface_par_defaut"/></xsl:otherwise> | |
906 | </xsl:choose></xsl:variable> | |
907 | 1224 | |
908 | 1225 | <xsl:choose> |
909 | <xsl:when test="@localisation='icône' and $affichage='web'"> | |
910 | <xsl:variable name="rep" select="concat($chemin-site, '/', 'pages_', ancestor::XPAGES[1]/INFORMATIONS/LABEL)"/> | |
911 | <xsl:variable name="numero"><xsl:number level="any" from="XPAGES" count="APPLET|FLASH"/></xsl:variable> | |
1226 | <xsl:when test="$affichage='impression'"> | |
1227 | <xsl:variable name="icone"><xsl:choose> | |
1228 | <xsl:when test="self::APPLET">applet.gif</xsl:when> | |
1229 | <xsl:when test="self::FLASH">flash.gif</xsl:when> | |
1230 | </xsl:choose></xsl:variable> | |
1231 | <p><img src="{$prefixe}{$interface}/{$icone}" width="45" height="45" border="0" alt="{$icone}"/></p> | |
1232 | </xsl:when> | |
1233 | <xsl:when test="@localisation='icône'"> | |
1234 | <xsl:variable name="label-fichiers" select="ancestor::XPAGES[1]/@labelfichiers"/> | |
1235 | <xsl:variable name="rep" select="concat($chemin-site, '/', 'pages_', $label-fichiers)"/> | |
1236 | <xsl:variable name="numero"><xsl:number level="any" from="XPAGES[@contribution='oui']" count="APPLET|FLASH"/></xsl:variable> | |
912 | 1237 | <xsl:variable name="nomfichiermedia"><xsl:value-of select="concat('media',$numero)"/>.html</xsl:variable> |
913 | 1238 | <xsl:variable name="fichiermedia"><xsl:value-of select="concat($rep,$sep,$nomfichiermedia)"/></xsl:variable> |
914 | 1239 | <xsl:variable name="icone"><xsl:choose> |
915 | 1240 | <xsl:when test="self::APPLET">applet.gif</xsl:when> |
916 | 1241 | <xsl:when test="self::FLASH">flash.gif</xsl:when> |
917 | 1242 | </xsl:choose></xsl:variable> |
918 | <br/><a href="{$nomfichiermedia}" target="blank"><img src="{$interface}/{$icone}" width="45" height="45" border="0" alt="{$icone}"/></a> | |
1243 | <br/><a href="{$nomfichiermedia}" target="_blank"><img src="{$prefixe}{$interface}/{$icone}" width="45" height="45" border="0" alt="{$icone}"/></a> | |
919 | 1244 | <xsl:call-template name="ecrire-fichier"> |
920 | 1245 | <xsl:with-param name="fichier" select="$fichiermedia"/> |
921 | 1246 | <xsl:with-param name="contenu"> |
922 | 1247 | <html> |
923 | 1248 | <head> |
924 | 1249 | <title><xsl:value-of select="concat('applet ',$numero)"/></title> |
925 | <link type="text/css" rel="stylesheet" href="{$interface}/{$feuille-de-style}"/> | |
1250 | <link type="text/css" rel="stylesheet" href="{$prefixe}{$interface}/{$feuille-de-style}"/> | |
926 | 1251 | </head> |
927 | 1252 | <body> |
928 | 1253 | <xsl:call-template name="contenu-media"> |
929 | <xsl:with-param name="interface"><xsl:value-of select="$interface"/></xsl:with-param> | |
930 | 1254 | <xsl:with-param name="prefixe"><xsl:value-of select="$prefixe"/></xsl:with-param> |
931 | 1255 | </xsl:call-template> |
932 | 1256 | </body> |
934 | 1258 | </xsl:with-param> |
935 | 1259 | </xsl:call-template> |
936 | 1260 | </xsl:when> |
937 | <xsl:when test="@localisation='page' and $affichage='web'"> | |
1261 | <xsl:when test="@localisation='page'"> | |
938 | 1262 | <div class="zone_figure"> |
939 | 1263 | <xsl:call-template name="contenu-media"> |
940 | <xsl:with-param name="interface"><xsl:value-of select="$interface"/></xsl:with-param> | |
941 | 1264 | <xsl:with-param name="prefixe"><xsl:value-of select="$prefixe"/></xsl:with-param> |
942 | 1265 | </xsl:call-template> |
943 | 1266 | </div> |
952 | 1275 | </xsl:template> |
953 | 1276 | |
954 | 1277 | <xsl:template name="contenu-media"> |
955 | <xsl:param name="interface"/> | |
956 | 1278 | <xsl:param name="prefixe">../</xsl:param> |
957 | 1279 | |
958 | 1280 | <xsl:variable name="classe-div"><xsl:choose> |
967 | 1289 | <div class="titrefigure"><xsl:value-of select="@titre"/></div> |
968 | 1290 | </xsl:if> |
969 | 1291 | <xsl:choose> |
970 | <xsl:when test="self::APPLET and $affichage='web'"> | |
1292 | <xsl:when test="self::APPLET"> | |
971 | 1293 | <applet code="{@classe}" archive="{@archive}" width="{@largeur}" height="{@hauteur}"> |
972 | 1294 | <xsl:apply-templates select="PARAM"/> |
973 | 1295 | <xsl:value-of select="$messages/message[@label='Java n_est pas activé.']"/> |
974 | 1296 | </applet> |
975 | 1297 | </xsl:when> |
976 | <xsl:when test="self::FLASH and $affichage='web'"> | |
1298 | <xsl:when test="self::FLASH"> | |
977 | 1299 | <object type="application/x-shockwave-flash" data="{@fichier}" width="{@largeur}" height="{@hauteur}" title="{@titre}"> |
978 | 1300 | <param name="movie" value="{@fichier}"/> |
979 | 1301 | <xsl:variable name="parametres"><xsl:for-each select="PARAM"> |
985 | 1307 | <xsl:value-of select="$messages/message[@label='Erreur: plugin Flash absent ou désactivé ?']"/> |
986 | 1308 | </object> |
987 | 1309 | </xsl:when> |
988 | <xsl:otherwise> | |
989 | <xsl:variable name="icone"><xsl:choose> | |
990 | <xsl:when test="self::APPLET">applet.gif</xsl:when> | |
991 | <xsl:when test="self::FLASH">flash.gif</xsl:when> | |
992 | </xsl:choose></xsl:variable> | |
993 | <img src="{$interface}/{$icone}" width="45" height="45" border="0" alt="{$icone}"/> | |
994 | </xsl:otherwise> | |
995 | 1310 | </xsl:choose> |
996 | 1311 | <xsl:apply-templates select="LEGENDE"/> |
997 | 1312 | <xsl:apply-templates select="CREDIT"/> |
1005 | 1320 | |
1006 | 1321 | |
1007 | 1322 | <xsl:template match="COMMENTAIRE"> |
1323 | <xsl:if test="$sortie='production'"> | |
1324 | <div class="commentaire"> | |
1325 | <xsl:value-of select="."/> | |
1326 | </div> | |
1327 | </xsl:if> | |
1328 | </xsl:template> | |
1329 | ||
1330 | ||
1331 | <!-- Exercices --> | |
1332 | ||
1333 | <xsl:template match="EXERCICE"> | |
1334 | <xsl:param name="affichage">web</xsl:param> | |
1335 | <xsl:param name="interface">interface/<xsl:value-of select="$interface_par_defaut"/></xsl:param> | |
1336 | <xsl:variable name="prefixe"><xsl:choose> | |
1337 | <xsl:when test="ancestor::PAGE[@label='index']"></xsl:when> | |
1338 | <xsl:otherwise>../</xsl:otherwise> | |
1339 | </xsl:choose></xsl:variable> | |
1340 | <div class="exercice"> | |
1341 | <xsl:element name="h{count(ancestor::SECTION)+2}"> | |
1342 | <img src="{$prefixe}{$interface}/icones_sections/exercice.png" width="40" height="40" alt="exercice" class="icone_section"/> | |
1343 | <xsl:choose> | |
1344 | <xsl:when test="@titre!=''"><xsl:value-of select="@titre"/></xsl:when> | |
1345 | <xsl:otherwise><xsl:value-of select="$messages/message[@label='Exercice']"/></xsl:otherwise> | |
1346 | </xsl:choose> | |
1347 | </xsl:element> | |
1348 | <xsl:if test="DIFFICULTE | TEMPS"> | |
1349 | <p> | |
1350 | <xsl:if test="DIFFICULTE"> | |
1351 | <xsl:value-of select="concat($messages/message[@label='Difficulté :'], ' ', DIFFICULTE)"/>   | |
1352 | </xsl:if> | |
1353 | <xsl:if test="TEMPS"> | |
1354 | <xsl:value-of select="concat($messages/message[@label='Temps :'], ' ', TEMPS)"/> | |
1355 | </xsl:if> | |
1356 | </p> | |
1357 | </xsl:if> | |
1358 | <xsl:apply-templates select="ENONCE"> | |
1359 | <xsl:with-param name="affichage" select="$affichage"/> | |
1360 | <xsl:with-param name="interface" select="$interface"/> | |
1361 | </xsl:apply-templates> | |
1362 | <xsl:apply-templates select="QUESTION"> | |
1363 | <xsl:with-param name="affichage" select="$affichage"/> | |
1364 | </xsl:apply-templates> | |
1365 | </div> | |
1366 | </xsl:template> | |
1367 | ||
1368 | <xsl:template match="ENONCE"> | |
1369 | <xsl:param name="affichage">web</xsl:param> | |
1370 | <xsl:param name="interface">interface/<xsl:value-of select="$interface_par_defaut"/></xsl:param> | |
1371 | <xsl:apply-templates> | |
1372 | <xsl:with-param name="affichage" select="$affichage"/> | |
1373 | <xsl:with-param name="interface" select="$interface"/> | |
1374 | </xsl:apply-templates> | |
1375 | </xsl:template> | |
1376 | ||
1377 | <xsl:template match="QUESTION"> | |
1378 | <xsl:param name="affichage">web</xsl:param> | |
1379 | <xsl:variable name="numquestion"><xsl:number level="any" from="EXERCICE" count="QUESTION"/></xsl:variable> | |
1380 | <div class="question"> | |
1381 | <b><xsl:value-of select="concat($messages/message[@label='Question'], ' ', $numquestion)"/>)</b> | |
1382 | <xsl:apply-templates select="ENONCE"/> | |
1383 | <p> | |
1384 | <xsl:if test="$affichage='web'"> | |
1385 | <xsl:apply-templates select="AIDE" mode="lien"/> | |
1386 | </xsl:if> | |
1387 | <xsl:if test="$affichage='web' and (../@type='auto-évaluation' or $sortie='production')"> | |
1388 | <xsl:apply-templates select="SOLUTION" mode="lien"/> | |
1389 | </xsl:if> | |
1390 | <xsl:apply-templates select="POINTS"/> | |
1391 | </p> | |
1392 | </div> | |
1393 | </xsl:template> | |
1394 | ||
1395 | <xsl:template match="AIDE" mode="lien"> | |
1396 | <xsl:variable name="numaide"><xsl:number level="any" from="XPAGES[@contribution='oui']" count="AIDE | SOLUTION"/></xsl:variable> | |
1397 | ||
1398 | <xsl:variable name="nomFichier" select="concat('aide',$numaide,'.html')"/> | |
1399 | <a href="{$nomFichier}" class="lienaide" onclick="w=window.open('{$nomFichier}','aide_solution','scrollbars=yes,scrolling=auto,toolbar=no,directories=no,menubar=no,status=no,height=400,width=600'); w.focus(); return false"><xsl:value-of select="$messages/message[@label='Aide']"/></a>   | |
1400 | </xsl:template> | |
1401 | ||
1402 | <xsl:template match="AIDE"> | |
1403 | <xsl:apply-templates/> | |
1404 | </xsl:template> | |
1405 | ||
1406 | <xsl:template match="SOLUTION" mode="lien"> | |
1407 | <xsl:variable name="numaide"> | |
1408 | <xsl:number level="any" from="XPAGES[@contribution='oui']" count="AIDE | SOLUTION"/> | |
1409 | </xsl:variable> | |
1410 | <xsl:variable name="nomFichier" select="concat('aide',$numaide,'.html')"/> | |
1411 | <a href="{$nomFichier}" class="liensolution" onclick="w=window.open('{$nomFichier}','aide_solution','scrollbars=yes,scrolling=auto,toolbar=no,directories=no,menubar=no,status=no,height=400,width=600'); w.focus(); return false"><xsl:value-of select="$messages/message[@label='Solution']"/></a>   | |
1412 | </xsl:template> | |
1413 | ||
1414 | <xsl:template match="SOLUTION"> | |
1415 | <xsl:param name="interface">interface/<xsl:value-of select="$interface_par_defaut"/></xsl:param> | |
1416 | <xsl:apply-templates> | |
1417 | <xsl:with-param name="interface" select="$interface"/> | |
1418 | </xsl:apply-templates> | |
1419 | </xsl:template> | |
1420 | ||
1421 | <xsl:template match="POINTS"> | |
1422 | [<em><xsl:value-of select="concat(., ' ', $messages/message[@label='points'])"/></em>] | |
1423 | </xsl:template> | |
1424 | ||
1425 | ||
1426 | <xsl:template match="QCM"> | |
1427 | <xsl:param name="affichage">web</xsl:param> | |
1428 | <xsl:param name="interface">interface/<xsl:value-of select="$interface_par_defaut"/></xsl:param> | |
1429 | <xsl:variable name="prefixe"><xsl:choose> | |
1430 | <xsl:when test="ancestor::PAGE[@label='index']"></xsl:when> | |
1431 | <xsl:otherwise>../</xsl:otherwise> | |
1432 | </xsl:choose></xsl:variable> | |
1433 | <div class="qcm"> | |
1434 | <xsl:element name="h{count(ancestor::SECTION)+2}"> | |
1435 | <img src="{$prefixe}{$interface}/icones_sections/qcm.png" width="40" height="40" alt="qcm" class="icone_section"/> | |
1436 | <xsl:choose> | |
1437 | <xsl:when test="@titre!=''"><xsl:value-of select="@titre"/></xsl:when> | |
1438 | <xsl:otherwise><xsl:value-of select="$messages/message[@label='QCM']"/></xsl:otherwise> | |
1439 | </xsl:choose> | |
1440 | </xsl:element> | |
1441 | <xsl:apply-templates select="ENONCE"/> | |
1442 | <xsl:if test="DIFFICULTE | TEMPS"> | |
1443 | <p> | |
1444 | <xsl:if test="DIFFICULTE"> | |
1445 | <xsl:value-of select="concat($messages/message[@label='Difficulté :'], ' ', DIFFICULTE)"/>   | |
1446 | </xsl:if> | |
1447 | <xsl:if test="TEMPS"> | |
1448 | <xsl:value-of select="concat($messages/message[@label='Temps :'], ' ', TEMPS)"/> | |
1449 | </xsl:if> | |
1450 | </p> | |
1451 | </xsl:if> | |
1452 | <xsl:choose> | |
1453 | <xsl:when test="$affichage='web'"> | |
1454 | <xsl:variable name="numqcm"><xsl:number level="any" from="XPAGES" count="QCM" /></xsl:variable> | |
1455 | <!-- remarque: le onsubmit ne marchera pas sur de vieux navigateurs, mais c'est le seul | |
1456 | moyen d'avoir un code valide --> | |
1457 | <form name="qcm{$numqcm}" action="#" onsubmit="resultat({$numqcm}); return false"> | |
1458 | <xsl:apply-templates select="QUESTIONQCM"/> | |
1459 | <br/> | |
1460 | <input value="{$messages/message[@label='Solution']}" type="submit"/>  | |
1461 | </form> | |
1462 | </xsl:when> | |
1463 | <xsl:otherwise> | |
1464 | <xsl:apply-templates select="QUESTIONQCM"/> | |
1465 | </xsl:otherwise> | |
1466 | </xsl:choose> | |
1467 | </div> | |
1468 | </xsl:template> | |
1469 | ||
1470 | <xsl:template name="script-qcm"> | |
1471 | <script language="JavaScript" type="text/javascript"> | |
1472 | <xsl:comment> | |
1473 | function resultat(numqcm) | |
1474 | { | |
1475 | var reponses=''; | |
1476 | var valrep=''; | |
1477 | var numq=''; | |
1478 | ||
1479 | <xsl:variable name="reponses"> | |
1480 | var formulaire = document.forms[numqcm-1]; | |
1481 | for (var irep=0; irep < formulaire.elements.length; irep++) { | |
1482 | if (formulaire.elements[irep].checked) { | |
1483 | valrep = formulaire.elements[irep].value; | |
1484 | numq = formulaire.elements[irep].name.substring(4); | |
1485 | if (valrep.substring(0,1)=='V') | |
1486 | reponses = reponses + '<xsl:value-of select="$messages/message[@label='Question']"/> ' + numq + ' : <xsl:value-of select="$messages/message[@label='juste']"/> : ' + valrep.substring(1) + '\n'; | |
1487 | else | |
1488 | reponses = reponses + 'Question ' + numq + ' : <xsl:value-of select="$messages/message[@label='faux']"/> : ' + valrep.substring(1) + '\n'; | |
1489 | } | |
1490 | } | |
1491 | </xsl:variable> | |
1492 | ||
1493 | <xsl:value-of select="$reponses"/> | |
1494 | ||
1495 | alert(reponses); | |
1496 | } | |
1497 | //</xsl:comment> | |
1498 | <xsl:text> | |
1499 | </xsl:text> | |
1500 | </script> | |
1501 | </xsl:template> | |
1502 | ||
1503 | <xsl:template match="QUESTIONQCM"> | |
1504 | <div class="questionqcm"> | |
1505 | <xsl:apply-templates select="ENONCEQCM"/> | |
1506 | <xsl:apply-templates select="REPONSEQCM"/> | |
1507 | <br/> | |
1508 | <xsl:apply-templates select="AIDE" mode="lien"/> | |
1509 | </div> | |
1510 | </xsl:template> | |
1511 | ||
1512 | <xsl:template match="ENONCEQCM"> | |
1513 | <xsl:variable name="numquestion"><xsl:number level="any" from="QCM" count="QUESTIONQCM"/></xsl:variable> | |
1514 | <!--<div class="enonceqcm">--> | |
1515 | <xsl:value-of select="$numquestion"/>) <xsl:apply-templates/> | |
1516 | <!--</div>--> | |
1517 | </xsl:template> | |
1518 | ||
1519 | <xsl:template match="REPONSEQCM"> | |
1520 | <br/> | |
1521 | <xsl:variable name="vraifaux"><xsl:choose> | |
1522 | <xsl:when test="@bonne='oui'">V</xsl:when> | |
1523 | <xsl:when test="@bonne='non'">F</xsl:when> | |
1524 | <xsl:otherwise><xsl:choose> | |
1525 | <xsl:when test="COMMENTAIREREP='ok'">V</xsl:when> | |
1526 | <xsl:otherwise>F</xsl:otherwise> | |
1527 | </xsl:choose></xsl:otherwise> | |
1528 | </xsl:choose></xsl:variable> | |
1529 | <xsl:variable name="numquestion"><xsl:number level="any" from="QCM" count="QUESTIONQCM" /></xsl:variable> | |
1530 | <input type="radio" name="repq{$numquestion}" value="{$vraifaux}{normalize-space(COMMENTAIREREP)}"/> | |
1531 | <xsl:apply-templates/> | |
1532 | </xsl:template> | |
1533 | ||
1534 | <xsl:template match="TEXTEREP"> | |
1535 | <span class="reptexte"> | |
1536 | <xsl:apply-templates/> | |
1537 | </span> | |
1538 | </xsl:template> | |
1539 | ||
1540 | <xsl:template match="COMMENTAIREREP"> | |
1541 | </xsl:template> | |
1542 | ||
1543 | <xsl:template name="fichiers-aide"> | |
1544 | <xsl:param name="interface">interface/<xsl:value-of select="$interface_par_defaut"/></xsl:param> | |
1545 | <xsl:variable name="prefixe">../</xsl:variable> | |
1546 | <xsl:variable name="rep" select="concat($chemin-site, $sep, 'pages_', ancestor::XPAGES[1]/@labelfichiers)"/> | |
1547 | <xsl:for-each select=".//AIDE | .//SOLUTION"> | |
1548 | <xsl:if test="self::AIDE or $sortie='production'"> | |
1549 | <xsl:variable name="numaide"> | |
1550 | <xsl:number level="any" from="XPAGES[@contribution='oui']" count="AIDE | SOLUTION"/> | |
1551 | </xsl:variable> | |
1552 | <xsl:call-template name="ecrire-fichier"> | |
1553 | <xsl:with-param name="fichier" select="concat($rep,'/aide',$numaide,'.html')"/> | |
1554 | <xsl:with-param name="contenu"> | |
1555 | <html> | |
1556 | <head> | |
1557 | <title><xsl:value-of select="name()"/></title> | |
1558 | <link type="text/css" rel="stylesheet" href="{$prefixe}{$interface}/style.css"/> | |
1559 | <!-- ne marche pas avec IE6 (la fenêtre se ferme quand on clique sur la barre de défilement) | |
1560 | <script language="JavaScript" type="text/javascript"> | |
1561 | window.onblur = fermeture; | |
1562 | function fermeture() { window.close(); } | |
1563 | </script> | |
1564 | --> | |
1565 | </head> | |
1566 | <body> | |
1567 | <xsl:apply-templates> | |
1568 | <xsl:with-param name="interface" select="$interface"/> | |
1569 | </xsl:apply-templates> | |
1570 | <br/> | |
1571 | <br/> | |
1572 | <div align="center"> | |
1573 | <form action=""> | |
1574 | <input onclick="window.close()" value="{$messages/message[@label='Fermer']}" type="button"/> | |
1575 | </form> | |
1576 | </div> | |
1577 | </body> | |
1578 | </html> | |
1579 | </xsl:with-param> | |
1580 | </xsl:call-template> | |
1581 | </xsl:if> | |
1582 | </xsl:for-each> | |
1008 | 1583 | </xsl:template> |
1009 | 1584 | |
1010 | 1585 | |
1016 | 1591 | <xsl:otherwise>../</xsl:otherwise> |
1017 | 1592 | </xsl:choose></xsl:variable> |
1018 | 1593 | <xsl:choose> |
1594 | <xsl:when test="(@contribution='' or not(@contribution)) and ancestor::PAGE[@label='index'] and count(ancestor::XPAGES)=1"> | |
1595 | <a href="{concat($prefixe, 'pages_', ancestor::XPAGES[1]/@labelfichiers, '/', @page, '.html')}" class="lien"><xsl:apply-templates/></a> | |
1596 | </xsl:when> | |
1019 | 1597 | <xsl:when test="@contribution='' or not(@contribution)"> |
1020 | 1598 | <a href="{@page}.html" class="lien"><xsl:apply-templates/></a> |
1021 | 1599 | </xsl:when> |
1022 | 1600 | <xsl:when test="@page='' or not(@page)"> |
1023 | <a href="{concat($prefixe,'pages_',@contribution,'/',//XPAGES[INFORMATIONS/LABEL=current()/@contribution]/PAGE[1]/@label,'.html')}" class="lien"><xsl:apply-templates/></a> | |
1601 | <a href="{concat($prefixe,'pages_', //XPAGES[INFORMATIONS/LABEL=current()/@contribution]/@labelfichiers, '/', //XPAGES[INFORMATIONS/LABEL=current()/@contribution]/PAGE[1]/@label,'.html')}" class="lien"><xsl:apply-templates/></a> | |
1024 | 1602 | </xsl:when> |
1025 | 1603 | <xsl:otherwise> |
1026 | <a href="{concat($prefixe,'pages_',@contribution,'/',@page,'.html')}" class="lien"><xsl:apply-templates/></a> | |
1604 | <a href="{concat($prefixe, 'pages_', //XPAGES[INFORMATIONS/LABEL=current()/@contribution]/@labelfichiers, '/', @page, '.html')}" class="lien"><xsl:apply-templates/></a> | |
1027 | 1605 | </xsl:otherwise> |
1028 | 1606 | </xsl:choose> |
1029 | 1607 | </xsl:template> |
1034 | 1612 | </xsl:template> |
1035 | 1613 | |
1036 | 1614 | |
1615 | <xsl:template match="LIENIMAGE"> | |
1616 | <xsl:variable name="label" select="@label"/> | |
1617 | <xsl:choose> | |
1618 | <xsl:when test="ancestor::PAGE[1]//ENVIMAGE[@label=$label]"> | |
1619 | <xsl:variable name="localisation" select="ancestor::PAGE[1]//ENVIMAGE[@label=$label][1]/@localisation"/> | |
1620 | <xsl:choose> | |
1621 | <xsl:when test="$localisation='icône'"> | |
1622 | <xsl:variable name="nom" select="ancestor::PAGE[1]//ENVIMAGE[@label=$label][1]/FICHIER[1]/@nom"/> | |
1623 | <xsl:variable name="lien" select="concat('../pages_', ancestor::XPAGES[1]/@labelfichiers, '/', 'html_images/', translate($nom, '/\\', '__'), '.html')"/> | |
1624 | <xsl:variable name="label-fichiers" select="ancestor::XPAGES[1]/@labelfichiers"/> | |
1625 | <xsl:variable name="largeur1" select="document(concat($uri-site, '/images.xml'))/IMAGES/IMAGE[@contrib=$label-fichiers and @nom=$nom]/@largeur1"/> | |
1626 | <xsl:variable name="hauteur1" select="document(concat($uri-site, '/images.xml'))/IMAGES/IMAGE[@contrib=$label-fichiers and @nom=$nom]/@hauteur1"/> | |
1627 | <a href="{$lien}" class="lienimage" target="_blank" onclick="window.open('{$lien}', '', 'scrollbars=yes,scrolling=auto,toolbar=no,directories=no,menubar=no,status=no,width={$largeur1+35},height={$hauteur1+200}'); return false"><xsl:apply-templates/></a> | |
1628 | </xsl:when> | |
1629 | <xsl:when test="$localisation='page'"> | |
1630 | <xsl:variable name="position" select="count(ancestor::PAGE[1]//ENVIMAGE[@label=$label][1]/preceding-sibling::ENVIMAGE[@localisation='page'])+1"/> | |
1631 | <a href="#" onclick="imagette({$position}); return false;" class="lienimage"><xsl:apply-templates/></a> | |
1632 | </xsl:when> | |
1633 | <xsl:otherwise> | |
1634 | <a href="#{$label}" class="lienimage"><xsl:apply-templates/></a> | |
1635 | </xsl:otherwise> | |
1636 | </xsl:choose> | |
1637 | </xsl:when> | |
1638 | <xsl:otherwise> | |
1639 | <a href="???" class="lienimage"><xsl:apply-templates/></a> | |
1640 | </xsl:otherwise> | |
1641 | </xsl:choose> | |
1642 | </xsl:template> | |
1643 | ||
1644 | ||
1645 | <xsl:template name="sortie-symbole"> | |
1646 | <xsl:param name="nomlettre"/> | |
1647 | <xsl:param name="prefixe"/> | |
1648 | ||
1649 | <xsl:variable name="nomsansext" select="substring-before($nomlettre,'.')"/> | |
1650 | <xsl:choose> | |
1651 | <!-- pour chaque symbole on donne l'équivalent sous forme de caractère UNICODE, | |
1652 | ou d'une image pour les caractères qui ne s'affichent pas bien partout --> | |
1653 | <xsl:when test="$nomsansext='Alpha'">Α</xsl:when> | |
1654 | <xsl:when test="$nomsansext='Beta'">Β</xsl:when> | |
1655 | <xsl:when test="$nomsansext='Gamma'">Γ</xsl:when> | |
1656 | <xsl:when test="$nomsansext='Delta'">Δ</xsl:when> | |
1657 | <xsl:when test="$nomsansext='Epsilon'">Ε</xsl:when> | |
1658 | <xsl:when test="$nomsansext='Zeta'">Ζ</xsl:when> | |
1659 | <xsl:when test="$nomsansext='Eta'">Η</xsl:when> | |
1660 | <xsl:when test="$nomsansext='Theta'">Θ</xsl:when> | |
1661 | <xsl:when test="$nomsansext='Iota'">Ι</xsl:when> | |
1662 | <xsl:when test="$nomsansext='Kappa'">Κ</xsl:when> | |
1663 | <xsl:when test="$nomsansext='Lambda'">Λ</xsl:when> | |
1664 | <xsl:when test="$nomsansext='Mu'">Μ</xsl:when> | |
1665 | <xsl:when test="$nomsansext='Nu'">Ν</xsl:when> | |
1666 | <xsl:when test="$nomsansext='Xi'">Ξ</xsl:when> | |
1667 | <xsl:when test="$nomsansext='Omicron'">Ο</xsl:when> | |
1668 | <xsl:when test="$nomsansext='Pi'">Π</xsl:when> | |
1669 | <xsl:when test="$nomsansext='Rho'">Ρ</xsl:when> | |
1670 | <xsl:when test="$nomsansext='Sigma'">Σ</xsl:when> | |
1671 | <xsl:when test="$nomsansext='Tau'">Τ</xsl:when> | |
1672 | <xsl:when test="$nomsansext='Upsilon'">Υ</xsl:when> | |
1673 | <xsl:when test="$nomsansext='Phi'">Φ</xsl:when> | |
1674 | <xsl:when test="$nomsansext='Chi'">Χ</xsl:when> | |
1675 | <xsl:when test="$nomsansext='Psi'">Ψ</xsl:when> | |
1676 | <xsl:when test="$nomsansext='Omega'">Ω</xsl:when> | |
1677 | <xsl:when test="$nomsansext='alpha'">α</xsl:when> | |
1678 | <xsl:when test="$nomsansext='beta'">β</xsl:when> | |
1679 | <xsl:when test="$nomsansext='gamma'">γ</xsl:when> | |
1680 | <xsl:when test="$nomsansext='delta'">δ</xsl:when> | |
1681 | <xsl:when test="$nomsansext='epsilon'">ε</xsl:when> | |
1682 | <xsl:when test="$nomsansext='zeta'">ζ</xsl:when> | |
1683 | <xsl:when test="$nomsansext='eta'">η</xsl:when> | |
1684 | <xsl:when test="$nomsansext='theta'">θ</xsl:when> | |
1685 | <xsl:when test="$nomsansext='iota'">ι</xsl:when> | |
1686 | <!--<xsl:when test="$nomsansext='kappa'">κ</xsl:when> 03BA confondu avec 03F0 sur MacOS à cause de la police Times --> | |
1687 | <xsl:when test="$nomsansext='lambda'">λ</xsl:when> | |
1688 | <xsl:when test="$nomsansext='mu'">μ</xsl:when> | |
1689 | <xsl:when test="$nomsansext='nu'">ν</xsl:when> | |
1690 | <xsl:when test="$nomsansext='xi'">ξ</xsl:when> | |
1691 | <xsl:when test="$nomsansext='omicron'">ο</xsl:when> | |
1692 | <xsl:when test="$nomsansext='pi'">π</xsl:when> | |
1693 | <xsl:when test="$nomsansext='rho'">ρ</xsl:when> | |
1694 | <!--<xsl:when test="$nomsansext='sigmaf'">ς</xsl:when> pas bien affiché sur Firefox Mac --> | |
1695 | <xsl:when test="$nomsansext='sigma'">σ</xsl:when> | |
1696 | <xsl:when test="$nomsansext='tau'">τ</xsl:when> | |
1697 | <xsl:when test="$nomsansext='upsilon'">υ</xsl:when> | |
1698 | <!--<xsl:when test="$nomsansext='phi'">ϕ</xsl:when> phi = unicode 03C6 != 03D5, inversé sur MacOS à cause de la police Times, 03D5 ne s'affiche pas sur IE6 XP --> | |
1699 | <!--<xsl:when test="$nomsansext='phi2'">φ</xsl:when> unicode 03C6 != 03D5, inversé sur MacOS --> | |
1700 | <xsl:when test="$nomsansext='chi'">χ</xsl:when> | |
1701 | <xsl:when test="$nomsansext='psi'">ψ</xsl:when> | |
1702 | <xsl:when test="$nomsansext='omega'">ω</xsl:when> | |
1703 | <!--<xsl:when test="$nomsansext='thetasym'">ϑ</xsl:when> pas bien affiché sur IE6 Windows et Firefox Mac --> | |
1704 | <!--<xsl:when test="$nomsansext='upsih'">ϒ</xsl:when> pas bien affiché sur IE6 Windows --> | |
1705 | <!--<xsl:when test="$nomsansext='piv'">ϖ</xsl:when> pas bien affiché sur IE6 Windows et Firefox Mac --> | |
1706 | ||
1707 | <xsl:when test="$nomsansext='asymp'">≈</xsl:when> | |
1708 | <xsl:when test="$nomsansext='cap'">∩</xsl:when> | |
1709 | <!-- <xsl:when test="$nomsansext='cup'">∪</xsl:when> ne s'affiche pas sur IE6 et IE7 XP --> | |
1710 | <!-- <xsl:when test="$nomsansext='exist'">∃</xsl:when> ne s'affiche pas sur IE6 et IE7 XP --> | |
1711 | <!-- <xsl:when test="$nomsansext='forall'">∀</xsl:when> ne s'affiche pas sur IE6 et IE7 XP --> | |
1712 | <xsl:when test="$nomsansext='ge'">≥</xsl:when> | |
1713 | <xsl:when test="$nomsansext='harr'">↔</xsl:when> | |
1714 | <!-- <xsl:when test="$nomsansext='hdarr'">⇔</xsl:when> ne s'affiche pas sur IE6 et IE7 XP --> | |
1715 | <xsl:when test="$nomsansext='infin'">∞</xsl:when> | |
1716 | <!-- <xsl:when test="$nomsansext='isin'">∈</xsl:when> ne s'affiche pas sur IE6 et IE7 XP --> | |
1717 | <xsl:when test="$nomsansext='larr'">←</xsl:when> | |
1718 | <!-- ldarr = symbole HTML lArr ne s'affiche pas avec IE 6 --> | |
1719 | <xsl:when test="$nomsansext='le'">≤</xsl:when> | |
1720 | <!-- <xsl:when test="$nomsansext='nabla'">∇</xsl:when> ne s'affiche pas sur IE6 et IE7 XP --> | |
1721 | <xsl:when test="$nomsansext='ne'">≠</xsl:when> | |
1722 | <xsl:when test="$nomsansext='not'">¬</xsl:when> | |
1723 | <xsl:when test="$nomsansext='part'">∂</xsl:when> | |
1724 | <xsl:when test="$nomsansext='plusmn'">±</xsl:when> | |
1725 | <xsl:when test="$nomsansext='rarr'">→</xsl:when> | |
1726 | <!-- <xsl:when test="$nomsansext='rdarr'">⇒</xsl:when> ne s'affiche pas sur IE6 et IE7 XP --> | |
1727 | <!-- sim ne s'affiche pas sur IE6 et IE7 XP--> | |
1728 | <!-- <xsl:when test="$nomsansext='sub'">⊂</xsl:when> ne s'affiche pas sur IE6 et IE7 XP --> | |
1729 | ||
1730 | <xsl:otherwise> | |
1731 | <img src="{$prefixe}interface/{@nom}" border="0" alt="{$nomlettre}" class="maths"/> | |
1732 | </xsl:otherwise> | |
1733 | </xsl:choose> | |
1734 | </xsl:template> | |
1735 | ||
1736 | <xsl:template match="SYMBOLE"> | |
1737 | <xsl:variable name="nomlettre"><xsl:call-template name="nom-fichier"><xsl:with-param name="chemin" select="@nom"/></xsl:call-template></xsl:variable> | |
1738 | <xsl:variable name="prefixe"><xsl:choose> | |
1739 | <xsl:when test="ancestor::PAGE[@label='index']"></xsl:when> | |
1740 | <xsl:otherwise>../</xsl:otherwise> | |
1741 | </xsl:choose></xsl:variable> | |
1742 | <xsl:call-template name="sortie-symbole"> | |
1743 | <xsl:with-param name="nomlettre" select="$nomlettre"/> | |
1744 | <xsl:with-param name="prefixe" select="$prefixe"/> | |
1745 | </xsl:call-template> | |
1746 | </xsl:template> | |
1747 | ||
1748 | ||
1037 | 1749 | <xsl:template match="EQUATION|EQUATEX"> |
1750 | <xsl:param name="prefixe"><xsl:choose> | |
1751 | <xsl:when test="ancestor::ENVIMAGE[@localisation='icône']">../../</xsl:when> | |
1752 | <xsl:when test="ancestor::PAGE[@label='index']"></xsl:when> | |
1753 | <xsl:otherwise>../</xsl:otherwise> | |
1754 | </xsl:choose></xsl:param> | |
1038 | 1755 | <xsl:variable name="label-ensemble" select="ancestor::XPAGES[1]/INFORMATIONS/LABEL"/> |
1756 | <xsl:variable name="label-fichiers" select="ancestor::XPAGES[1]/@labelfichiers"/> | |
1039 | 1757 | <!-- |
1040 | 1758 | <xsl:variable name="largeur1" select="document(concat($uri-site, '/images.xml'))/IMAGES/IMAGE[@contrib=$label-ensemble and @nom=current()/@image]/@largeur1"/> |
1041 | 1759 | <xsl:variable name="hauteur1" select="document(concat($uri-site, '/images.xml'))/IMAGES/IMAGE[@contrib=$label-ensemble and @nom=current()/@image]/@hauteur1"/> |
1042 | 1760 | pour l'instant les dimensions ne sont pas dans ce fichier |
1043 | 1761 | --> |
1044 | 1762 | <xsl:variable name="numero"><xsl:number from="XPAGES" count="EQUATION|EQUATEX" level="any"/></xsl:variable> |
1045 | <xsl:variable name="prefixe"><xsl:choose> | |
1046 | <xsl:when test="ancestor::ENVIMAGE[@localisation='icône']">../../</xsl:when> | |
1047 | <xsl:when test="ancestor::PAGE[@label='index']"></xsl:when> | |
1048 | <xsl:otherwise>../</xsl:otherwise> | |
1049 | </xsl:choose></xsl:variable> | |
1050 | <img alt="{@texte}" src="{$prefixe}pages_{$label-ensemble}/equations_{$label-ensemble}/equation{$numero}.png" class="maths"/> | |
1763 | <img alt="{@texte}" src="{$prefixe}pages_{$label-fichiers}/equations_{$label-ensemble}/equation{$numero}.png" class="maths"/> | |
1051 | 1764 | </xsl:template> |
1052 | 1765 | |
1053 | 1766 | |
1062 | 1775 | </xsl:choose></xsl:variable> |
1063 | 1776 | <xsl:variable name="definition"><xsl:choose> |
1064 | 1777 | <xsl:when test="normalize-space(.)!=''"><xsl:value-of select="."/></xsl:when> |
1065 | <xsl:otherwise><xsl:value-of select="//GLOSSAIRE[@ref=$motref]"/></xsl:otherwise> | |
1778 | <xsl:otherwise><xsl:value-of select="//GLOSSAIRE[@ref=$motref and normalize-space(.)!='']"/></xsl:otherwise> | |
1066 | 1779 | </xsl:choose></xsl:variable> |
1067 | 1780 | <xsl:variable name="motreftrans" select="translate($motref,' אגיטךמןפצש�','_aaeeeiioouu')"/> |
1068 | <a href="{$prefixe}pages_{ancestor::XPAGES[last()]/INFORMATIONS/LABEL}/glossaire.html#{$motreftrans}" title="{$definition}" class="glossaire" target="blank"><xsl:value-of select="@mot"/></a> | |
1781 | <a href="{$prefixe}pages_{ancestor::XPAGES[last()]/INFORMATIONS/LABEL}/glossaire.html#{$motreftrans}" title="{$definition}" class="glossaire" target="_blank"><xsl:value-of select="@mot"/></a> | |
1069 | 1782 | </xsl:template> |
1070 | 1783 | |
1071 | 1784 | |
1085 | 1798 | |
1086 | 1799 | |
1087 | 1800 | <xsl:template match="CODE"> |
1088 | <tt><xsl:apply-templates/></tt> | |
1801 | <xsl:choose> | |
1802 | <xsl:when test="parent::PAGE or parent::SECTION"> | |
1803 | <pre> | |
1804 | <xsl:apply-templates/> | |
1805 | </pre> | |
1806 | </xsl:when> | |
1807 | <xsl:otherwise><tt><xsl:apply-templates/></tt></xsl:otherwise> | |
1808 | </xsl:choose> | |
1089 | 1809 | </xsl:template> |
1090 | 1810 | |
1091 | 1811 | |
1095 | 1815 | |
1096 | 1816 | <!-- Page d'entrée du site --> |
1097 | 1817 | |
1098 | <xsl:template name="page-entree"> | |
1818 | <xsl:template name="page-entree"> | |
1099 | 1819 | <xsl:variable name="interface">interface/<xsl:choose> |
1100 | 1820 | <xsl:when test="count(ancestor-or-self::XPAGES[INFORMATIONS/INTERFACE!='']) > 0"><xsl:value-of select="ancestor-or-self::XPAGES[INFORMATIONS/INTERFACE!=''][1]/INFORMATIONS/INTERFACE"/></xsl:when> |
1101 | 1821 | <xsl:otherwise><xsl:value-of select="$interface_par_defaut"/></xsl:otherwise> |
1104 | 1824 | <head> |
1105 | 1825 | <title><xsl:value-of select="ancestor-or-self::XPAGES[last()]/INFORMATIONS/TITRE"/></title> |
1106 | 1826 | <link type="text/css" rel="stylesheet" href="{$interface}/style.css"/> |
1827 | <xsl:if test=".//ENVIMAGE[@localisation='page']"> | |
1828 | <xsl:call-template name="script-imagettes"> | |
1829 | <xsl:with-param name="interface" select="$interface"/> | |
1830 | <xsl:with-param name="prefixe"></xsl:with-param> | |
1831 | </xsl:call-template> | |
1832 | </xsl:if> | |
1107 | 1833 | </head> |
1108 | 1834 | |
1109 | 1835 | <body class="page"> |
1113 | 1839 | |
1114 | 1840 | <xsl:call-template name="zone_bandeau"/> |
1115 | 1841 | |
1116 | <xsl:if test="count(ancestor-or-self::XPAGES[last()]/XPAGES) > 1"> | |
1842 | <xsl:if test="count(ancestor-or-self::XPAGES[last()]/XPAGES) > 1 and $rubriques='oui'"> | |
1117 | 1843 | <xsl:call-template name="zone_rubriques"> |
1118 | 1844 | <xsl:with-param name="prefixe"></xsl:with-param> |
1119 | 1845 | </xsl:call-template> |
1137 | 1863 | </div> |
1138 | 1864 | |
1139 | 1865 | <div class="zone_contenu_entree"> |
1140 | <!-- pb de chemin vers html_images | |
1141 | 1866 | <xsl:if test=".//ENVIMAGE[@localisation='page']"> |
1142 | 1867 | <xsl:call-template name="figures-page"> |
1143 | 1868 | <xsl:with-param name="prefixe"></xsl:with-param> |
1144 | 1869 | </xsl:call-template> |
1145 | 1870 | </xsl:if> |
1146 | --> | |
1147 | 1871 | <div class="zone_texte"> |
1148 | 1872 | <xsl:call-template name="infos-erreurs"/> |
1149 | 1873 | <xsl:choose> |
1163 | 1887 | |
1164 | 1888 | <!-- Sommaire et Glossaire du site --> |
1165 | 1889 | |
1166 | <xsl:template name="page-sommaire"> | |
1890 | <xsl:template name="page-sommaire"> | |
1891 | <xsl:param name="interface">interface/<xsl:value-of select="$interface_par_defaut"/></xsl:param> | |
1167 | 1892 | <xsl:variable name="prefixe">../</xsl:variable> |
1168 | <xsl:variable name="interface"><xsl:value-of select="$prefixe"/>interface/<xsl:choose> | |
1169 | <xsl:when test="count(ancestor-or-self::XPAGES[INFORMATIONS/INTERFACE!='']) > 0"><xsl:value-of select="ancestor-or-self::XPAGES[INFORMATIONS/INTERFACE!=''][1]/INFORMATIONS/INTERFACE"/></xsl:when> | |
1170 | <xsl:otherwise><xsl:value-of select="$interface_par_defaut"/></xsl:otherwise> | |
1171 | </xsl:choose></xsl:variable> | |
1172 | 1893 | <html> |
1173 | 1894 | <head> |
1174 | 1895 | <title><xsl:value-of select="$messages/message[@label='Sommaire']"/></title> |
1175 | <link type="text/css" rel="stylesheet" href="{$interface}/style.css"/> | |
1896 | <link type="text/css" rel="stylesheet" href="{$prefixe}{$interface}/style.css"/> | |
1176 | 1897 | </head> |
1177 | 1898 | |
1178 | 1899 | <body class="page"> |
1180 | 1901 | |
1181 | 1902 | <xsl:call-template name="zone_bandeau"/> |
1182 | 1903 | |
1183 | <xsl:if test="count(XPAGES) > 1"> | |
1904 | <xsl:if test="count(XPAGES) > 1 and $rubriques='oui'"> | |
1184 | 1905 | <xsl:call-template name="zone_rubriques"/> |
1185 | 1906 | </xsl:if> |
1186 | 1907 | |
1187 | 1908 | <div class="zone_sommaire"> |
1188 | 1909 | <div class="zone_outils"> |
1189 | <a href="{$prefixe}index.html" title="{$messages/message[@label='entrée du site']}"><img src="{$interface}/home.gif" width="25" height="25" alt="home" border="0"/></a> | |
1910 | <a href="{$prefixe}index.html" title="{$messages/message[@label='Entrée du site']}"><img src="{$prefixe}{$interface}/home.gif" width="25" height="25" alt="home" border="0"/></a> | |
1190 | 1911 | <xsl:if test="//GLOSSAIRE"> |
1191 | 1912 |    |
1192 | <a href="glossaire.html" title="{$messages/message[@label='Glossaire']}"><img src="{$interface}/glossaire_petit.gif" width="25" height="25" border="0" alt="{$messages/message[@label='Glossaire']}"/></a> | |
1913 | <a href="glossaire.html" title="{$messages/message[@label='Glossaire']}"><img src="{$prefixe}{$interface}/glossaire_petit.gif" width="25" height="25" border="0" alt="{$messages/message[@label='Glossaire']}"/></a> | |
1193 | 1914 | </xsl:if> |
1194 | 1915 | </div> |
1195 | 1916 | |
1213 | 1934 | </xsl:template> |
1214 | 1935 | |
1215 | 1936 | <xsl:template match="XPAGES" mode="sommaire-site"> |
1937 | <xsl:param name="prefixe">../</xsl:param> | |
1938 | <li> | |
1939 | <xsl:variable name="nom-fichier-index"><xsl:choose> | |
1940 | <xsl:when test="@contribution='oui'">index.html</xsl:when> | |
1941 | <xsl:otherwise><xsl:value-of select="INFORMATIONS/LABEL"/>_index.html</xsl:otherwise> | |
1942 | </xsl:choose></xsl:variable> | |
1943 | <a href="{$prefixe}pages_{@labelfichiers}/{$nom-fichier-index}" class="sommaire2"><xsl:value-of select="INFORMATIONS/TITRE"/></a> | |
1944 | <xsl:if test="count(ancestor::XPAGES) < 3"> | |
1945 | <ul> | |
1946 | <xsl:apply-templates select="PAGE[@label!='index']|XPAGES" mode="sommaire-site"> | |
1947 | <xsl:with-param name="prefixe" select="$prefixe"/> | |
1948 | </xsl:apply-templates> | |
1949 | </ul> | |
1950 | </xsl:if> | |
1951 | </li> | |
1952 | </xsl:template> | |
1953 | ||
1954 | <xsl:template match="PAGE" mode="sommaire-site"> | |
1955 | <xsl:param name="prefixe">../</xsl:param> | |
1956 | <li> | |
1957 | <a href="{$prefixe}pages_{ancestor::XPAGES[1]/@labelfichiers}/{@label}.html" class="sommairepage"><xsl:value-of select="@titre"/></a> | |
1958 | </li> | |
1959 | </xsl:template> | |
1960 | ||
1961 | ||
1962 | <xsl:template name="page-glossaire"> | |
1963 | <xsl:param name="interface">interface/<xsl:value-of select="$interface_par_defaut"/></xsl:param> | |
1216 | 1964 | <xsl:variable name="prefixe">../</xsl:variable> |
1217 | <li> | |
1218 | <a href="{$prefixe}pages_{INFORMATIONS/LABEL}/index.html" class="sommaire2"><xsl:value-of select="INFORMATIONS/TITRE"/></a> | |
1219 | <ul> | |
1220 | <xsl:apply-templates select="PAGE|XPAGES" mode="sommaire-site"/> | |
1221 | </ul> | |
1222 | </li> | |
1223 | </xsl:template> | |
1224 | ||
1225 | <xsl:template match="PAGE" mode="sommaire-site"> | |
1226 | <xsl:variable name="prefixe">../</xsl:variable> | |
1227 | <li> | |
1228 | <a href="{$prefixe}pages_{ancestor::XPAGES[1]/INFORMATIONS/LABEL}/{@label}.html" class="sommairepage"><xsl:value-of select="@titre"/></a> | |
1229 | </li> | |
1230 | </xsl:template> | |
1231 | ||
1232 | ||
1233 | <xsl:template name="page-glossaire"> | |
1234 | <xsl:variable name="prefixe">../</xsl:variable> | |
1235 | <xsl:variable name="interface"><xsl:value-of select="$prefixe"/>interface/<xsl:choose> | |
1236 | <xsl:when test="count(ancestor-or-self::XPAGES[INFORMATIONS/INTERFACE!='']) > 0"><xsl:value-of select="ancestor-or-self::XPAGES[INFORMATIONS/INTERFACE!=''][1]/INFORMATIONS/INTERFACE"/></xsl:when> | |
1237 | <xsl:otherwise><xsl:value-of select="$interface_par_defaut"/></xsl:otherwise> | |
1238 | </xsl:choose></xsl:variable> | |
1239 | 1965 | <html> |
1240 | 1966 | <head> |
1241 | 1967 | <title><xsl:value-of select="$messages/message[@label='Glossaire']"/></title> |
1242 | <link type="text/css" rel="stylesheet" href="{$interface}/style.css"/> | |
1968 | <link type="text/css" rel="stylesheet" href="{$prefixe}{$interface}/style.css"/> | |
1243 | 1969 | </head> |
1244 | 1970 | <body class="page"> |
1245 | 1971 | <xsl:call-template name="zone_logo"/> |
1246 | 1972 | |
1247 | 1973 | <xsl:call-template name="zone_bandeau"/> |
1248 | 1974 | |
1249 | <xsl:if test="count(XPAGES) > 1"> | |
1975 | <xsl:if test="count(XPAGES) > 1 and $rubriques='oui'"> | |
1250 | 1976 | <xsl:call-template name="zone_rubriques"/> |
1251 | 1977 | </xsl:if> |
1252 | 1978 | |
1253 | 1979 | <div class="zone_sommaire"> |
1254 | 1980 | <div class="zone_outils"> |
1255 | <a href="{$prefixe}index.html" title="{$messages/message[@label='entrée du site']}"><img src="{$interface}/home.gif" width="25" height="25" alt="{$messages/message[@label='entrée du site']}" border="0"/></a> | |
1981 | <a href="{$prefixe}index.html" title="{$messages/message[@label='Entrée du site']}"><img src="{$prefixe}{$interface}/home.gif" width="25" height="25" alt="{$messages/message[@label='Entrée du site']}" border="0"/></a> | |
1256 | 1982 |    |
1257 | <a href="sommaire.html" title="{$messages/message[@label='Sommaire']}"><img src="{$interface}/sommaire_petit.gif" width="25" height="25" border="0" alt="{$messages/message[@label='Sommaire']}"/></a> | |
1983 | <a href="sommaire.html" title="{$messages/message[@label='Sommaire']}"><img src="{$prefixe}{$interface}/sommaire_petit.gif" width="25" height="25" border="0" alt="{$messages/message[@label='Sommaire']}"/></a> | |
1258 | 1984 |    |
1259 | <img src="{$interface}/glossaire_petit.gif" width="25" height="25" border="0" alt="{$messages/message[@label='Glossaire']}"/> | |
1985 | <img src="{$prefixe}{$interface}/glossaire_petit.gif" width="25" height="25" border="0" alt="{$messages/message[@label='Glossaire']}"/> | |
1260 | 1986 | </div> |
1261 | 1987 | |
1262 | 1988 | </div> |
1281 | 2007 | |
1282 | 2008 | |
1283 | 2009 | <xsl:template name="lettres-glossaire"> |
1284 | <xsl:param name="lettres"/> | |
2010 | <xsl:param name="lettres"/> | |
1285 | 2011 | |
1286 | 2012 | <xsl:variable name="lettre" select="substring($lettres,1,1)"/> |
1287 | 2013 | |
1288 | <h2>- <xsl:value-of select="$lettre"/> -</h2> | |
1289 | <dl> | |
1290 | <xsl:apply-templates select="//GLOSSAIRE[translate(substring(@ref,1,1),'aàbcçdeéèêfghiïîjklmnoôpqrstuùvwxyz','AABCCDEEEEFGHIIIJKLMNOOPQRSTUUVWXYZ')=$lettre or (not(@ref) and translate(substring(@mot,1,1),'aàbcçdeéèêfghiïîjklmnoôpqrstuùvwxyz','AABCCDEEEEFGHIIIJKLMNOOPQRSTUUVWXYZ')=$lettre)]" mode="glossaire-site"> | |
1291 | <xsl:sort select="concat(@ref,@mot)"/> | |
1292 | </xsl:apply-templates> | |
2014 | <h2>- <xsl:value-of select="$lettre"/> -</h2> | |
2015 | <dl> | |
2016 | <xsl:apply-templates select="//GLOSSAIRE[translate(substring(@ref,1,1),'aàbcçdeéèêfghiïîjklmnoôpqrstuùvwxyz','AABCCDEEEEFGHIIIJKLMNOOPQRSTUUVWXYZ')=$lettre or (not(@ref) and translate(substring(@mot,1,1),'aàbcçdeéèêfghiïîjklmnoôpqrstuùvwxyz','AABCCDEEEEFGHIIIJKLMNOOPQRSTUUVWXYZ')=$lettre)]" mode="glossaire-site"> | |
2017 | <xsl:sort select="concat(@ref,@mot)"/> | |
2018 | </xsl:apply-templates> | |
1293 | 2019 | </dl> |
1294 | 2020 | <xsl:if test="string-length($lettres)>1"> |
1295 | 2021 | <xsl:call-template name="lettres-glossaire"> |
1318 | 2044 | |
1319 | 2045 | <xsl:template name="format-fichier"> |
1320 | 2046 | <!-- renvoit le format supposé d'un fichier d'image/animation à partir de son nom, en utilisant l'extension --> |
1321 | <!-- formats reconnus: PNG, JPEG, GIF, MPEG, MNG --> | |
2047 | <!-- formats reconnus: PNG, JPEG, GIF, MPEG, OGG --> | |
1322 | 2048 | <!-- renvoit '?' si le format n'est pas reconnu --> |
1323 | 2049 | <xsl:param name="nom"/> |
1324 | 2050 | <xsl:variable name="ext"><xsl:call-template name="extension-fichier"><xsl:with-param name="nom" select="$nom"/></xsl:call-template></xsl:variable> |
1328 | 2054 | <xsl:when test="$extmin='jpg' or $extmin='jpeg'">JPEG</xsl:when> |
1329 | 2055 | <xsl:when test="$extmin='gif'">GIF</xsl:when> |
1330 | 2056 | <xsl:when test="$extmin='mpg' or $extmin='mpeg'">MPEG</xsl:when> |
1331 | <xsl:when test="$extmin='mng'">MNG</xsl:when> | |
2057 | <xsl:when test="$extmin='ogg' or $extmin='ogv'">OGG</xsl:when> | |
1332 | 2058 | <xsl:otherwise>?</xsl:otherwise> |
1333 | 2059 | </xsl:choose> |
1334 | 2060 | </xsl:template> |
1423 | 2149 | </xsl:choose> |
1424 | 2150 | </xsl:template> |
1425 | 2151 | |
2152 | <xsl:template name="mauvais-liens"> | |
2153 | <xsl:call-template name="ecrire-fichier"> | |
2154 | <xsl:with-param name="fichier" select="concat($chemin-site, $sep, 'mauvais_liens.html')"/> | |
2155 | <xsl:with-param name="contenu"> | |
2156 | <html> | |
2157 | <head> | |
2158 | <title><xsl:value-of select="$messages/message[@label='Liste des liens non résolus']"/></title> | |
2159 | </head> | |
2160 | <body> | |
2161 | <div align="center"><h1><xsl:value-of select="$messages/message[@label='Liste des liens non résolus']"/></h1></div> | |
2162 | <ul> | |
2163 | <xsl:apply-templates select=".//LIENPAGE" mode="mauvais-liens"/> | |
2164 | <xsl:apply-templates select=".//LIENIMAGE" mode="mauvais-liens"/> | |
2165 | </ul> | |
2166 | <p></p> | |
2167 | <div align="center"><h1><xsl:value-of select="$messages/message[@label='Mots du glossaire non définis']"/></h1></div> | |
2168 | <ul> | |
2169 | <xsl:apply-templates select=".//GLOSSAIRE" mode="mauvais-liens"> | |
2170 | <xsl:sort select="@ref|@mot"/> | |
2171 | </xsl:apply-templates> | |
2172 | </ul> | |
2173 | <p></p> | |
2174 | <div align="center"><h1><xsl:value-of select="$messages/message[@label='Mots du glossaire définis plus d_une fois']"/></h1></div> | |
2175 | <ul> | |
2176 | <xsl:apply-templates select=".//GLOSSAIRE" mode="doublons"> | |
2177 | <xsl:sort select="@ref|@mot"/> | |
2178 | </xsl:apply-templates> | |
2179 | </ul> | |
2180 | </body> | |
2181 | </html> | |
2182 | </xsl:with-param> | |
2183 | </xsl:call-template> | |
2184 | </xsl:template> | |
2185 | ||
2186 | <xsl:template match="LIENPAGE" mode="mauvais-liens"> | |
2187 | <xsl:variable name="page" select="@page"/> | |
2188 | <xsl:variable name="contribution" select="@contribution"/> | |
2189 | <xsl:choose> | |
2190 | <xsl:when test="@contribution='' or not(@contribution)"> | |
2191 | <xsl:if test="count(ancestor::XPAGES[1]//PAGE[@label=$page]) != 1"> | |
2192 | <li> | |
2193 | <a href="{concat('pages_',ancestor::XPAGES[1]/@labelfichiers)}/{ancestor::PAGE/@label}.html" class="lien"><xsl:value-of select="$messages/message[@label='page']"/> | |
2194 | <xsl:value-of select="@page"/><xsl:text> </xsl:text><xsl:value-of select="$messages/message[@label='de la même contribution']"/></a> | |
2195 | <br/> | |
2196 | </li> | |
2197 | </xsl:if> | |
2198 | </xsl:when> | |
2199 | <xsl:when test="@page='' or not(@page)"> | |
2200 | <xsl:if test="count(//XPAGES[INFORMATIONS/LABEL=$contribution]) != 1"> | |
2201 | <li> | |
2202 | <a href="{concat('pages_',ancestor::XPAGES[1]/@labelfichiers)}/{ancestor::PAGE/@label}.html" class="lien"><xsl:value-of select="$messages/message[@label='contribution']"/> | |
2203 | <xsl:text> </xsl:text> | |
2204 | <xsl:value-of select="@contribution"/></a> | |
2205 | <xsl:if test="count(//XPAGES[INFORMATIONS/LABEL=$contribution]) > 1"> | |
2206 | <xsl:text> </xsl:text> | |
2207 | <xsl:value-of select="$messages/message[@label='(il y a plus d_une contribution avec ce label)']"/> | |
2208 | </xsl:if> | |
2209 | <br/> | |
2210 | </li> | |
2211 | </xsl:if> | |
2212 | </xsl:when> | |
2213 | <xsl:otherwise> | |
2214 | <xsl:if test="count(//XPAGES[INFORMATIONS/LABEL=$contribution]/PAGE[@label=$page]) != 1"> | |
2215 | <li> | |
2216 | <xsl:value-of select="$messages/message[@label='page']"/><xsl:text> </xsl:text> | |
2217 | <a href="{concat('pages_',ancestor::XPAGES[1]/@labelfichiers)}/{ancestor::PAGE/@label}.html" class="lien"><xsl:value-of select="concat($contribution, '/', $page)"/></a> | |
2218 | <br/> | |
2219 | </li> | |
2220 | </xsl:if> | |
2221 | </xsl:otherwise> | |
2222 | </xsl:choose> | |
2223 | </xsl:template> | |
2224 | ||
2225 | <xsl:template match="LIENIMAGE" mode="mauvais-liens"> | |
2226 | <xsl:variable name="label" select="@label"/> | |
2227 | <xsl:variable name="contribution" select="ancestor::XPAGES[1]/INFORMATIONS/LABEL"/> | |
2228 | <xsl:variable name="page" select="ancestor::PAGE[1]/@label"/> | |
2229 | <xsl:if test="count(//XPAGES[INFORMATIONS/LABEL=$contribution]/PAGE[@label=$page]//ENVIMAGE[@label=$label]) != 1"> | |
2230 | <li> | |
2231 | <xsl:value-of select="$messages/message[@label='Lien vers l_image']"/><xsl:text> </xsl:text> | |
2232 | <xsl:value-of select="$label"/><xsl:text> </xsl:text> | |
2233 | <xsl:value-of select="$messages/message[@label='à la page']"/><xsl:text> </xsl:text> | |
2234 | <a href="{concat('pages_',$contribution,'/',$page,'.html')}" class="lien"><xsl:value-of select="concat($contribution, '/', $page)"/></a> | |
2235 | <br/> | |
2236 | </li> | |
2237 | </xsl:if> | |
2238 | </xsl:template> | |
2239 | ||
2240 | <xsl:template match="GLOSSAIRE" mode="mauvais-liens"> | |
2241 | <xsl:variable name="motref"><xsl:choose> | |
2242 | <xsl:when test="@ref!=''"><xsl:value-of select="@ref"/></xsl:when> | |
2243 | <xsl:otherwise><xsl:value-of select="@mot"/></xsl:otherwise> | |
2244 | </xsl:choose></xsl:variable> | |
2245 | <xsl:if test="$motref != ''"> | |
2246 | <xsl:if test="normalize-space(.)=''"> | |
2247 | <xsl:if test="count(//GLOSSAIRE[(@ref=$motref or @mot=$motref) and normalize-space(.)!=''])=0"> | |
2248 | <li><xsl:value-of select="$motref"/> (<xsl:value-of select="$messages/message[@label='utilisé page']"/><xsl:text> </xsl:text><xsl:value-of select="concat(ancestor::XPAGES[1]/INFORMATIONS/LABEL, '_', ancestor::PAGE[1]/@label)"/>)</li> | |
2249 | </xsl:if> | |
2250 | </xsl:if> | |
2251 | </xsl:if> | |
2252 | </xsl:template> | |
2253 | ||
2254 | <xsl:template match="GLOSSAIRE" mode="doublons"> | |
2255 | <xsl:variable name="motref"><xsl:choose> | |
2256 | <xsl:when test="@ref!=''"><xsl:value-of select="@ref"/></xsl:when> | |
2257 | <xsl:otherwise><xsl:value-of select="@mot"/></xsl:otherwise> | |
2258 | </xsl:choose></xsl:variable> | |
2259 | <xsl:if test="$motref != ''"> | |
2260 | <xsl:if test="normalize-space(.)!=''"> | |
2261 | <xsl:if test="count(//GLOSSAIRE[(@ref=$motref or (not(@ref) and @mot=$motref)) and normalize-space(.)!=''])>1"> | |
2262 | <li><xsl:value-of select="$motref"/> (<xsl:value-of select="$messages/message[@label='utilisé page']"/><xsl:text> </xsl:text><xsl:value-of select="concat(ancestor::XPAGES[1]/INFORMATIONS/LABEL, '_', ancestor::PAGE[1]/@label)"/>)</li> | |
2263 | </xsl:if> | |
2264 | </xsl:if> | |
2265 | </xsl:if> | |
2266 | </xsl:template> | |
2267 | ||
2268 | <xsl:template name="labels"> | |
2269 | <xsl:call-template name="ecrire-fichier"> | |
2270 | <xsl:with-param name="fichier" select="concat($chemin-site, $sep, 'labels.html')"/> | |
2271 | <xsl:with-param name="contenu"> | |
2272 | <html> | |
2273 | <head> | |
2274 | <title><xsl:value-of select="$messages/message[@label='Labels utilisés']"/></title> | |
2275 | </head> | |
2276 | <body> | |
2277 | <p> | |
2278 | <a href="#erreurs"><xsl:value-of select="$messages/message[@label='Erreurs']"/></a><xsl:text> - </xsl:text> | |
2279 | <a href="#contributions"><xsl:value-of select="$messages/message[@label='Contributions']"/></a><xsl:text> - </xsl:text> | |
2280 | <a href="#pages"><xsl:value-of select="$messages/message[@label='Pages']"/></a><xsl:text> - </xsl:text> | |
2281 | <a href="#index"><xsl:value-of select="$messages/message[@label='Index']"/></a> | |
2282 | </p> | |
2283 | ||
2284 | <hr/> | |
2285 | ||
2286 | <xsl:call-template name="labels-erreurs"/> | |
2287 | ||
2288 | <hr/> | |
2289 | ||
2290 | <a name="contributions"/> | |
2291 | <h2><xsl:value-of select="$messages/message[@label='Contributions']"/></h2> | |
2292 | <xsl:call-template name="labels-xpages"/> | |
2293 | ||
2294 | <hr/> | |
2295 | ||
2296 | <a name="pages"/> | |
2297 | <h2><xsl:value-of select="$messages/message[@label='Pages']"/></h2> | |
2298 | <xsl:call-template name="labels-pages"/> | |
2299 | ||
2300 | <hr/> | |
2301 | ||
2302 | <a name="index"/> | |
2303 | <h1><xsl:value-of select="$messages/message[@label='Index']"/></h1> | |
2304 | <xsl:for-each select="//XPAGES | //PAGE"> | |
2305 | <xsl:sort select="INFORMATIONS/LABEL|@label"/> | |
2306 | <xsl:variable name="label" select="INFORMATIONS/LABEL|@label"/> | |
2307 | <xsl:variable name="titre" select="INFORMATIONS/TITRE|@titre"/> | |
2308 | <xsl:variable name="type" select="translate(name(),'ABCDEFGHIJKLMNOPQRSTUVWXYZ','abcdefghijklmnopqrstuvwxyz')"/> | |
2309 |      | |
2310 | <xsl:choose> | |
2311 | <xsl:when test="$label!=''"><a href="#{$type}{$label}"><tt><xsl:value-of select="$label"/></tt></a></xsl:when> | |
2312 | <xsl:otherwise><em><xsl:value-of select="$messages/message[@label='sans label']"/></em></xsl:otherwise> | |
2313 | </xsl:choose> | |
2314 |      | |
2315 | <xsl:value-of select="$type"/> "<xsl:value-of select="$titre"/>"<br/> | |
2316 | </xsl:for-each> | |
2317 | </body> | |
2318 | </html> | |
2319 | </xsl:with-param> | |
2320 | </xsl:call-template> | |
2321 | </xsl:template> | |
2322 | ||
2323 | <xsl:template name="labels-xpages"> | |
2324 | <xsl:if test="XPAGES"> | |
2325 | <ul> | |
2326 | <xsl:for-each select="XPAGES"> | |
2327 | <li><a name="xpages{INFORMATIONS/LABEL}"/>XPAGES "<xsl:value-of select="INFORMATIONS/TITRE"/>": <tt><xsl:value-of select="INFORMATIONS/LABEL"/></tt></li> | |
2328 | <xsl:call-template name="labels-xpages"/> | |
2329 | </xsl:for-each> | |
2330 | </ul> | |
2331 | </xsl:if> | |
2332 | </xsl:template> | |
2333 | ||
2334 | <xsl:template name="labels-pages"> | |
2335 | <xsl:if test="XPAGES|PAGE"> | |
2336 | <ul> | |
2337 | <xsl:for-each select="*[self::XPAGES|self::PAGE]"> | |
2338 | <xsl:choose> | |
2339 | <xsl:when test="self::XPAGES"> | |
2340 | <li><a name="xpages{INFORMATIONS/LABEL}"/>XPAGES "<xsl:value-of select="INFORMATIONS/TITRE"/>": <tt><xsl:value-of select="INFORMATIONS/LABEL"/></tt></li> | |
2341 | </xsl:when> | |
2342 | <xsl:when test="self::PAGE"> | |
2343 | <li><a name="page{@label}"/>PAGE "<xsl:value-of select="@titre"/>": <tt><xsl:value-of select="@label"/></tt></li> | |
2344 | </xsl:when> | |
2345 | </xsl:choose> | |
2346 | <xsl:call-template name="labels-pages"/> | |
2347 | </xsl:for-each> | |
2348 | </ul> | |
2349 | </xsl:if> | |
2350 | </xsl:template> | |
2351 | ||
2352 | <xsl:template name="labels-erreurs"> | |
2353 | <a name="erreurs"/> | |
2354 | <h1><xsl:value-of select="$messages/message[@label='Erreurs']"/></h1> | |
2355 | <p><xsl:value-of select="$messages/message[@label='Un lien utilisant un label avec un doublon ne fonctionnera pas, et apparaîtra sur la page des']"/> | |
2356 | <xsl:text> </xsl:text><a href="mauvais_liens.html"><xsl:value-of select="$messages/message[@label='mauvais liens']"/></a>.</p> | |
2357 | <xsl:if test="//XPAGES[@label=following::XPAGES/@label]"> | |
2358 | <h2><xsl:value-of select="$messages/message[@label='Doublons d_ensembles XPAGES']"/></h2> | |
2359 | <ul> | |
2360 | <xsl:for-each select="//XPAGES"> | |
2361 | <xsl:if test="count(//XPAGES[@label=current()/@label])>1"> | |
2362 | <li>XPAGES "<xsl:value-of select="INFORMATIONS/TITRE"/>": <tt><xsl:value-of select="INFORMATIONS/LABEL"/></tt> | |
2363 | <xsl:text> - </xsl:text> | |
2364 | <a href="#xpages{@label}"><xsl:value-of select="$messages/message[@label='lien vers le premier avec ce label']"/></a></li> | |
2365 | </xsl:if> | |
2366 | </xsl:for-each> | |
2367 | </ul> | |
2368 | </xsl:if> | |
2369 | <xsl:if test="//PAGE[@label=following::PAGE/@label]"> | |
2370 | <h2><xsl:value-of select="$messages/message[@label='Doublons de pages']"/></h2> | |
2371 | <ul> | |
2372 | <xsl:for-each select="//PAGE"> | |
2373 | <xsl:if test="count(//PAGE[@label=current()/@label])>1"> | |
2374 | <li><xsl:value-of select="$messages/message[@label='page']"/> "<xsl:value-of select="@titre"/>": <tt><xsl:value-of select="@label"/></tt> - <a href="#page{@label}"><xsl:value-of select="$messages/message[@label='lien vers la première avec ce label']"/></a></li> | |
2375 | </xsl:if> | |
2376 | </xsl:for-each> | |
2377 | </ul> | |
2378 | </xsl:if> | |
2379 | <xsl:if test="//XPAGES[normalize-space(translate(INFORMATIONS/LABEL,'abcdefghijklmnopqrstuvwxyz0123456789-',' '))!=''] or //PAGE[normalize-space(translate(@label,'abcdefghijklmnopqrstuvwxyz0123456789-',' '))!=''] or //ENVIMAGE[@label!='' and normalize-space(translate(@label,'abcdefghijklmnopqrstuvwxyz0123456789-',' '))!='']"> | |
2380 | <h2><xsl:value-of select="$messages/message[@label='Labels invalides']"/></h2> | |
2381 | <ul> | |
2382 | <xsl:for-each select="//XPAGES"> | |
2383 | <xsl:if test="normalize-space(translate(INFORMATIONS/LABEL,'abcdefghijklmnopqrstuvwxyz0123456789-',' '))!=''"> | |
2384 | <li><xsl:value-of select="name()"/> "<xsl:value-of select="INFORMATIONS/TITRE"/>": | |
2385 | <tt><xsl:value-of select="INFORMATIONS/LABEL"/></tt></li> | |
2386 | </xsl:if> | |
2387 | </xsl:for-each> | |
2388 | <xsl:for-each select="//PAGE|//ENVIMAGE[@label!='']"> | |
2389 | <xsl:if test="normalize-space(translate(@label,'abcdefghijklmnopqrstuvwxyz0123456789-',' '))!=''"> | |
2390 | <li><xsl:value-of select="name()"/> "<xsl:value-of select="@titre"/>": | |
2391 | <tt><xsl:value-of select="@label"/></tt></li> | |
2392 | </xsl:if> | |
2393 | </xsl:for-each> | |
2394 | </ul> | |
2395 | </xsl:if> | |
2396 | </xsl:template> | |
2397 | ||
2398 | <xsl:template name="commentaires"> | |
2399 | <xsl:call-template name="ecrire-fichier"> | |
2400 | <xsl:with-param name="fichier" select="concat($chemin-site, $sep, 'commentaires.html')"/> | |
2401 | <xsl:with-param name="contenu"> | |
2402 | <html> | |
2403 | <head> | |
2404 | <title><xsl:value-of select="$messages/message[@label='Commentaires des auteurs']"/></title> | |
2405 | </head> | |
2406 | <body> | |
2407 | <h1><xsl:value-of select="$messages/message[@label='Commentaires des auteurs']"/></h1> | |
2408 | <ul> | |
2409 | <xsl:for-each select="//COMMENTAIRE"> | |
2410 | <li><xsl:apply-templates/> - <xsl:value-of select="$messages/message[@label='page']"/><xsl:text> </xsl:text><a href="pages_{concat(ancestor::XPAGES[1]/@labelfichiers, '/', ancestor::PAGE[1]/@label, '.html')}"><xsl:value-of select="ancestor::PAGE/@titre"/></a></li> | |
2411 | </xsl:for-each> | |
2412 | </ul> | |
2413 | </body> | |
2414 | </html> | |
2415 | </xsl:with-param> | |
2416 | </xsl:call-template> | |
2417 | </xsl:template> | |
2418 | ||
2419 | <xsl:template name="credits"> | |
2420 | <xsl:call-template name="ecrire-fichier"> | |
2421 | <xsl:with-param name="fichier" select="concat($chemin-site, $sep, 'credits.html')"/> | |
2422 | <xsl:with-param name="contenu"> | |
2423 | <html> | |
2424 | <head> | |
2425 | <title><xsl:value-of select="$messages/message[@label='Liste des images et des crédits, triée par crédit']"/></title> | |
2426 | </head> | |
2427 | <body> | |
2428 | <h1><xsl:value-of select="$messages/message[@label='Liste des images et des crédits, triée par crédit']"/></h1> | |
2429 | <table border="1"> | |
2430 | <tr> | |
2431 | <th><xsl:value-of select="$messages/message[@label='Crédit']"/></th> | |
2432 | <th><xsl:value-of select="$messages/message[@label='Image']"/></th> | |
2433 | <th><xsl:value-of select="$messages/message[@label='Titre']"/></th> | |
2434 | <th><xsl:value-of select="$messages/message[@label='Nom fichier']"/></th> | |
2435 | <th><xsl:value-of select="$messages/message[@label='Légende']"/></th> | |
2436 | <th><xsl:value-of select="$messages/message[@label='page']"/></th> | |
2437 | </tr> | |
2438 | <xsl:apply-templates select=".//ENVIMAGE" mode="credits"> | |
2439 | <xsl:sort select="CREDIT"/> | |
2440 | </xsl:apply-templates> | |
2441 | </table> | |
2442 | </body> | |
2443 | </html> | |
2444 | </xsl:with-param> | |
2445 | </xsl:call-template> | |
2446 | </xsl:template> | |
2447 | ||
2448 | <xsl:template match="ENVIMAGE" mode="credits"> | |
2449 | <tr> | |
2450 | <xsl:variable name="nomf"><xsl:choose> | |
2451 | <xsl:when test="contains(FICHIER[1]/@nom, '.mpg') or contains(FICHIER[1]/@nom, '.mpeg') or contains(FICHIER[1]/@nom, '.mng')"><xsl:value-of select="$messages/message[@label='animation']"/>animation</xsl:when> | |
2452 | <xsl:otherwise><xsl:value-of select="FICHIER[1]/@nom"/></xsl:otherwise> | |
2453 | </xsl:choose></xsl:variable> | |
2454 | <xsl:variable name="url" select="concat('pages_', ancestor::XPAGES[1]/@labelfichiers, '/', ancestor::PAGE[1]/@label, '.html')"/> | |
2455 | <td><xsl:value-of select="CREDIT"/></td> | |
2456 | <td><a href="{$url}"><xsl:choose> | |
2457 | <xsl:when test="$nomf='animation'"><xsl:value-of select="$messages/message[@label='animation']"/></xsl:when> | |
2458 | <xsl:otherwise><img src="{concat('pages_', ancestor::XPAGES[1]/@labelfichiers, '/', $nomf)}" width="200"/></xsl:otherwise> | |
2459 | </xsl:choose></a></td> | |
2460 | <td><xsl:value-of select="@titre"/></td> | |
2461 | <td><xsl:value-of select="FICHIER[1]/@nom"/></td> | |
2462 | <td><xsl:apply-templates select="LEGENDE"/></td> | |
2463 | <td><a href="{$url}"><xsl:value-of select="ancestor::PAGE[1]/@titre"/></a></td> | |
2464 | </tr> | |
2465 | </xsl:template> | |
2466 | ||
1426 | 2467 | </xsl:stylesheet> |
27 | 27 | <MENU_INSERTION nom="FLASH" type_noeud="element"/> |
28 | 28 | <MENU_INSERTION nom="PARAM" type_noeud="element"/> |
29 | 29 | </MENU> |
30 | <MENU nom="Exercices"> | |
31 | <MENU_INSERTION nom="EXERCICE"/> | |
32 | <MENU_INSERTION nom="ENONCE" type_noeud="element"/> | |
33 | <MENU_INSERTION nom="DIFFICULTE"/> | |
34 | <MENU_INSERTION nom="TEMPS"/> | |
35 | <MENU_INSERTION nom="QUESTION"/> | |
36 | <MENU_INSERTION nom="AIDE" type_noeud="element"/> | |
37 | <MENU_INSERTION nom="SOLUTION"/> | |
38 | <MENU_INSERTION nom="POINTS"/> | |
39 | <MENU_INSERTION nom="QCM" type_noeud="element"/> | |
40 | <MENU_INSERTION nom="ENONCEQCM"/> | |
41 | <MENU_INSERTION nom="QUESTIONQCM" type_noeud="element"/> | |
42 | <MENU_INSERTION nom="REPONSEQCM"/> | |
43 | <MENU_INSERTION nom="TEXTEREP" type_noeud="element"/> | |
44 | <MENU_INSERTION nom="COMMENTAIREREP" type_noeud="element"/> | |
45 | </MENU> | |
30 | 46 | <MENU nom="Autres"> |
31 | 47 | <MENU_INSERTION nom="LIENPAGE" type_noeud="element"/> |
32 | 48 | <MENU_INSERTION nom="LIENWEB" type_noeud="element"/> |
33 | 49 | <MENU_INSERTION nom="GLOSSAIRE" type_noeud="element"/> |
50 | <MENU_INSERTION nom="SYMBOLE"/> | |
34 | 51 | <MENU_INSERTION nom="EQUATION" raccourci="E" type_noeud="element"/> |
35 | 52 | <MENU_INSERTION nom="EQUATEX" raccourci="T" type_noeud="element"/> |
36 | 53 | <MENU_INSERTION nom="CODE" type_noeud="element"/> |
70 | 87 | <VALEUR_SUGGEREE>complement</VALEUR_SUGGEREE> |
71 | 88 | <VALEUR_SUGGEREE>methode</VALEUR_SUGGEREE> |
72 | 89 | <VALEUR_SUGGEREE>activite</VALEUR_SUGGEREE> |
73 | <VALEUR_SUGGEREE>exercice</VALEUR_SUGGEREE> | |
74 | 90 | <VALEUR_SUGGEREE>bibliographie</VALEUR_SUGGEREE> |
75 | 91 | <VALEUR_SUGGEREE>autre</VALEUR_SUGGEREE> |
76 | 92 | </AFFICHAGE_ATTRIBUT> |
85 | 101 | <AFFICHAGE_ELEMENT element="LOGO" type="vide"> |
86 | 102 | <PARAMETRE nom="srcAtt" valeur="fichier"/> |
87 | 103 | </AFFICHAGE_ELEMENT> |
88 | <AFFICHAGE_ELEMENT element="INTERFACE" type="typesimple"/> | |
104 | <AFFICHAGE_ELEMENT element="INTERFACE" type="typesimple"> | |
105 | <VALEUR_SUGGEREE>bois</VALEUR_SUGGEREE> | |
106 | <VALEUR_SUGGEREE>etoiles</VALEUR_SUGGEREE> | |
107 | <VALEUR_SUGGEREE>marbre</VALEUR_SUGGEREE> | |
108 | <VALEUR_SUGGEREE>parchemin</VALEUR_SUGGEREE> | |
109 | <VALEUR_SUGGEREE>peinture</VALEUR_SUGGEREE> | |
110 | </AFFICHAGE_ELEMENT> | |
89 | 111 | <AFFICHAGE_ELEMENT element="LANGUE" type="typesimple"/> |
90 | 112 | <AFFICHAGE_ELEMENT element="TABLEAU" type="tabletexte"> |
91 | 113 | <PARAMETRE nom="trTag" valeur="TR"/> |
121 | 143 | <AFFICHAGE_ELEMENT element="PARAM" type="vide"> |
122 | 144 | <PARAMETRE nom="titreAtt" valeur="nom"/> |
123 | 145 | </AFFICHAGE_ELEMENT> |
146 | ||
147 | <AFFICHAGE_ELEMENT element="EXERCICE" type="zone"> | |
148 | <PARAMETRE nom="titreAtt" valeur="titre"/> | |
149 | </AFFICHAGE_ELEMENT> | |
150 | <AFFICHAGE_ELEMENT element="ENONCE" type="zone"/> | |
151 | <AFFICHAGE_ELEMENT element="DIFFICULTE" type="typesimple"/> | |
152 | <AFFICHAGE_ELEMENT element="TEMPS" type="typesimple"/> | |
153 | <AFFICHAGE_ELEMENT element="QUESTION" type="zone"/> | |
154 | <AFFICHAGE_ELEMENT element="AIDE" type="zone"/> | |
155 | <AFFICHAGE_ELEMENT element="SOLUTION" type="zone"/> | |
156 | <AFFICHAGE_ELEMENT element="POINTS" type="typesimple"/> | |
157 | <AFFICHAGE_ELEMENT element="QCM" type="zone"> | |
158 | <PARAMETRE nom="titreAtt" valeur="titre"/> | |
159 | </AFFICHAGE_ELEMENT> | |
160 | <AFFICHAGE_ELEMENT element="QUESTIONQCM" type="zone"/><AFFICHAGE_ELEMENT element="ENONCEQCM" type="zone"/> | |
161 | <AFFICHAGE_ELEMENT element="REPONSEQCM" type="zone"/> | |
162 | <AFFICHAGE_ELEMENT element="TEXTEREP" type="zone"/> | |
163 | <AFFICHAGE_ELEMENT element="COMMENTAIREREP" type="zone"/> | |
164 | ||
124 | 165 | <AFFICHAGE_ELEMENT element="LIENPAGE" type="string"/> |
125 | 166 | <AFFICHAGE_ELEMENT element="LIENWEB" type="string"/> |
126 | 167 | <AFFICHAGE_ELEMENT element="GLOSSAIRE" type="string"> |
127 | 168 | <PARAMETRE nom="titreAtt" valeur="mot"/> |
169 | </AFFICHAGE_ELEMENT> | |
170 | <AFFICHAGE_ELEMENT element="SYMBOLE" type="symbole"> | |
171 | <PARAMETRE nom="srcAtt" valeur="nom"/> | |
128 | 172 | </AFFICHAGE_ELEMENT> |
129 | 173 | <AFFICHAGE_ELEMENT element="EQUATION" type="plugin"> |
130 | 174 | <PARAMETRE nom="classe" valeur="xpages.JEEquationMemoire"/> |
154 | 198 | </AFFICHAGE_NOEUDS> |
155 | 199 | |
156 | 200 | <EXPORTS> |
157 | <EXPORT nom="HTML" sortie="HTML"> | |
201 | <EXPORT nom="Site public..." sortie="HTML"> | |
158 | 202 | <FICHIER_XSL nom="XPAGES1.xsl"> |
159 | 203 | <PARAMETRE nom="jaxe-uri-xml" valeur="*"/> |
160 | 204 | </FICHIER_XSL> |
161 | 205 | <FICHIER_XSL nom="XPAGES2.xsl"> |
162 | 206 | <PARAMETRE nom="jaxe-fichier-xml" valeur="*"/> |
163 | 207 | <PARAMETRE nom="jaxe-fichier-xsl" valeur="*"/> |
208 | <PARAMETRE nom="jaxe-fichier-destination" valeur="*"/> | |
209 | <PARAMETRE nom="jaxe-uri-destination" valeur="*"/> | |
164 | 210 | </FICHIER_XSL> |
165 | 211 | <FICHIER_XSL nom="XPAGES3.xsl"> |
166 | 212 | <PARAMETRE nom="jaxe-fichier-xml" valeur="*"/> |
167 | 213 | <PARAMETRE nom="jaxe-fichier-xsl" valeur="*"/> |
168 | 214 | <PARAMETRE nom="jaxe-uri-xml" valeur="*"/> |
215 | <PARAMETRE nom="jaxe-fichier-destination" valeur="*"/> | |
216 | <PARAMETRE nom="jaxe-uri-destination" valeur="*"/> | |
169 | 217 | <PARAMETRE nom="affichage" valeur="web"/> |
218 | <PARAMETRE nom="sortie" valeur="public"/> | |
219 | </FICHIER_XSL> | |
220 | </EXPORT> | |
221 | <EXPORT nom="Site de production..." sortie="HTML"> | |
222 | <FICHIER_XSL nom="XPAGES1.xsl"> | |
223 | <PARAMETRE nom="jaxe-uri-xml" valeur="*"/> | |
224 | </FICHIER_XSL> | |
225 | <FICHIER_XSL nom="XPAGES2.xsl"> | |
226 | <PARAMETRE nom="jaxe-fichier-xml" valeur="*"/> | |
227 | <PARAMETRE nom="jaxe-fichier-xsl" valeur="*"/> | |
228 | <PARAMETRE nom="jaxe-fichier-destination" valeur="*"/> | |
229 | <PARAMETRE nom="jaxe-uri-destination" valeur="*"/> | |
230 | </FICHIER_XSL> | |
231 | <FICHIER_XSL nom="XPAGES3.xsl"> | |
232 | <PARAMETRE nom="jaxe-fichier-xml" valeur="*"/> | |
233 | <PARAMETRE nom="jaxe-fichier-xsl" valeur="*"/> | |
234 | <PARAMETRE nom="jaxe-uri-xml" valeur="*"/> | |
235 | <PARAMETRE nom="jaxe-fichier-destination" valeur="*"/> | |
236 | <PARAMETRE nom="jaxe-uri-destination" valeur="*"/> | |
237 | <PARAMETRE nom="affichage" valeur="web"/> | |
238 | <PARAMETRE nom="sortie" valeur="production"/> | |
170 | 239 | </FICHIER_XSL> |
171 | 240 | </EXPORT> |
172 | 241 | </EXPORTS> |
195 | 264 | <STRINGS_MENU menu="Normal"> |
196 | 265 | <TITRE>Sans style</TITRE> |
197 | 266 | </STRINGS_MENU> |
267 | <STRINGS_MENU menu="Plugins"> | |
268 | <TITRE>Plugins</TITRE> | |
269 | </STRINGS_MENU> | |
198 | 270 | |
199 | 271 | <STRINGS_ELEMENT element="XPAGES"> |
200 | <TITRE>Racine du document</TITRE> | |
272 | <TITRE>Ensemble XPAGES</TITRE> | |
201 | 273 | <DOCUMENTATION> |
202 | 274 | Un ensemble de pages qui se suivent, sur un sujet donné. |
203 | 275 | </DOCUMENTATION> |
344 | 416 | <TITRE_VALEUR valeur="complement">complément</TITRE_VALEUR> |
345 | 417 | <TITRE_VALEUR valeur="methode">méthode</TITRE_VALEUR> |
346 | 418 | <TITRE_VALEUR valeur="activite">activité</TITRE_VALEUR> |
347 | <TITRE_VALEUR valeur="exercice">exercice</TITRE_VALEUR> | |
348 | 419 | <TITRE_VALEUR valeur="bibliographie">bibliographie</TITRE_VALEUR> |
349 | 420 | <TITRE_VALEUR valeur="autre">autre</TITRE_VALEUR> |
350 | 421 | </STRINGS_ATTRIBUT> |
442 | 513 | </DOCUMENTATION> |
443 | 514 | </STRINGS_ELEMENT> |
444 | 515 | <STRINGS_ELEMENT element="ITEM"> |
445 | <TITRE>élément de liste</TITRE> | |
516 | <TITRE>Elément de liste</TITRE> | |
446 | 517 | <DOCUMENTATION> |
447 | 518 | Elément d'une liste |
448 | 519 | </DOCUMENTATION> |
606 | 677 | </STRINGS_ATTRIBUT> |
607 | 678 | </STRINGS_ELEMENT> |
608 | 679 | |
680 | <STRINGS_ELEMENT element="EXERCICE"> | |
681 | <TITRE>Exercice</TITRE> | |
682 | <DOCUMENTATION> | |
683 | Exercice de type questions-réponses | |
684 | </DOCUMENTATION> | |
685 | <STRINGS_ATTRIBUT attribut="titre"> | |
686 | <TITRE>titre</TITRE> | |
687 | </STRINGS_ATTRIBUT> | |
688 | </STRINGS_ELEMENT> | |
689 | <STRINGS_ELEMENT element="DIFFICULTE"> | |
690 | <TITRE>Difficulté</TITRE> | |
691 | <DOCUMENTATION> | |
692 | Indication du niveau de difficulté : | |
693 | * : facile, ou application directe du cours | |
694 | ** : moyen | |
695 | *** : difficile | |
696 | </DOCUMENTATION> | |
697 | </STRINGS_ELEMENT> | |
698 | <STRINGS_ELEMENT element="TEMPS"> | |
699 | <TITRE>Temps</TITRE> | |
700 | <DOCUMENTATION> | |
701 | Temps indicatif nécessaire pour résoudre l'exercice | |
702 | </DOCUMENTATION> | |
703 | </STRINGS_ELEMENT> | |
704 | <STRINGS_ELEMENT element="QUESTION"> | |
705 | <TITRE>Question</TITRE> | |
706 | <DOCUMENTATION> | |
707 | Question d'un exercice, avec un énoncé, éventuellement des aides, une solution, et éventuellement des points. | |
708 | </DOCUMENTATION> | |
709 | </STRINGS_ELEMENT> | |
710 | <STRINGS_ELEMENT element="ENONCE"> | |
711 | <TITRE>Enoncé</TITRE> | |
712 | <DOCUMENTATION> | |
713 | Enoncé d'un exercice ou d'une question | |
714 | </DOCUMENTATION> | |
715 | </STRINGS_ELEMENT> | |
716 | <STRINGS_ELEMENT element="AIDE"> | |
717 | <TITRE>Aide</TITRE> | |
718 | <DOCUMENTATION> | |
719 | Aide d'un exercice | |
720 | </DOCUMENTATION> | |
721 | </STRINGS_ELEMENT> | |
722 | <STRINGS_ELEMENT element="SOLUTION"> | |
723 | <TITRE>Solution</TITRE> | |
724 | </STRINGS_ELEMENT> | |
725 | <STRINGS_ELEMENT element="POINTS"> | |
726 | <TITRE>Points</TITRE> | |
727 | <DOCUMENTATION> | |
728 | Nombre de points gagnés si la réponse est correcte. | |
729 | </DOCUMENTATION> | |
730 | </STRINGS_ELEMENT> | |
731 | <STRINGS_ELEMENT element="QCM"> | |
732 | <TITRE>QCM</TITRE> | |
733 | <DOCUMENTATION> | |
734 | Questionnaire à choix multiples, avec des commentaires affichés après le choix de l'utilisateur. | |
735 | </DOCUMENTATION> | |
736 | <STRINGS_ATTRIBUT attribut="titre"> | |
737 | <TITRE>titre</TITRE> | |
738 | </STRINGS_ATTRIBUT> | |
739 | </STRINGS_ELEMENT> | |
740 | <STRINGS_ELEMENT element="QUESTIONQCM"> | |
741 | <TITRE>Question de QCM</TITRE> | |
742 | <DOCUMENTATION> | |
743 | Question d'un QCM, avec un énoncé, éventuellement des aides, et les réponses possibles. | |
744 | </DOCUMENTATION> | |
745 | </STRINGS_ELEMENT> | |
746 | <STRINGS_ELEMENT element="ENONCEQCM"> | |
747 | <TITRE>Enoncé de question</TITRE> | |
748 | <DOCUMENTATION> | |
749 | Enoncé d'une question de QCM (texte court) | |
750 | </DOCUMENTATION> | |
751 | </STRINGS_ELEMENT> | |
752 | <STRINGS_ELEMENT element="REPONSEQCM"> | |
753 | <TITRE>Réponse de QCM</TITRE> | |
754 | <DOCUMENTATION> | |
755 | Réponse possible à un QCM. | |
756 | Contient le texte de la réponse et un commentaire à afficher si la réponse donnée est incorrecte. | |
757 | L'attribut bonne indique si la réponse est bonne ou pas. | |
758 | </DOCUMENTATION> | |
759 | <STRINGS_ATTRIBUT attribut="bonne"> | |
760 | <TITRE>bonne</TITRE> | |
761 | <TITRE_VALEUR valeur="non">non</TITRE_VALEUR> | |
762 | <TITRE_VALEUR valeur="oui">oui</TITRE_VALEUR> | |
763 | </STRINGS_ATTRIBUT> | |
764 | </STRINGS_ELEMENT> | |
765 | <STRINGS_ELEMENT element="TEXTEREP"> | |
766 | <TITRE>Texte de réponse</TITRE> | |
767 | <DOCUMENTATION> | |
768 | Texte de la réponse | |
769 | </DOCUMENTATION> | |
770 | </STRINGS_ELEMENT> | |
771 | <STRINGS_ELEMENT element="COMMENTAIREREP"> | |
772 | <TITRE>Commentaire de réponse</TITRE> | |
773 | <DOCUMENTATION> | |
774 | Commentaire à afficher après le choix de l'utilisateur (en particulier si la réponse donnée est incorrecte). | |
775 | </DOCUMENTATION> | |
776 | </STRINGS_ELEMENT> | |
777 | ||
609 | 778 | <STRINGS_ELEMENT element="LIENPAGE"> |
610 | 779 | <TITRE>Lien vers page interne</TITRE> |
611 | 780 | <DOCUMENTATION> |
636 | 805 | <TITRE>url</TITRE> |
637 | 806 | <DOCUMENTATION> |
638 | 807 | Adresse de la page web. Doit commencer par "http://". |
808 | </DOCUMENTATION> | |
809 | </STRINGS_ATTRIBUT> | |
810 | </STRINGS_ELEMENT> | |
811 | <STRINGS_ELEMENT element="LIENIMAGE"> | |
812 | <TITRE>Lien vers image</TITRE> | |
813 | <DOCUMENTATION> | |
814 | Lien vers un environnement d'image dans la même page. | |
815 | Doit contenir du texte ou un fichier sur lequel sera placé le lien. | |
816 | </DOCUMENTATION> | |
817 | <STRINGS_ATTRIBUT attribut="url"> | |
818 | <TITRE>label</TITRE> | |
819 | <DOCUMENTATION> | |
820 | Label de l'environnement d'image (qui doit se trouver dans la même page). | |
639 | 821 | </DOCUMENTATION> |
640 | 822 | </STRINGS_ATTRIBUT> |
641 | 823 | </STRINGS_ELEMENT> |
660 | 842 | </DOCUMENTATION> |
661 | 843 | </STRINGS_ATTRIBUT> |
662 | 844 | </STRINGS_ELEMENT> |
845 | <STRINGS_ELEMENT element="SYMBOLE"> | |
846 | <TITRE>Symbole</TITRE> | |
847 | <DOCUMENTATION> | |
848 | Lettre grecque ou petite image à incorporer dans le texte. | |
849 | </DOCUMENTATION> | |
850 | </STRINGS_ELEMENT> | |
663 | 851 | <STRINGS_ELEMENT element="EQUATION"> |
664 | 852 | <TITRE>Equation</TITRE> |
665 | 853 | <DOCUMENTATION> |
707 | 895 | </DOCUMENTATION> |
708 | 896 | </STRINGS_ELEMENT> |
709 | 897 | <STRINGS_ELEMENT element="NBSP"> |
710 | <TITRE>espace insécable</TITRE> | |
898 | <TITRE>Espace insécable</TITRE> | |
711 | 899 | <DOCUMENTATION> |
712 | 900 | Espace insécable |
713 | 901 | </DOCUMENTATION> |
757 | 945 | <STRINGS_MENU menu="Normal"> |
758 | 946 | <TITRE>Normal</TITRE> |
759 | 947 | </STRINGS_MENU> |
948 | <STRINGS_MENU menu="Plugins"> | |
949 | <TITRE>Plugins</TITRE> | |
950 | </STRINGS_MENU> | |
760 | 951 | |
761 | 952 | <STRINGS_ELEMENT element="XPAGES"> |
762 | <TITRE>Document root</TITRE> | |
953 | <TITRE>XPAGES set</TITRE> | |
763 | 954 | <DOCUMENTATION> |
764 | 955 | A set of pages on a given subject. |
765 | 956 | </DOCUMENTATION> |
906 | 1097 | <TITRE_VALEUR valeur="complement">additional_information</TITRE_VALEUR> |
907 | 1098 | <TITRE_VALEUR valeur="methode">method</TITRE_VALEUR> |
908 | 1099 | <TITRE_VALEUR valeur="activite">activity</TITRE_VALEUR> |
909 | <TITRE_VALEUR valeur="exercice">exercise</TITRE_VALEUR> | |
910 | 1100 | <TITRE_VALEUR valeur="bibliographie">bibliography</TITRE_VALEUR> |
911 | 1101 | <TITRE_VALEUR valeur="autre">other</TITRE_VALEUR> |
912 | 1102 | </STRINGS_ATTRIBUT> |
1168 | 1358 | </STRINGS_ATTRIBUT> |
1169 | 1359 | </STRINGS_ELEMENT> |
1170 | 1360 | |
1361 | <STRINGS_ELEMENT element="EXERCICE"> | |
1362 | <TITRE>Exercise</TITRE> | |
1363 | <DOCUMENTATION> | |
1364 | Exercise with questions and answers | |
1365 | </DOCUMENTATION> | |
1366 | <STRINGS_ATTRIBUT attribut="titre"> | |
1367 | <TITRE>title</TITRE> | |
1368 | </STRINGS_ATTRIBUT> | |
1369 | </STRINGS_ELEMENT> | |
1370 | <STRINGS_ELEMENT element="DIFFICULTE"> | |
1371 | <TITRE>Difficulty</TITRE> | |
1372 | <DOCUMENTATION> | |
1373 | gives an idea of the difficulty : | |
1374 | * : easy, direct application of the lecture | |
1375 | ** : medium | |
1376 | *** : hard | |
1377 | </DOCUMENTATION> | |
1378 | </STRINGS_ELEMENT> | |
1379 | <STRINGS_ELEMENT element="TEMPS"> | |
1380 | <TITRE>Time</TITRE> | |
1381 | <DOCUMENTATION> | |
1382 | Indicative time to solve the exercise | |
1383 | </DOCUMENTATION> | |
1384 | </STRINGS_ELEMENT> | |
1385 | <STRINGS_ELEMENT element="QUESTION"> | |
1386 | <TITRE>Question</TITRE> | |
1387 | <DOCUMENTATION> | |
1388 | Exercise question, with the terms, optional helps, a solution, and optional points. | |
1389 | </DOCUMENTATION> | |
1390 | </STRINGS_ELEMENT> | |
1391 | <STRINGS_ELEMENT element="ENONCE"> | |
1392 | <TITRE>Terms</TITRE> | |
1393 | <DOCUMENTATION> | |
1394 | Terms of an exercise or a question | |
1395 | </DOCUMENTATION> | |
1396 | </STRINGS_ELEMENT> | |
1397 | <STRINGS_ELEMENT element="AIDE"> | |
1398 | <TITRE>Help</TITRE> | |
1399 | <DOCUMENTATION> | |
1400 | Help for a question | |
1401 | </DOCUMENTATION> | |
1402 | </STRINGS_ELEMENT> | |
1403 | <STRINGS_ELEMENT element="SOLUTION"> | |
1404 | <TITRE>Solution</TITRE> | |
1405 | </STRINGS_ELEMENT> | |
1406 | <STRINGS_ELEMENT element="POINTS"> | |
1407 | <TITRE>Points</TITRE> | |
1408 | <DOCUMENTATION> | |
1409 | Awarded points if the answer is correct | |
1410 | </DOCUMENTATION> | |
1411 | </STRINGS_ELEMENT> | |
1412 | <STRINGS_ELEMENT element="QCM"> | |
1413 | <TITRE>Quiz</TITRE> | |
1414 | <DOCUMENTATION> | |
1415 | Quiz with comments displayed depending on the user's answer | |
1416 | </DOCUMENTATION> | |
1417 | <STRINGS_ATTRIBUT attribut="titre"> | |
1418 | <TITRE>title</TITRE> | |
1419 | </STRINGS_ATTRIBUT> | |
1420 | </STRINGS_ELEMENT> | |
1421 | <STRINGS_ELEMENT element="QUESTIONQCM"> | |
1422 | <TITRE>Quiz question</TITRE> | |
1423 | <DOCUMENTATION> | |
1424 | Quiz question, with the terms, optional helps, and possible answers. | |
1425 | </DOCUMENTATION> | |
1426 | </STRINGS_ELEMENT> | |
1427 | <STRINGS_ELEMENT element="ENONCEQCM"> | |
1428 | <TITRE>Question terms</TITRE> | |
1429 | <DOCUMENTATION> | |
1430 | Quiz question terms (short text) | |
1431 | </DOCUMENTATION> | |
1432 | </STRINGS_ELEMENT> | |
1433 | <STRINGS_ELEMENT element="REPONSEQCM"> | |
1434 | <TITRE>Quiz answer</TITRE> | |
1435 | <DOCUMENTATION> | |
1436 | Possible answer for a quiz. Contains the text of the answer and a comment to display after a choice. The "right" attribute tells if the answer is right or wrong. | |
1437 | </DOCUMENTATION> | |
1438 | <STRINGS_ATTRIBUT attribut="bonne"> | |
1439 | <TITRE>correct</TITRE> | |
1440 | <TITRE_VALEUR valeur="non">no</TITRE_VALEUR> | |
1441 | <TITRE_VALEUR valeur="oui">yes</TITRE_VALEUR> | |
1442 | </STRINGS_ATTRIBUT> | |
1443 | </STRINGS_ELEMENT> | |
1444 | <STRINGS_ELEMENT element="TEXTEREP"> | |
1445 | <TITRE>Answer text</TITRE> | |
1446 | </STRINGS_ELEMENT> | |
1447 | <STRINGS_ELEMENT element="COMMENTAIREREP"> | |
1448 | <TITRE>Answer comment</TITRE> | |
1449 | <DOCUMENTATION> | |
1450 | Comment to display after a choice (especially if the answer in wrong). | |
1451 | </DOCUMENTATION> | |
1452 | </STRINGS_ELEMENT> | |
1453 | ||
1171 | 1454 | <STRINGS_ELEMENT element="LIENPAGE"> |
1172 | 1455 | <TITRE>Link to internal page</TITRE> |
1173 | 1456 | <DOCUMENTATION> |
1201 | 1484 | </DOCUMENTATION> |
1202 | 1485 | </STRINGS_ATTRIBUT> |
1203 | 1486 | </STRINGS_ELEMENT> |
1487 | <STRINGS_ELEMENT element="LIENIMAGE"> | |
1488 | <TITRE>Image link</TITRE> | |
1489 | <DOCUMENTATION> | |
1490 | Link to an image environnement in the same page. | |
1491 | Must contain text or a file upon which the link will be displayed. | |
1492 | </DOCUMENTATION> | |
1493 | <STRINGS_ATTRIBUT attribut="url"> | |
1494 | <TITRE>label</TITRE> | |
1495 | <DOCUMENTATION> | |
1496 | Label for the image environnement (which must be in the same page). | |
1497 | </DOCUMENTATION> | |
1498 | </STRINGS_ATTRIBUT> | |
1499 | </STRINGS_ELEMENT> | |
1204 | 1500 | <STRINGS_ELEMENT element="GLOSSAIRE"> |
1205 | 1501 | <TITRE>Glossary word</TITRE> |
1206 | 1502 | <DOCUMENTATION> |
1220 | 1516 | Reference word in the glossary, if different from the displayed word. |
1221 | 1517 | </DOCUMENTATION> |
1222 | 1518 | </STRINGS_ATTRIBUT> |
1519 | </STRINGS_ELEMENT> | |
1520 | <STRINGS_ELEMENT element="SYMBOLE"> | |
1521 | <TITRE>Symbol</TITRE> | |
1522 | <DOCUMENTATION> | |
1523 | Greek letter or small image to insert in the text. | |
1524 | </DOCUMENTATION> | |
1223 | 1525 | </STRINGS_ELEMENT> |
1224 | 1526 | <STRINGS_ELEMENT element="EQUATION"> |
1225 | 1527 | <TITRE>Equation</TITRE> |
Binary diff not shown
Binary diff not shown
Binary diff not shown
Binary diff not shown
Binary diff not shown
Binary diff not shown
Binary diff not shown
Binary diff not shown
85 | 85 | |
86 | 86 | .zone_titre { |
87 | 87 | margin-left: 220px; |
88 | margin-top: 1em; | |
88 | margin-top: 1.5em; | |
89 | 89 | margin-bottom: 1em; |
90 | 90 | text-align: center; |
91 | 91 | } |
95 | 95 | margin-right: auto; |
96 | 96 | } |
97 | 97 | |
98 | .zone_titre h1 { | |
98 | h1 { | |
99 | 99 | color: #753500; |
100 | 100 | background-image: url(blanc_transparent.png); |
101 | 101 | font-family : Arial, Helvetica, sans-serif; |
157 | 157 | background-color: #F6F4B9; |
158 | 158 | } |
159 | 159 | |
160 | .sommaire3 { | |
161 | font-family : Arial, Helvetica, sans-serif; | |
162 | text-decoration: none; | |
163 | font-size: 100%; | |
164 | color: #753500; | |
165 | } | |
166 | ||
160 | 167 | .sommairepage { |
161 | 168 | font-family : Arial, Helvetica, sans-serif; |
162 | 169 | text-decoration: none; |
165 | 172 | } |
166 | 173 | |
167 | 174 | :hover.sommaire2 { |
175 | color: #D08570; | |
176 | } | |
177 | :hover.sommaire3 { | |
168 | 178 | color: #D08570; |
169 | 179 | } |
170 | 180 | :hover.sommairepage { |
224 | 234 | |
225 | 235 | .zone_figure { |
226 | 236 | float: right; |
237 | clear: right; | |
227 | 238 | width: 308px; |
228 | 239 | margin-left: 10px; |
229 | 240 | margin-bottom: 5px; |
233 | 244 | padding: 3px; |
234 | 245 | border: solid black 1px; |
235 | 246 | background-color: #FFFFFF; |
247 | text-align: center; | |
236 | 248 | } |
237 | 249 | |
238 | 250 | .cadre_figure_texte { |
300 | 312 | zoom: 100%; /* pour eviter un bug de IE */ |
301 | 313 | } |
302 | 314 | |
303 | .exercice { | |
315 | .exercice, .qcm { | |
304 | 316 | background-color: #FFFDF2; |
305 | 317 | border: solid thin black; |
306 | 318 | padding: 0em 0.7em 0.7em 0.7em; |
437 | 449 | background-color: #F6F4B9; |
438 | 450 | } |
439 | 451 | |
452 | a.lienimage { | |
453 | font-size: 100%; | |
454 | font-weight: bold; | |
455 | text-decoration: none; | |
456 | color: #006030; | |
457 | } | |
458 | ||
459 | div#imagettes { | |
460 | text-align: right; | |
461 | } | |
462 | ||
440 | 463 | img.icone_section { |
441 | 464 | vertical-align: middle; |
442 | 465 | margin-right: 5px; |
443 | 466 | } |
467 | ||
468 | a.lienaide { | |
469 | font-size: 75%; | |
470 | font-family: Arial, Helvetica, sans-serif; | |
471 | font-weight: bold; | |
472 | color: #804020; | |
473 | text-decoration: none ; | |
474 | } | |
475 | ||
476 | a.liensolution { | |
477 | font-size: 75%; | |
478 | font-family: Arial, Helvetica, sans-serif; | |
479 | font-weight: bold; | |
480 | color: #903000; | |
481 | text-decoration: none ; | |
482 | } | |
483 | ||
484 | div.questionqcm | |
485 | { | |
486 | background-color: #FFF9E5; | |
487 | padding: 5px; | |
488 | margin-bottom: 0.5em; | |
489 | } | |
490 | ||
491 | span.reptexte | |
492 | { | |
493 | font-family: sans-serif; | |
494 | font-size: 80%; | |
495 | } | |
496 | ||
497 | .commentaire { | |
498 | font-weight: bold; | |
499 | font-style: italic; | |
500 | color: #FF0000; | |
501 | } |
Binary diff not shown
Binary diff not shown
Binary diff not shown
Binary diff not shown
Binary diff not shown
Binary diff not shown
Binary diff not shown
93 | 93 | |
94 | 94 | .zone_titre { |
95 | 95 | margin-left: 220px; |
96 | margin-top: 1em; | |
96 | margin-top: 1.5em; | |
97 | 97 | margin-bottom: 1em; |
98 | 98 | text-align: center; |
99 | 99 | } |
103 | 103 | margin-right: auto; |
104 | 104 | } |
105 | 105 | |
106 | .zone_titre h1 { | |
106 | h1 { | |
107 | 107 | color: #202020; |
108 | 108 | background-image: url(blanc_transparent.png); |
109 | 109 | font-family : Arial, Helvetica, sans-serif; |
163 | 163 | background-color: #505050; |
164 | 164 | } |
165 | 165 | |
166 | .sommaire3 { | |
167 | font-family : Arial, Helvetica, sans-serif; | |
168 | text-decoration: none; | |
169 | font-size: 100%; | |
170 | color: #E0E0E0; | |
171 | } | |
172 | ||
166 | 173 | .sommairepage { |
167 | 174 | font-family : Arial, Helvetica, sans-serif; |
168 | 175 | text-decoration: none; |
171 | 178 | } |
172 | 179 | |
173 | 180 | :hover.sommaire2 { |
181 | color: #F6F4B9; | |
182 | } | |
183 | :hover.sommaire3 { | |
174 | 184 | color: #F6F4B9; |
175 | 185 | } |
176 | 186 | :hover.sommairepage { |
230 | 240 | |
231 | 241 | .zone_figure { |
232 | 242 | float: right; |
243 | clear: right; | |
233 | 244 | width: 308px; |
234 | 245 | margin-left: 10px; |
235 | 246 | margin-bottom: 5px; |
239 | 250 | padding: 3px; |
240 | 251 | border: solid black 1px; |
241 | 252 | background-color: #FFFFFF; |
253 | text-align: center; | |
242 | 254 | } |
243 | 255 | |
244 | 256 | .cadre_figure_texte { |
306 | 318 | zoom: 100%; /* pour eviter un bug de IE */ |
307 | 319 | } |
308 | 320 | |
309 | .exercice { | |
321 | .exercice, .qcm { | |
310 | 322 | background: #F5F5F5; |
311 | 323 | border: solid thin black; |
312 | 324 | padding: 0em 0.7em 0.7em 0.7em; |
451 | 463 | background-color: #F6F4B9; |
452 | 464 | } |
453 | 465 | |
466 | a.lienimage { | |
467 | font-size: 100%; | |
468 | font-weight: bold; | |
469 | text-decoration: none; | |
470 | color: #106030; | |
471 | } | |
472 | ||
473 | :hover.lienimage { | |
474 | background-color: #F6F4B9; | |
475 | } | |
476 | ||
477 | div#imagettes { | |
478 | text-align: right; | |
479 | } | |
480 | ||
454 | 481 | img.icone_section { |
455 | 482 | vertical-align: middle; |
456 | 483 | margin-right: 5px; |
457 | 484 | } |
485 | ||
486 | a.lienaide { | |
487 | font-size: 75%; | |
488 | font-family: Arial, Helvetica, sans-serif; | |
489 | font-weight: bold; | |
490 | color: #202020; | |
491 | text-decoration: none ; | |
492 | } | |
493 | ||
494 | a.liensolution { | |
495 | font-size: 75%; | |
496 | font-family: Arial, Helvetica, sans-serif; | |
497 | font-weight: bold; | |
498 | color: #202020; | |
499 | text-decoration: none ; | |
500 | } | |
501 | ||
502 | div.questionqcm | |
503 | { | |
504 | background-color: #E9E9E9; | |
505 | padding: 5px; | |
506 | margin-bottom: 0.5em; | |
507 | } | |
508 | ||
509 | span.reptexte | |
510 | { | |
511 | font-family: sans-serif; | |
512 | font-size: 80%; | |
513 | } | |
514 | ||
515 | .commentaire { | |
516 | font-weight: bold; | |
517 | font-style: italic; | |
518 | color: #FF0000; | |
519 | } |
Binary diff not shown
Binary diff not shown
Binary diff not shown
Binary diff not shown
Binary diff not shown
Binary diff not shown
Binary diff not shown
93 | 93 | |
94 | 94 | .zone_titre { |
95 | 95 | margin-left: 220px; |
96 | margin-top: 1em; | |
96 | margin-top: 1.5em; | |
97 | 97 | margin-bottom: 1em; |
98 | 98 | text-align: center; |
99 | 99 | } |
103 | 103 | margin-right: auto; |
104 | 104 | } |
105 | 105 | |
106 | .zone_titre h1 { | |
106 | h1 { | |
107 | 107 | color: #202020; |
108 | 108 | background-image: url(blanc_transparent.png); |
109 | 109 | font-family : Arial, Helvetica, sans-serif; |
163 | 163 | background-color: #505050; |
164 | 164 | } |
165 | 165 | |
166 | .sommaire3 { | |
167 | font-family : Arial, Helvetica, sans-serif; | |
168 | text-decoration: none; | |
169 | font-size: 100%; | |
170 | color: #E0E0E0; | |
171 | } | |
172 | ||
166 | 173 | .sommairepage { |
167 | 174 | font-family : Arial, Helvetica, sans-serif; |
168 | 175 | text-decoration: none; |
171 | 178 | } |
172 | 179 | |
173 | 180 | :hover.sommaire2 { |
181 | color: #F6F4B9; | |
182 | } | |
183 | :hover.sommaire3 { | |
174 | 184 | color: #F6F4B9; |
175 | 185 | } |
176 | 186 | :hover.sommairepage { |
229 | 239 | |
230 | 240 | .zone_figure { |
231 | 241 | float: right; |
242 | clear: right; | |
232 | 243 | width: 308px; |
233 | 244 | margin-left: 10px; |
234 | 245 | margin-bottom: 5px; |
238 | 249 | padding: 3px; |
239 | 250 | border: solid black 1px; |
240 | 251 | background-color: #FFFFFF; |
252 | text-align: center; | |
241 | 253 | } |
242 | 254 | |
243 | 255 | .cadre_figure_texte { |
305 | 317 | zoom: 100%; /* pour eviter un bug de IE */ |
306 | 318 | } |
307 | 319 | |
308 | .exercice { | |
320 | .exercice, .qcm { | |
309 | 321 | background: #F5F5F5; |
310 | 322 | border: solid thin black; |
311 | 323 | padding: 0em 0.7em 0.7em 0.7em; |
450 | 462 | background-color: #F6F4B9; |
451 | 463 | } |
452 | 464 | |
465 | a.lienimage { | |
466 | font-size: 100%; | |
467 | font-weight: bold; | |
468 | text-decoration: none; | |
469 | color: #007755; | |
470 | } | |
471 | ||
472 | :hover.lienimage { | |
473 | background-color: #F6F4B9; | |
474 | } | |
475 | ||
476 | div#imagettes { | |
477 | text-align: right; | |
478 | } | |
479 | ||
453 | 480 | img.icone_section { |
454 | 481 | vertical-align: middle; |
455 | 482 | margin-right: 5px; |
456 | 483 | } |
484 | ||
485 | a.lienaide { | |
486 | font-size: 75%; | |
487 | font-family: Arial, Helvetica, sans-serif; | |
488 | font-weight: bold; | |
489 | color: #202020; | |
490 | text-decoration: none ; | |
491 | } | |
492 | ||
493 | a.liensolution { | |
494 | font-size: 75%; | |
495 | font-family: Arial, Helvetica, sans-serif; | |
496 | font-weight: bold; | |
497 | color: #202020; | |
498 | text-decoration: none ; | |
499 | } | |
500 | ||
501 | div.questionqcm | |
502 | { | |
503 | background-color: #E9E9E9; | |
504 | padding: 5px; | |
505 | margin-bottom: 0.5em; | |
506 | } | |
507 | ||
508 | span.reptexte | |
509 | { | |
510 | font-family: sans-serif; | |
511 | font-size: 80%; | |
512 | } | |
513 | ||
514 | .commentaire { | |
515 | font-weight: bold; | |
516 | font-style: italic; | |
517 | color: #FF0000; | |
518 | } |
Binary diff not shown
Binary diff not shown
Binary diff not shown
Binary diff not shown
Binary diff not shown
Binary diff not shown
Binary diff not shown
85 | 85 | |
86 | 86 | .zone_titre { |
87 | 87 | margin-left: 220px; |
88 | margin-top: 1em; | |
88 | margin-top: 1.5em; | |
89 | 89 | margin-bottom: 1em; |
90 | 90 | text-align: center; |
91 | 91 | } |
95 | 95 | margin-right: auto; |
96 | 96 | } |
97 | 97 | |
98 | .zone_titre h1 { | |
98 | h1 { | |
99 | 99 | color: #753500; |
100 | 100 | background-image: url(blanc_transparent.png); |
101 | 101 | font-family : Arial, Helvetica, sans-serif; |
157 | 157 | background-color: #F6F4B9; |
158 | 158 | } |
159 | 159 | |
160 | .sommaire3 { | |
161 | font-family : Arial, Helvetica, sans-serif; | |
162 | text-decoration: none; | |
163 | font-size: 100%; | |
164 | color: #753500; | |
165 | } | |
166 | ||
160 | 167 | .sommairepage { |
161 | 168 | font-family : Arial, Helvetica, sans-serif; |
162 | 169 | text-decoration: none; |
165 | 172 | } |
166 | 173 | |
167 | 174 | :hover.sommaire2 { |
175 | color: #D08570; | |
176 | } | |
177 | :hover.sommaire3 { | |
168 | 178 | color: #D08570; |
169 | 179 | } |
170 | 180 | :hover.sommairepage { |
224 | 234 | |
225 | 235 | .zone_figure { |
226 | 236 | float: right; |
237 | clear: right; | |
227 | 238 | width: 308px; |
228 | 239 | margin-left: 10px; |
229 | 240 | margin-bottom: 5px; |
233 | 244 | padding: 3px; |
234 | 245 | border: solid black 1px; |
235 | 246 | background-color: #FFFFFF; |
247 | text-align: center; | |
236 | 248 | } |
237 | 249 | |
238 | 250 | .cadre_figure_texte { |
300 | 312 | zoom: 100%; /* pour eviter un bug de IE */ |
301 | 313 | } |
302 | 314 | |
303 | .exercice { | |
315 | .exercice, .qcm { | |
304 | 316 | background-color: #FFFDF2; |
305 | 317 | border: solid thin black; |
306 | 318 | padding: 0em 0.7em 0.7em 0.7em; |
437 | 449 | background-color: #F6F4B9; |
438 | 450 | } |
439 | 451 | |
452 | a.lienimage { | |
453 | font-size: 100%; | |
454 | font-weight: bold; | |
455 | text-decoration: none; | |
456 | color: #006030; | |
457 | } | |
458 | ||
459 | div#imagettes { | |
460 | text-align: right; | |
461 | } | |
462 | ||
440 | 463 | img.icone_section { |
441 | 464 | vertical-align: middle; |
442 | 465 | margin-right: 5px; |
443 | 466 | } |
467 | ||
468 | a.lienaide { | |
469 | font-size: 75%; | |
470 | font-family: Arial, Helvetica, sans-serif; | |
471 | font-weight: bold; | |
472 | color: #804020; | |
473 | text-decoration: none ; | |
474 | } | |
475 | ||
476 | a.liensolution { | |
477 | font-size: 75%; | |
478 | font-family: Arial, Helvetica, sans-serif; | |
479 | font-weight: bold; | |
480 | color: #903000; | |
481 | text-decoration: none ; | |
482 | } | |
483 | ||
484 | div.questionqcm | |
485 | { | |
486 | background-color: #FFF9E5; | |
487 | padding: 5px; | |
488 | margin-bottom: 0.5em; | |
489 | } | |
490 | ||
491 | span.reptexte | |
492 | { | |
493 | font-family: sans-serif; | |
494 | font-size: 80%; | |
495 | } | |
496 | ||
497 | .commentaire { | |
498 | font-weight: bold; | |
499 | font-style: italic; | |
500 | color: #FF0000; | |
501 | } |
Binary diff not shown
Binary diff not shown
Binary diff not shown
Binary diff not shown
Binary diff not shown
Binary diff not shown
Binary diff not shown
85 | 85 | |
86 | 86 | .zone_titre { |
87 | 87 | margin-left: 220px; |
88 | margin-top: 1em; | |
88 | margin-top: 1.5em; | |
89 | 89 | margin-bottom: 1em; |
90 | 90 | text-align: center; |
91 | 91 | } |
95 | 95 | margin-right: auto; |
96 | 96 | } |
97 | 97 | |
98 | .zone_titre h1 { | |
98 | h1 { | |
99 | 99 | color: #001070; |
100 | 100 | background-image: url(blanc_transparent.png); |
101 | 101 | font-family : Arial, Helvetica, sans-serif; |
158 | 158 | background-color: #F6F4B9; |
159 | 159 | } |
160 | 160 | |
161 | .sommaire3 { | |
162 | font-family : Arial, Helvetica, sans-serif; | |
163 | text-decoration: none; | |
164 | font-size: 100%; | |
165 | color: #0000FF; | |
166 | } | |
167 | ||
161 | 168 | .sommairepage { |
162 | 169 | font-family : Arial, Helvetica, sans-serif; |
163 | 170 | text-decoration: none; |
166 | 173 | } |
167 | 174 | |
168 | 175 | :hover.sommaire2 { |
176 | color: #7B7BFF; | |
177 | } | |
178 | :hover.sommaire3 { | |
169 | 179 | color: #7B7BFF; |
170 | 180 | } |
171 | 181 | :hover.sommairepage { |
225 | 235 | |
226 | 236 | .zone_figure { |
227 | 237 | float: right; |
238 | clear: right; | |
228 | 239 | width: 308px; |
229 | 240 | margin-left: 10px; |
230 | 241 | margin-bottom: 5px; |
234 | 245 | padding: 3px; |
235 | 246 | border: solid black 1px; |
236 | 247 | background-color: #FFFFFF; |
248 | text-align: center; | |
237 | 249 | } |
238 | 250 | |
239 | 251 | .cadre_figure_texte { |
301 | 313 | zoom: 100%; /* pour eviter un bug de IE */ |
302 | 314 | } |
303 | 315 | |
304 | .exercice { | |
316 | .exercice, .qcm { | |
305 | 317 | background: #F2F2FF; |
306 | 318 | border: solid thin black; |
307 | 319 | padding: 0em 0.7em 0.7em 0.7em; |
439 | 451 | background-color: #F6F4B9; |
440 | 452 | } |
441 | 453 | |
454 | a.lienimage { | |
455 | font-size: 100%; | |
456 | font-weight: bold; | |
457 | text-decoration: none; | |
458 | color: #007755; | |
459 | } | |
460 | ||
461 | div#imagettes { | |
462 | text-align: right; | |
463 | } | |
464 | ||
442 | 465 | img.icone_section { |
443 | 466 | vertical-align: middle; |
444 | 467 | margin-right: 5px; |
445 | 468 | } |
469 | ||
470 | a.lienaide { | |
471 | font-size: 75%; | |
472 | font-family: Arial, Helvetica, sans-serif; | |
473 | font-weight: bold; | |
474 | color: #0065CD; | |
475 | text-decoration: none; | |
476 | } | |
477 | ||
478 | a.liensolution { | |
479 | font-size: 75%; | |
480 | font-family: Arial, Helvetica, sans-serif; | |
481 | font-weight: bold; | |
482 | color: #0000FF; | |
483 | text-decoration: none; | |
484 | } | |
485 | ||
486 | div.questionqcm | |
487 | { | |
488 | background-color: #F5F5FF; | |
489 | padding: 5px; | |
490 | margin-bottom: 0.5em; | |
491 | } | |
492 | ||
493 | span.reptexte | |
494 | { | |
495 | font-family: sans-serif; | |
496 | font-size: 80%; | |
497 | } | |
498 | ||
499 | .commentaire { | |
500 | font-weight: bold; | |
501 | font-style: italic; | |
502 | color: #FF0000; | |
503 | } |
Binary diff not shown
Binary diff not shown
Binary diff not shown
Binary diff not shown
Binary diff not shown
Binary diff not shown
Binary diff not shown
Binary diff not shown
Binary diff not shown
Binary diff not shown
Binary diff not shown
Binary diff not shown
Binary diff not shown
Binary diff not shown
Binary diff not shown
Binary diff not shown
Binary diff not shown
Binary diff not shown
Binary diff not shown
Binary diff not shown
Binary diff not shown
Binary diff not shown
Binary diff not shown
Binary diff not shown
Binary diff not shown
Binary diff not shown
Binary diff not shown
Binary diff not shown
Binary diff not shown
Binary diff not shown
Binary diff not shown
Binary diff not shown
Binary diff not shown
Binary diff not shown
Binary diff not shown
Binary diff not shown
Binary diff not shown
Binary diff not shown
Binary diff not shown
Binary diff not shown
Binary diff not shown
Binary diff not shown
Binary diff not shown
Binary diff not shown
Binary diff not shown
Binary diff not shown
Binary diff not shown
Binary diff not shown
Binary diff not shown
Binary diff not shown
Binary diff not shown
Binary diff not shown
Binary diff not shown
Binary diff not shown
Binary diff not shown
Binary diff not shown
Binary diff not shown
Binary diff not shown
Binary diff not shown
Binary diff not shown
12 | 12 | <message label=", et le nom du fichier est">, and the name of the file is</message> |
13 | 13 | <message label="Page pour l_impression">Page for printing</message> |
14 | 14 | <message label="page">page</message> |
15 | <message label="entrée du site">Home page</message> | |
15 | <message label="Entrée du site">Home page</message> | |
16 | 16 | <message label="Sommaire">Summary</message> |
17 | 17 | <message label="Glossaire">Glossary</message> |
18 | 18 | <message label="Page précédente">Previous page</message> |
28 | 28 | <message label="Erreur: plugin Flash absent ou désactivé ?">Error: Flash plugin not installed or enabled ?</message> |
29 | 29 | <message label="Vous pouvez définir une page d_accueil du site en créant une page avec le label _index_.">You can create a site home page by creating a page with the 'index' label.</message> |
30 | 30 | <message label="Impossible de créer un fichier avec le processeur XSLT de">Could not create a file with the following XSLT processor:</message> |
31 | <message label="Exercice">Exercise</message> | |
32 | <message label="Difficulté :">Difficulty :</message> | |
33 | <message label="Temps :">Time :</message> | |
34 | <message label="Question">Question</message> | |
35 | <message label="Aide">Help</message> | |
36 | <message label="Solution">Solution</message> | |
37 | <message label="points">points</message> | |
38 | <message label="QCM">Quiz</message> | |
39 | <message label="juste">right</message> | |
40 | <message label="faux">wrong</message> | |
41 | <message label="Fermer">Close</message> | |
42 | <message label="Liste des liens non résolus">List of unresolved links</message> | |
43 | <message label="Mots du glossaire non définis">Undefined glossary words</message> | |
44 | <message label="Mots du glossaire définis plus d_une fois">Glossary words defined more than once</message> | |
45 | <message label="de la même contribution">in the same contribution</message> | |
46 | <message label="contribution">contribution</message> | |
47 | <message label="(il y a plus d_une contribution avec ce label)">(there is more than one contribution with this label)</message> | |
48 | <message label="Lien vers l_image">Link to the image</message> | |
49 | <message label="à la page">at page</message> | |
50 | <message label="utilisé page">used page</message> | |
51 | <message label="Labels utilisés">Used labels</message> | |
52 | <message label="Erreurs">Errors</message> | |
53 | <message label="Contributions">Contributions</message> | |
54 | <message label="Pages">Pages</message> | |
55 | <message label="Index">Index</message> | |
56 | <message label="sans label">wihtout label</message> | |
57 | <message label="Un lien utilisant un label avec un doublon ne fonctionnera pas, et apparaîtra sur la page des">A link using a label with a duplicated will not work, and will appear on the page of the</message> | |
58 | <message label="mauvais liens">broken links</message> | |
59 | <message label="Doublons d_ensembles XPAGES">XPAGES set duplicates</message> | |
60 | <message label="lien vers le premier avec ce label">link to the first with this label</message> | |
61 | <message label="Doublons de pages">Pages duplicates</message> | |
62 | <message label="lien vers la première avec ce label">link to the first with this label</message> | |
63 | <message label="Labels invalides">Invalid labels</message> | |
64 | <message label="Commentaires des auteurs">Author comments</message> | |
65 | <message label="Liste des images et des crédits, triée par crédit">List of images and copyrights, sorted by copyright</message> | |
66 | <message label="Crédit">Copyright</message> | |
67 | <message label="Image">Image</message> | |
68 | <message label="Titre">Title</message> | |
69 | <message label="Nom fichier">File name</message> | |
70 | <message label="Légende">Legend</message> | |
71 | <message label="animation">animation</message> | |
31 | 72 | </messages> |
12 | 12 | <message label=", et le nom du fichier est">, et le nom du fichier est</message> |
13 | 13 | <message label="Page pour l_impression">Page pour l'impression</message> |
14 | 14 | <message label="page">page</message> |
15 | <message label="entrée du site">entrée du site</message> | |
15 | <message label="Entrée du site">Entrée du site</message> | |
16 | 16 | <message label="Sommaire">Sommaire</message> |
17 | 17 | <message label="Glossaire">Glossaire</message> |
18 | 18 | <message label="Page précédente">Page précédente</message> |
28 | 28 | <message label="Erreur: plugin Flash absent ou désactivé ?">Erreur: plugin Flash absent ou désactivé ?</message> |
29 | 29 | <message label="Vous pouvez définir une page d_accueil du site en créant une page avec le label _index_.">Vous pouvez définir une page d'accueil du site en créant une page avec le label 'index'.</message> |
30 | 30 | <message label="Impossible de créer un fichier avec le processeur XSLT de">Impossible de créer un fichier avec le processeur XSLT de</message> |
31 | <message label="Exercice">Exercice</message> | |
32 | <message label="Difficulté :">Difficulté :</message> | |
33 | <message label="Temps :">Temps :</message> | |
34 | <message label="Question">Question</message> | |
35 | <message label="Aide">Aide</message> | |
36 | <message label="Solution">Solution</message> | |
37 | <message label="points">points</message> | |
38 | <message label="QCM">QCM</message> | |
39 | <message label="juste">juste</message> | |
40 | <message label="faux">faux</message> | |
41 | <message label="Fermer">Fermer</message> | |
42 | <message label="Liste des liens non résolus">Liste des liens non résolus</message> | |
43 | <message label="Mots du glossaire non définis">Mots du glossaire non définis</message> | |
44 | <message label="Mots du glossaire définis plus d_une fois">Mots du glossaire définis plus d'une fois</message> | |
45 | <message label="de la même contribution">de la même contribution</message> | |
46 | <message label="contribution">contribution</message> | |
47 | <message label="(il y a plus d_une contribution avec ce label)">(il y a plus d'une contribution avec ce label)</message> | |
48 | <message label="Lien vers l_image">Lien vers l'image</message> | |
49 | <message label="à la page">à la page</message> | |
50 | <message label="utilisé page">utilisé page</message> | |
51 | <message label="Labels utilisés">Labels utilisés</message> | |
52 | <message label="Erreurs">Erreurs</message> | |
53 | <message label="Contributions">Contributions</message> | |
54 | <message label="Pages">Pages</message> | |
55 | <message label="Index">Index</message> | |
56 | <message label="sans label">sans label</message> | |
57 | <message label="Un lien utilisant un label avec un doublon ne fonctionnera pas, et apparaîtra sur la page des">Un lien utilisant un label avec un doublon ne fonctionnera pas, et apparaîtra sur la page des</message> | |
58 | <message label="mauvais liens">mauvais liens</message> | |
59 | <message label="Doublons d_ensembles XPAGES">Doublons d'ensembles XPAGES</message> | |
60 | <message label="lien vers le premier avec ce label">lien vers le premier avec ce label</message> | |
61 | <message label="Doublons de pages">Doublons de pages</message> | |
62 | <message label="lien vers la première avec ce label">lien vers la première avec ce label</message> | |
63 | <message label="Labels invalides">Labels invalides</message> | |
64 | <message label="Commentaires des auteurs">Commentaires des auteurs</message> | |
65 | <message label="Liste des images et des crédits, triée par crédit">Liste des images et des crédits, triée par crédit</message> | |
66 | <message label="Crédit">Crédit</message> | |
67 | <message label="Image">Image</message> | |
68 | <message label="Titre">Titre</message> | |
69 | <message label="Nom fichier">Nom fichier</message> | |
70 | <message label="Légende">Légende</message> | |
71 | <message label="animation">animation</message> | |
31 | 72 | </messages> |
Binary diff not shown
43 | 43 | public ActionFonction(final JaxeDocument doc, final String titre, final String classe, final Element fctdef) { |
44 | 44 | super(titre); |
45 | 45 | this.doc = doc; |
46 | Class c; | |
46 | Class<?> c; | |
47 | 47 | try { |
48 | 48 | c = Class.forName(classe, true, JEFactory.getPluginClassLoader()); |
49 | 49 | } catch (final Exception ex) { |
139 | 139 | l.fill = GridBagConstraints.HORIZONTAL; |
140 | 140 | l.weighty = 0; |
141 | 141 | l.insets = new Insets(0, 0, 0, 5); |
142 | ||
143 | final ArrayList<Element> attrlist = _doc.cfg.listeAttributs(ref); | |
142 | ||
143 | final Config conf = _doc.cfg.getRefConf(ref); | |
144 | final ArrayList<Element> attrlist = conf.listeAttributs(ref); | |
144 | 145 | for (final Element att : attrlist) { |
145 | final String st = _doc.cfg.nomAttribut(att); | |
146 | final String title = _doc.cfg.titreAttribut(ref, att); | |
147 | final String ns = _doc.cfg.espaceAttribut(att); | |
146 | final String st = conf.nomAttribut(att); | |
147 | final String title = conf.titreAttribut(ref, att); | |
148 | final String ns = conf.espaceAttribut(att); | |
148 | 149 | String elval = el.getAttribute(st); |
149 | 150 | |
150 | String documentation = _doc.cfg.documentationAttribut(ref, att); | |
151 | String documentation = conf.documentationAttribut(ref, att); | |
151 | 152 | if (documentation != null) { |
152 | 153 | final JButton baide = new JButton(new ActionAide(att, ref)); |
153 | 154 | baide.setFont(baide.getFont().deriveFont((float)9)); |
169 | 170 | } |
170 | 171 | |
171 | 172 | final JLabel label = new JLabel(title); |
172 | if (_doc.cfg.estObligatoire(att)) | |
173 | if (conf.estObligatoire(att)) | |
173 | 174 | label.setForeground(new Color(150, 0, 0)); // rouge foncé |
174 | 175 | else |
175 | 176 | label.setForeground(new Color(0, 100, 0)); // vert foncé |
176 | 177 | |
177 | 178 | attribPanel.add(label, l); |
178 | 179 | |
179 | final ArrayList<String> lval = _doc.cfg.listeValeursAttribut(att); | |
180 | final String defaut = _doc.cfg.valeurParDefaut(att); | |
180 | final ArrayList<String> lval = conf.listeValeursAttribut(att); | |
181 | final String defaut = conf.valeurParDefaut(att); | |
181 | 182 | if ("".equals(elval) && defaut != null && el.getAttributeNode(st) == null) |
182 | 183 | elval = defaut; |
183 | 184 | if (lval != null) { |
184 | 185 | final ElementComboBox popup = new ElementComboBox(el, st, ns); |
185 | if (!_doc.cfg.estObligatoire(att)) | |
186 | if (!conf.estObligatoire(att)) | |
186 | 187 | popup.addValue("", ""); |
187 | 188 | for (final String sval : lval) |
188 | popup.addValue(sval, _doc.cfg.titreValeurAttribut(ref, att, sval)); | |
189 | popup.addValue(sval, conf.titreValeurAttribut(ref, att, sval)); | |
189 | 190 | popup.setValue(elval); |
190 | 191 | popup.startListener(); |
191 | 192 | attribPanel.add(popup, c); |
192 | 193 | } else { |
193 | final ArrayList<String> lvs = _doc.cfg.listeValeursSuggereesAttribut(ref, att); | |
194 | final ArrayList<String> lvs = conf.listeValeursSuggereesAttribut(ref, att); | |
194 | 195 | if (lvs != null && lvs.size() > 0) { |
195 | 196 | final ElementComboBox popup = new ElementComboBox(el, st, ns); |
196 | 197 | popup.setEditable(true); |
197 | if (!_doc.cfg.estObligatoire(att)) | |
198 | if (!conf.estObligatoire(att)) | |
198 | 199 | popup.addValue("", ""); |
199 | 200 | for (final String sval : lvs) |
200 | popup.addValue(sval, _doc.cfg.titreValeurAttribut(ref, att, sval)); | |
201 | popup.addValue(sval, conf.titreValeurAttribut(ref, att, sval)); | |
201 | 202 | popup.setValue(elval); |
202 | 203 | popup.startListener(); |
203 | 204 | attribPanel.add(popup, c); |
382 | 382 | d.width += fleche; |
383 | 383 | final FontMetrics fm = getFontMetrics(police); |
384 | 384 | d.width += fm.stringWidth(texte); |
385 | if (attributsVisibles && typeBalise != FIN) { | |
385 | if (attributsVisibles && typeBalise != FIN && je.refElement != null) { | |
386 | 386 | final NamedNodeMap listeAttributs = je.noeud.getAttributes(); |
387 | final ArrayList<Element> latt; | |
388 | 387 | final Config cfg = je.doc.cfg; |
389 | if (je.refElement != null) | |
390 | latt = cfg.listeAttributs(je.refElement); | |
391 | else | |
392 | latt = null; | |
393 | for (int i=0; i<listeAttributs.getLength(); i++) { | |
394 | final Attr att = (Attr)listeAttributs.item(i); | |
395 | String titreAtt = att.getName(); | |
396 | String titreVal = att.getValue(); | |
397 | if (latt != null) { | |
398 | final String nomAtt = att.getName(); | |
399 | for (Element refatt : latt) | |
400 | if (nomAtt.equals(cfg.nomAttribut(refatt))) { | |
401 | titreAtt = cfg.titreAttribut(je.refElement, refatt); | |
402 | titreVal = cfg.titreValeurAttribut(je.refElement, refatt, att.getValue()); | |
403 | break; | |
404 | } | |
388 | final ArrayList<Element> latt = cfg.listeAttributs(je.refElement); | |
389 | for (Element refatt : latt) { | |
390 | final Node natt = listeAttributs.getNamedItemNS(cfg.espaceAttribut(refatt), | |
391 | cfg.nomAttribut(refatt)); | |
392 | if (natt != null) { | |
393 | String titreAtt = natt.getNodeName(); | |
394 | String titreVal = natt.getNodeValue(); | |
395 | titreAtt = cfg.titreAttribut(je.refElement, refatt); | |
396 | titreVal = cfg.titreValeurAttribut(je.refElement, refatt, titreVal); | |
397 | d.width += fm.stringWidth(" " + titreAtt + "=" + titreVal); | |
405 | 398 | } |
406 | d.width += fm.stringWidth(" " + titreAtt + "=" + titreVal); | |
407 | 399 | } |
408 | 400 | } |
409 | 401 | if (je.doc.textPane.iconeValide) |
555 | 547 | px += fm.stringWidth(texteAffiche); |
556 | 548 | |
557 | 549 | // attributs |
558 | if (attributsVisibles && typeBalise != FIN) { | |
550 | if (attributsVisibles && typeBalise != FIN && je.refElement != null) { | |
559 | 551 | int pxmax = dim.width - bords.right - 1; |
560 | 552 | if (je.doc.textPane.iconeValide) |
561 | 553 | pxmax -= 20; |
565 | 557 | final Color vertFonce = new Color(0, 70, 0); |
566 | 558 | final Color bleuFonce = new Color(0, 0, 150); |
567 | 559 | final NamedNodeMap listeAttributs = je.noeud.getAttributes(); |
568 | final ArrayList<Element> latt; | |
569 | if (je.refElement != null) | |
570 | latt = je.doc.cfg.listeAttributs(je.refElement); | |
571 | else | |
572 | latt = null; | |
573 | for (int i=0; i<listeAttributs.getLength(); i++) { | |
574 | px += fm.stringWidth(" "); | |
575 | final Attr att = (Attr)listeAttributs.item(i); | |
576 | String titreAtt = att.getName(); | |
577 | String titreVal = att.getValue(); | |
578 | if (latt != null) { | |
579 | final String nomAtt = att.getName(); | |
580 | for (Element refatt : latt) | |
581 | if (nomAtt.equals(je.doc.cfg.nomAttribut(refatt))) { | |
582 | titreAtt = je.doc.cfg.titreAttribut(je.refElement, refatt); | |
583 | titreVal = je.doc.cfg.titreValeurAttribut(je.refElement, refatt, att.getValue()); | |
584 | break; | |
585 | } | |
560 | final ArrayList<Element> latt = je.doc.cfg.listeAttributs(je.refElement); | |
561 | for (Element refatt : latt) { | |
562 | final Node natt = listeAttributs.getNamedItemNS(je.doc.cfg.espaceAttribut(refatt), | |
563 | je.doc.cfg.nomAttribut(refatt)); | |
564 | if (natt != null) { | |
565 | px += fm.stringWidth(" "); | |
566 | String titreAtt = je.doc.cfg.titreAttribut(je.refElement, refatt); | |
567 | String titreVal = je.doc.cfg.titreValeurAttribut(je.refElement, refatt, natt.getNodeValue()); | |
568 | final String texteAtt = titreAtt + "=" + titreVal; | |
569 | if (px + fm.stringWidth(texteAtt) > pxmax) { | |
570 | g.drawString("...", px, py); | |
571 | px += fm.stringWidth("..."); | |
572 | break; | |
573 | } | |
574 | g.setColor(bleuFonce); | |
575 | g.drawString(titreAtt, px, py); | |
576 | px += fm.stringWidth(titreAtt); | |
577 | g.setColor(Color.black); | |
578 | g.drawString("=", px, py); | |
579 | px += fm.stringWidth("="); | |
580 | g.setColor(vertFonce); | |
581 | g.drawString(titreVal, px, py); | |
582 | px += fm.stringWidth(titreVal); | |
586 | 583 | } |
587 | final String texteAtt = titreAtt + "=" + titreVal; | |
588 | if (px + fm.stringWidth(texteAtt) > pxmax) { | |
589 | g.drawString("...", px, py); | |
590 | px += fm.stringWidth("..."); | |
591 | break; | |
592 | } | |
593 | g.setColor(bleuFonce); | |
594 | g.drawString(titreAtt, px, py); | |
595 | px += fm.stringWidth(titreAtt); | |
596 | g.setColor(Color.black); | |
597 | g.drawString("=", px, py); | |
598 | px += fm.stringWidth("="); | |
599 | g.setColor(vertFonce); | |
600 | g.drawString(titreVal, px, py); | |
601 | px += fm.stringWidth(titreVal); | |
602 | 584 | } |
603 | 585 | } |
604 | 586 | g.setFont(tmpFont); |
139 | 139 | * @param lireSchema faire un chargement en mémoire du schéma (false uniquement pour chercher une Config |
140 | 140 | * en fonction de la racine d'un document) |
141 | 141 | */ |
142 | public Config(final String nomFichierCfg, final boolean lireSchema) { | |
143 | super(); | |
142 | public Config(final String nomFichierCfg, final boolean lireSchema) throws JaxeException { | |
144 | 143 | try { |
145 | 144 | initialisation(new File(nomFichierCfg).toURI().toURL(), lireSchema); |
146 | 145 | } catch (final MalformedURLException ex) { |
147 | 146 | LOG.error("Config("+nomFichierCfg+","+lireSchema+") : MalformedURLException: " + ex.getMessage(), ex); |
147 | throw new JaxeException("Erreur à la construction de l'URL pour " + nomFichierCfg, ex); | |
148 | 148 | } |
149 | 149 | } |
150 | 150 | |
155 | 155 | * @param lireSchema faire un chargement en mémoire du schéma (false uniquement pour chercher une Config |
156 | 156 | * en fonction de la racine d'un document) |
157 | 157 | */ |
158 | public Config(final URL urlFichierCfg, final boolean lireSchema) { | |
159 | super(); | |
158 | public Config(final URL urlFichierCfg, final boolean lireSchema) throws JaxeException { | |
160 | 159 | initialisation(urlFichierCfg, lireSchema); |
161 | 160 | } |
162 | 161 | |
163 | private void initialisation(final URL urlFichierCfg, final boolean lireSchema) { | |
162 | private void initialisation(final URL urlFichierCfg, final boolean lireSchema) throws JaxeException { | |
164 | 163 | if (urlFichierCfg == null) { |
165 | 164 | jaxecfg = null; |
166 | 165 | return; |
176 | 175 | final DocumentBuilder parser = DocumentBuilderFactory.newInstance().newDocumentBuilder(); |
177 | 176 | final String furl = urlFichierCfg.toExternalForm(); |
178 | 177 | configdoc = parser.parse(furl); |
179 | } catch (final Exception e) { | |
180 | LOG.error("initialisation: lecture de " + urlFichierCfg.toExternalForm(), e); | |
181 | return; | |
178 | } catch (final Exception ex) { | |
179 | LOG.error("Config: initialisation: lecture de " + urlFichierCfg.toExternalForm(), ex); | |
180 | throw new JaxeException("Erreur à la lecture de " + urlFichierCfg.toExternalForm(), ex); | |
182 | 181 | } |
183 | 182 | |
184 | 183 | final String resource; |
191 | 190 | |
192 | 191 | configdoc = transformationConfig(configdoc); |
193 | 192 | if (configdoc == null) { |
194 | LOG.error("initialisation: erreur à la transformation du fichier de config"); | |
195 | return; | |
193 | LOG.error("Config: initialisation: erreur à la transformation du fichier de config " + urlFichierCfg.toExternalForm()); | |
194 | throw new JaxeException("Erreur à la transformation du fichier de config " + urlFichierCfg.getFile()); | |
196 | 195 | } |
197 | 196 | |
198 | 197 | jaxecfg = configdoc.getDocumentElement(); |
207 | 206 | else |
208 | 207 | urlAutreConfig = new URL(cfgdir.toExternalForm() + "/" + elconfig.getAttribute("nom")); |
209 | 208 | } catch (final MalformedURLException ex) { |
210 | LOG.error("initialisation : MalformedURLException: " + ex.getMessage(), ex); | |
209 | LOG.error("Config: initialisation: MalformedURLException: " + ex.getMessage(), ex); | |
211 | 210 | urlAutreConfig = null; |
212 | 211 | } |
213 | final Config autreConfig = new Config(urlAutreConfig, true); | |
214 | autresConfigs.add(autreConfig); | |
212 | try { | |
213 | final Config autreConfig = new Config(urlAutreConfig, true); | |
214 | autresConfigs.add(autreConfig); | |
215 | } catch (JaxeException ex) { | |
216 | } | |
215 | 217 | elconfig = nextElement(elconfig, "AUTRE_CONFIG"); |
216 | 218 | } |
217 | 219 | |
236 | 238 | if (noms == null) { |
237 | 239 | final Element schema_simple = findElement(getLangage(), "SCHEMA_SIMPLE"); |
238 | 240 | if (schema_simple == null) { |
239 | LOG.error("Erreur : aucun schéma n'est défini dans le fichier de config " + urlFichierCfg); | |
240 | return; | |
241 | LOG.error("Config: initialisation: Aucun schéma XML n'est défini dans le fichier de config " + urlFichierCfg.toExternalForm()); | |
242 | throw new JaxeException("Erreur : aucun schéma XML n'est défini dans le fichier de config " + urlFichierCfg.getFile()); | |
241 | 243 | } |
242 | 244 | schema = new SchemaSimple(schema_simple, this); |
243 | 245 | schemaURL = null; |
251 | 253 | else |
252 | 254 | schemaURL = new URL(noms); |
253 | 255 | } catch (final MalformedURLException ex) { |
254 | System.err.println("MalformedURLException: " + ex.getMessage()); | |
256 | LOG.error("Config: initialisation: MalformedURLException: " + ex.getMessage()); | |
255 | 257 | } |
256 | 258 | if (noms.endsWith(".rng")) |
257 | 259 | schema = new SchemaRelaxNG(schemaURL, this); |
1023 | 1025 | final String nom = fonction.getAttribute("nom"); |
1024 | 1026 | final String titre = titreMenu(nom); |
1025 | 1027 | item = jmenu.add(new ActionFonction(doc, titre, classe, fonction)); |
1028 | String itemdoc = documentationMenu(nom); | |
1029 | if (itemdoc != null) { | |
1030 | itemdoc = formatageDoc(itemdoc); | |
1031 | item.setToolTipText(itemdoc); | |
1032 | } | |
1026 | 1033 | } else if ("MENU".equals(nodename)) { |
1027 | 1034 | item = creationMenu(doc, (Element)menunode); |
1028 | 1035 | jmenu.add(item); |
1175 | 1182 | if (espace == null) |
1176 | 1183 | return(null); |
1177 | 1184 | return(prefixeEspace(espace)); |
1185 | } | |
1186 | ||
1187 | /** | |
1188 | * Renvoie la liste des valeurs possibles pour un élément, à partir de sa référence. | |
1189 | * Renvoie null s'il y a un nombre infini de valeurs possibles. | |
1190 | */ | |
1191 | public ArrayList<String> listeValeursElement(final Element refElement) { | |
1192 | final ArrayList<String> liste = schema.listeValeursElement(refElement); | |
1193 | return(liste); | |
1178 | 1194 | } |
1179 | 1195 | |
1180 | 1196 | /** |
1826 | 1842 | */ |
1827 | 1843 | public ArrayList<String> listeValeursAttribut(final Element refAttribut) { |
1828 | 1844 | final ArrayList<String> liste = schema.listeValeursAttribut(refAttribut); |
1829 | if (liste == null) | |
1830 | return(null); | |
1831 | 1845 | return(liste); |
1832 | 1846 | } |
1833 | 1847 |
291 | 291 | if (aideAttribut) { |
292 | 292 | refElementsParents = new ArrayList<Element>(); |
293 | 293 | refElementsParents.add(refElementParent); |
294 | final String[] nomParent = new String[1]; | |
295 | nomParent[0] = cfg.nomElement(refElementParent); | |
296 | listeParents.setListData(nomParent); | |
294 | final String[] titreParent = new String[1]; | |
295 | titreParent[0] = cfg.titreElement(refElementParent); | |
296 | listeParents.setListData(titreParent); | |
297 | 297 | } else { |
298 | 298 | refElementsParents = cfg.listeElementsParents(refNoeud); |
299 | 299 | final String[] titres = new String[refElementsParents.size()]; |
50 | 50 | JFrame jframe; |
51 | 51 | JaxeDocument doc; |
52 | 52 | ArrayList<Element> latt; |
53 | Config conf; | |
53 | 54 | |
54 | 55 | public DialogueAttributs(final JFrame jframe, final JaxeDocument doc, final String titre, final Element refElement, final Element el) { |
55 | 56 | super(jframe, titre, true); |
57 | 58 | this.doc = doc; |
58 | 59 | this.refElement = refElement; |
59 | 60 | this.el = el; |
60 | latt = doc.cfg.listeAttributs(refElement); | |
61 | conf = doc.cfg.getRefConf(refElement); | |
62 | latt = conf.listeAttributs(refElement); | |
61 | 63 | final int natt = latt.size(); |
62 | 64 | noms = new String[natt]; |
63 | 65 | final String[] titres = new String[natt]; |
68 | 70 | tbval = new JLabel[natt]; |
69 | 71 | for (int i=0; i<natt; i++) { |
70 | 72 | final Element att = latt.get(i); |
71 | noms[i] = doc.cfg.nomAttribut(att); | |
72 | titres[i] = doc.cfg.titreAttribut(refElement, att); | |
73 | espaces[i] = doc.cfg.espaceAttribut(att); | |
74 | documentation[i] = doc.cfg.documentationAttribut(refElement, att); | |
73 | noms[i] = conf.nomAttribut(att); | |
74 | titres[i] = conf.titreAttribut(refElement, att); | |
75 | espaces[i] = conf.espaceAttribut(att); | |
76 | documentation[i] = conf.documentationAttribut(refElement, att); | |
75 | 77 | if (documentation[i] != null) { |
76 | 78 | avecdoc = true; |
77 | documentation[i] = doc.cfg.formatageDoc(documentation[i]); | |
79 | documentation[i] = conf.formatageDoc(documentation[i]); | |
78 | 80 | } |
79 | 81 | String elval = el.getAttribute(noms[i]); |
80 | defauts[i] = doc.cfg.valeurParDefaut(att); | |
82 | defauts[i] = conf.valeurParDefaut(att); | |
81 | 83 | if ("".equals(elval) && defauts[i] != null && el.getAttributeNode(noms[i]) == null) |
82 | 84 | elval = defauts[i]; |
83 | final ArrayList<String> lval = doc.cfg.listeValeursAttribut(att); | |
85 | final ArrayList<String> lval = conf.listeValeursAttribut(att); | |
84 | 86 | if (lval != null && lval.size() > 0) { |
85 | 87 | final JComboBox popup = new JComboBox(); |
86 | 88 | champs[i] = popup; |
88 | 90 | popup.addItem(""); |
89 | 91 | for (int j=0; j<lval.size(); j++) { |
90 | 92 | final String sval = lval.get(j); |
91 | popup.addItem(doc.cfg.titreValeurAttribut(refElement, att, sval)); | |
93 | popup.addItem(conf.titreValeurAttribut(refElement, att, sval)); | |
92 | 94 | if (sval.equals(elval)) { |
93 | 95 | if (defauts[i] == null) |
94 | 96 | popup.setSelectedIndex(j+1); |
98 | 100 | } |
99 | 101 | popup.addItemListener(this); |
100 | 102 | } else { |
101 | final ArrayList<String> lvs = doc.cfg.listeValeursSuggereesAttribut(refElement, att); | |
103 | final ArrayList<String> lvs = conf.listeValeursSuggereesAttribut(refElement, att); | |
102 | 104 | if (lvs != null && lvs.size() > 0) { |
103 | 105 | final JComboBox popup = new JComboBox(); |
104 | 106 | popup.setEditable(true); |
108 | 110 | int indexsel = -1; |
109 | 111 | for (int j=0; j<lvs.size(); j++) { |
110 | 112 | final String sval = lvs.get(j); |
111 | popup.addItem(doc.cfg.titreValeurAttribut(refElement, att, sval)); | |
113 | popup.addItem(conf.titreValeurAttribut(refElement, att, sval)); | |
112 | 114 | if (sval.equals(elval)) { |
113 | 115 | if (defauts[i] == null) |
114 | 116 | indexsel = j+1; |
134 | 136 | } |
135 | 137 | } |
136 | 138 | final boolean attvalide; |
137 | if ("".equals(elval) && !doc.cfg.estObligatoire(att)) | |
139 | if ("".equals(elval) && !conf.estObligatoire(att)) | |
138 | 140 | attvalide = true; |
139 | 141 | else |
140 | attvalide = doc.cfg.attributValide(att, elval); | |
142 | attvalide = conf.attributValide(att, elval); | |
141 | 143 | final ImageIcon icone; |
142 | 144 | if (attvalide) |
143 | 145 | icone = iconeValide; |
179 | 181 | for (int i=0; i<titres.length; i++) { |
180 | 182 | final JLabel label = new JLabel(titres[i]); |
181 | 183 | final Element att = latt.get(i); |
182 | if (doc.cfg.estObligatoire(att)) | |
184 | if (conf.estObligatoire(att)) | |
183 | 185 | label.setForeground(new Color(150, 0, 0)); // rouge foncé |
184 | 186 | else |
185 | 187 | label.setForeground(new Color(0, 100, 0)); // vert foncé |
349 | 351 | indexval = index - 1; |
350 | 352 | else |
351 | 353 | indexval = index; |
352 | final boolean attvalide = !(indexval < 0 && doc.cfg.estObligatoire(att)); | |
354 | final boolean attvalide = !(indexval < 0 && conf.estObligatoire(att)); | |
353 | 355 | final ImageIcon icone; |
354 | 356 | if (!attvalide) |
355 | 357 | icone = iconeInvalide; |
367 | 369 | final String valeur = ((JTextComponent)champs[i]).getText(); |
368 | 370 | final boolean attvalide; |
369 | 371 | final Element att = latt.get(i); |
370 | if ("".equals(valeur) && !doc.cfg.estObligatoire(att)) | |
372 | if ("".equals(valeur) && !conf.estObligatoire(att)) | |
371 | 373 | attvalide = true; |
372 | 374 | else |
373 | attvalide = doc.cfg.attributValide(att, valeur); | |
375 | attvalide = conf.attributValide(att, valeur); | |
374 | 376 | final ImageIcon icone; |
375 | 377 | if (!attvalide) { |
376 | 378 | icone = iconeInvalide; |
405 | 407 | final String valeur; |
406 | 408 | if (indexval >= 0) { |
407 | 409 | final Element att = latt.get(i); |
408 | ArrayList<String> lval = doc.cfg.listeValeursAttribut(att); | |
410 | ArrayList<String> lval = conf.listeValeursAttribut(att); | |
409 | 411 | if (lval == null || lval.size() == 0) |
410 | lval = doc.cfg.listeValeursSuggereesAttribut(refElement, att); | |
412 | lval = conf.listeValeursSuggereesAttribut(refElement, att); | |
411 | 413 | valeur = lval.get(indexval); |
412 | 414 | } else |
413 | 415 | valeur = (String)combo.getSelectedItem(); |
442 | 444 | final String[] rep = lireReponses(); |
443 | 445 | for (int i=0; i<latt.size(); i++) { |
444 | 446 | final Element att = latt.get(i); |
445 | if (doc.cfg.estObligatoire(att) && (rep[i] == null || | |
447 | if (conf.estObligatoire(att) && (rep[i] == null || | |
446 | 448 | "".equals(rep[i]))) { |
447 | 449 | getToolkit().beep(); |
448 | 450 | if (champs[i] instanceof JTextComponent) |
483 | 485 | this.attref = attref; |
484 | 486 | } |
485 | 487 | public void actionPerformed(final ActionEvent e) { |
486 | JOptionPane.showMessageDialog(doc.jframe, doc.cfg.documentationAttribut(refElement, attref), | |
487 | doc.cfg.titreAttribut(refElement, attref), JOptionPane.INFORMATION_MESSAGE); | |
488 | String attdoc = conf.documentationAttribut(refElement, attref); | |
489 | if (attdoc != null) | |
490 | attdoc = conf.formatageDoc(attdoc); | |
491 | JOptionPane.showMessageDialog(doc.jframe, attdoc, | |
492 | conf.titreAttribut(refElement, attref), JOptionPane.INFORMATION_MESSAGE); | |
488 | 493 | } |
489 | 494 | } |
490 | 495 |
0 | /* | |
1 | Jaxe - Editeur XML en Java | |
2 | ||
3 | Copyright (C) 2008 Observatoire de Paris-Meudon | |
4 | ||
5 | Ce programme est un logiciel libre ; vous pouvez le redistribuer et/ou le modifier conformément aux dispositions de la Licence Publique Générale GNU, telle que publiée par la Free Software Foundation ; version 2 de la licence, ou encore (à votre choix) toute version ultérieure. | |
6 | ||
7 | Ce programme est distribué dans l'espoir qu'il sera utile, mais SANS AUCUNE GARANTIE ; sans même la garantie implicite de COMMERCIALISATION ou D'ADAPTATION A UN OBJET PARTICULIER. Pour plus de détail, voir la Licence Publique Générale GNU . | |
8 | ||
9 | Vous devez avoir reçu un exemplaire de la Licence Publique Générale GNU en même temps que ce programme ; si ce n'est pas le cas, écrivez à la Free Software Foundation Inc., 675 Mass Ave, Cambridge, MA 02139, Etats-Unis. | |
10 | */ | |
11 | package jaxe; | |
12 | ||
13 | import java.awt.Toolkit; | |
14 | import java.util.ArrayList; | |
15 | import java.util.Iterator; | |
16 | ||
17 | import javax.swing.JOptionPane; | |
18 | ||
19 | import org.apache.log4j.Logger; | |
20 | import org.w3c.dom.Element; | |
21 | ||
22 | /** | |
23 | * The Default ErrorHandler | |
24 | * @author tasche | |
25 | */ | |
26 | public class ErrorHandler implements ErrorHandlerIf { | |
27 | /** | |
28 | * Logger for this class | |
29 | */ | |
30 | private static final Logger LOG = Logger.getLogger(ErrorHandler.class); | |
31 | ||
32 | private final JaxeDocument doc; | |
33 | ||
34 | /** | |
35 | * @param document | |
36 | */ | |
37 | public ErrorHandler(final JaxeDocument document) { | |
38 | doc = document; | |
39 | } | |
40 | ||
41 | public void childNotAllowedInParentdef(final Element parentdef, final Element defbalise) { | |
42 | final ArrayList<String> autorisees = doc.cfg.nomsSousElements(parentdef); | |
43 | final StringBuilder infos = new StringBuilder(); | |
44 | infos.append(JaxeResourceBundle.getRB().getString("insertion.BalisesAutorisees")); | |
45 | infos.append(" "); | |
46 | infos.append(doc.cfg.nomElement(parentdef)); | |
47 | infos.append(":"); | |
48 | infos.append(Jaxe.newline); | |
49 | final StringBuilder infos1 = new StringBuilder(); | |
50 | int nbnl = 0; | |
51 | final Iterator<String> autIt = autorisees.iterator(); | |
52 | while (autIt.hasNext()) { | |
53 | infos1.append(autIt.next()); | |
54 | if (autIt.hasNext()) { | |
55 | infos1.append(", "); | |
56 | } | |
57 | if (nbnl < infos1.length()/80) { | |
58 | infos1.append(Jaxe.newline); | |
59 | nbnl++; | |
60 | } | |
61 | } | |
62 | infos.append(infos1); | |
63 | if (defbalise != null) { | |
64 | infos.append(Jaxe.newline); | |
65 | infos.append(Jaxe.newline); | |
66 | infos.append(JaxeResourceBundle.getRB().getString("insertion.BalisesParents")); | |
67 | infos.append(" "); | |
68 | infos.append(doc.cfg.nomElement(defbalise)); | |
69 | infos.append(": "); | |
70 | infos.append(Jaxe.newline); | |
71 | final ArrayList<String> lparents = doc.cfg.nomsParents(defbalise); | |
72 | final StringBuilder infos2 = new StringBuilder(); | |
73 | nbnl = 0; | |
74 | final Iterator<String> parIt = lparents.iterator(); | |
75 | while (parIt.hasNext()) { | |
76 | infos2.append(parIt.next()); | |
77 | if (parIt.hasNext()) { | |
78 | infos2.append(", "); | |
79 | } | |
80 | if (nbnl < infos2.length()/80) { | |
81 | infos2.append(Jaxe.newline); | |
82 | nbnl++; | |
83 | } | |
84 | } | |
85 | infos.append(infos2); | |
86 | } | |
87 | JOptionPane.showMessageDialog(doc.textPane.jframe, infos.toString(), | |
88 | JaxeResourceBundle.getRB().getString("insertion.InsertionBalise"), JOptionPane.ERROR_MESSAGE); | |
89 | } | |
90 | ||
91 | public void childNotAllowed(final String expr, final JaxeElement parent, final Element defbalise) { | |
92 | final StringBuilder infos = new StringBuilder(); | |
93 | infos.append(JaxeResourceBundle.getRB().getString("insertion.Expression")); | |
94 | infos.append(" "); | |
95 | infos.append(expr); | |
96 | ||
97 | if (infos.length() > 90) { | |
98 | int p=0; | |
99 | for (int i=0; i<infos.length(); i++) { | |
100 | if (i-p > 80 && (infos.charAt(i) == ' ' || infos.charAt(i) == '|')) { | |
101 | infos.insert(i, "\n"); | |
102 | p = i; | |
103 | } | |
104 | } | |
105 | } | |
106 | JOptionPane.showMessageDialog(doc.textPane.jframe, infos.toString(), | |
107 | JaxeResourceBundle.getRB().getString("insertion.InsertionBalise"), JOptionPane.ERROR_MESSAGE); | |
108 | } | |
109 | ||
110 | public void notInRootError(final Element defbalise) { | |
111 | Toolkit.getDefaultToolkit().beep(); | |
112 | JOptionPane.showMessageDialog(doc.textPane.jframe, | |
113 | JaxeResourceBundle.getRB().getString("insertion.SousRacine"), | |
114 | JaxeResourceBundle.getRB().getString("insertion.InsertionBalise"), | |
115 | JOptionPane.ERROR_MESSAGE); | |
116 | } | |
117 | ||
118 | public void editNotAllowed(final JaxeElement parent, final Element defbalise) { | |
119 | Toolkit.getDefaultToolkit().beep(); | |
120 | JOptionPane.showMessageDialog(doc.textPane.jframe, | |
121 | JaxeResourceBundle.getRB().getString("insertion.EditionInterdite") + | |
122 | " " + parent.noeud.getNodeName(), | |
123 | JaxeResourceBundle.getRB().getString("insertion.InsertionBalise"), | |
124 | JOptionPane.ERROR_MESSAGE); | |
125 | } | |
126 | ||
127 | public void textNotAllowed(final JaxeElement element) { | |
128 | final String infos = JaxeResourceBundle.getRB().getString("erreur.InsertionInterdite") + " " + element.noeud.getNodeName(); | |
129 | JOptionPane.showMessageDialog(doc.textPane.jframe, infos, | |
130 | JaxeResourceBundle.getRB().getString("document.Insertion"), JOptionPane.ERROR_MESSAGE); | |
131 | ||
132 | } | |
133 | ||
134 | } |
0 | /* | |
1 | * Created on 17.02.2004 | |
2 | */ | |
3 | package jaxe; | |
4 | ||
5 | import org.w3c.dom.Element; | |
6 | ||
7 | /** | |
8 | * The Errorhandler shows the Errors to the Users. | |
9 | * It can be overwritten to add better Errorhandling, like | |
10 | * displaying Tips. | |
11 | * | |
12 | * @author tasche | |
13 | * | |
14 | * @deprecated Use InterfaceGestionErreurs instead | |
15 | */ | |
16 | @Deprecated | |
17 | public interface ErrorHandlerIf { | |
18 | /** | |
19 | * The User tried to add an Element before or after the Root-Element | |
20 | * @param defbalise Element the User tried to add | |
21 | */ | |
22 | public void notInRootError(Element defbalise); | |
23 | ||
24 | /** | |
25 | * The User tried to add an Element in an Node that is not editable | |
26 | * @param parent This node was edited | |
27 | * @param defbalise This node was not inserted | |
28 | */ | |
29 | public void editNotAllowed(JaxeElement parent, Element defbalise); | |
30 | ||
31 | /** | |
32 | * A child was not inserted because it is not allowed in the parent-node | |
33 | * @param parentdef Parent | |
34 | * @param defbalise Child that should have been inserted | |
35 | */ | |
36 | public void childNotAllowedInParentdef(Element parentdef, Element defbalise); | |
37 | ||
38 | /** | |
39 | * The childis not allowed in the Parent-Node | |
40 | * @param expr Expr what is allowed in the Parent-Node | |
41 | * @param parent The Parent | |
42 | * @param defbalise The child that should have been inserted | |
43 | */ | |
44 | public void childNotAllowed(String expr, JaxeElement parent, Element defbalise); | |
45 | ||
46 | /** | |
47 | * It is not allowed to insert Text into this Element | |
48 | * @param element no Text allowed here | |
49 | */ | |
50 | public void textNotAllowed(JaxeElement element); | |
51 | }⏎ |
0 | /* | |
1 | Jaxe - Editeur XML en Java | |
2 | ||
3 | Copyright (C) 2008 Observatoire de Paris-Meudon | |
4 | ||
5 | Ce programme est un logiciel libre ; vous pouvez le redistribuer et/ou le modifier conformément aux dispositions de la Licence Publique Générale GNU, telle que publiée par la Free Software Foundation ; version 2 de la licence, ou encore (à votre choix) toute version ultérieure. | |
6 | ||
7 | Ce programme est distribué dans l'espoir qu'il sera utile, mais SANS AUCUNE GARANTIE ; sans même la garantie implicite de COMMERCIALISATION ou D'ADAPTATION A UN OBJET PARTICULIER. Pour plus de détail, voir la Licence Publique Générale GNU . | |
8 | ||
9 | Vous devez avoir reçu un exemplaire de la Licence Publique Générale GNU en même temps que ce programme ; si ce n'est pas le cas, écrivez à la Free Software Foundation Inc., 675 Mass Ave, Cambridge, MA 02139, Etats-Unis. | |
10 | */ | |
11 | package jaxe; | |
12 | ||
13 | import org.w3c.dom.Element; | |
14 | ||
15 | public class ErrorHandlerWrapper implements InterfaceGestionErreurs { | |
16 | ||
17 | private final ErrorHandlerIf _errorHandler; | |
18 | ||
19 | public ErrorHandlerWrapper(final ErrorHandlerIf errorHandler) { | |
20 | _errorHandler = errorHandler; | |
21 | } | |
22 | ||
23 | public void editionInterdite(final JaxeElement parent, final Element refElement) { | |
24 | _errorHandler.editNotAllowed(parent, refElement); | |
25 | } | |
26 | ||
27 | public void enfantInterditSousParent(final JaxeElement parent, final Element refElement) { | |
28 | _errorHandler.childNotAllowedInParentdef((Element) parent.noeud, refElement); | |
29 | } | |
30 | ||
31 | public void insertionImpossible(final String expr, final JaxeElement parent, final Element refElement) { | |
32 | _errorHandler.childNotAllowed(expr, parent, refElement); | |
33 | } | |
34 | ||
35 | public void pasSousLaRacine(final Element refElement) { | |
36 | _errorHandler.notInRootError(refElement); | |
37 | ||
38 | } | |
39 | ||
40 | public void texteInterdit(final JaxeElement parent) { | |
41 | _errorHandler.textNotAllowed(parent); | |
42 | } | |
43 | ||
44 | } |
76 | 76 | } |
77 | 77 | |
78 | 78 | private void dialogueEnregistrement() { |
79 | if (System.getProperty("os.name").startsWith("Mac OS") && doc.jframe instanceof JaxeFrame) // pour éviter un bug avec FileDialog et cmd-v | |
80 | ((JaxeFrame)doc.jframe).getJaxeMenuBar().setEnabled(false); | |
79 | 81 | FileDialog fd = new FileDialog(doc.jframe, null, FileDialog.SAVE); |
80 | 82 | fd.setVisible(true); |
83 | if (System.getProperty("os.name").startsWith("Mac OS") && doc.jframe instanceof JaxeFrame) | |
84 | ((JaxeFrame)doc.jframe).getJaxeMenuBar().setEnabled(true); | |
81 | 85 | final String sf = fd.getFile(); |
82 | 86 | if (sf != null) { |
83 | 87 | File f = new File(fd.getDirectory(), sf); |
98 | 102 | } |
99 | 103 | } |
100 | 104 | |
101 | public File transformation(final File fichierFinal) { | |
105 | public void transformation(final File fichierFinal) { | |
106 | transformation(fichierFinal, null); | |
107 | } | |
108 | ||
109 | public void transformation(final File fichierFinal, final HTMLFrame htmlFrame) { | |
110 | ThreadTransformation th = new ThreadTransformation(fichierFinal, htmlFrame); | |
111 | th.start(); | |
112 | } | |
113 | ||
114 | class ThreadTransformation extends Thread { | |
115 | private File fichierFinal; | |
116 | private HTMLFrame htmlFrame; | |
117 | ThreadTransformation(final File fichierFinal, final HTMLFrame htmlFrame) { | |
118 | this.fichierFinal = fichierFinal; | |
119 | this.htmlFrame = htmlFrame; | |
120 | } | |
121 | @Override | |
122 | public void run() { | |
123 | transformation2(fichierFinal, htmlFrame); | |
124 | } | |
125 | } | |
126 | ||
127 | private void transformation2(final File fichierFinal, final HTMLFrame htmlFrame) { | |
102 | 128 | org.w3c.dom.Document XMLdoc = doc.DOMdoc; |
103 | 129 | File outFile = null; |
104 | 130 | // les feuilles de styles sont utilisées les unes à la suite des autres |
105 | 131 | final ArrayList<File> listeFichiers = doc.cfg.listeFichiersExport(refExport) ; |
106 | for (int i = 0; i < listeFichiers.size(); i++) { | |
107 | final boolean dernierFichier = (i == listeFichiers.size() - 1); | |
108 | final File xslFile = listeFichiers.get(i); | |
109 | if (xslFile == null) { | |
110 | JOptionPane.showMessageDialog(doc.jframe, JaxeResourceBundle.getRB().getString("erreur.XSLNonTrouve"), | |
111 | JaxeResourceBundle.getRB().getString("erreur.Erreur"), JOptionPane.ERROR_MESSAGE); | |
112 | return(outFile); | |
132 | final DialogueAttente attente; | |
133 | if (listeFichiers.size() > 1) | |
134 | attente = new DialogueAttente(doc.jframe, doc.cfg.titreExport(refExport), 0, listeFichiers.size()); | |
135 | else | |
136 | attente = new DialogueAttente(doc.jframe, doc.cfg.titreExport(refExport)); | |
137 | attente.setVisible(true); | |
138 | try { | |
139 | for (int i = 0; i < listeFichiers.size(); i++) { | |
140 | final boolean dernierFichier = (i == listeFichiers.size() - 1); | |
141 | final File xslFile = listeFichiers.get(i); | |
142 | if (xslFile == null) { | |
143 | JOptionPane.showMessageDialog(doc.jframe, JaxeResourceBundle.getRB().getString("erreur.XSLNonTrouve"), | |
144 | JaxeResourceBundle.getRB().getString("erreur.Erreur"), JOptionPane.ERROR_MESSAGE); | |
145 | return; | |
146 | } | |
147 | try { | |
148 | // pour les classes dans le dossier des plugins, qui peuvent être utilisées comme extensions, | |
149 | // on utilise le ClassLoader avec les plugins | |
150 | if (Thread.currentThread().getContextClassLoader() != JEFactory.getPluginClassLoader()) | |
151 | Thread.currentThread().setContextClassLoader(JEFactory.getPluginClassLoader()); | |
152 | ||
153 | final TransformerFactory tFactory = TransformerFactory.newInstance() ; | |
154 | tFactory.setErrorListener(new MyErrorListener()); | |
155 | final Transformer transformer = tFactory.newTransformer(new StreamSource(xslFile)) ; | |
156 | final Map<String, String> parametres = doc.cfg.getXSLParam(xslFile) ; | |
157 | for (final Entry<String, String> parametre : parametres.entrySet()) { | |
158 | if ("jaxe-fichier-xml".equals(parametre.getKey())) | |
159 | transformer.setParameter("jaxe-fichier-xml", doc.fsave.getAbsolutePath()); | |
160 | else if ("jaxe-uri-xml".equals(parametre.getKey())) | |
161 | transformer.setParameter("jaxe-uri-xml", doc.fsave.toURI().toASCIIString()); | |
162 | else if ("jaxe-fichier-xsl".equals(parametre.getKey())) | |
163 | transformer.setParameter("jaxe-fichier-xsl", xslFile.getAbsolutePath()); | |
164 | else if ("jaxe-uri-xsl".equals(parametre.getKey())) | |
165 | transformer.setParameter("jaxe-uri-xsl", xslFile.toURI().toASCIIString()); | |
166 | else if ("jaxe-fichier-destination".equals(parametre.getKey())) | |
167 | transformer.setParameter("jaxe-fichier-destination", fichierFinal.getAbsolutePath()); | |
168 | else if ("jaxe-uri-destination".equals(parametre.getKey())) | |
169 | transformer.setParameter("jaxe-uri-destination", fichierFinal.toURI().toASCIIString()); | |
170 | else | |
171 | transformer.setParameter(parametre.getKey(),parametre.getValue()) ; | |
172 | } | |
173 | if (dernierFichier) | |
174 | outFile = fichierFinal; | |
175 | else { | |
176 | outFile = java.io.File.createTempFile("tmp",".xml") ; | |
177 | outFile.deleteOnExit() ; | |
178 | } | |
179 | final DOMSource ds = new DOMSource(XMLdoc); | |
180 | if (doc.fsave != null) | |
181 | ds.setSystemId(doc.fsave.toURI().toURL().toExternalForm()); | |
182 | final FileOutputStream fos = new FileOutputStream(outFile); | |
183 | Result res; | |
184 | if (dernierFichier && "PDF".equals(doc.cfg.sortieExport(refExport))) { | |
185 | final Fop fop = FopFactory.newInstance().newFop(MimeConstants.MIME_PDF, fos); | |
186 | res = new SAXResult(fop.getDefaultHandler()); | |
187 | } else | |
188 | res = new StreamResult(fos); | |
189 | transformer.transform(ds, res); | |
190 | fos.close(); | |
191 | } catch (final Exception ex) { | |
192 | afficherErreur(ex); | |
193 | return; | |
194 | } | |
195 | ||
196 | if (!dernierFichier) { | |
197 | try { | |
198 | final DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance(); | |
199 | dbf.setNamespaceAware(true); | |
200 | final DocumentBuilder parser = dbf.newDocumentBuilder(); | |
201 | XMLdoc = parser.parse(outFile); | |
202 | } catch (final Exception e) { | |
203 | LOG.error("miseAJour()", e); | |
204 | return; | |
205 | } | |
206 | } | |
207 | if (listeFichiers.size() > 1) | |
208 | attente.setProgress(i+1); | |
113 | 209 | } |
114 | try { | |
115 | // pour les classes dans le dossier des plugins, qui peuvent être utilisées comme extensions, | |
116 | // on utilise le ClassLoader avec les plugins | |
117 | if (Thread.currentThread().getContextClassLoader() != JEFactory.getPluginClassLoader()) | |
118 | Thread.currentThread().setContextClassLoader(JEFactory.getPluginClassLoader()); | |
119 | ||
120 | final TransformerFactory tFactory = TransformerFactory.newInstance() ; | |
121 | tFactory.setErrorListener(new MyErrorListener()); | |
122 | final Transformer transformer = tFactory.newTransformer(new StreamSource(xslFile)) ; | |
123 | final Map<String, String> parametres = doc.cfg.getXSLParam(xslFile) ; | |
124 | for (final Entry<String, String> parametre : parametres.entrySet()) { | |
125 | if ("jaxe-fichier-xml".equals(parametre.getKey())) | |
126 | transformer.setParameter("jaxe-fichier-xml", doc.fsave.getAbsolutePath()); | |
127 | else if ("jaxe-uri-xml".equals(parametre.getKey())) | |
128 | transformer.setParameter("jaxe-uri-xml", doc.fsave.toURI().toASCIIString()); | |
129 | else if ("jaxe-fichier-xsl".equals(parametre.getKey())) | |
130 | transformer.setParameter("jaxe-fichier-xsl", xslFile.getAbsolutePath()); | |
131 | else if ("jaxe-uri-xsl".equals(parametre.getKey())) | |
132 | transformer.setParameter("jaxe-uri-xsl", xslFile.toURI().toASCIIString()); | |
133 | else | |
134 | transformer.setParameter(parametre.getKey(),parametre.getValue()) ; | |
135 | } | |
136 | if (dernierFichier) | |
137 | outFile = fichierFinal; | |
138 | else { | |
139 | outFile = java.io.File.createTempFile("tmp",".xml") ; | |
140 | outFile.deleteOnExit() ; | |
141 | } | |
142 | final DOMSource ds = new DOMSource(XMLdoc); | |
143 | if (doc.fsave != null) | |
144 | ds.setSystemId(doc.fsave.toURI().toURL().toExternalForm()); | |
145 | final FileOutputStream fos = new FileOutputStream(outFile); | |
146 | Result res; | |
147 | if (dernierFichier && "PDF".equals(doc.cfg.sortieExport(refExport))) { | |
148 | final Fop fop = FopFactory.newInstance().newFop(MimeConstants.MIME_PDF, fos); | |
149 | res = new SAXResult(fop.getDefaultHandler()); | |
150 | } else | |
151 | res = new StreamResult(fos); | |
152 | transformer.transform(ds, res); | |
153 | fos.close(); | |
154 | } catch (final Exception ex) { | |
155 | afficherErreur(ex); | |
156 | return(outFile); | |
157 | } | |
158 | ||
159 | if (!dernierFichier) { | |
160 | try { | |
161 | final DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance(); | |
162 | dbf.setNamespaceAware(true); | |
163 | final DocumentBuilder parser = dbf.newDocumentBuilder(); | |
164 | XMLdoc = parser.parse(outFile); | |
165 | } catch (final Exception e) { | |
166 | LOG.error("miseAJour()", e); | |
167 | return(outFile); | |
168 | } | |
169 | } | |
170 | } | |
171 | return(outFile); | |
210 | } finally { | |
211 | attente.setVisible(false); | |
212 | if (htmlFrame != null) | |
213 | htmlFrame.afficherHTML(outFile); | |
214 | } | |
172 | 215 | } |
173 | 216 | |
174 | 217 | private void afficherErreur(final Exception ex) { |
142 | 142 | if (listeExportsHTML == null || listeExportsHTML.size() == 0) |
143 | 143 | return; |
144 | 144 | final Export exp = new Export(doc, listeExportsHTML.get(0)); |
145 | final File outFile = exp.transformation(fichierHTML(doc.fsave)); | |
146 | ||
145 | exp.transformation(fichierHTML(doc.fsave), this); // appelle afficherHTML à la fin | |
146 | } | |
147 | ||
148 | public void afficherHTML(final File outFile) { | |
147 | 149 | try { |
148 | 150 | affichage(); // pour refaire textPane, sinon update marche pas |
149 | 151 | if (outFile != null) { |
68 | 68 | * (sous forme de texte simple, ou de HTML 3 pour faire des sauts de lignes) |
69 | 69 | */ |
70 | 70 | public String documentationElement(final Element refElement); |
71 | ||
72 | /** | |
73 | * Renvoie la liste des valeurs possibles pour un élément, à partir de sa référence. | |
74 | * Renvoie null s'il y a un nombre infini de valeurs possibles ou si l'élément n'a pas un type simple. | |
75 | */ | |
76 | public ArrayList<String> listeValeursElement(final Element refElement); | |
71 | 77 | |
72 | 78 | /** |
73 | 79 | * Renvoie la liste des espaces de noms (String) utilisés par ce schéma. |
136 | 136 | if ("plugin".equals(typeAffichage)) { |
137 | 137 | final String classid = doc.cfg.valeurParametreElement(refElement, typeNoeud, nom, "classe", null); |
138 | 138 | try { |
139 | final Class c = Class.forName(classid, true, pluginClassLoader); | |
139 | final Class<?> c = Class.forName(classid, true, pluginClassLoader); | |
140 | 140 | Constructor cons = null; |
141 | 141 | try { |
142 | 142 | cons = c.getConstructor(JaxeDocument.class); |
118 | 118 | private final List<JaxeEditListenerIf> _editListener; |
119 | 119 | |
120 | 120 | private boolean _ignorer = false; |
121 | ||
122 | private ErrorHandlerIf errorHandler; | |
123 | ||
121 | ||
122 | ||
124 | 123 | public JaxeDocument() { |
125 | 124 | super(); |
126 | 125 | setDefaultStyle(); |
130 | 129 | public JaxeDocument(final String nomFichierCfg) { |
131 | 130 | super(); |
132 | 131 | this.nomFichierCfg = nomFichierCfg; |
133 | if (nomFichierCfg != null) cfg = new Config(nomFichierCfg, true); | |
132 | if (nomFichierCfg != null) { | |
133 | try { | |
134 | cfg = new Config(nomFichierCfg, true); | |
135 | } catch (JaxeException ex) { | |
136 | JOptionPane.showMessageDialog(jframe, ex.getMessage(), | |
137 | rb.getString("erreur.Erreur"), JOptionPane.ERROR_MESSAGE); | |
138 | cfg = null; | |
139 | } | |
140 | } | |
134 | 141 | setDefaultStyle(); |
135 | 142 | _editListener = new ArrayList<JaxeEditListenerIf>(); |
136 | 143 | } |
147 | 154 | this.textPane = textPane; |
148 | 155 | this.nomFichierCfg = nomFichierCfg; |
149 | 156 | jframe = textPane.jframe; |
150 | if (nomFichierCfg != null) cfg = new Config(nomFichierCfg, true); | |
157 | if (nomFichierCfg != null) { | |
158 | try { | |
159 | cfg = new Config(nomFichierCfg, true); | |
160 | } catch (JaxeException ex) { | |
161 | JOptionPane.showMessageDialog(jframe, ex.getMessage(), | |
162 | rb.getString("erreur.Erreur"), JOptionPane.ERROR_MESSAGE); | |
163 | cfg = null; | |
164 | } | |
165 | } | |
151 | 166 | setDefaultStyle(); |
152 | 167 | _editListener = new ArrayList<JaxeEditListenerIf>(); |
153 | } | |
154 | ||
155 | /** | |
156 | * Sets the Errorhandler for this Document | |
157 | * | |
158 | * @param error | |
159 | * Errorhandler | |
160 | * @deprecated | |
161 | */ | |
162 | public void setErrorHandler(final ErrorHandlerIf error) { | |
163 | errorHandler = error; | |
164 | gestionErreurs = new ErrorHandlerWrapper(error); | |
165 | } | |
166 | ||
167 | /** | |
168 | * Returns the ErrorHandler for this Document | |
169 | * | |
170 | * @return ErrorHandler | |
171 | * @deprecated | |
172 | */ | |
173 | public ErrorHandlerIf getErrorHandler() { | |
174 | return errorHandler; | |
175 | // return(null); | |
176 | 168 | } |
177 | 169 | |
178 | 170 | /** |
396 | 388 | |
397 | 389 | if (urlFichierCfg != null) { |
398 | 390 | nomFichierCfg = urlFichierCfg.getPath(); |
399 | cfg = new Config(urlFichierCfg, true); | |
391 | try { | |
392 | cfg = new Config(urlFichierCfg, true); | |
393 | } catch (JaxeException ex) { | |
394 | JOptionPane.showMessageDialog(jframe, ex.getMessage(), | |
395 | rb.getString("erreur.Erreur"), JOptionPane.ERROR_MESSAGE); | |
396 | cfg = null; | |
397 | } | |
400 | 398 | } else |
401 | 399 | nomFichierCfg = null; |
402 | 400 | |
403 | if (urlFichierCfg == null) | |
401 | if (urlFichierCfg == null || cfg == null) | |
404 | 402 | rootJE = new JEInconnu(this); |
405 | 403 | else { |
406 | 404 | final Element refracine = cfg.getElementRef(rootel); |
626 | 624 | final URL cfgURL = cfgFile.toURI().toURL(); |
627 | 625 | final ArrayList<String> noms = Config.nomsElementsRacine(cfgURL); |
628 | 626 | if (noms.contains(Config.localValue(rootel.getTagName()))) { |
629 | final Config cfgTest = new Config(cfgURL, true); | |
630 | final String rootns = rootel.getNamespaceURI(); | |
631 | final String cfgns = cfgTest.espaceCible(); | |
632 | if ((rootns != null && rootns.equals(cfgns)) || | |
633 | (rootns == null && (cfgns == null || "".equals(cfgns)))) { | |
634 | nomFichierCfg = cfgFile.getPath(); | |
635 | cfg = cfgTest; | |
636 | break; | |
627 | try { | |
628 | final Config cfgTest = new Config(cfgURL, true); | |
629 | final String rootns = rootel.getNamespaceURI(); | |
630 | final String cfgns = cfgTest.espaceCible(); | |
631 | if ((rootns != null && rootns.equals(cfgns)) || | |
632 | (rootns == null && (cfgns == null || "".equals(cfgns)))) { | |
633 | nomFichierCfg = cfgFile.getPath(); | |
634 | cfg = cfgTest; | |
635 | break; | |
636 | } | |
637 | } catch (JaxeException ex) { | |
637 | 638 | } |
638 | 639 | } |
639 | 640 | } catch (final MalformedURLException ex) { |
0 | /** | |
1 | * (c) Lexis Nexis Deutschland, 2004 | |
2 | */ | |
0 | /* | |
1 | Jaxe - Editeur XML en Java | |
2 | ||
3 | Copyright (C) Lexis Nexis Deutschland, 2004 | |
4 | ||
5 | Ce programme est un logiciel libre ; vous pouvez le redistribuer et/ou le modifier conformément aux dispositions de la Licence Publique Générale GNU, telle que publiée par la Free Software Foundation ; version 2 de la licence, ou encore (à votre choix) toute version ultérieure. | |
6 | ||
7 | Ce programme est distribué dans l'espoir qu'il sera utile, mais SANS AUCUNE GARANTIE ; sans même la garantie implicite de COMMERCIALISATION ou D'ADAPTATION A UN OBJET PARTICULIER. Pour plus de détail, voir la Licence Publique Générale GNU . | |
8 | ||
9 | Vous devez avoir reçu un exemplaire de la Licence Publique Générale GNU en même temps que ce programme ; si ce n'est pas le cas, écrivez à la Free Software Foundation Inc., 675 Mass Ave, Cambridge, MA 02139, Etats-Unis. | |
10 | */ | |
11 | ||
3 | 12 | package jaxe; |
4 | 13 | |
5 | 14 | import org.apache.log4j.Logger; |
0 | /** | |
1 | * (c) Lexis Nexis Deutschland, 2004 | |
2 | */ | |
0 | /* | |
1 | Jaxe - Editeur XML en Java | |
2 | ||
3 | Copyright (C) Lexis Nexis Deutschland, 2004 | |
4 | ||
5 | Ce programme est un logiciel libre ; vous pouvez le redistribuer et/ou le modifier conformément aux dispositions de la Licence Publique Générale GNU, telle que publiée par la Free Software Foundation ; version 2 de la licence, ou encore (à votre choix) toute version ultérieure. | |
6 | ||
7 | Ce programme est distribué dans l'espoir qu'il sera utile, mais SANS AUCUNE GARANTIE ; sans même la garantie implicite de COMMERCIALISATION ou D'ADAPTATION A UN OBJET PARTICULIER. Pour plus de détail, voir la Licence Publique Générale GNU . | |
8 | ||
9 | Vous devez avoir reçu un exemplaire de la Licence Publique Générale GNU en même temps que ce programme ; si ce n'est pas le cas, écrivez à la Free Software Foundation Inc., 675 Mass Ave, Cambridge, MA 02139, Etats-Unis. | |
10 | */ | |
11 | ||
3 | 12 | package jaxe; |
4 | 13 | |
5 | 14 | import javax.swing.text.Position; |
76 | 76 | |
77 | 77 | public JaxeDocument doc; |
78 | 78 | |
79 | public ArrayList<Object> jcomps = new ArrayList<Object>(); // de JComponent ou Icon | |
80 | ||
81 | public ArrayList<Position> compos = new ArrayList<Position>(); // de Position (positions des | |
79 | public ArrayList<Object> jcomps = null; // de JComponent ou Icon | |
80 | ||
81 | public ArrayList<Position> compos = null; // de Position (positions des | |
82 | 82 | // composants) |
83 | 83 | |
84 | 84 | private boolean effacementAutorise = true; |
169 | 169 | * plus du texte |
170 | 170 | */ |
171 | 171 | public ArrayList<Object> getComponents() { |
172 | if (jcomps == null) | |
173 | return(new ArrayList<Object>()); | |
172 | 174 | return jcomps; |
173 | 175 | } |
174 | 176 | |
176 | 178 | * Renvoit la liste des positions dans le texte des composants graphiques |
177 | 179 | */ |
178 | 180 | public ArrayList<Position> getComponentPositions() { |
181 | if (compos == null) | |
182 | return(new ArrayList<Position>()); | |
179 | 183 | return compos; |
180 | 184 | } |
181 | 185 | |
230 | 234 | StyleConstants.setComponent(s, comp); |
231 | 235 | try { |
232 | 236 | doc.insertString(pos.getOffset(), "*", s, false); |
237 | if (jcomps == null) | |
238 | jcomps = new ArrayList<Object>(2); | |
233 | 239 | jcomps.add(comp); |
240 | if (compos == null) | |
241 | compos = new ArrayList<Position>(2); | |
234 | 242 | compos.add(doc.createPosition(pos.getOffset() - 1)); |
235 | 243 | if (debut == null) debut = doc.createPosition(offsetdebut); |
236 | 244 | fin = doc.createPosition(offsetdebut); |
252 | 260 | StyleConstants.setIcon(s, icon); |
253 | 261 | try { |
254 | 262 | doc.insertString(pos.getOffset(), "*", s, false); |
263 | if (jcomps == null) | |
264 | jcomps = new ArrayList<Object>(2); | |
255 | 265 | jcomps.add(icon); |
266 | if (compos == null) | |
267 | compos = new ArrayList<Position>(2); | |
256 | 268 | compos.add(doc.createPosition(pos.getOffset() - 1)); |
257 | 269 | if (debut == null) debut = doc.createPosition(offsetdebut); |
258 | 270 | fin = doc.createPosition(offsetdebut); |
427 | 439 | je.effacer(); |
428 | 440 | } |
429 | 441 | } |
430 | for (final Object o : jcomps) { | |
431 | if (o instanceof JComponent && ((JComponent) o).getParent() != null) { | |
432 | final JComponent comp = (JComponent) o; | |
433 | comp.getParent().remove(comp); | |
434 | } | |
435 | } | |
436 | jcomps = new ArrayList<Object>(); | |
437 | compos = new ArrayList<Position>(); | |
442 | if (jcomps != null) { | |
443 | for (final Object o : jcomps) { | |
444 | if (o instanceof JComponent && ((JComponent) o).getParent() != null) { | |
445 | final JComponent comp = (JComponent) o; | |
446 | comp.getParent().remove(comp); | |
447 | } | |
448 | } | |
449 | jcomps = null; | |
450 | } | |
451 | compos = null; | |
438 | 452 | } |
439 | 453 | |
440 | 454 | /** |
726 | 740 | newje = oldje; |
727 | 741 | newje.debut = null; |
728 | 742 | newje.fin = null; |
729 | newje.jcomps = new ArrayList<Object>(); | |
730 | newje.compos = new ArrayList<Position>(); | |
743 | newje.jcomps = null; | |
744 | newje.compos = null; | |
731 | 745 | } else |
732 | 746 | newje = JEFactory.createJE(doc, elref, n.getNodeName(), typeNoeud, n); |
733 | 747 | newje.creer(newpos, n); |
782 | 796 | return result; |
783 | 797 | } |
784 | 798 | |
785 | public boolean hasProcessing(final Node n) { | |
799 | public static boolean hasProcessing(final Node n) { | |
786 | 800 | boolean result = false; |
787 | 801 | final Node child = n.getFirstChild(); |
788 | 802 | if (child != null) { |
795 | 809 | return result; |
796 | 810 | } |
797 | 811 | |
798 | public ProcessingInstruction getProcessing(final Node n) { | |
812 | public static ProcessingInstruction getProcessing(final Node n) { | |
799 | 813 | ProcessingInstruction result = null; |
800 | 814 | final Node child = n.getFirstChild(); |
801 | 815 | if (child != null) { |
1033 | 1047 | * Sélection de la zone de texte où se trouve cet élément |
1034 | 1048 | */ |
1035 | 1049 | public void selection(final boolean select) { |
1036 | for (final Object comp : jcomps) { | |
1037 | if (comp instanceof Balise) | |
1038 | ((Balise) comp).selection(select); | |
1050 | if (jcomps != null) { | |
1051 | for (final Object comp : jcomps) { | |
1052 | if (comp instanceof Balise) | |
1053 | ((Balise) comp).selection(select); | |
1054 | } | |
1039 | 1055 | } |
1040 | 1056 | for (Node n = noeud.getFirstChild(); n != null; n = n.getNextSibling()) { |
1041 | 1057 | final JaxeElement je = doc.getElementForNode(n); |
1044 | 1060 | } |
1045 | 1061 | } |
1046 | 1062 | |
1047 | public boolean sameStyle(final JaxeElement source, final JaxeElement target) { | |
1063 | public static boolean sameStyle(final JaxeElement source, final JaxeElement target) { | |
1048 | 1064 | if (!(source instanceof JEStyle && target instanceof JEStyle)) |
1049 | 1065 | return false; |
1050 | 1066 | final List<String> s1 = new ArrayList<String>(); |
1201 | 1217 | } |
1202 | 1218 | |
1203 | 1219 | |
1204 | protected String getString(final String key) { | |
1205 | return (JaxeResourceBundle.getRB().getString(key)); | |
1220 | protected static String getString(final String key) { | |
1221 | return(JaxeResourceBundle.getRB().getString(key)); | |
1206 | 1222 | } |
1207 | 1223 | |
1208 | 1224 | public void changerStyle(final String style, final int offset, final int longueur) { |
1239 | 1255 | } |
1240 | 1256 | } |
1241 | 1257 | |
1242 | private Color obtenezCouleur(final String arg, Color result) { | |
1258 | private static Color obtenezCouleur(final String arg, Color result) { | |
1243 | 1259 | final Matcher m = COLOR_PATTERN.matcher(arg); |
1244 | 1260 | if (m.matches()) { |
1245 | 1261 | boolean error = false; |
0 | /* | |
1 | Jaxe - Editeur XML en Java | |
2 | ||
3 | Copyright (C) 2009 Observatoire de Paris-Meudon | |
4 | ||
5 | Ce programme est un logiciel libre ; vous pouvez le redistribuer et/ou le modifier conformément aux dispositions de la Licence Publique Générale GNU, telle que publiée par la Free Software Foundation ; version 2 de la licence, ou encore (à votre choix) toute version ultérieure. | |
6 | ||
7 | Ce programme est distribué dans l'espoir qu'il sera utile, mais SANS AUCUNE GARANTIE ; sans même la garantie implicite de COMMERCIALISATION ou D'ADAPTATION A UN OBJET PARTICULIER. Pour plus de détail, voir la Licence Publique Générale GNU . | |
8 | ||
9 | Vous devez avoir reçu un exemplaire de la Licence Publique Générale GNU en même temps que ce programme ; si ce n'est pas le cas, écrivez à la Free Software Foundation Inc., 675 Mass Ave, Cambridge, MA 02139, Etats-Unis. | |
10 | */ | |
11 | ||
12 | package jaxe; | |
13 | ||
14 | public class JaxeException extends Exception { | |
15 | ||
16 | public JaxeException(final String message) { | |
17 | super(message); | |
18 | } | |
19 | ||
20 | public JaxeException(final Exception ex) { | |
21 | super(ex); | |
22 | } | |
23 | ||
24 | public JaxeException(final String message, final Exception ex) { | |
25 | super(message, ex); | |
26 | } | |
27 | ||
28 | } |
587 | 587 | } |
588 | 588 | |
589 | 589 | public void enregistrerSous() { |
590 | if (System.getProperty("os.name").startsWith("Mac OS")) // pour éviter un bug avec FileDialog et cmd-v | |
591 | menuBar.setEnabled(false); | |
590 | 592 | FileDialog fd = new FileDialog(this, null, FileDialog.SAVE); |
591 | 593 | if (System.getProperty("os.name").indexOf("Linux") != -1 && JaxeMenuBar.dernierRepertoire != null) |
592 | 594 | fd.setDirectory(JaxeMenuBar.dernierRepertoire); |
593 | 595 | fd.setVisible(true); |
596 | if (System.getProperty("os.name").startsWith("Mac OS")) | |
597 | menuBar.setEnabled(true); | |
594 | 598 | final String sf = fd.getFile(); |
595 | 599 | if (sf != null) { |
596 | 600 | JaxeMenuBar.dernierRepertoire = fd.getDirectory(); |
774 | 778 | } else |
775 | 779 | action.setEnabled(true); |
776 | 780 | } |
781 | } else if (action instanceof ActionFonction) { | |
782 | action.setEnabled(true); | |
783 | anyenab = true; | |
777 | 784 | } else if (item instanceof JMenu) |
778 | 785 | anyenab = majMenu((JMenu)item, parentconf, autorisees) || anyenab; |
779 | 786 | } |
425 | 425 | final ArrayList<Element> exportsPDF = doc.cfg.listeExports("PDF"); |
426 | 426 | if (exportsPDF != null) |
427 | 427 | exports.addAll(exportsPDF); |
428 | final ArrayList<Element> exportsHTML = doc.cfg.listeExports("HTML"); | |
429 | if (exportsHTML != null && exportsHTML.size() > 1) | |
430 | exports.addAll(exportsHTML); | |
428 | 431 | if (exports != null && exports.size() > 0) { |
429 | 432 | int pos = 6; |
430 | 433 | fileMenu.insertSeparator(pos++); |
340 | 340 | |
341 | 341 | ActionAide(final Element refElement) { |
342 | 342 | super(JaxeResourceBundle.getRB().getString("aide.element") + " " |
343 | + doc.cfg.nomElement(refElement)); | |
343 | + doc.cfg.titreElement(refElement)); | |
344 | 344 | this.refElement = refElement; |
345 | 345 | } |
346 | 346 | |
513 | 513 | return; |
514 | 514 | } |
515 | 515 | // bidouille pour afficher la position en haut de la fenêtre |
516 | try { | |
517 | doc.textPane.scrollRectToVisible(doc.textPane.modelToView(doc.getLength())); | |
518 | final Rectangle rDebut = new Rectangle(ptDebut); | |
519 | doc.textPane.scrollRectToVisible(rDebut); | |
520 | } catch (final BadLocationException ex) { | |
521 | LOG.error("JaxeTextPane.allerElement scrollRectToVisible", ex); | |
522 | } | |
516 | final Rectangle rDebut = new Rectangle(ptDebut); | |
517 | rDebut.height = doc.textPane.getVisibleRect().height - 1; | |
518 | doc.textPane.scrollRectToVisible(rDebut); | |
523 | 519 | } |
524 | 520 | |
525 | 521 | public void debutIgnorerEdition() { |
64 | 64 | |
65 | 65 | @Override |
66 | 66 | public boolean canImport(JComponent comp, DataFlavor[] transferFlavors) { |
67 | if (!(comp instanceof JaxeTextPane)) | |
68 | return(false); | |
67 | 69 | final JTextComponent c = (JTextComponent)comp; |
68 | 70 | if (!(c.isEditable() && c.isEnabled())) |
69 | 71 | return false; |
177 | 179 | if (parent != null && (parent instanceof JETexte || |
178 | 180 | (parent.debut.getOffset() == pos && !(parent instanceof JESwing)))) |
179 | 181 | parent = parent.getParent(); |
180 | if (frag != null && (parent == null || !(parent instanceof JECommentaire || parent instanceof JECData))) | |
181 | return(tp.doc.coller(frag, ppos)); | |
182 | else if (reffichier != null && data instanceof Image && tp.doc.fsave != null) | |
182 | if (frag != null && (parent == null || !(parent instanceof JECommentaire || parent instanceof JECData))) { | |
183 | boolean effaceSelection = false; | |
184 | if (tp.getSelectionStart() != tp.getSelectionEnd()) { | |
185 | effaceSelection = true; | |
186 | tp.debutEditionSpeciale(JaxeResourceBundle.getRB().getString("menus.Coller"), false); | |
187 | tp.doc.remove(tp.getSelectionStart(), tp.getSelectionEnd() - tp.getSelectionStart()); | |
188 | } | |
189 | final boolean accept = tp.doc.coller(frag, ppos); | |
190 | if (effaceSelection) { | |
191 | tp.finEditionSpeciale(); | |
192 | if (!accept) | |
193 | tp.undo(); | |
194 | } | |
195 | return(accept); | |
196 | } else if (reffichier != null && data instanceof Image && tp.doc.fsave != null) | |
183 | 197 | JEFichier.collerImage((Image)data, tp.doc, ppos, reffichier); |
184 | 198 | else if (reffichier != null && |
185 | 199 | flavor.getMimeType().startsWith("image/x-pict") && |
210 | 210 | développé dans le cadre du projet <i>Astrophysique sur Mesure</i><br><br> \ |
211 | 211 | avec la participation de contributeurs sur SourceForge<br><br> \ |
212 | 212 | Licence GPL <br><br> \ |
213 | Version 3.2 <br><br> \ | |
213 | Version 3.3 <br><br> \ | |
214 | 214 | <font size="-1"><tt>http://jaxe.sourceforge.net/Jaxe.html</tt></font></div></html> |
215 | 215 | |
216 | 216 | # validation |
210 | 210 | Entwickelt für das Projekt <i>Astrophysique sur Mesure</i><br><br> \ |
211 | 211 | mit der Hilfe von Unterstützern per SourceForge<br><br> \ |
212 | 212 | Licence GPL <br><br> \ |
213 | Version 3.2 <br><br> \ | |
213 | Version 3.3 <br><br> \ | |
214 | 214 | <font size="-1"><tt>http://jaxe.sourceforge.net/</tt></font></div></html> |
215 | 215 | |
216 | 216 | # validation |
210 | 210 | developed for the project <i>Astrophysique sur Mesure</i><br><br> \ |
211 | 211 | with the help of SourceForge contributors<br><br> \ |
212 | 212 | GPL Licence<br><br> \ |
213 | Version 3.2 <br><br> \ | |
213 | Version 3.3 <br><br> \ | |
214 | 214 | <font size="-1"><tt>http://jaxe.sourceforge.net/</tt></font></div></html> |
215 | 215 | |
216 | 216 | # validation |
205 | 205 | valeur = valor |
206 | 206 | |
207 | 207 | # About dialog |
208 | apropos.texte = <html><div align\="center"> Jaxe - <b>Ja</b>va <b>X</b>ML <b>E</b>ditor<br><br> desarrolloado por el proyecto <i>Astrophysique sur Mesure</i><br><br> con la ayuda de SourceForge contributors<br><br> GPL Licence<br><br> Version 3.2 <br><br> <font size\="-1"><tt>http\://jaxe.sourceforge.net/</tt></font></div></html> | |
208 | apropos.texte = <html><div align\="center"> \ | |
209 | Jaxe - <b>Ja</b>va <b>X</b>ML <b>E</b>ditor<br><br> \ | |
210 | desarrolloado por el proyecto <i>Astrophysique sur Mesure</i><br><br> \ | |
211 | con la ayuda de SourceForge contributors<br><br> \ | |
212 | GPL Licence<br><br> \ | |
213 | Version 3.3 <br><br> \ | |
214 | <font size\="-1"><tt>http\://jaxe.sourceforge.net/</tt></font></div></html> | |
209 | 215 | |
210 | 216 | # validation |
211 | 217 | validation.Validation = Validación |
210 | 210 | desenvolvido pelo projeto <i>Astrophysique sur Mesure</i><br><br> \ |
211 | 211 | com a ajuda dos contribuidores SourceForge <br><br> \ |
212 | 212 | Licença GPL<br><br> \ |
213 | Versão 3.2 <br><br> \ | |
213 | Versão 3.3 <br><br> \ | |
214 | 214 | <font size="-1"><tt>http://jaxe.sourceforge.net/</tt></font></div></html> |
215 | 215 | |
216 | 216 | # validation |
210 | 210 | \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0430\u043d \u0434\u043b\u044f \u043f\u0440\u043e\u0435\u043a\u0442\u0430 <i>Astrophysique sur Mesure</i><br><br> \ |
211 | 211 | \u0431\u043b\u0430\u0433\u043e\u0434\u0430\u0440\u044f \u043f\u043e\u043c\u043e\u0449\u043d\u0438\u043a\u0430\u043c \u043d\u0430 \u0441\u0430\u0439\u0442\u0435 SourceForge <br><br> \ |
212 | 212 | \u041b\u0438\u0446\u0435\u043d\u0437\u0438\u044f GPL<br><br> \ |
213 | Version 3.2 <br><br> \ | |
213 | Version 3.3 <br><br> \ | |
214 | 214 | <font size="-1"><tt>http://jaxe.sourceforge.net/</tt></font></div></html> |
215 | 215 | |
216 | 216 | # validation |
0 | /** | |
1 | * (c) Lexis Nexis Deutschland, 2005 | |
2 | */ | |
0 | /* | |
1 | Jaxe - Editeur XML en Java | |
2 | ||
3 | Copyright (C) Lexis Nexis Deutschland, 2005 | |
4 | ||
5 | Ce programme est un logiciel libre ; vous pouvez le redistribuer et/ou le modifier conformément aux dispositions de la Licence Publique Générale GNU, telle que publiée par la Free Software Foundation ; version 2 de la licence, ou encore (à votre choix) toute version ultérieure. | |
6 | ||
7 | Ce programme est distribué dans l'espoir qu'il sera utile, mais SANS AUCUNE GARANTIE ; sans même la garantie implicite de COMMERCIALISATION ou D'ADAPTATION A UN OBJET PARTICULIER. Pour plus de détail, voir la Licence Publique Générale GNU . | |
8 | ||
9 | Vous devez avoir reçu un exemplaire de la Licence Publique Générale GNU en même temps que ce programme ; si ce n'est pas le cas, écrivez à la Free Software Foundation Inc., 675 Mass Ave, Cambridge, MA 02139, Etats-Unis. | |
10 | */ | |
11 | ||
3 | 12 | package jaxe; |
4 | 13 | |
5 | 14 | import org.apache.log4j.Logger; |
317 | 317 | enfant = enfant.getNextSibling(); |
318 | 318 | } |
319 | 319 | return(null); |
320 | } | |
321 | ||
322 | /** | |
323 | * Renvoie la liste des valeurs possibles pour un élément, à partir de sa référence. | |
324 | * Renvoie null s'il y a un nombre infini de valeurs possibles ou si l'élément n'a pas un type simple. | |
325 | */ | |
326 | public ArrayList<String> listeValeursElement(final Element refElement) { | |
327 | final LinkedHashSet<String> liste = new LinkedHashSet<String>(); | |
328 | Node enfant = refElement.getFirstChild(); | |
329 | while (enfant != null) { | |
330 | if (enfant.getNodeType() == Node.ELEMENT_NODE) { | |
331 | final String nom = enfant.getNodeName(); | |
332 | if (nom.equals("choice")) { | |
333 | ArrayList<String> liste2 = listeValeursAttribut((Element)enfant); | |
334 | if (liste2 != null) | |
335 | liste.addAll(liste2); | |
336 | } else if (nom.equals("value")) | |
337 | liste.add(enfant.getFirstChild().getNodeValue()); | |
338 | } | |
339 | enfant = enfant.getNextSibling(); | |
340 | } | |
341 | if (liste.size() == 0) | |
342 | return(null); | |
343 | return(new ArrayList<String>(liste)); | |
320 | 344 | } |
321 | 345 | |
322 | 346 | /** |
91 | 91 | * (sous forme de texte simple, ou de HTML 3 pour faire des sauts de lignes) |
92 | 92 | */ |
93 | 93 | public String documentationElement(final Element refElement) { |
94 | return(null); | |
95 | } | |
96 | ||
97 | /** | |
98 | * Renvoie la liste des valeurs possibles pour un élément, à partir de sa référence. | |
99 | * Renvoie null s'il y a un nombre infini de valeurs possibles ou si l'élément n'a pas un type simple. | |
100 | */ | |
101 | public ArrayList<String> listeValeursElement(final Element refElement) { | |
94 | 102 | return(null); |
95 | 103 | } |
96 | 104 |
204 | 204 | */ |
205 | 205 | public String documentationElement(final Element refElement) { |
206 | 206 | return(sDocumentation(refElement)); |
207 | } | |
208 | ||
209 | /** | |
210 | * Renvoie la liste des valeurs possibles pour un élément, à partir de sa référence. | |
211 | * Renvoie null s'il y a un nombre infini de valeurs possibles ou si l'élément n'a pas un type simple. | |
212 | */ | |
213 | public ArrayList<String> listeValeursElement(final Element refElement) { | |
214 | if (!"".equals(refElement.getAttribute("fixed"))) { | |
215 | final ArrayList<String> fixedval = new ArrayList<String>(); | |
216 | fixedval.add(refElement.getAttribute("fixed")); | |
217 | return(fixedval); | |
218 | } | |
219 | final ArrayList<Element> lst = enfants(refElement, "simpleType"); | |
220 | if (lst.size() > 0) | |
221 | return(enumerationDuType(lst.get(0))); | |
222 | else if (!"".equals(refElement.getAttribute("type"))) { | |
223 | final String type = refElement.getAttribute("type"); | |
224 | final String tns = refElement.lookupNamespaceURI(prefixeString(type)); | |
225 | return(enumerationDuType(type, tns)); | |
226 | } else | |
227 | return(null); | |
207 | 228 | } |
208 | 229 | |
209 | 230 | /** |
549 | 570 | } |
550 | 571 | |
551 | 572 | /** |
573 | * Renvoie la liste des valeurs possibles pour un type simple ou complexe. | |
574 | * Renvoie null s'il y a un nombre infini de valeurs possibles. | |
575 | * Paramètres : nom du type (potentiellement avec le préfixe), et espace de noms | |
576 | */ | |
577 | private ArrayList<String> enumerationDuType(final String type, final String tns) { | |
578 | final String stype = localValue(type); | |
579 | if (schemaNamespace.equals(tns)) { | |
580 | if ("boolean".equals(stype)) { | |
581 | final String[] tvalbool = {"true", "false", "1", "0"}; | |
582 | final ArrayList<String> valbool = new ArrayList<String>(Arrays.asList(tvalbool)); | |
583 | return(valbool); | |
584 | } else if (!schemaNamespace.equals(targetNamespace)) | |
585 | return(null); | |
586 | } | |
587 | final Element st = chercherPremier(TypeObjetSchema.SIMPLETYPE, stype, tns); | |
588 | if (st != null) | |
589 | return(enumerationDuType(st)); | |
590 | final Element ct = chercherPremier(TypeObjetSchema.COMPLEXTYPE, stype, tns); | |
591 | if (ct != null) { | |
592 | final ArrayList<Element> lsc = enfants(ct, "simpleContent"); | |
593 | if (lsc.size() > 0) { | |
594 | final Element simpleContent = lsc.get(0); | |
595 | final ArrayList<Element> lext = enfants(simpleContent, "extension"); | |
596 | if (lext.size() > 0) { | |
597 | final Element extension = lext.get(0); | |
598 | final String type_ext = extension.getAttribute("base"); | |
599 | final String tns_ext = extension.lookupNamespaceURI(prefixeString(type_ext)); | |
600 | return(enumerationDuType(type_ext, tns_ext)); | |
601 | } else | |
602 | return(enumerationDuType(simpleContent)); | |
603 | } else | |
604 | return(null); | |
605 | } else { | |
606 | LOG.error("enumerationDuType(String, String): type introuvable: " + type + " " + tns); | |
607 | return(null); | |
608 | } | |
609 | } | |
610 | ||
611 | /** | |
612 | * Renvoie la liste des valeurs possibles pour un type simple. | |
613 | * Renvoie null s'il y a un nombre infini de valeurs possibles. | |
614 | */ | |
615 | private ArrayList<String> enumerationDuType(final Element simpleType) { | |
616 | final ArrayList<Element> lrest = enfants(simpleType, "restriction"); | |
617 | if (lrest.size() > 0) { | |
618 | final Element restriction = lrest.get(0); | |
619 | final ArrayList<Element> lenum = enfants(restriction, "enumeration"); | |
620 | if (lenum.size() > 0) { | |
621 | final ArrayList<String> liste = new ArrayList<String>(); | |
622 | for (Element enumeration : lenum) { | |
623 | final String sval = enumeration.getAttribute("value"); | |
624 | liste.add(sval); | |
625 | } | |
626 | return(liste); | |
627 | } else | |
628 | return(null); | |
629 | } | |
630 | final ArrayList<Element> lunion = enfants(simpleType, "union"); | |
631 | if (lunion.size() > 0) { | |
632 | final Element union = lunion.get(0); | |
633 | final ArrayList<String> liste = new ArrayList<String>(); | |
634 | final ArrayList<Element> lst = enfants(union, "simpleType"); | |
635 | for (Element st : lst) { | |
636 | final ArrayList<String> listest = enumerationDuType(st); | |
637 | if (listest == null) | |
638 | return(null); | |
639 | liste.addAll(listest); | |
640 | } | |
641 | final String memberTypes = union.getAttribute("memberTypes"); | |
642 | if (!"".equals(memberTypes)) { | |
643 | final String[] types = memberTypes.split("\\s"); | |
644 | for (String type : types) { | |
645 | final String tns = simpleType.lookupNamespaceURI(prefixeString(type)); | |
646 | final ArrayList<String> listest = enumerationDuType(type, tns); | |
647 | if (listest == null) | |
648 | return(null); | |
649 | liste.addAll(listest); | |
650 | } | |
651 | } | |
652 | return(liste); | |
653 | } | |
654 | return(null); | |
655 | } | |
656 | ||
657 | /** | |
552 | 658 | * Renvoie la liste des valeurs possibles pour un attribut, à partir de sa référence. |
553 | 659 | * Renvoie null s'il y a un nombre infini de valeurs possibles. |
554 | 660 | */ |
558 | 664 | fixedval.add(refAttribut.getAttribute("fixed")); |
559 | 665 | return(fixedval); |
560 | 666 | } |
561 | NodeList lval = refAttribut.getElementsByTagNameNS(schemaNamespace, "enumeration"); // pas très rigoureux | |
562 | if (lval.getLength() == 0) { | |
563 | lval = null; | |
564 | if (!"".equals(refAttribut.getAttribute("type"))) { | |
565 | final String type = refAttribut.getAttribute("type"); | |
566 | final String stype = localValue(type); | |
567 | final String tns = refAttribut.lookupNamespaceURI(prefixeString(type)); | |
568 | if (schemaNamespace.equals(tns) && "boolean".equals(stype)) { | |
569 | final String[] tvalbool = {"true", "false", "1", "0"}; | |
570 | final ArrayList<String> valbool = new ArrayList<String>(Arrays.asList(tvalbool)); | |
571 | return(valbool); | |
572 | } | |
573 | final Element st = chercherPremier(TypeObjetSchema.SIMPLETYPE, stype, tns); | |
574 | if (st != null) | |
575 | lval = st.getElementsByTagNameNS(schemaNamespace, "enumeration"); | |
576 | } | |
577 | if (lval == null || lval.getLength() == 0) | |
578 | return(null); | |
579 | } | |
580 | final ArrayList<String> liste = new ArrayList<String>(); | |
581 | for (int i=0; i<lval.getLength(); i++) { | |
582 | final Element val = (Element)lval.item(i); | |
583 | final String sval = val.getAttribute("value"); | |
584 | liste.add(sval); | |
585 | } | |
586 | return(liste); | |
667 | final ArrayList<Element> lst = enfants(refAttribut, "simpleType"); | |
668 | if (lst.size() > 0) | |
669 | return(enumerationDuType(lst.get(0))); | |
670 | else if (!"".equals(refAttribut.getAttribute("type"))) { | |
671 | final String type = refAttribut.getAttribute("type"); | |
672 | final String tns = refAttribut.lookupNamespaceURI(prefixeString(type)); | |
673 | return(enumerationDuType(type, tns)); | |
674 | } else | |
675 | return(null); | |
587 | 676 | } |
588 | 677 | |
589 | 678 | /** |
688 | 777 | * Renvoie true si l'élément dont on donne la référence peut contenir du texte |
689 | 778 | */ |
690 | 779 | public boolean contientDuTexte(final Element refElement) { |
691 | if ("element".equals(refElement.getLocalName())) { | |
692 | // si le type fait partie des schémas XML (comme "string" ou "anyURI") | |
693 | // on considère que c'est du texte | |
694 | final Element schemael = refElement.getOwnerDocument().getDocumentElement(); | |
695 | final String prefixeSchema = schemael.getPrefix(); | |
696 | final String stype = refElement.getAttribute("type"); | |
697 | if (!"".equals(stype)) { | |
698 | final String prefixe = prefixeString(stype); | |
699 | if (prefixe == null && prefixeSchema == null || | |
700 | prefixe != null && prefixe.equals(prefixeSchema)) | |
701 | return(true); | |
702 | } | |
703 | } | |
704 | 780 | if ("element".equals(refElement.getLocalName()) && !refElement.getAttribute("type").equals("")) { |
705 | // complexType | |
706 | 781 | final String type = refElement.getAttribute("type"); |
707 | 782 | final String stype = localValue(type); |
708 | 783 | final String tns = refElement.lookupNamespaceURI(prefixeString(type)); |
784 | // si le type fait partie des schémas XML (comme "string" ou "anyURI") | |
785 | // on considère que c'est du texte (sauf si le schéma est le schéma des schémas) | |
786 | if (!schemaNamespace.equals(targetNamespace) && schemaNamespace.equals(tns)) | |
787 | return(true); | |
788 | // complexType | |
709 | 789 | final Element ct = chercherPremier(TypeObjetSchema.COMPLEXTYPE, stype, tns); |
710 | 790 | if (ct != null) { |
711 | 791 | if ("true".equals(ct.getAttribute("mixed"))) |
1356 | 1436 | final Element sousb = (Element)item; |
1357 | 1437 | if (!"annotation".equals(sousb.getLocalName())) { |
1358 | 1438 | regexp2 = expressionReguliere(sousb, 2, modechoice, modevisu, modepasnul, 0, modevalid, annulable2); |
1439 | if (regexp2 != null && !"".equals(regexp2)) { | |
1440 | if (modechoice) { | |
1441 | if (builder.length() > 0) | |
1442 | builder.append("|"); | |
1443 | builder.append(regexp2); | |
1444 | } else { | |
1445 | if (!(modevisu || modevalid) && !annulable2[0]) { | |
1446 | annulable2[0] = true; | |
1447 | if (regexp2.endsWith(")")) { | |
1448 | builder.append(regexp2); | |
1449 | builder.append("?"); | |
1450 | } else { | |
1451 | builder.append("("); | |
1452 | builder.append(regexp2); | |
1453 | builder.append(")?"); | |
1454 | } | |
1455 | if (!modevisu) | |
1456 | builder.append("+"); | |
1457 | } else { | |
1458 | if (builder.length() > 0 && modevisu) | |
1459 | builder.append(", "); | |
1460 | builder.append(regexp2); | |
1461 | } | |
1462 | } | |
1463 | } | |
1359 | 1464 | annulable[0] = annulable[0] && annulable2[0]; |
1360 | 1465 | break; |
1361 | 1466 | } |
1362 | 1467 | } |
1363 | 1468 | item = item.getNextSibling(); |
1364 | } | |
1365 | if (regexp2 != null && !"".equals(regexp2)) { | |
1366 | if (builder.length() > 0 && modevisu) { | |
1367 | builder.append(", "); | |
1368 | } | |
1369 | builder.append(regexp2); | |
1370 | 1469 | } |
1371 | 1470 | } |
1372 | 1471 | // System.out.println("-> " + builder.toString()); |
1519 | 1618 | liste.addAll(sCtAttributs(ct, pile)); |
1520 | 1619 | } |
1521 | 1620 | final ArrayList<Element> restattr = sCtAttributs(rest, pile); |
1522 | final ArrayList<Element> aretirer = new ArrayList<Element>(); | |
1523 | for (final Element att : restattr) { | |
1621 | for (int i=0; i<liste.size(); i++) { | |
1622 | final Element att = liste.get(i); | |
1524 | 1623 | final String nomatt = att.getAttribute("name"); |
1525 | for (final Element att2 : liste) { | |
1624 | for (final Element att2 : restattr) { | |
1526 | 1625 | final String nomatt2 = att2.getAttribute("name"); |
1527 | if (nomatt2.equals(nomatt)) | |
1528 | aretirer.add(att2); | |
1626 | if (nomatt2.equals(nomatt)) { | |
1627 | if ("prohibited".equals(att2.getAttribute("use"))) { | |
1628 | liste.remove(i); | |
1629 | i--; | |
1630 | } else | |
1631 | liste.set(i, att2); | |
1632 | } | |
1529 | 1633 | } |
1530 | 1634 | } |
1531 | for (final Element att : aretirer) | |
1532 | liste.remove(att); | |
1533 | for (final Element att : restattr) | |
1534 | if (!"prohibited".equals(att.getAttribute("use"))) | |
1535 | liste.add(att); | |
1536 | 1635 | } |
1537 | 1636 | } |
1538 | 1637 | } |
62 | 62 | private Style styleTexte; |
63 | 63 | private Style styleEntite; |
64 | 64 | private Style styleCommentaire; |
65 | private DialogueRechercher dlgRecherche; | |
65 | private DialogueRechercher dlgRecherche = null; | |
66 | 66 | static String texteRecherche = null; |
67 | 67 | |
68 | 68 | public SourceFrame(final JaxeDocument jdoc, final JaxeFrame jframe) { |
118 | 118 | } |
119 | 119 | |
120 | 120 | public void miseAJour() { |
121 | if (dlgRecherche != null) { | |
122 | if (dlgRecherche.isVisible()) | |
123 | dlgRecherche.setVisible(false); | |
124 | dlgRecherche = null; | |
125 | } | |
121 | 126 | try { |
122 | 127 | final BufferedReader in = new BufferedReader(jdoc.getReader()); |
123 | 128 | textPane.read(in, null); |
207 | 207 | protected Node chercherOriginal(final Node clone) { |
208 | 208 | final ArrayList<Integer> numeros = new ArrayList<Integer>(); |
209 | 209 | Node n1 = clone; |
210 | while (n1.getNodeType() != Node.DOCUMENT_NODE) { | |
210 | while (n1 != null && n1.getNodeType() != Node.DOCUMENT_NODE) { | |
211 | 211 | Node n2 = n1.getPreviousSibling(); |
212 | 212 | int i = 0; |
213 | 213 | while (n2 != null) { |
37 | 37 | private static final Logger LOG = Logger.getLogger(VerifTypeSimple.class); |
38 | 38 | |
39 | 39 | private final boolean required; |
40 | protected String baseType = null; | |
41 | protected ArrayList<String> enumeration = null; // de String | |
42 | protected ArrayList<String> patterns = null; // de String | |
43 | protected ArrayList<Restriction> restrictions = null; // de Restriction | |
40 | private String fixed = null; | |
41 | private Contraintes contraintes; | |
44 | 42 | private static final HashMap<String, Pattern> PATTERN_CACHE = new HashMap<String, Pattern>(); |
45 | 43 | // protected PatternCompiler compiler; |
46 | 44 | // protected PatternMatcher matcher; |
54 | 52 | final String stype = snodedef.getAttribute("type"); |
55 | 53 | final String sReq = snodedef.getAttribute("use"); |
56 | 54 | required = "required".equals(sReq); |
57 | if (!"".equals(stype)) { | |
58 | final String schemaPrefix = snodedef.getPrefix(); | |
55 | if (!"".equals(stype)) | |
56 | contraintes = new Contraintes(cfg, stype, snodedef); | |
57 | else { | |
58 | Node n = snodedef.getFirstChild(); | |
59 | while (n != null) { | |
60 | if (n instanceof Element && n.getLocalName().equals("simpleType")) { | |
61 | contraintes = new Contraintes(cfg, (Element)n); | |
62 | } else if (n instanceof Element && n.getLocalName().equals("complexType")) { | |
63 | Node n2 = n.getFirstChild(); | |
64 | while (n2 != null) { | |
65 | if (n2 instanceof Element && n2.getLocalName().equals("simpleContent")) | |
66 | contraintes = new Contraintes(cfg, (Element)n2); | |
67 | n2 = n2.getNextSibling(); | |
68 | } | |
69 | } | |
70 | n = n.getNextSibling(); | |
71 | } | |
72 | ||
73 | } | |
74 | final String fixedval = snodedef.getAttribute("fixed"); | |
75 | if (!"".equals(fixedval)) | |
76 | fixed = fixedval; | |
77 | } | |
78 | ||
79 | /** | |
80 | * Renvoit le type de base (sans préciser les éventuelles restrictions). | |
81 | */ | |
82 | public String getBaseType() { | |
83 | if (contraintes == null) | |
84 | return(null); | |
85 | else | |
86 | return(contraintes.getBaseType()); | |
87 | } | |
88 | ||
89 | /** | |
90 | * Renvoit la liste de valeurs possibles, ou null s'il n'y en a pas. | |
91 | */ | |
92 | public ArrayList<String> getEnumeration() { | |
93 | if (contraintes == null) { | |
94 | if (fixed != null) { | |
95 | final ArrayList<String> enumeration = new ArrayList<String>(); | |
96 | enumeration.add(fixed); | |
97 | enumeration.add(""); | |
98 | return(enumeration); | |
99 | } | |
100 | return(null); | |
101 | } else { | |
102 | ArrayList<String> enumeration = contraintes.getEnumeration(); | |
103 | if (fixed != null) { | |
104 | if (enumeration == null) | |
105 | enumeration = new ArrayList<String>(); | |
106 | if (!enumeration.contains(fixed)) | |
107 | enumeration.add(fixed); | |
108 | if (!enumeration.contains("")) | |
109 | enumeration.add(""); | |
110 | } | |
111 | return(enumeration); | |
112 | } | |
113 | } | |
114 | ||
115 | /** | |
116 | * Renvoit true si la valeur est valide par rapport à la définition du type simple. | |
117 | */ | |
118 | public boolean estValide(final String valeur) { | |
119 | if (fixed != null && !fixed.equals(valeur)) | |
120 | return(false); | |
121 | if (contraintes == null) | |
122 | return(true); | |
123 | return(contraintes.valide(valeur)); | |
124 | } | |
125 | ||
126 | ||
127 | class Contraintes { | |
128 | private String baseType = null; | |
129 | private ArrayList<String> enumeration = null; | |
130 | private ArrayList<String> patterns = null; | |
131 | private ArrayList<Restriction> restrictions = null; | |
132 | private Union union = null; | |
133 | private Liste liste = null; | |
134 | ||
135 | // prend en paramètre un élément simpleType ou simpleContent | |
136 | public Contraintes(final Config cfg, final Element st) { | |
137 | lireTypeEtRestrictions(cfg, st); | |
138 | } | |
139 | ||
140 | // prend en paramètre le nom d'un type avec son préfixe, et un élément du schéma pour résoudre le préfixe en espace de noms | |
141 | public Contraintes(final Config cfg, final String stype, final Element nref) { | |
142 | lireTypeEtRestrictions(cfg, stype, nref); | |
143 | } | |
144 | ||
145 | protected void lireTypeEtRestrictions(final Config cfg, final Element st) { | |
146 | Element restel = null; | |
147 | Node n = st.getFirstChild(); | |
148 | while (n != null) { | |
149 | if (n instanceof Element && (n.getLocalName().equals("restriction") || n.getLocalName().equals("extension") || | |
150 | n.getLocalName().equals("union") || n.getLocalName().equals("list"))) { | |
151 | restel = (Element)n; | |
152 | break; | |
153 | } | |
154 | n = n.getNextSibling(); | |
155 | } | |
156 | if (restel == null) | |
157 | return; | |
158 | if (restel.getLocalName().equals("restriction")) { | |
159 | baseType = restel.getAttribute("base"); | |
160 | if (baseType.indexOf(':') != -1) | |
161 | baseType = baseType.substring(baseType.indexOf(':') + 1); | |
162 | Node n2 = restel.getFirstChild(); | |
163 | while (n2 != null) { | |
164 | if (n2 instanceof Element) | |
165 | lireRestriction((Element)n2); | |
166 | n2 = n2.getNextSibling(); | |
167 | } | |
168 | } else if (restel.getLocalName().equals("extension")) { | |
169 | baseType = restel.getAttribute("base"); | |
170 | lireTypeEtRestrictions(cfg, baseType, st); | |
171 | } else if (restel.getLocalName().equals("union")) { | |
172 | union = new Union(cfg, restel); | |
173 | enumeration = union.getEnumeration(); | |
174 | } else if (restel.getLocalName().equals("list")) { | |
175 | liste = new Liste(cfg, restel); | |
176 | enumeration = null; | |
177 | } | |
178 | } | |
179 | ||
180 | protected void lireTypeEtRestrictions(final Config cfg, final String stype, final Element nref) { | |
181 | final String targetNamespace = cfg.espaceCible(); | |
182 | final boolean metaschema = targetNamespace != null && targetNamespace.equals(nref.getNamespaceURI()); | |
183 | final String schemaPrefix = nref.getPrefix(); | |
59 | 184 | final int indp = stype.indexOf(':'); |
60 | if (indp == -1 && schemaPrefix == null || | |
61 | indp != -1 && stype.substring(0, indp).equals(schemaPrefix)) { | |
185 | if (!metaschema && ((indp == -1 && schemaPrefix == null) || | |
186 | (indp != -1 && stype.substring(0, indp).equals(schemaPrefix)))) { | |
62 | 187 | baseType = stype.substring(indp+1); |
63 | 188 | } else { |
64 | 189 | String nomType, tns; |
65 | 190 | if (indp == -1) { |
66 | 191 | nomType = stype; |
67 | tns = snodedef.lookupNamespaceURI(null); | |
192 | tns = nref.lookupNamespaceURI(null); | |
68 | 193 | } else { |
69 | 194 | nomType = stype.substring(indp+1); |
70 | tns = snodedef.lookupNamespaceURI(stype.substring(0, indp)); | |
195 | tns = nref.lookupNamespaceURI(stype.substring(0, indp)); | |
71 | 196 | } |
72 | 197 | final Element eltype = cfg.getSchemaTypeElement(nomType, tns); |
73 | 198 | if (eltype == null) |
77 | 202 | Node n = eltype.getFirstChild(); |
78 | 203 | while (n != null) { |
79 | 204 | if (n instanceof Element && n.getLocalName().equals("simpleContent")) |
80 | lireTypeEtRestrictions((Element)n); | |
205 | lireTypeEtRestrictions(cfg, (Element)n); | |
81 | 206 | n = n.getNextSibling(); |
82 | 207 | } |
83 | 208 | } else if (eltype.getLocalName().equals("simpleType")) |
84 | lireTypeEtRestrictions(eltype); | |
85 | } | |
86 | } else { | |
87 | Node n = snodedef.getFirstChild(); | |
209 | lireTypeEtRestrictions(cfg, eltype); | |
210 | } | |
211 | } | |
212 | ||
213 | // prend en paramètre un élément enfant de l'élément restriction | |
214 | protected void lireRestriction(final Element facet) { | |
215 | if (facet.getLocalName().equals("enumeration")) { | |
216 | final String val = facet.getAttribute("value"); | |
217 | if (enumeration == null) | |
218 | enumeration = new ArrayList<String>(); | |
219 | enumeration.add(val); | |
220 | } else if (facet.getLocalName().equals("pattern")) { | |
221 | String val = facet.getAttribute("value"); | |
222 | if (patterns == null) | |
223 | patterns = new ArrayList<String>(); | |
224 | // remplacements très approximatifs de \i, \I, \c et \C | |
225 | val = remplacer(val, "\\i", "[^<>&#!/?'\",0-9.\\-\\s]"); | |
226 | val = remplacer(val, "\\I", "[^a-zA-Z]"); | |
227 | val = remplacer(val, "\\c", "[^<>&#!/?'\",\\s]"); | |
228 | val = remplacer(val, "\\C", "\\W"); | |
229 | patterns.add(val); | |
230 | } else { | |
231 | final String val = facet.getAttribute("value"); | |
232 | if (restrictions == null) | |
233 | restrictions = new ArrayList<Restriction>(); | |
234 | restrictions.add(new Restriction(facet.getLocalName(), val)); | |
235 | } | |
236 | } | |
237 | ||
238 | protected String remplacer(String s, final String sremp, final String spar) { | |
239 | int ind = s.indexOf(sremp); | |
240 | while (ind != -1) { | |
241 | s = s.substring(0, ind) + spar + s.substring(ind + sremp.length()); | |
242 | ind = s.indexOf(sremp); | |
243 | } | |
244 | return(s); | |
245 | } | |
246 | ||
247 | protected boolean valide(final String valeur) { | |
248 | // vérif required | |
249 | if ((valeur == null || "".equals(valeur)) && required) | |
250 | return false; | |
251 | ||
252 | // vérif union | |
253 | if (union != null) | |
254 | return(union.valide(valeur)); | |
255 | ||
256 | // vérif liste | |
257 | if (liste != null) | |
258 | return(liste.valide(valeur)); | |
259 | ||
260 | // vérif baseType | |
261 | if (baseType != null && !verifType(baseType, valeur)) | |
262 | return(false); | |
263 | ||
264 | // vérif enumerations | |
265 | if (enumeration != null) { | |
266 | if (valeur == null) | |
267 | return(false); | |
268 | boolean trouve = false; | |
269 | for (final String en : enumeration) | |
270 | if (valeur.equals(en)) { | |
271 | trouve = true; | |
272 | break; | |
273 | } | |
274 | if (!trouve) | |
275 | return(false); | |
276 | } | |
277 | // vérif patterns | |
278 | if (patterns != null) { | |
279 | boolean trouve = false; | |
280 | for (final String pattern : patterns) | |
281 | if (verifExpr(valeur, pattern)) { | |
282 | trouve = true; | |
283 | break; | |
284 | } | |
285 | if (!trouve) | |
286 | return(false); | |
287 | } | |
288 | // vérif restrictions | |
289 | if (restrictions != null) { | |
290 | for (final Restriction res : restrictions) { | |
291 | if (!res.valide(valeur)) | |
292 | return(false); | |
293 | } | |
294 | } | |
295 | return(true); | |
296 | } | |
297 | ||
298 | protected boolean verifType(final String type, final String valeur) { | |
299 | if ("string".equals(type)) | |
300 | return(true); | |
301 | else if ("normalizedString".equals(type)) | |
302 | return(verifExpr(valeur, "[^\\t\\r\\n]*")); | |
303 | else if ("token".equals(type)) { | |
304 | if (valeur.indexOf('\n') != -1 || valeur.indexOf('\r') != -1 || | |
305 | valeur.indexOf('\t') != -1 || valeur.indexOf(" ") != -1) | |
306 | return(false); | |
307 | return(!valeur.startsWith(" ") && !valeur.endsWith(" ")); | |
308 | } else if ("base64Binary".equals(type)) | |
309 | return(verifExpr(valeur, "(([a-zA-Z0-9+/=]\\s?){4})*")); | |
310 | else if ("hexBinary".equals(type)) | |
311 | return(verifExpr(valeur, "(([0-9a-fA-F]){2})*")); | |
312 | else if ("integer".equals(type)) | |
313 | return(verifExpr(valeur, "[+\\-]?\\d+")); | |
314 | else if ("positiveInteger".equals(type)) | |
315 | return(verifExpr(valeur, "\\+?0*[1-9]\\d*")); | |
316 | else if ("negativeInteger".equals(type)) | |
317 | return(verifExpr(valeur, "-0*[1-9]\\d*")); | |
318 | else if ("nonNegativeInteger".equals(type)) | |
319 | return(verifExpr(valeur, "(-0+)|(\\+?\\d+)")); | |
320 | else if ("nonPositiveInteger".equals(type)) | |
321 | return(verifExpr(valeur, "(\\+?0+)|(-\\d+)")); | |
322 | else if ("long".equals(type)) { | |
323 | if (!verifExpr(valeur, "[+\\-]?\\d+")) | |
324 | return(false); | |
325 | try { | |
326 | final BigInteger big = new BigInteger(valeur); | |
327 | final BigInteger max = new BigInteger("9223372036854775807"); | |
328 | final BigInteger min = new BigInteger("-9223372036854775808"); | |
329 | if (big.compareTo(max) > 0) | |
330 | return(false); | |
331 | if (big.compareTo(min) < 0) | |
332 | return(false); | |
333 | return(true); | |
334 | } catch (final NumberFormatException ex) { | |
335 | LOG.error("verifType(String, String) - NumberFormatException", ex); | |
336 | return(false); | |
337 | } | |
338 | } else if ("unsignedLong".equals(type)) { | |
339 | if (!verifExpr(valeur, "\\d+")) | |
340 | return(false); | |
341 | try { | |
342 | final BigInteger big = new BigInteger(valeur); | |
343 | final BigInteger max = new BigInteger("18446744073709551615"); | |
344 | return(big.compareTo(max) <= 0); | |
345 | } catch (final NumberFormatException ex) { | |
346 | LOG.error("verifType(String, String) - NumberFormatException", ex); | |
347 | return(false); | |
348 | } | |
349 | } else if ("int".equals(type)) { | |
350 | if (!verifExpr(valeur, "[+\\-]?\\d+")) | |
351 | return(false); | |
352 | try { | |
353 | final long val = Long.parseLong(valeur); | |
354 | return(val <= 2147483647l && val >= -2147483648l); | |
355 | } catch (final NumberFormatException ex) { | |
356 | LOG.error("verifType(String, String) - NumberFormatException", ex); | |
357 | return(false); | |
358 | } | |
359 | } else if ("unsignedInt".equals(type)) { | |
360 | if (!verifExpr(valeur, "\\d+")) | |
361 | return(false); | |
362 | try { | |
363 | final long val = Long.parseLong(valeur); | |
364 | return(val <= 4294967295l && val >= 0); | |
365 | } catch (final NumberFormatException ex) { | |
366 | LOG.error("verifType(String, String) - NumberFormatException", ex); | |
367 | return(false); | |
368 | } | |
369 | } else if ("short".equals(type)) { | |
370 | if (!verifExpr(valeur, "[+\\-]?\\d+")) | |
371 | return(false); | |
372 | try { | |
373 | final int val = Integer.parseInt(valeur); | |
374 | return(val <= 32767 && val >= -32768); | |
375 | } catch (final NumberFormatException ex) { | |
376 | LOG.error("verifType(String, String) - NumberFormatException", ex); | |
377 | return(false); | |
378 | } | |
379 | } else if ("unsignedShort".equals(type)) { | |
380 | if (!verifExpr(valeur, "\\d+")) | |
381 | return(false); | |
382 | try { | |
383 | final int val = Integer.parseInt(valeur); | |
384 | return(val <= 65535 && val >= 0); | |
385 | } catch (final NumberFormatException ex) { | |
386 | LOG.error("verifType(String, String) - NumberFormatException", ex); | |
387 | return(false); | |
388 | } | |
389 | } else if ("byte".equals(type)) { | |
390 | if (!verifExpr(valeur, "[+\\-]?\\d+")) | |
391 | return(false); | |
392 | try { | |
393 | final int val = Integer.parseInt(valeur); | |
394 | return(val <= 127 && val >= -128); | |
395 | } catch (final NumberFormatException ex) { | |
396 | LOG.error("verifType(String, String) - NumberFormatException", ex); | |
397 | return(false); | |
398 | } | |
399 | } else if ("unsignedByte".equals(type)) { | |
400 | if (!verifExpr(valeur, "\\d+")) | |
401 | return(false); | |
402 | try { | |
403 | final int val = Integer.parseInt(valeur); | |
404 | return(val <= 255 && val >= 0); | |
405 | } catch (final NumberFormatException ex) { | |
406 | LOG.error("verifType(String, String) - NumberFormatException", ex); | |
407 | return(false); | |
408 | } | |
409 | } else if ("decimal".equals(type)) { | |
410 | return(verifExpr(valeur, "[+\\-]?\\d+\\.?\\d*")); | |
411 | } else if ("float".equals(type)) { | |
412 | if (!verifExpr(valeur, "(-?INF)|(NaN)|([+\\-]?\\d+\\.?\\d*([eE][+\\-]?\\d{1,3})?)")) | |
413 | return(false); | |
414 | if ("INF".equals(valeur) || "-INF".equals(valeur)) // "Infinity" en Java | |
415 | return(true); | |
416 | try { | |
417 | Float.parseFloat(valeur); | |
418 | return(true); | |
419 | } catch (final NumberFormatException ex) { | |
420 | return(false); | |
421 | } | |
422 | } else if ("double".equals(type)) { | |
423 | if (!verifExpr(valeur, "(-?INF)|(NaN)|([+\\-]?\\d+\\.?\\d*([eE][+\\-]?\\d{1,3})?)")) | |
424 | return(false); | |
425 | if ("INF".equals(valeur) || "-INF".equals(valeur)) | |
426 | return(true); | |
427 | try { | |
428 | Double.parseDouble(valeur); | |
429 | return(true); | |
430 | } catch (final NumberFormatException ex) { | |
431 | return(false); | |
432 | } | |
433 | } else if ("boolean".equals(type)) | |
434 | return(verifExpr(valeur, "(true)|(false)|1|0")); | |
435 | else if ("duration".equals(type)) | |
436 | return(verifExpr(valeur, "-?P(\\d{1,4}Y)?(\\d{1,2}M)?(\\d{1,2}D)?T?(\\d{1,2}H)?(\\d{1,2}M)?(\\d{1,2}(\\.\\d+)?S)?")); | |
437 | else if ("dateTime".equals(type)) | |
438 | return(verifExpr(valeur, "-?\\d{4}-[01]\\d-[0-3]\\dT[0-2]\\d:[0-5]\\d:[0-5]\\d(\\.\\d+)?(([+\\-][01]\\d:\\d{2})|Z)?")); | |
439 | else if ("date".equals(type)) | |
440 | return(verifExpr(valeur, "-?\\d{4}-[01]\\d-[0-3]\\d(([+\\-][01]\\d:\\d{2})|Z)?")); | |
441 | else if ("time".equals(type)) | |
442 | return(verifExpr(valeur, "[0-2]\\d:[0-5]\\d:[0-5]\\d(\\.\\d+)?(([+\\-][01]\\d:\\d{2})|Z)?")); | |
443 | else if ("gYear".equals(type)) | |
444 | return(verifExpr(valeur, "-?\\d{4}(([+\\-][01]\\d:\\d{2})|Z)?")); | |
445 | else if ("gYearMonth".equals(type)) | |
446 | return(verifExpr(valeur, "-?\\d{4}-[01]\\d(([+\\-][01]\\d:\\d{2})|Z)?")); | |
447 | else if ("gMonth".equals(type)) | |
448 | return(verifExpr(valeur, "--[01]\\d(([+\\-][01]\\d:\\d{2})|Z)?")); | |
449 | else if ("gMonthDay".equals(type)) | |
450 | return(verifExpr(valeur, "--[01]\\d-[0-3]\\d(([+\\-][01]\\d:\\d{2})|Z)?")); | |
451 | else if ("gDay".equals(type)) | |
452 | return(verifExpr(valeur, "---[0-3]\\d(([+\\-][01]\\d:\\d{2})|Z)?")); | |
453 | else if ("Name".equals(type)) | |
454 | return(verifExpr(valeur, "[^<>&#!/?'\",0-9.\\-\\s][^<>&#!/?'\",\\s]*")); // en fait plus restrictif: \i\c* | |
455 | else if ("QName".equals(type)) | |
456 | return(verifExpr(valeur, "[^<>&#!/?'\",0-9.\\-\\s][^<>&#!/?'\",\\s]*")); // en fait plus restrictif | |
457 | else if ("NCName".equals(type)) | |
458 | return(verifExpr(valeur, "[^<>&#!/?'\",0-9.\\-\\s:][^<>&#!/?'\",:\\s]*")); // en fait plus restrictif: [\i-[:]][\c-[:]]* | |
459 | else if ("anyURI".equals(type)) | |
460 | return(true); | |
461 | //return(verifExpr(valeur, "([^:/?#]+:)?(//[^/?#]*)?[^?#]*(\\?[^#]*)?(#.*)?")); | |
462 | // pb: cette expression autorise tout! | |
463 | // (mais les RFC 2396 et 2732 ne restreignent rien) | |
464 | else if ("language".equals(type)) | |
465 | return(verifExpr(valeur, "[a-zA-Z]{1,8}(-[a-zA-Z0-9]{1,8})*")); | |
466 | else if ("ID".equals(type)) | |
467 | return(verifExpr(valeur, "[^<>&#!/?'\",0-9.\\-\\s:][^<>&#!/?'\",:\\s]*")); // comme NCName | |
468 | else if ("IDREF".equals(type)) | |
469 | return(verifExpr(valeur, "[^<>&#!/?'\",0-9.\\-\\s:][^<>&#!/?'\",:\\s]*")); // comme NCName | |
470 | else if ("IDREFS".equals(type)) | |
471 | return(verifExpr(valeur, "[^<>&#!/?'\",0-9.\\-\\s:][^<>&#!/?'\",:]*")); | |
472 | else if ("ENTITY".equals(type)) | |
473 | return(verifExpr(valeur, "[^<>&#!/?'\",0-9.\\-\\s:][^<>&#!/?'\",:\\s]*")); // comme NCName | |
474 | else if ("ENTITIES".equals(type)) | |
475 | return(verifExpr(valeur, "[^<>&#!/?'\",0-9.\\-\\s:][^<>&#!/?'\",:]*")); // comme IDREFS | |
476 | else if ("NOTATION".equals(type)) | |
477 | return(verifExpr(valeur, "[^0-9.\\-\\s][^\\s]*(\\s[^0-9.\\-\\s][^\\s]*)*")); | |
478 | // la facette enumeration est obligatoire -> contrainte supplémentaire | |
479 | else if ("NMTOKEN".equals(type)) | |
480 | return(verifExpr(valeur, "[^<>&#!/?'\",\\s]+")); // en fait plus restrictif: \c+ | |
481 | else if ("NMTOKENS".equals(type)) | |
482 | return(verifExpr(valeur, "[^<>&#!/?'\",]+")); // en fait plus restrictif | |
483 | else | |
484 | return(true); | |
485 | } | |
486 | ||
487 | protected boolean verifExpr(final String valeur, final String regexp) { | |
488 | try { | |
489 | // final Pattern r = compiler.compile("^" + regexp + "$"); | |
490 | // on pourrait utiliser un cache, comme dans Config | |
491 | // final String regex = "^" + regex + "$"; | |
492 | Pattern r = PATTERN_CACHE.get(regexp); | |
493 | if (r == null) { | |
494 | r = Pattern.compile("^" + regexp + "$"); | |
495 | PATTERN_CACHE.put(regexp, r); | |
496 | return r.matcher(valeur).matches(); | |
497 | } | |
498 | // return(matcher.matches(valeur, r)); | |
499 | // } catch (final MalformedPatternException ex) { | |
500 | return r.matcher(valeur).matches(); | |
501 | } catch (final PatternSyntaxException ex) { | |
502 | LOG.error("verifExpr(String, String): " + regexp, ex); | |
503 | return(true); | |
504 | } | |
505 | } | |
506 | ||
507 | protected String getBaseType() { | |
508 | return(baseType); | |
509 | } | |
510 | ||
511 | protected ArrayList<String> getEnumeration() { | |
512 | return(enumeration); | |
513 | } | |
514 | } | |
515 | ||
516 | ||
517 | class Union { | |
518 | private ArrayList<Contraintes> contraintes = null; | |
519 | ||
520 | public Union(final Config cfg, final Element u) { | |
521 | contraintes = new ArrayList<Contraintes>(); | |
522 | Node n = u.getFirstChild(); | |
523 | while (n != null) { | |
524 | if (n instanceof Element && n.getLocalName().equals("simpleType")) | |
525 | contraintes.add(new Contraintes(cfg, (Element)n)); | |
526 | n = n.getNextSibling(); | |
527 | } | |
528 | final String memberTypes = u.getAttribute("memberTypes"); | |
529 | if (!"".equals(memberTypes)) { | |
530 | final String[] types = memberTypes.split("\\s"); | |
531 | for (String type : types) | |
532 | contraintes.add(new Contraintes(cfg, type, u)); | |
533 | } | |
534 | } | |
535 | ||
536 | protected boolean valide(final String valeur) { | |
537 | if (contraintes == null) | |
538 | return(true); | |
539 | for (Contraintes c : contraintes) | |
540 | if (c.valide(valeur)) | |
541 | return(true); | |
542 | return(false); | |
543 | } | |
544 | ||
545 | protected ArrayList<String> getEnumeration() { | |
546 | ArrayList<String> enumeration = null; | |
547 | for (Contraintes c : contraintes) { | |
548 | ArrayList<String> ec = c.getEnumeration(); | |
549 | if (ec == null) | |
550 | return(null); | |
551 | else { | |
552 | if (enumeration == null) | |
553 | enumeration = new ArrayList<String>(); | |
554 | enumeration.addAll(ec); | |
555 | } | |
556 | } | |
557 | return(enumeration); | |
558 | } | |
559 | } | |
560 | ||
561 | ||
562 | class Liste { | |
563 | private Contraintes contraintesItem = null; | |
564 | ||
565 | public Liste(final Config cfg, final Element u) { | |
566 | contraintesItem = null; | |
567 | Node n = u.getFirstChild(); | |
88 | 568 | while (n != null) { |
89 | 569 | if (n instanceof Element && n.getLocalName().equals("simpleType")) { |
90 | lireTypeEtRestrictions((Element)n); | |
91 | } else if (n instanceof Element && n.getLocalName().equals("complexType")) { | |
92 | Node n2 = n.getFirstChild(); | |
93 | while (n2 != null) { | |
94 | if (n2 instanceof Element && n2.getLocalName().equals("simpleContent")) | |
95 | lireTypeEtRestrictions((Element)n2); | |
96 | n2 = n2.getNextSibling(); | |
97 | } | |
570 | contraintesItem = new Contraintes(cfg, (Element)n); | |
571 | break; | |
98 | 572 | } |
99 | 573 | n = n.getNextSibling(); |
100 | 574 | } |
101 | ||
102 | } | |
103 | final String fixed = snodedef.getAttribute("fixed"); | |
104 | if (!"".equals(fixed)) { | |
105 | enumeration = new ArrayList<String>(); | |
106 | enumeration.add(""); | |
107 | enumeration.add(fixed); | |
108 | } | |
109 | } | |
110 | ||
111 | /** | |
112 | * Renvoit le type de base (sans préciser les éventuelles restrictions). | |
113 | */ | |
114 | public String getBaseType() { | |
115 | return(baseType); | |
116 | } | |
117 | ||
118 | /** | |
119 | * Renvoit la liste de valeurs possibles, ou null s'il n'y en a pas. | |
120 | */ | |
121 | public ArrayList<String> getEnumeration() { | |
122 | return(enumeration); | |
123 | } | |
124 | ||
125 | /** | |
126 | * Renvoit true si la valeur est valide par rapport à la définition du type simple. | |
127 | */ | |
128 | public boolean estValide(final String valeur) { | |
129 | // vérif baseType | |
130 | if ((valeur == null || "".equals(valeur)) && required) { | |
131 | return false; | |
132 | } | |
133 | if (!verifType(baseType, valeur)) | |
134 | return(false); | |
135 | // vérif enumerations | |
136 | if (enumeration != null) { | |
137 | if (valeur == null) | |
138 | return(false); | |
139 | boolean trouve = false; | |
140 | for (final String en : enumeration) | |
141 | if (valeur.equals(en)) { | |
142 | trouve = true; | |
143 | break; | |
144 | } | |
145 | if (!trouve) | |
146 | return(false); | |
147 | } | |
148 | // vérif patterns | |
149 | if (patterns != null) { | |
150 | boolean trouve = false; | |
151 | for (final String pattern : patterns) | |
152 | if (verifExpr(valeur, pattern)) { | |
153 | trouve = true; | |
154 | break; | |
155 | } | |
156 | if (!trouve) | |
157 | return(false); | |
158 | } | |
159 | // vérif restrictions | |
160 | if (restrictions != null) { | |
161 | for (final Restriction res : restrictions) { | |
162 | if (!res.valide(valeur)) | |
163 | return(false); | |
164 | } | |
165 | } | |
166 | return(true); | |
167 | } | |
168 | ||
169 | // prend en paramètre un élément simpleType ou simpleContent | |
170 | protected void lireTypeEtRestrictions(final Element st) { | |
171 | Element restel = null; | |
172 | Node n = st.getFirstChild(); | |
173 | while (n != null) { | |
174 | if (n instanceof Element && (n.getLocalName().equals("restriction") || n.getLocalName().equals("extension"))) { | |
175 | restel = (Element)n; | |
176 | break; | |
177 | } | |
178 | n = n.getNextSibling(); | |
179 | } | |
180 | if (restel == null) | |
181 | return; | |
182 | baseType = restel.getAttribute("base"); | |
183 | if (baseType.indexOf(':') != -1) | |
184 | baseType = baseType.substring(baseType.indexOf(':') + 1); | |
185 | if (restel.getLocalName().equals("restriction")) { | |
186 | Node n2 = restel.getFirstChild(); | |
187 | while (n2 != null) { | |
188 | if (n2 instanceof Element) | |
189 | lireRestriction((Element)n2); | |
190 | n2 = n2.getNextSibling(); | |
191 | } | |
192 | } | |
193 | } | |
194 | ||
195 | // prend en paramètre un élément enfant de l'élément restriction | |
196 | protected void lireRestriction(final Element facet) { | |
197 | if (facet.getLocalName().equals("enumeration")) { | |
198 | final String val = facet.getAttribute("value"); | |
199 | if (enumeration == null) | |
200 | enumeration = new ArrayList<String>(); | |
201 | enumeration.add(val); | |
202 | } else if (facet.getLocalName().equals("pattern")) { | |
203 | String val = facet.getAttribute("value"); | |
204 | if (patterns == null) | |
205 | patterns = new ArrayList<String>(); | |
206 | // remplacements très approximatifs de \i, \I, \c et \C | |
207 | val = remplacer(val, "\\i", "[^<>&#!/?'\",0-9.\\-\\s]"); | |
208 | val = remplacer(val, "\\I", "[^a-zA-Z]"); | |
209 | val = remplacer(val, "\\c", "[^<>&#!/?'\",\\s]"); | |
210 | val = remplacer(val, "\\C", "\\W"); | |
211 | patterns.add(val); | |
212 | } else { | |
213 | final String val = facet.getAttribute("value"); | |
214 | if (restrictions == null) | |
215 | restrictions = new ArrayList<Restriction>(); | |
216 | restrictions.add(new Restriction(facet.getLocalName(), val)); | |
217 | } | |
218 | } | |
219 | ||
220 | protected String remplacer(String s, final String sremp, final String spar) { | |
221 | int ind = s.indexOf(sremp); | |
222 | while (ind != -1) { | |
223 | s = s.substring(0, ind) + spar + s.substring(ind + sremp.length()); | |
224 | ind = s.indexOf(sremp); | |
225 | } | |
226 | return(s); | |
227 | } | |
228 | ||
229 | protected boolean verifType(final String type, final String valeur) { | |
230 | if ("string".equals(type)) | |
575 | if (contraintesItem == null) { | |
576 | final String itemType = u.getAttribute("itemType"); | |
577 | if (!"".equals(itemType)) | |
578 | contraintesItem = new Contraintes(cfg, itemType, u); | |
579 | } | |
580 | } | |
581 | ||
582 | protected boolean valide(final String valeur) { | |
583 | if (contraintesItem == null) | |
584 | return(true); | |
585 | final String[] items = valeur.trim().split("\\s"); | |
586 | for (String item : items) | |
587 | if (!contraintesItem.valide(item)) | |
588 | return(false); | |
231 | 589 | return(true); |
232 | else if ("normalizedString".equals(type)) | |
233 | return(verifExpr(valeur, "[^\\t\\r\\n]*")); | |
234 | else if ("token".equals(type)) { | |
235 | if (valeur.indexOf('\n') != -1 || valeur.indexOf('\r') != -1 || | |
236 | valeur.indexOf('\t') != -1 || valeur.indexOf(" ") != -1) | |
237 | return(false); | |
238 | return(!valeur.startsWith(" ") && !valeur.endsWith(" ")); | |
239 | } else if ("base64Binary".equals(type)) | |
240 | return(verifExpr(valeur, "(([a-zA-Z0-9+/=]\\s?){4})*")); | |
241 | else if ("hexBinary".equals(type)) | |
242 | return(verifExpr(valeur, "(([0-9a-fA-F]){2})*")); | |
243 | else if ("integer".equals(type)) | |
244 | return(verifExpr(valeur, "[+\\-]?\\d+")); | |
245 | else if ("positiveInteger".equals(type)) | |
246 | return(verifExpr(valeur, "\\+?0*[1-9]\\d*")); | |
247 | else if ("negativeInteger".equals(type)) | |
248 | return(verifExpr(valeur, "-0*[1-9]\\d*")); | |
249 | else if ("nonNegativeInteger".equals(type)) | |
250 | return(verifExpr(valeur, "(-0+)|(\\+?\\d+)")); | |
251 | else if ("nonPositiveInteger".equals(type)) | |
252 | return(verifExpr(valeur, "(\\+?0+)|(-\\d+)")); | |
253 | else if ("long".equals(type)) { | |
254 | if (!verifExpr(valeur, "[+\\-]?\\d+")) | |
255 | return(false); | |
256 | try { | |
257 | final BigInteger big = new BigInteger(valeur); | |
258 | final BigInteger max = new BigInteger("9223372036854775807"); | |
259 | final BigInteger min = new BigInteger("-9223372036854775808"); | |
260 | if (big.compareTo(max) > 0) | |
261 | return(false); | |
262 | if (big.compareTo(min) < 0) | |
263 | return(false); | |
264 | return(true); | |
265 | } catch (final NumberFormatException ex) { | |
266 | LOG.error("verifType(String, String) - NumberFormatException", ex); | |
267 | return(false); | |
268 | } | |
269 | } else if ("unsignedLong".equals(type)) { | |
270 | if (!verifExpr(valeur, "\\d+")) | |
271 | return(false); | |
272 | try { | |
273 | final BigInteger big = new BigInteger(valeur); | |
274 | final BigInteger max = new BigInteger("18446744073709551615"); | |
275 | return(big.compareTo(max) <= 0); | |
276 | } catch (final NumberFormatException ex) { | |
277 | LOG.error("verifType(String, String) - NumberFormatException", ex); | |
278 | return(false); | |
279 | } | |
280 | } else if ("int".equals(type)) { | |
281 | if (!verifExpr(valeur, "[+\\-]?\\d+")) | |
282 | return(false); | |
283 | try { | |
284 | final long val = Long.parseLong(valeur); | |
285 | return(val <= 2147483647l && val >= -2147483648l); | |
286 | } catch (final NumberFormatException ex) { | |
287 | LOG.error("verifType(String, String) - NumberFormatException", ex); | |
288 | return(false); | |
289 | } | |
290 | } else if ("unsignedInt".equals(type)) { | |
291 | if (!verifExpr(valeur, "\\d+")) | |
292 | return(false); | |
293 | try { | |
294 | final long val = Long.parseLong(valeur); | |
295 | return(val <= 4294967295l && val >= 0); | |
296 | } catch (final NumberFormatException ex) { | |
297 | LOG.error("verifType(String, String) - NumberFormatException", ex); | |
298 | return(false); | |
299 | } | |
300 | } else if ("short".equals(type)) { | |
301 | if (!verifExpr(valeur, "[+\\-]?\\d+")) | |
302 | return(false); | |
303 | try { | |
304 | final int val = Integer.parseInt(valeur); | |
305 | return(val <= 32767 && val >= -32768); | |
306 | } catch (final NumberFormatException ex) { | |
307 | LOG.error("verifType(String, String) - NumberFormatException", ex); | |
308 | return(false); | |
309 | } | |
310 | } else if ("unsignedShort".equals(type)) { | |
311 | if (!verifExpr(valeur, "\\d+")) | |
312 | return(false); | |
313 | try { | |
314 | final int val = Integer.parseInt(valeur); | |
315 | return(val <= 65535 && val >= 0); | |
316 | } catch (final NumberFormatException ex) { | |
317 | LOG.error("verifType(String, String) - NumberFormatException", ex); | |
318 | return(false); | |
319 | } | |
320 | } else if ("byte".equals(type)) { | |
321 | if (!verifExpr(valeur, "[+\\-]?\\d+")) | |
322 | return(false); | |
323 | try { | |
324 | final int val = Integer.parseInt(valeur); | |
325 | return(val <= 127 && val >= -128); | |
326 | } catch (final NumberFormatException ex) { | |
327 | LOG.error("verifType(String, String) - NumberFormatException", ex); | |
328 | return(false); | |
329 | } | |
330 | } else if ("unsignedByte".equals(type)) { | |
331 | if (!verifExpr(valeur, "\\d+")) | |
332 | return(false); | |
333 | try { | |
334 | final int val = Integer.parseInt(valeur); | |
335 | return(val <= 255 && val >= 0); | |
336 | } catch (final NumberFormatException ex) { | |
337 | LOG.error("verifType(String, String) - NumberFormatException", ex); | |
338 | return(false); | |
339 | } | |
340 | } else if ("decimal".equals(type)) { | |
341 | return(verifExpr(valeur, "[+\\-]?\\d+\\.?\\d*")); | |
342 | } else if ("float".equals(type)) { | |
343 | if (!verifExpr(valeur, "(-?INF)|(NaN)|([+\\-]?\\d+\\.?\\d*([eE][+\\-]?\\d{1,3})?)")) | |
344 | return(false); | |
345 | if ("INF".equals(valeur) || "-INF".equals(valeur)) // "Infinity" en Java | |
346 | return(true); | |
347 | try { | |
348 | Float.parseFloat(valeur); | |
349 | return(true); | |
350 | } catch (final NumberFormatException ex) { | |
351 | return(false); | |
352 | } | |
353 | } else if ("double".equals(type)) { | |
354 | if (!verifExpr(valeur, "(-?INF)|(NaN)|([+\\-]?\\d+\\.?\\d*([eE][+\\-]?\\d{1,3})?)")) | |
355 | return(false); | |
356 | if ("INF".equals(valeur) || "-INF".equals(valeur)) | |
357 | return(true); | |
358 | try { | |
359 | Double.parseDouble(valeur); | |
360 | return(true); | |
361 | } catch (final NumberFormatException ex) { | |
362 | return(false); | |
363 | } | |
364 | } else if ("boolean".equals(type)) | |
365 | return(verifExpr(valeur, "(true)|(false)|1|0")); | |
366 | else if ("duration".equals(type)) | |
367 | return(verifExpr(valeur, "-?P(\\d{1,4}Y)?(\\d{1,2}M)?(\\d{1,2}D)?T?(\\d{1,2}H)?(\\d{1,2}M)?(\\d{1,2}(\\.\\d+)?S)?")); | |
368 | else if ("dateTime".equals(type)) | |
369 | return(verifExpr(valeur, "-?\\d{4}-[01]\\d-[0-3]\\dT[0-2]\\d:[0-5]\\d:[0-5]\\d(\\.\\d+)?(([+\\-][01]\\d:\\d{2})|Z)?")); | |
370 | else if ("date".equals(type)) | |
371 | return(verifExpr(valeur, "-?\\d{4}-[01]\\d-[0-3]\\d(([+\\-][01]\\d:\\d{2})|Z)?")); | |
372 | else if ("time".equals(type)) | |
373 | return(verifExpr(valeur, "[0-2]\\d:[0-5]\\d:[0-5]\\d(\\.\\d+)?(([+\\-][01]\\d:\\d{2})|Z)?")); | |
374 | else if ("gYear".equals(type)) | |
375 | return(verifExpr(valeur, "-?\\d{4}(([+\\-][01]\\d:\\d{2})|Z)?")); | |
376 | else if ("gYearMonth".equals(type)) | |
377 | return(verifExpr(valeur, "-?\\d{4}-[01]\\d(([+\\-][01]\\d:\\d{2})|Z)?")); | |
378 | else if ("gMonth".equals(type)) | |
379 | return(verifExpr(valeur, "--[01]\\d(([+\\-][01]\\d:\\d{2})|Z)?")); | |
380 | else if ("gMonthDay".equals(type)) | |
381 | return(verifExpr(valeur, "--[01]\\d-[0-3]\\d(([+\\-][01]\\d:\\d{2})|Z)?")); | |
382 | else if ("gDay".equals(type)) | |
383 | return(verifExpr(valeur, "---[0-3]\\d(([+\\-][01]\\d:\\d{2})|Z)?")); | |
384 | else if ("Name".equals(type)) | |
385 | return(verifExpr(valeur, "[^<>&#!/?'\",0-9.\\-\\s][^<>&#!/?'\",\\s]*")); // en fait plus restrictif: \i\c* | |
386 | else if ("QName".equals(type)) | |
387 | return(verifExpr(valeur, "[^<>&#!/?'\",0-9.\\-\\s][^<>&#!/?'\",\\s]*")); // en fait plus restrictif | |
388 | else if ("NCName".equals(type)) | |
389 | return(verifExpr(valeur, "[^<>&#!/?'\",0-9.\\-\\s:][^<>&#!/?'\",:\\s]*")); // en fait plus restrictif: [\i-[:]][\c-[:]]* | |
390 | else if ("anyURI".equals(type)) | |
391 | return(true); | |
392 | //return(verifExpr(valeur, "([^:/?#]+:)?(//[^/?#]*)?[^?#]*(\\?[^#]*)?(#.*)?")); | |
393 | // pb: cette expression autorise tout! | |
394 | // (mais les RFC 2396 et 2732 ne restreignent rien) | |
395 | else if ("language".equals(type)) | |
396 | return(verifExpr(valeur, "[a-zA-Z]{1,8}(-[a-zA-Z0-9]{1,8})*")); | |
397 | else if ("ID".equals(type)) | |
398 | return(verifExpr(valeur, "[^<>&#!/?'\",0-9.\\-\\s:][^<>&#!/?'\",:\\s]*")); // comme NCName | |
399 | else if ("IDREF".equals(type)) | |
400 | return(verifExpr(valeur, "[^<>&#!/?'\",0-9.\\-\\s:][^<>&#!/?'\",:\\s]*")); // comme NCName | |
401 | else if ("IDREFS".equals(type)) | |
402 | return(verifExpr(valeur, "[^<>&#!/?'\",0-9.\\-\\s:][^<>&#!/?'\",:]*")); | |
403 | else if ("ENTITY".equals(type)) | |
404 | return(verifExpr(valeur, "[^<>&#!/?'\",0-9.\\-\\s:][^<>&#!/?'\",:\\s]*")); // comme NCName | |
405 | else if ("ENTITIES".equals(type)) | |
406 | return(verifExpr(valeur, "[^<>&#!/?'\",0-9.\\-\\s:][^<>&#!/?'\",:]*")); // comme IDREFS | |
407 | else if ("NOTATION".equals(type)) | |
408 | return(verifExpr(valeur, "[^0-9.\\-\\s][^\\s]*(\\s[^0-9.\\-\\s][^\\s]*)*")); | |
409 | // la facette enumeration est obligatoire -> contrainte supplémentaire | |
410 | else if ("NMTOKEN".equals(type)) | |
411 | return(verifExpr(valeur, "[^<>&#!/?'\",\\s]+")); // en fait plus restrictif: \c+ | |
412 | else if ("NMTOKENS".equals(type)) | |
413 | return(verifExpr(valeur, "[^<>&#!/?'\",]+")); // en fait plus restrictif | |
414 | else | |
415 | return(true); | |
416 | } | |
417 | ||
418 | protected boolean verifExpr(final String valeur, final String regexp) { | |
419 | try { | |
420 | // final Pattern r = compiler.compile("^" + regexp + "$"); | |
421 | // on pourrait utiliser un cache, comme dans Config | |
422 | // final String regex = "^" + regex + "$"; | |
423 | Pattern r = PATTERN_CACHE.get(regexp); | |
424 | if (r == null) { | |
425 | r = Pattern.compile("^" + regexp + "$"); | |
426 | PATTERN_CACHE.put(regexp, r); | |
427 | return r.matcher(valeur).matches(); | |
428 | } | |
429 | // return(matcher.matches(valeur, r)); | |
430 | // } catch (final MalformedPatternException ex) { | |
431 | return r.matcher(valeur).matches(); | |
432 | } catch (final PatternSyntaxException ex) { | |
433 | LOG.error("verifExpr(String, String): " + regexp, ex); | |
434 | return(true); | |
435 | } | |
436 | } | |
590 | } | |
591 | ||
592 | protected ArrayList<String> getEnumeration() { | |
593 | return(null); | |
594 | } | |
595 | } | |
596 | ||
437 | 597 | |
438 | 598 | class Restriction { |
439 | 599 | private final String nom; |
458 | 618 | return(valeur.length() <= iparam); |
459 | 619 | else if ("maxInclusive".equals(nom)) { |
460 | 620 | try { |
461 | final int val = Integer.parseInt(valeur); | |
621 | final double val = Double.parseDouble(valeur); | |
462 | 622 | return(val <= iparam); |
463 | 623 | } catch (final NumberFormatException ex) { |
464 | 624 | return(false); |
465 | 625 | } |
466 | 626 | } else if ("maxExclusive".equals(nom)) { |
467 | 627 | try { |
468 | final int val = Integer.parseInt(valeur); | |
628 | final double val = Double.parseDouble(valeur); | |
469 | 629 | return(val < iparam); |
470 | 630 | } catch (final NumberFormatException ex) { |
471 | 631 | return(false); |
472 | 632 | } |
473 | 633 | } else if ("minInclusive".equals(nom)) { |
474 | 634 | try { |
475 | final int val = Integer.parseInt(valeur); | |
635 | final double val = Double.parseDouble(valeur); | |
476 | 636 | return(val >= iparam); |
477 | 637 | } catch (final NumberFormatException ex) { |
478 | 638 | return(false); |
479 | 639 | } |
480 | 640 | } else if ("minExclusive".equals(nom)) { |
481 | 641 | try { |
482 | final int val = Integer.parseInt(valeur); | |
642 | final double val = Double.parseDouble(valeur); | |
483 | 643 | return(val > iparam); |
484 | 644 | } catch (final NumberFormatException ex) { |
485 | 645 | return(false); |
45 | 45 | import jaxe.JaxeElement; |
46 | 46 | import jaxe.VerifTypeSimple; |
47 | 47 | |
48 | import org.w3c.dom.Attr; | |
48 | 49 | import org.w3c.dom.Element; |
50 | import org.w3c.dom.NamedNodeMap; | |
49 | 51 | import org.w3c.dom.Node; |
50 | 52 | import org.w3c.dom.NodeList; |
51 | 53 | |
53 | 55 | * Affichage pour JEFormulaire (affichage d'un élément sous forme d'un formulaire). |
54 | 56 | * Attention, le nombre de descendants possibles ne doit pas être infini ! |
55 | 57 | */ |
56 | public class AffichageFormulaire implements DocumentListener, ActionListener, ItemListener { | |
58 | public class AffichageFormulaire implements DocumentListener, ItemListener { | |
57 | 59 | /** |
58 | 60 | * Logger for this class |
59 | 61 | */ |
66 | 68 | private static final ImageIcon iconeAttributs = new ImageIcon(ImageKeeper.loadImage("images/attributs.gif", true)); |
67 | 69 | private static final int profondeurMax = 10; |
68 | 70 | |
69 | final private Element refElement; | |
70 | private Element el; | |
71 | final private AffichageFormulaire affParent; | |
71 | final private Element refNoeud; // référence de l'élément ou de l'attribut | |
72 | private Node noeud; // élément ou attribut affiché (null si c'est un nouveau) | |
73 | final private boolean attribut; // true s'il s'agit d'un attribut | |
74 | final private AffichageFormulaire affParent; // affichage de l'élément parent (obligatoire pour un attribut) | |
72 | 75 | final private JaxeDocument doc; |
73 | 76 | final private Config cfg; |
74 | private ArrayList<Element> enfants; | |
77 | private ArrayList<Node> enfants; | |
75 | 78 | private JComponent comp = null; |
76 | 79 | private final VerifTypeSimple verif; |
77 | 80 | private final ArrayList<Element> refEnfantsPossibles; |
81 | private final ArrayList<Element> refAttributsPossibles; | |
78 | 82 | private JLabel labelTitre = null; |
79 | 83 | private JPanel panelElement = null; |
80 | 84 | private JPanel panelEnfants = null; |
84 | 88 | private ArrayList<AffichageFormulaire> affEnfants = null; |
85 | 89 | private ArrayList<String> listeValeurs = null; |
86 | 90 | |
91 | ||
87 | 92 | public AffichageFormulaire(final Element refElement, final Element el, final AffichageFormulaire affParent, |
88 | 93 | final JaxeDocument doc) { |
89 | this.refElement = refElement; | |
90 | this.el = el; | |
94 | this(refElement, el, affParent, doc, false); | |
95 | } | |
96 | ||
97 | public AffichageFormulaire(final Element refNoeud, final Node noeud, final AffichageFormulaire affParent, | |
98 | final JaxeDocument doc, final boolean attribut) { | |
99 | this.refNoeud = refNoeud; | |
100 | this.noeud = noeud; | |
91 | 101 | this.affParent = affParent; |
92 | 102 | this.doc = doc; |
93 | 103 | this.cfg = doc.cfg; |
104 | this.attribut = attribut; | |
94 | 105 | if (affParent == null) |
95 | 106 | profondeur = 0; |
96 | 107 | else |
97 | 108 | profondeur = affParent.getProfondeur() + 1; |
98 | refEnfantsPossibles = cfg.listeSousElements(refElement); | |
109 | if (!attribut) { | |
110 | refAttributsPossibles = cfg.listeAttributs(refNoeud); | |
111 | refEnfantsPossibles = cfg.listeSousElements(refNoeud); | |
112 | } else { | |
113 | refAttributsPossibles = null; | |
114 | refEnfantsPossibles = null; | |
115 | } | |
99 | 116 | |
100 | 117 | lireEnfants(); |
101 | 118 | if (avecEnfants()) |
102 | 119 | verif = null; |
103 | 120 | else |
104 | verif = cfg.getVerifTypeSimple(refElement); // sera null si ce n'est pas un schéma W3C | |
105 | } | |
106 | ||
107 | /** | |
108 | * Lecture du tableau des éléments enfants. | |
121 | verif = cfg.getVerifTypeSimple(refNoeud); // sera null si ce n'est pas un schéma W3C | |
122 | } | |
123 | ||
124 | /** | |
125 | * Lecture du tableau des attributs et des éléments enfants. | |
109 | 126 | */ |
110 | 127 | private void lireEnfants() { |
111 | if (el == null) { | |
128 | if (attribut || noeud == null) { | |
112 | 129 | enfants = null; |
113 | 130 | return; |
114 | 131 | } |
115 | enfants = new ArrayList<Element>(); | |
116 | final NodeList nl = el.getChildNodes(); | |
132 | enfants = new ArrayList<Node>(); | |
133 | final NamedNodeMap listeAttr = noeud.getAttributes(); | |
134 | for (int i=0; i<listeAttr.getLength(); i++) | |
135 | enfants.add(listeAttr.item(i)); | |
136 | final NodeList nl = ((Element)noeud).getChildNodes(); | |
117 | 137 | for (int i=0; i<nl.getLength(); i++) { |
118 | 138 | final Node n = nl.item(i); |
119 | 139 | if (n.getNodeType() == Node.ELEMENT_NODE) |
120 | enfants.add((Element)n); | |
121 | } | |
122 | } | |
123 | ||
124 | /** | |
125 | * Renvoit true si le nombre d'enfants possible est supérieur à 0. | |
140 | enfants.add(n); | |
141 | } | |
142 | } | |
143 | ||
144 | /** | |
145 | * Renvoit true si le nombre d'attributs et d'enfants possible est supérieur à 0. | |
126 | 146 | */ |
127 | 147 | private boolean avecEnfants() { |
128 | return(refEnfantsPossibles.size() > 0); | |
148 | return((refAttributsPossibles != null && refAttributsPossibles.size() > 0) || | |
149 | (refEnfantsPossibles != null && refEnfantsPossibles.size() > 0)); | |
129 | 150 | } |
130 | 151 | |
131 | 152 | /** |
142 | 163 | private JPanel getPanel(final boolean dernier) { |
143 | 164 | panelEnfants = new JPanel(new GridBagLayout()); |
144 | 165 | panelElement = new JPanel(new BorderLayout()); |
145 | if (affParent != null && affParent.enfantsMultiples(refElement)) { | |
166 | if (!attribut && affParent != null && affParent.enfantsMultiples(refNoeud)) { | |
146 | 167 | final JPanel panelBoutons = new JPanel(new BorderLayout()); |
147 | 168 | if (dernier) { |
148 | 169 | final JButton boutonPlus = new JButton("+"); |
176 | 197 | panelElement = new JPanel(new BorderLayout()); |
177 | 198 | panelElement.setOpaque(false); |
178 | 199 | panelElement.setBorder(BorderFactory.createEmptyBorder(0, 5, 0, 5)); |
179 | panelEnfants.setBorder(BorderFactory.createCompoundBorder(BorderFactory.createTitledBorder(cfg.titreElement(refElement)), | |
200 | panelEnfants.setBorder(BorderFactory.createCompoundBorder(BorderFactory.createTitledBorder(getTitre()), | |
180 | 201 | BorderFactory.createEmptyBorder(5, 5, 5, 5))); |
181 | 202 | panelElement.add(panelEnfants, BorderLayout.CENTER); |
182 | 203 | } |
187 | 208 | * Panel avec le titre de l'élément, et les boutons d'aide et d'attributs de l'élément |
188 | 209 | */ |
189 | 210 | private JPanel getPanelTitre() { |
190 | final JButton baide = new JButton(new ActionAide(refElement)); | |
211 | final JButton baide = new JButton(new ActionAide(refNoeud)); | |
191 | 212 | baide.setFont(baide.getFont().deriveFont((float)9)); |
192 | 213 | if (System.getProperty("os.name").startsWith("Mac OS")) { |
193 | 214 | baide.setText("?"); |
201 | 222 | baide.setBorderPainted(false); |
202 | 223 | baide.setContentAreaFilled(false); |
203 | 224 | } |
204 | String documentation = cfg.documentation(refElement); | |
205 | if (documentation != null) { | |
206 | documentation = "<html><body>" + documentation.replaceAll("\n", "<br>") + "</body></html>"; | |
225 | String documentation = getDocumentation(); | |
226 | if (documentation != null) | |
207 | 227 | baide.setToolTipText(documentation); |
208 | } | |
209 | 228 | final JPanel panelTitre = new JPanel(); |
210 | 229 | panelTitre.add(baide); |
211 | if (aDesAttributs()) { | |
212 | final JButton battr = new JButton(iconeAttributs); | |
213 | if (System.getProperty("os.name").startsWith("Mac OS") && | |
214 | "10.5".compareTo(System.getProperty("os.version")) > 0) | |
215 | battr.putClientProperty("JButton.buttonType", "toolbar"); | |
216 | else | |
217 | battr.setMargin( new java.awt.Insets(0, 0, 0, 0) ); | |
218 | battr.addActionListener(this); | |
219 | battr.setActionCommand("attributs"); | |
220 | panelTitre.add(battr); | |
221 | } | |
222 | final JLabel labelTitre = new JLabel(cfg.titreElement(refElement)); | |
230 | final JLabel labelTitre = new JLabel(getTitre()); | |
223 | 231 | Color couleurTitre; |
224 | 232 | if (affParent != null) { |
225 | if (affParent.elementObligatoire(refElement)) | |
233 | if (obligatoire()) | |
226 | 234 | couleurTitre = couleurObligatoire; |
227 | 235 | else |
228 | 236 | couleurTitre = couleurFacultatif; |
247 | 255 | affEnfants = new ArrayList<AffichageFormulaire>(); |
248 | 256 | final GridBagConstraints c = new GridBagConstraints(); |
249 | 257 | int pos = 0; |
250 | for (final Element refEnfantPossible : refEnfantsPossibles) { | |
251 | boolean unEnfant = false; | |
252 | if (enfants != null) { | |
253 | final int enfantsSize = enfants.size(); | |
254 | for (int i=0; i<enfantsSize; i++) { | |
255 | final Element elEnfant = enfants.get(i); | |
256 | final Element refEnfant = cfg.getElementRef(elEnfant); | |
257 | if (refEnfant == refEnfantPossible) { | |
258 | final AffichageFormulaire affEnfant = new AffichageFormulaire(refEnfant, elEnfant, this, doc); | |
259 | affEnfants.add(affEnfant); | |
260 | final boolean dernier = (refAjout == null && | |
261 | !(i+1 < enfantsSize && cfg.getElementRef(enfants.get(i+1)) == refEnfant)); | |
262 | placerAffichage(affEnfant, panelEnfants, c, pos++, dernier); | |
263 | unEnfant = true; | |
258 | if (!attribut) { | |
259 | for (final Element refAttributPossible : refAttributsPossibles) { | |
260 | Node nEnfant = null; | |
261 | if (enfants != null) { | |
262 | for (Node enfanti : enfants) { | |
263 | if (enfanti instanceof Attr) { | |
264 | final String nomAtt = enfanti.getNodeName(); | |
265 | final String espaceAtt = enfanti.getNamespaceURI(); | |
266 | boolean match = nomAtt.equals(cfg.nomAttribut(refAttributPossible)); | |
267 | final String espace2 = cfg.espaceAttribut(refAttributPossible); | |
268 | match = match && ((espaceAtt == null && espace2 == null) || (espaceAtt != null && espaceAtt.equals(espace2))); | |
269 | if (match) | |
270 | nEnfant = enfanti; | |
271 | } | |
264 | 272 | } |
265 | 273 | } |
266 | } | |
267 | if (!unEnfant || refEnfantPossible == refAjout) { | |
268 | final AffichageFormulaire affEnfant = new AffichageFormulaire(refEnfantPossible, null, this, doc); | |
274 | final AffichageFormulaire affEnfant = new AffichageFormulaire(refAttributPossible, nEnfant, this, doc, true); | |
269 | 275 | affEnfants.add(affEnfant); |
270 | placerAffichage(affEnfant, panelEnfants, c, pos++, true); | |
276 | placerAffichage(affEnfant, panelEnfants, c, pos++, false); | |
277 | } | |
278 | for (final Element refEnfantPossible : refEnfantsPossibles) { | |
279 | boolean unEnfant = false; | |
280 | if (enfants != null) { | |
281 | final int enfantsSize = enfants.size(); | |
282 | for (int i=0; i<enfantsSize; i++) { | |
283 | final Node nEnfant = enfants.get(i); | |
284 | if (nEnfant instanceof Element) { | |
285 | final Element refEnfant; | |
286 | refEnfant = cfg.getElementRef((Element)nEnfant); | |
287 | if (refEnfant == refEnfantPossible) { | |
288 | final AffichageFormulaire affEnfant = new AffichageFormulaire(refEnfant, nEnfant, this, doc, false); | |
289 | affEnfants.add(affEnfant); | |
290 | final Element refip1; | |
291 | if (i+1 < enfantsSize) { | |
292 | final Node enfantip1 = enfants.get(i+1); | |
293 | if (enfantip1 instanceof Element) | |
294 | refip1 = cfg.getElementRef((Element)enfantip1); | |
295 | else | |
296 | refip1 = null; | |
297 | } else | |
298 | refip1 = null; | |
299 | final boolean dernier = (refAjout == null && refip1 != refEnfant); | |
300 | placerAffichage(affEnfant, panelEnfants, c, pos++, dernier); | |
301 | unEnfant = true; | |
302 | } | |
303 | } | |
304 | } | |
305 | } | |
306 | if (!unEnfant || refEnfantPossible == refAjout) { | |
307 | final AffichageFormulaire affEnfant = new AffichageFormulaire(refEnfantPossible, null, this, doc, false); | |
308 | affEnfants.add(affEnfant); | |
309 | placerAffichage(affEnfant, panelEnfants, c, pos++, true); | |
310 | } | |
271 | 311 | } |
272 | 312 | } |
273 | 313 | } |
307 | 347 | } |
308 | 348 | |
309 | 349 | /** |
310 | * Renvoit le nom de l'élément, optionnellement avec une valeur d'attribut spécifié par le paramètre titreAtt | |
311 | */ | |
312 | private String getStringLabelTitre() { | |
313 | final StringBuilder titreAtt = new StringBuilder(cfg.titreElement(refElement)); | |
314 | if (el != null) { | |
315 | final ArrayList<String> attributsTitre = cfg.getParametresElement(refElement).get("titreAtt"); | |
316 | if (attributsTitre != null) | |
317 | for (final String nomAtt : attributsTitre) { | |
318 | final String valeurAtt = el.getAttribute(nomAtt); | |
319 | if (!"".equals(valeurAtt)) { | |
320 | titreAtt.append(" '").append(valeurAtt).append("'"); | |
321 | break; | |
322 | } | |
323 | } | |
324 | } | |
325 | return(titreAtt.toString()); | |
326 | } | |
327 | ||
328 | /** | |
329 | 350 | * Renvoit le JPanel de gauche, avec le titre du champ. |
330 | 351 | * Utilisé dans le cas où il n'y a pas d'enfants. |
331 | 352 | */ |
332 | 353 | private JPanel getPanelGauche() { |
333 | 354 | panelGauche = new JPanel(new FlowLayout(FlowLayout.LEFT)); |
334 | final JButton baide = new JButton(new ActionAide(refElement)); | |
355 | final JButton baide = new JButton(new ActionAide(refNoeud)); | |
335 | 356 | baide.setFont(baide.getFont().deriveFont((float)9)); |
336 | 357 | if (System.getProperty("os.name").startsWith("Mac OS")) { |
337 | 358 | baide.setText("?"); |
345 | 366 | baide.setBorderPainted(false); |
346 | 367 | baide.setContentAreaFilled(false); |
347 | 368 | } |
348 | String documentation = cfg.documentation(refElement); | |
349 | if (documentation != null) { | |
350 | documentation = "<html><body>" + documentation.replaceAll("\n", "<br>") + "</body></html>"; | |
369 | String documentation = getDocumentation(); | |
370 | if (documentation != null) | |
351 | 371 | baide.setToolTipText(documentation); |
352 | } | |
372 | if (documentation == null && attribut) | |
373 | baide.setEnabled(false); | |
353 | 374 | panelGauche.add(baide); |
354 | if (aDesAttributs()) { | |
355 | final JButton battr = new JButton(iconeAttributs); | |
356 | if (System.getProperty("os.name").startsWith("Mac OS") && | |
357 | "10.5".compareTo(System.getProperty("os.version")) > 0) | |
358 | battr.putClientProperty("JButton.buttonType", "toolbar"); | |
359 | else | |
360 | battr.setMargin( new java.awt.Insets(0, 0, 0, 0) ); | |
361 | battr.addActionListener(this); | |
362 | battr.setActionCommand("attributs"); | |
363 | panelGauche.add(battr); | |
364 | } | |
365 | labelTitre = new JLabel(getStringLabelTitre()); | |
375 | labelTitre = new JLabel(getTitre()); | |
366 | 376 | if (affParent != null) { |
367 | if (affParent.elementObligatoire(refElement)) | |
377 | if (obligatoire()) | |
368 | 378 | labelTitre.setForeground(couleurObligatoire); |
369 | 379 | else |
370 | 380 | labelTitre.setForeground(couleurFacultatif); |
380 | 390 | private JPanel getPanelDroite(final boolean dernier) { |
381 | 391 | panelDroite = new JPanel(new BorderLayout()); |
382 | 392 | String valeur = ""; |
383 | if (el != null) { | |
384 | final Node firstChild = el.getFirstChild(); | |
385 | if (firstChild != null && firstChild.getNodeType() == Node.TEXT_NODE) | |
386 | valeur = firstChild.getNodeValue(); | |
387 | } | |
388 | if (cfg.contientDuTexte(refElement)) { | |
393 | if (noeud != null) { | |
394 | if (attribut) | |
395 | valeur = noeud.getNodeValue(); | |
396 | else { | |
397 | final Node firstChild = ((Element)noeud).getFirstChild(); | |
398 | if (firstChild != null && firstChild.getNodeType() == Node.TEXT_NODE) | |
399 | valeur = firstChild.getNodeValue(); | |
400 | } | |
401 | } | |
402 | if (attribut || cfg.contientDuTexte(refNoeud)) { | |
389 | 403 | String baseType = null; |
390 | 404 | ArrayList<String> enumeration = null; |
391 | 405 | if (verif != null) { |
393 | 407 | enumeration = verif.getEnumeration(); |
394 | 408 | } |
395 | 409 | if ("boolean".equals(baseType)) { |
396 | final String titre = cfg.titreElement(refElement); | |
410 | final String titre = getTitre(); | |
397 | 411 | final JCheckBox cb = new JCheckBox(titre); |
398 | 412 | if ("true".equals(valeur.trim()) || "1".equals(valeur.trim())) |
399 | 413 | cb.setSelected(true); |
403 | 417 | listeValeurs = new ArrayList<String>(enumeration); |
404 | 418 | if (!listeValeurs.contains(valeur)) |
405 | 419 | listeValeurs.add(valeur); |
406 | if (!affParent.elementObligatoire(refElement) && !listeValeurs.contains("")) | |
420 | if (!obligatoire() && !listeValeurs.contains("")) | |
407 | 421 | listeValeurs.add(""); |
408 | 422 | final List<String> titresValeurs = new ArrayList<String>(listeValeurs.size()); |
409 | for (final String val : listeValeurs) | |
410 | titresValeurs.add(cfg.titreValeurElement(refElement, val)); | |
423 | for (final String val : listeValeurs) { | |
424 | final String titreValeur; | |
425 | if (attribut) { | |
426 | final Element refParent = affParent.getNoeudRef(); | |
427 | titreValeur = cfg.titreValeurAttribut(refParent, refNoeud, val); | |
428 | } else | |
429 | titreValeur = cfg.titreValeurElement(refNoeud, val); | |
430 | titresValeurs.add(titreValeur); | |
431 | } | |
411 | 432 | final JComboBox cb = new JComboBox(titresValeurs.toArray()); |
412 | cb.setSelectedItem(cfg.titreValeurElement(refElement, valeur)); | |
433 | final String titreValeur; | |
434 | if (attribut) { | |
435 | final Element refParent = affParent.getNoeudRef(); | |
436 | titreValeur = cfg.titreValeurAttribut(refParent, refNoeud, valeur); | |
437 | } else | |
438 | titreValeur = cfg.titreValeurElement(refNoeud, valeur); | |
439 | cb.setSelectedItem(titreValeur); | |
413 | 440 | cb.addItemListener(this); |
414 | 441 | comp = cb; |
415 | 442 | } else { |
416 | final ArrayList<String> listeValeursSuggerees = doc.cfg.listeValeursSuggereesElement(refElement); | |
443 | final ArrayList<String> listeValeursSuggerees; | |
444 | if (attribut) { | |
445 | final Element refParent = affParent.getNoeudRef(); | |
446 | listeValeursSuggerees = doc.cfg.listeValeursSuggereesAttribut(refParent, refNoeud); | |
447 | } else | |
448 | listeValeursSuggerees = doc.cfg.listeValeursSuggereesElement(refNoeud); | |
417 | 449 | if (listeValeursSuggerees != null && listeValeursSuggerees.size() > 0) { |
418 | 450 | listeValeurs = new ArrayList<String>(listeValeursSuggerees); |
419 | 451 | if (!listeValeurs.contains(valeur)) |
420 | 452 | listeValeurs.add(valeur); |
421 | 453 | final List<String> titresValeurs = new ArrayList<String>(listeValeurs.size()); |
422 | for (final String val : listeValeurs) | |
423 | titresValeurs.add(cfg.titreValeurElement(refElement, val)); | |
454 | for (final String val : listeValeurs) { | |
455 | final String titreValeur; | |
456 | if (attribut) { | |
457 | final Element refParent = affParent.getNoeudRef(); | |
458 | titreValeur = cfg.titreValeurAttribut(refParent, refNoeud, val); | |
459 | } else | |
460 | titreValeur = cfg.titreValeurElement(refNoeud, val); | |
461 | titresValeurs.add(titreValeur); | |
462 | } | |
424 | 463 | final JComboBox cb = new JComboBox(titresValeurs.toArray()); |
425 | 464 | cb.setEditable(true); |
426 | cb.setSelectedItem(cfg.titreValeurElement(refElement, valeur)); | |
465 | final String titreValeur; | |
466 | if (attribut) { | |
467 | final Element refParent = affParent.getNoeudRef(); | |
468 | titreValeur = cfg.titreValeurAttribut(refParent, refNoeud, valeur); | |
469 | } else | |
470 | titreValeur = cfg.titreValeurElement(refNoeud, valeur); | |
471 | cb.setSelectedItem(titreValeur); | |
427 | 472 | cb.addItemListener(this); |
428 | 473 | comp = cb; |
429 | 474 | } else { |
436 | 481 | if (verif != null && !"".equals(valeur)) |
437 | 482 | setValidite(verif.estValide(valeur)); |
438 | 483 | } |
439 | if (affParent != null && affParent.enfantsMultiples(refElement)) { | |
484 | if (!attribut && affParent != null && affParent.enfantsMultiples(refNoeud)) { | |
440 | 485 | final JPanel panelBoutons = new JPanel(new FlowLayout(FlowLayout.CENTER, 0, 0)); |
441 | 486 | if (dernier) { |
442 | 487 | final JButton boutonPlus = new JButton("+"); |
480 | 525 | if (valeur == null) |
481 | 526 | valeur = ""; |
482 | 527 | doc.setModif(true); |
483 | if (el == null && !"".equals(valeur)) | |
484 | creerElement(); | |
485 | else if (el != null && "".equals(valeur) && affParent != null) { | |
486 | effacerElement(); | |
528 | if (noeud == null && !"".equals(valeur)) | |
529 | creerNoeud(); | |
530 | else if (noeud != null && "".equals(valeur) && affParent != null) { | |
531 | effacerNoeud(); | |
487 | 532 | return; |
488 | 533 | } |
489 | if (el != null) { | |
534 | if (!attribut) { | |
535 | final Element el = (Element)noeud; | |
490 | 536 | final Node firstChild = el.getFirstChild(); |
491 | 537 | if (firstChild == null) { |
492 | 538 | final Node textnode = el.getOwnerDocument().createTextNode(valeur); |
495 | 541 | firstChild.setNodeValue(valeur); |
496 | 542 | else |
497 | 543 | LOG.error("AffichageFormulaire.enregistrerChangement : pas de noeud texte pour enregistrer le champ"); |
544 | } else { | |
545 | final Element elparent = (Element)affParent.getNoeud(); | |
546 | final String nom = cfg.nomAttribut(refNoeud); | |
547 | final String espace = cfg.espaceAttribut(refNoeud); | |
548 | elparent.setAttributeNS(espace, nom, valeur); | |
498 | 549 | } |
499 | 550 | if (verif != null) |
500 | 551 | setValidite("".equals(valeur) || verif.estValide(valeur)); |
540 | 591 | } |
541 | 592 | |
542 | 593 | /** |
543 | * Renvoit l'élément DOM. | |
544 | */ | |
545 | private Element getElement() { | |
546 | return(el); | |
594 | * Renvoit le noeud DOM. | |
595 | */ | |
596 | private Node getNoeud() { | |
597 | return(noeud); | |
547 | 598 | } |
548 | 599 | |
549 | 600 | /** |
550 | 601 | * Renvoit la référence de l'élément dans le schéma. |
551 | 602 | */ |
552 | private Element getElementRef() { | |
553 | return(refElement); | |
603 | private Element getNoeudRef() { | |
604 | return(refNoeud); | |
605 | } | |
606 | ||
607 | private String getTitre() { | |
608 | if (attribut) { | |
609 | final Element refParent = affParent.getNoeudRef(); | |
610 | return(cfg.titreAttribut(refParent, refNoeud)); | |
611 | } else | |
612 | return(cfg.titreElement(refNoeud)); | |
613 | } | |
614 | ||
615 | private String getDocumentation() { | |
616 | String documentation; | |
617 | if (attribut) { | |
618 | final Element refParent = affParent.getNoeudRef(); | |
619 | documentation = cfg.documentationAttribut(refParent, refNoeud); | |
620 | } else | |
621 | documentation = cfg.documentation(refNoeud); | |
622 | if (documentation != null) | |
623 | documentation = "<html><body>" + documentation.replaceAll("\n", "<br>") + "</body></html>"; | |
624 | return(documentation); | |
554 | 625 | } |
555 | 626 | |
556 | 627 | /** |
563 | 634 | /** |
564 | 635 | * Crée l'élément DOM correspondant à l'affichage, si nécessaire en créant l'élément DOM parent. |
565 | 636 | */ |
566 | private void creerElement() { | |
567 | el = JaxeElement.nouvelElementDOM(doc, refElement); | |
568 | Element elparent = affParent.getElement(); | |
569 | if (elparent == null) { | |
570 | affParent.creerElement(); | |
571 | elparent = affParent.getElement(); | |
572 | elparent.appendChild( el.getOwnerDocument().createTextNode("\n") ); | |
573 | } | |
574 | final Element suivant = affParent.trouverSuivant(refElement); | |
575 | final Node textnode = el.getOwnerDocument().createTextNode("\n"); | |
576 | if (suivant == null) { | |
577 | elparent.appendChild(el); | |
578 | elparent.appendChild(textnode); | |
637 | private void creerNoeud() { | |
638 | if (attribut) { | |
639 | Element elparent = (Element)affParent.getNoeud(); | |
640 | if (elparent == null) { | |
641 | affParent.creerNoeud(); | |
642 | elparent = (Element)affParent.getNoeud(); | |
643 | } | |
644 | final String nom = cfg.nomAttribut(refNoeud); | |
645 | final String espace = cfg.espaceAttribut(refNoeud); | |
646 | elparent.setAttributeNS(espace, nom, ""); | |
647 | noeud = elparent.getAttributeNodeNS(espace, nom); | |
579 | 648 | } else { |
580 | elparent.insertBefore(el, suivant); | |
581 | elparent.insertBefore(textnode, suivant); | |
649 | noeud = JaxeElement.nouvelElementDOM(doc, refNoeud); | |
650 | Element elparent = (Element)affParent.getNoeud(); | |
651 | if (elparent == null) { | |
652 | affParent.creerNoeud(); | |
653 | elparent = (Element)affParent.getNoeud(); | |
654 | elparent.appendChild( noeud.getOwnerDocument().createTextNode("\n") ); | |
655 | } | |
656 | final Element suivant = affParent.trouverSuivant(refNoeud); | |
657 | final Node textnode = noeud.getOwnerDocument().createTextNode("\n"); | |
658 | if (suivant == null) { | |
659 | elparent.appendChild(noeud); | |
660 | elparent.appendChild(textnode); | |
661 | } else { | |
662 | elparent.insertBefore(noeud, suivant); | |
663 | elparent.insertBefore(textnode, suivant); | |
664 | } | |
582 | 665 | } |
583 | 666 | affParent.lireEnfants(); |
584 | 667 | doc.textPane.miseAJourArbre(); |
585 | 668 | } |
586 | 669 | |
587 | 670 | /** |
588 | * Renvoit l'élément enfant se trouvant après la place où se trouverait l'enfant de référence ref. | |
671 | * Renvoie l'élément enfant se trouvant après la place où se trouverait l'enfant de référence ref. | |
589 | 672 | * (permet d'insérer un futur élément de référence ref par rapport à l'élément suivant) |
590 | 673 | */ |
591 | 674 | private Element trouverSuivant(final Element ref) { |
594 | 677 | return(null); |
595 | 678 | if (enfants == null) |
596 | 679 | return(null); |
597 | for (final Element elEnfant : enfants) { | |
598 | final Element refEnfant = cfg.getElementRef(elEnfant); | |
599 | final int ind2 = refEnfantsPossibles.indexOf(refEnfant); | |
600 | if (ind2 > ind) | |
601 | return(elEnfant); | |
680 | for (final Node nEnfant : enfants) { | |
681 | if (nEnfant instanceof Element) { | |
682 | final Element refEnfant = cfg.getElementRef((Element)nEnfant); | |
683 | final int ind2 = refEnfantsPossibles.indexOf(refEnfant); | |
684 | if (ind2 > ind) | |
685 | return((Element)nEnfant); | |
686 | } | |
602 | 687 | } |
603 | 688 | return(null); |
604 | 689 | } |
605 | 690 | |
606 | 691 | /** |
607 | * Efface l'élément DOM, et son parent s'il devient vide. | |
608 | */ | |
609 | private void effacerElement() { | |
610 | final Node textNode = el.getNextSibling(); | |
611 | affParent.getElement().removeChild(el); | |
612 | if (textNode.getNodeType() == Node.TEXT_NODE) | |
613 | affParent.getElement().removeChild(textNode); | |
614 | el = null; | |
692 | * Efface le noeud DOM, et son parent s'il devient vide. | |
693 | */ | |
694 | private void effacerNoeud() { | |
695 | final Element elparent = (Element)affParent.getNoeud(); | |
696 | if (attribut) { | |
697 | final String nom = cfg.nomAttribut(refNoeud); | |
698 | final String espace = cfg.espaceAttribut(refNoeud); | |
699 | elparent.removeAttributeNS(espace, nom); | |
700 | } else { | |
701 | final Node textNode = noeud.getNextSibling(); | |
702 | elparent.removeChild(noeud); | |
703 | if (textNode.getNodeType() == Node.TEXT_NODE) | |
704 | elparent.removeChild(textNode); | |
705 | } | |
706 | noeud = null; | |
615 | 707 | affParent.testEffacementParent(); |
616 | 708 | doc.textPane.miseAJourArbre(); |
617 | 709 | } |
621 | 713 | */ |
622 | 714 | private void testEffacementParent() { |
623 | 715 | lireEnfants(); |
624 | if (enfants.size() == 0 && el != null && affParent != null) | |
625 | effacerElement(); | |
716 | if (enfants.size() == 0 && noeud != null && affParent != null) | |
717 | effacerNoeud(); | |
626 | 718 | } |
627 | 719 | |
628 | 720 | /** |
629 | 721 | * Renvoit true si l'élément peut avoir des enfants multiples avec la référence ref (sequence ou choice). |
630 | 722 | */ |
631 | 723 | private boolean enfantsMultiples(final Element ref) { |
724 | if (attribut) | |
725 | return(false); | |
632 | 726 | if (cfg.getSchema() == null) |
633 | 727 | return(true); |
634 | return(cfg.getSchema().enfantsMultiples(refElement, ref)); | |
728 | return(cfg.getSchema().enfantsMultiples(refNoeud, ref)); | |
729 | } | |
730 | ||
731 | /** | |
732 | * Renvoit true si l'élément ou l'attribut est obligatoire | |
733 | */ | |
734 | private boolean obligatoire() { | |
735 | if (attribut) | |
736 | return(cfg.estObligatoire(refNoeud)); | |
737 | return(affParent.elementObligatoire(refNoeud)); | |
635 | 738 | } |
636 | 739 | |
637 | 740 | /** |
640 | 743 | private boolean elementObligatoire(final Element ref) { |
641 | 744 | if (cfg.getSchema() == null) |
642 | 745 | return(false); |
643 | return(cfg.getSchema().elementObligatoire(refElement, ref)); | |
644 | } | |
645 | ||
646 | /** | |
647 | * Renvoit true si l'élément a des attributs. | |
648 | */ | |
649 | private boolean aDesAttributs() { | |
650 | final ArrayList<Element> latt = cfg.listeAttributs(refElement); | |
651 | return (latt != null && latt.size() > 0); | |
746 | return(cfg.getSchema().elementObligatoire(refNoeud, ref)); | |
652 | 747 | } |
653 | 748 | |
654 | 749 | /** |
655 | 750 | * Mise à jour de l'affichage causée par le changement dans un sous-affichage. |
656 | 751 | */ |
657 | 752 | private void ajouterAffichageEnfant(final AffichageFormulaire aff) { |
658 | majPanel(aff.getElementRef()); | |
753 | majPanel(aff.getNoeudRef()); | |
659 | 754 | } |
660 | 755 | |
661 | 756 | /** |
662 | 757 | * Retire un élément et son affichage ( bouton - ) |
663 | 758 | */ |
664 | 759 | private void retirerAffichageEnfant(final AffichageFormulaire aff) { |
665 | if (aff.getElement() != null) | |
666 | aff.effacerElement(); | |
760 | if (aff.getNoeud() != null) | |
761 | aff.effacerNoeud(); | |
667 | 762 | majPanel(null); |
668 | } | |
669 | ||
670 | public void actionPerformed(final ActionEvent e) { | |
671 | final String cmd = e.getActionCommand(); | |
672 | if ("attributs".equals(cmd)) | |
673 | afficherDialogueAttributs(); | |
674 | 763 | } |
675 | 764 | |
676 | 765 | public void itemStateChanged(final ItemEvent e) { |
677 | 766 | enregistrerChangement(); |
678 | 767 | } |
679 | 768 | |
680 | /** | |
681 | * Affiche le dialogue d'édition des attributs. | |
682 | */ | |
683 | public void afficherDialogueAttributs() { | |
684 | boolean creation; | |
685 | if (el == null) { | |
686 | creerElement(); | |
687 | creation = true; | |
688 | } else | |
689 | creation = false; | |
690 | final DialogueAttributs dlg = new DialogueAttributs(doc.jframe, doc, | |
691 | cfg.titreElement(refElement), refElement, el); | |
692 | if (dlg.afficher()) { | |
693 | dlg.enregistrerReponses(); | |
694 | if (labelTitre != null) | |
695 | labelTitre.setText(getStringLabelTitre()); | |
696 | } else if (creation) | |
697 | effacerElement(); | |
698 | dlg.dispose(); | |
699 | } | |
700 | ||
701 | 769 | public Point getPointEnfant(final Element enfant) { |
702 | if (el == enfant) { | |
770 | if (noeud == enfant) { | |
703 | 771 | return(getPoint()); |
704 | 772 | } else if (affEnfants != null) { |
705 | 773 | for (final AffichageFormulaire affEnfant : affEnfants) { |
708 | 776 | final Point monPoint = getPoint(); |
709 | 777 | if (monPoint != null) |
710 | 778 | pt.translate(monPoint.x, monPoint.y); |
779 | final Point ptEnfants = panelEnfants.getLocation(); | |
780 | pt.translate(ptEnfants.x, ptEnfants.y); | |
711 | 781 | return(pt); |
712 | 782 | } |
713 | 783 | } |
736 | 806 | } |
737 | 807 | |
738 | 808 | class ActionAide extends AbstractAction { |
739 | Element refElement; | |
740 | ActionAide(final Element refElement) { | |
809 | Element refNoeud; | |
810 | ActionAide(final Element refNoeud) { | |
741 | 811 | super(); |
742 | this.refElement = refElement; | |
812 | this.refNoeud = refNoeud; | |
743 | 813 | } |
744 | 814 | public void actionPerformed(final ActionEvent e) { |
745 | final DialogueAideElement dlg = new DialogueAideElement(refElement, cfg.getRefConf(refElement), | |
746 | (JFrame)doc.textPane.getTopLevelAncestor()); | |
815 | final DialogueAideElement dlg; | |
816 | if (attribut) { | |
817 | final Element refParent = affParent.getNoeudRef(); | |
818 | dlg = new DialogueAideElement(refNoeud, refParent, cfg.getRefConf(refParent), | |
819 | (JFrame)doc.textPane.getTopLevelAncestor()); | |
820 | } else { | |
821 | dlg = new DialogueAideElement(refNoeud, cfg.getRefConf(refNoeud), | |
822 | (JFrame)doc.textPane.getTopLevelAncestor()); | |
823 | } | |
747 | 824 | dlg.setVisible(true); |
748 | 825 | } |
749 | 826 | } |
118 | 118 | final String baseURL = urlListe.toString().substring(0, urlListe.toString().indexOf("symboles/liste.txt")); |
119 | 119 | urlIcone = new URL(baseURL + liste[i].getPath()); |
120 | 120 | } else |
121 | urlIcone = liste[i].toURL(); | |
121 | urlIcone = liste[i].toURI().toURL(); | |
122 | 122 | } catch (MalformedURLException ex) { |
123 | 123 | LOG.error(ex); |
124 | 124 | break; |
132 | 132 | // création ou mise à jour du label |
133 | 133 | if (label == null) |
134 | 134 | label = new JLabel(); |
135 | else | |
136 | label.setEnabled(true); | |
135 | 137 | if (urlimg == null || (fimg != null && (!fimg.exists() || !fimg.isFile()))) { |
136 | 138 | label.setText(getString("erreur.FichierNonTrouve") + ": " + nomf); |
137 | 139 | label.setIcon(null); |
55 | 55 | JaxeResourceBundle.getRB().getString("inconnu.NomElement"), |
56 | 56 | JaxeResourceBundle.getRB().getString("inconnu.NouvelleBalise"), JOptionPane.QUESTION_MESSAGE); |
57 | 57 | |
58 | final Node newel = nouvelElementDOM(doc, "element", nom); | |
58 | //final Node newel = nouvelElementDOM(doc, "element", nom); (deprecated method) | |
59 | final Node newel = doc.DOMdoc.createElementNS(null, nom); | |
59 | 60 | |
60 | 61 | return newel; |
61 | 62 | } |
34 | 34 | |
35 | 35 | public JESymbole(final JaxeDocument doc) { |
36 | 36 | super(doc); |
37 | alignementY = (float)0.70; | |
38 | // 70% du composant au-dessus de la base de la ligne | |
39 | // donc pas parfait (il faudrait se placer par rapport au milieu vertical d'un 'x' | |
40 | // et non par rapport à la base de la ligne pour obtenir un résulat parfait, | |
41 | // mais ce n'est pas possible avec Swing) | |
37 | 42 | } |
38 | 43 | |
39 | 44 | @Override |
191 | 191 | } |
192 | 192 | |
193 | 193 | protected TableModel makeTableModel(final Element el) { |
194 | final Vector<Vector> v = new Vector<Vector>(); | |
194 | final Vector<Vector<Object>> v = new Vector<Vector<Object>>(); | |
195 | 195 | final Vector<String> ventete = new Vector<String>(); |
196 | 196 | int nligne = 0; |
197 | 197 | for (Node n=el.getFirstChild(); n != null; n=n.getNextSibling()) { |
198 | 198 | if (n.getNodeType() == Node.ELEMENT_NODE) { |
199 | 199 | final String bal = n.getNodeName(); |
200 | 200 | if (bal.equals(TRtag)) { |
201 | final Vector<String> v2 = new Vector<String>(); | |
201 | final Vector<Object> v2 = new Vector<Object>(); | |
202 | 202 | for (Node n2=n.getFirstChild(); n2 != null; n2=n2.getNextSibling()) { |
203 | 203 | if (n2.getNodeType() == Node.ELEMENT_NODE) { |
204 | 204 | final String bal2 = n2.getNodeName(); |
228 | 228 | } |
229 | 229 | |
230 | 230 | class MyTableModel extends AbstractTableModel { |
231 | Vector<Vector> rowData; | |
231 | Vector<Vector<Object>> rowData; | |
232 | 232 | Vector<String> columnNames; |
233 | public MyTableModel(final Vector<Vector> rowData, final Vector<String> columnNames) { | |
233 | public MyTableModel(final Vector<Vector<Object>> rowData, final Vector<String> columnNames) { | |
234 | 234 | this.rowData = rowData; |
235 | 235 | this.columnNames = columnNames; |
236 | 236 | } |
749 | 749 | champs[0] = new JTextField(10); |
750 | 750 | champs[1] = new JTextField(10); |
751 | 751 | |
752 | final DialogueChamps dlg = new DialogueChamps(doc.jframe, JaxeResourceBundle.getRB() | |
752 | final DialogueChamps dlg_dim = new DialogueChamps(doc.jframe, JaxeResourceBundle.getRB() | |
753 | 753 | .getString("table.NouvelleBalise"), titres, champs); |
754 | if (!dlg.afficher()) | |
754 | if (!dlg_dim.afficher()) | |
755 | 755 | return null; |
756 | 756 | |
757 | 757 | final int nlignes; |
779 | 779 | avecEntete = false; |
780 | 780 | |
781 | 781 | final Element newel = nouvelElementDOM(doc, refElement); |
782 | if (newel == null) return null; | |
782 | if (newel == null) | |
783 | return null; | |
784 | final ArrayList<Element> latt = doc.cfg.listeAttributs(refElement); | |
785 | if (latt != null && latt.size() > 0) { | |
786 | final DialogueAttributs dlg = new DialogueAttributs(doc.jframe, doc, | |
787 | JaxeResourceBundle.getRB().getString("zone.NouvelleBalise") + " " + doc.cfg.titreElement(refElement), refElement, newel); | |
788 | if (!dlg.afficher()) | |
789 | return null; | |
790 | dlg.enregistrerReponses(); | |
791 | } | |
783 | 792 | Node textnode = doc.DOMdoc.createTextNode(newline); |
784 | 793 | newel.appendChild(textnode); |
785 | 794 | for (int i = 0; i < nlignes; i++) { |
92 | 92 | |
93 | 93 | // lecture de la valeur de l'élément |
94 | 94 | final Node child = noeud.getFirstChild(); |
95 | String valeur = null; | |
95 | String valeur; | |
96 | 96 | if (child != null) |
97 | 97 | valeur = child.getNodeValue(); |
98 | else | |
99 | valeur = ""; | |
98 | 100 | |
99 | 101 | // création du composant Swing |
100 | 102 | String baseType = null; |
305 | 307 | if (((JCheckBox)comp).isSelected()) |
306 | 308 | return "true"; |
307 | 309 | return "false"; |
308 | } else if (comp instanceof JComboBox) | |
309 | return listeValeurs.get(((JComboBox)comp).getSelectedIndex()); | |
310 | } else if (comp instanceof JComboBox) { | |
311 | final int index = ((JComboBox)comp).getSelectedIndex(); | |
312 | if (index == -1) | |
313 | return(null); | |
314 | else | |
315 | return listeValeurs.get(index); | |
316 | } | |
310 | 317 | return ((JTextField)comp).getText(); |
311 | 318 | } |
312 | 319 |
36 | 36 | import jaxe.equations.element.MathUnderOver; |
37 | 37 | |
38 | 38 | /** |
39 | * Constructeur pour une expression mathématique linéaire (style maple) | |
39 | * Analyseur d'équation avec la syntaxe particulière de Jaxe. | |
40 | * L'analyse se fait en 2 étape : | |
41 | * - parsing du string avec l'équation, avec la création de structures en mémoire représentant le sens mathématique de l'expression | |
42 | * - transformation en MathML présentationnel | |
40 | 43 | */ |
41 | 44 | public class StringMathBuilder { |
42 | 45 | /** |
107 | 110 | rootElement = new MathRootElement(); |
108 | 111 | final String s2 = ajParentheses(replaceSpecial(s)); |
109 | 112 | if (!s.equals("")) { |
110 | final MathElement me = parser(s2, false); | |
113 | final JEQ jeq = parser(s2); | |
114 | final MathElement me; | |
115 | if (jeq == null) | |
116 | me = null; | |
117 | else | |
118 | me = jeq.versMathML(); | |
111 | 119 | rootElement.addMathElement(me); |
112 | 120 | } |
113 | 121 | } |
235 | 243 | return s; |
236 | 244 | } |
237 | 245 | |
238 | public MathElement parser(String s, final boolean parentheses) { | |
246 | public JEQ parser(String s) { | |
239 | 247 | if (s == null || "".equals(s)) |
240 | 248 | return null; |
241 | 249 | |
242 | boolean ajparentheses = false; | |
243 | 250 | if (s.charAt(0) == '(' && s.charAt(s.length()-1) == ')') { |
244 | 251 | int pp = 0; |
245 | 252 | for (int i=1; i<s.length()-1; i++) { |
250 | 257 | if (pp == -1) |
251 | 258 | break; |
252 | 259 | } |
253 | if (pp != -1) { | |
260 | if (pp != -1) | |
254 | 261 | s = s.substring(1, s.length()-1); |
255 | if (parentheses) | |
256 | ajparentheses = true; | |
257 | } | |
258 | 262 | } |
259 | 263 | |
260 | 264 | int indop = -1; |
275 | 279 | } catch (final PatternSyntaxException ex) { |
276 | 280 | nb = false; |
277 | 281 | } |
278 | if (nb) { | |
279 | final MathNumber mn = new MathNumber(); | |
280 | mn.addText(s); | |
281 | return mn; | |
282 | } | |
282 | if (nb) | |
283 | return(new JEQNombre(s)); | |
283 | 284 | final int indf = s.indexOf('('); |
284 | 285 | if (indf != -1 && s.charAt(s.length()-1) == ')') { |
285 | 286 | // nomfct(p1; p2; ...) ou (nomfctcomplexe)(p1; p2; ...) ? |
298 | 299 | pp--; |
299 | 300 | } |
300 | 301 | String nomfct = null; |
301 | MathElement mfct = null; | |
302 | JEQ nom = null; | |
302 | 303 | if (indf2 == -1) { |
303 | nomfct = s.substring(0,indf); | |
304 | nom = new JEQVariable(s.substring(0,indf)); | |
304 | 305 | s = s.substring(indf+1, s.length()-1); |
305 | 306 | } else { |
306 | mfct = parser(s.substring(0, indf2), false); | |
307 | nom = parser(s.substring(0, indf2)); | |
307 | 308 | s = s.substring(indf2+1, s.length()-1); |
308 | 309 | } |
309 | 310 | // recherche des paramètres |
310 | final Vector<MathElement> vp = new Vector<MathElement>(); // of MathElement | |
311 | final Vector<JEQ> vp = new Vector<JEQ>(); | |
311 | 312 | //indv = s.indexOf(';'); marche pas avec f(g(a;b);c) |
312 | 313 | int indv = -1; |
313 | 314 | pp = 0; |
322 | 323 | pp--; |
323 | 324 | } |
324 | 325 | if (indv == -1) |
325 | vp.add(parser(s.trim(), false)); | |
326 | vp.add(parser(s.trim())); | |
326 | 327 | else |
327 | 328 | while (indv != -1) { |
328 | vp.add(parser(s.substring(0,indv).trim(), false)); | |
329 | vp.add(parser(s.substring(0,indv).trim())); | |
329 | 330 | s = s.substring(indv+1); |
330 | 331 | indv = -1; |
331 | 332 | pp = 0; |
340 | 341 | pp--; |
341 | 342 | } |
342 | 343 | if (indv == -1) |
343 | vp.add(parser(s.trim(), false)); | |
344 | vp.add(parser(s.trim())); | |
344 | 345 | } |
345 | // transformation en MathML | |
346 | MathElement p1, p2, p3, p4; | |
347 | if (vp.size() > 0) | |
348 | p1 = vp.get(0); | |
349 | else | |
350 | p1 = null; | |
351 | if (vp.size() > 1) | |
352 | p2 = vp.get(1); | |
353 | else | |
354 | p2 = null; | |
355 | if (vp.size() > 2) | |
356 | p3 = vp.get(2); | |
357 | else | |
358 | p3 = null; | |
359 | if (vp.size() > 3) | |
360 | p4 = vp.get(3); | |
361 | else | |
362 | p4 = null; | |
363 | MathElement me; | |
364 | if ("sqrt".equals(nomfct) || "racine".equals(nomfct)) { | |
365 | me = new MathSqrt(); | |
366 | me.addMathElement(p1); | |
367 | } else if ("exp".equals(nomfct)) { | |
368 | me = new MathSup(); | |
369 | final MathIdentifier mi = new MathIdentifier(); | |
370 | mi.addText("e"); | |
371 | me.addMathElement(mi); | |
372 | me.addMathElement(p1); | |
373 | } else if ("abs".equals(nomfct)) { | |
374 | me = new MathRow(); | |
375 | MathOperator mo = new MathOperator(); | |
376 | mo.addText("|"); | |
377 | me.addMathElement(mo); | |
378 | me.addMathElement(p1); | |
346 | return(new JEQFonction(nom, vp)); | |
347 | } else | |
348 | return(new JEQVariable(s)); | |
349 | } | |
350 | ||
351 | final char op = s.charAt(indop); | |
352 | final String s1 = s.substring(0,indop).trim(); | |
353 | JEQ p1; | |
354 | if (s1.equals("")) | |
355 | p1 = null; | |
356 | else | |
357 | p1 = parser(s1); | |
358 | final String s2 = s.substring(indop+1).trim(); | |
359 | JEQ p2; | |
360 | if (s2.equals("")) | |
361 | p2 = null; | |
362 | else | |
363 | p2 = parser(s2); | |
364 | ||
365 | return(new JEQOperation(op, p1, p2)); | |
366 | } | |
367 | ||
368 | private static MathElement elemOrQuestion(final JEQ jeq) { | |
369 | if (jeq != null) | |
370 | return jeq.versMathML(); | |
371 | final MathText mtext = new MathText(); | |
372 | mtext.addText("?"); | |
373 | return mtext; | |
374 | } | |
375 | ||
376 | ||
377 | interface JEQ { | |
378 | public MathElement versMathML(); | |
379 | public void setUnites(); | |
380 | } | |
381 | ||
382 | class JEQFonction implements JEQ { | |
383 | JEQ nom; | |
384 | Vector<JEQ> vp; | |
385 | boolean unites; | |
386 | public JEQFonction(final JEQ nom, final Vector<JEQ> arguments) { | |
387 | this.nom = nom; | |
388 | vp = arguments; | |
389 | unites = ("unité".equals(getNomFct()) || "unit".equals(getNomFct())); | |
390 | if (unites) | |
391 | setUnites(); | |
392 | } | |
393 | public void setUnites() { | |
394 | unites = true; | |
395 | for (JEQ param : vp) | |
396 | if (param != null) | |
397 | param.setUnites(); | |
398 | } | |
399 | public String getNomFct() { | |
400 | if (nom instanceof JEQVariable) | |
401 | return(((JEQVariable)nom).nom); | |
402 | else | |
403 | return(null); | |
404 | } | |
405 | public MathElement versMathML() { | |
406 | JEQ p1, p2, p3, p4; | |
407 | if (vp.size() > 0) | |
408 | p1 = vp.get(0); | |
409 | else | |
410 | p1 = null; | |
411 | if (vp.size() > 1) | |
412 | p2 = vp.get(1); | |
413 | else | |
414 | p2 = null; | |
415 | if (vp.size() > 2) | |
416 | p3 = vp.get(2); | |
417 | else | |
418 | p3 = null; | |
419 | if (vp.size() > 3) | |
420 | p4 = vp.get(3); | |
421 | else | |
422 | p4 = null; | |
423 | String nomfct = getNomFct(); | |
424 | MathElement me; | |
425 | if ("sqrt".equals(nomfct) || "racine".equals(nomfct)) { | |
426 | me = new MathSqrt(); | |
427 | me.addMathElement(p1.versMathML()); | |
428 | } else if ("exp".equals(nomfct)) { | |
429 | me = new MathSup(); | |
430 | final MathIdentifier mi = new MathIdentifier(); | |
431 | mi.addText("e"); | |
432 | me.addMathElement(mi); | |
433 | me.addMathElement(p1.versMathML()); | |
434 | } else if ("abs".equals(nomfct)) { | |
435 | me = new MathRow(); | |
436 | MathOperator mo = new MathOperator(); | |
437 | mo.addText("|"); | |
438 | me.addMathElement(mo); | |
439 | me.addMathElement(p1.versMathML()); | |
440 | mo = new MathOperator(); | |
441 | mo.addText("|"); | |
442 | me.addMathElement(mo); | |
443 | } else if ("fact".equals(nomfct) || "factorielle".equals(nomfct) | |
444 | || "factorial".equals(nomfct)) { | |
445 | me = new MathRow(); | |
446 | MathOperator mo; | |
447 | if (!(p1 instanceof JEQVariable || p1 instanceof JEQNombre)) { | |
379 | 448 | mo = new MathOperator(); |
380 | mo.addText("|"); | |
381 | me.addMathElement(mo); | |
382 | } else if ("fact".equals(nomfct) || "factorielle".equals(nomfct) | |
383 | || "factorial".equals(nomfct)) { | |
384 | me = new MathRow(); | |
385 | MathOperator mo; | |
386 | if (!(p1 instanceof MathIdentifier || p1 instanceof MathNumber)) { | |
387 | mo = new MathOperator(); | |
388 | mo.addText("("); | |
389 | me.addMathElement(mo); | |
390 | } | |
391 | me.addMathElement(p1); | |
392 | if (!(p1 instanceof MathIdentifier || p1 instanceof MathNumber)) { | |
393 | mo = new MathOperator(); | |
394 | mo.addText(")"); | |
395 | me.addMathElement(mo); | |
396 | } | |
397 | mo = new MathOperator(); | |
398 | mo.addText("!"); | |
399 | me.addMathElement(mo); | |
400 | } else if ("int".equals(nomfct) || "intégrale".equals(nomfct)) { | |
401 | me = new MathRow(); | |
402 | MathOperator mo = new MathOperator(); | |
403 | mo.addText("\u222B"); | |
404 | mo.setStretchy(true); | |
405 | if (p3 != null && p4 != null) { | |
406 | final MathUnderOver munderover = new MathUnderOver(); | |
407 | munderover.addMathElement(mo); | |
408 | munderover.addMathElement(elemOrQuestion(p3)); | |
409 | munderover.addMathElement(elemOrQuestion(p4)); | |
410 | me.addMathElement(munderover); | |
411 | } else if (p3 != null) { | |
412 | final MathUnder munder = new MathUnder(); | |
413 | munder.addMathElement(mo); | |
414 | munder.addMathElement(elemOrQuestion(p3)); | |
415 | me.addMathElement(munder); | |
416 | } else if (p4 != null) { | |
417 | final MathOver mover = new MathOver(); | |
418 | mover.addMathElement(mo); | |
419 | mover.addMathElement(elemOrQuestion(p4)); | |
420 | me.addMathElement(mover); | |
421 | } else | |
422 | me.addMathElement(mo); | |
423 | final MathRow mrow = new MathRow(); | |
424 | mrow.addMathElement(elemOrQuestion(p1)); | |
425 | // <mo> ⁢ </mo> | |
426 | if (p2 != null) { | |
427 | mo = new MathOperator(); | |
428 | mo.addText("d"); // ⅆ | |
429 | mrow.addMathElement(mo); | |
430 | mrow.addMathElement(p2); | |
431 | } | |
432 | me.addMathElement(mrow); | |
433 | } else if ("prod".equals(nomfct) || "sum".equals(nomfct) || | |
434 | "produit".equals(nomfct) || "somme".equals(nomfct)) { | |
435 | me = new MathRow(); | |
436 | final MathUnderOver munderover = new MathUnderOver(); | |
437 | final MathOperator mo = new MathOperator(); | |
438 | if ("prod".equals(nomfct) || "produit".equals(nomfct)) | |
439 | mo.addText("\u220F"); | |
440 | else if ("sum".equals(nomfct) || "somme".equals(nomfct)) | |
441 | mo.addText("\u2211"); | |
442 | mo.setStretchy(true); | |
443 | munderover.addMathElement(mo); | |
444 | munderover.addMathElement(elemOrQuestion(p2)); | |
445 | munderover.addMathElement(elemOrQuestion(p3)); | |
446 | me.addMathElement(munderover); | |
447 | final MathRow mrow = new MathRow(); | |
448 | mrow.addMathElement(elemOrQuestion(p1)); | |
449 | me.addMathElement(mrow); | |
450 | } else if ("over".equals(nomfct) || "dessus".equals(nomfct)) { | |
451 | final MathOver mover = new MathOver(); | |
452 | mover.addMathElement(elemOrQuestion(p1)); | |
453 | mover.addMathElement(elemOrQuestion(p2)); | |
454 | me = mover; | |
455 | } else if ("subsup".equals(nomfct)) { | |
456 | final MathSubSup msubsup = new MathSubSup(); | |
457 | msubsup.addMathElement(elemOrQuestion(p1)); | |
458 | msubsup.addMathElement(elemOrQuestion(p2)); | |
459 | msubsup.addMathElement(elemOrQuestion(p3)); | |
460 | me = msubsup; | |
461 | } else if ("accent".equals(nomfct)) { | |
462 | final MathOver mover = new MathOver(); | |
463 | mover.setAccent(true); | |
464 | mover.addMathElement(elemOrQuestion(p1)); | |
465 | mover.addMathElement(elemOrQuestion(p2)); | |
466 | me = mover; | |
467 | } else if ("matrix".equals(nomfct) || "matrice".equals(nomfct)) { | |
468 | me = new MathRow(); | |
469 | MathOperator mo = new MathOperator(); | |
470 | 449 | mo.addText("("); |
471 | 450 | me.addMathElement(mo); |
472 | final MathTable mtable = new MathTable(); | |
473 | for (final MathElement mel : vp) | |
474 | mtable.addMathElement(elemOrQuestion(mel)); | |
475 | me.addMathElement(mtable); | |
451 | } | |
452 | me.addMathElement(p1.versMathML()); | |
453 | if (!(p1 instanceof JEQVariable || p1 instanceof JEQNombre)) { | |
476 | 454 | mo = new MathOperator(); |
477 | 455 | mo.addText(")"); |
478 | 456 | me.addMathElement(mo); |
479 | } else if ("system".equals(nomfct) || "système".equals(nomfct)) { | |
480 | me = new MathRow(); | |
481 | final MathOperator mo = new MathOperator(); | |
482 | mo.addText("{"); | |
457 | } | |
458 | mo = new MathOperator(); | |
459 | mo.addText("!"); | |
460 | me.addMathElement(mo); | |
461 | } else if ("int".equals(nomfct) || "intégrale".equals(nomfct)) { | |
462 | me = new MathRow(); | |
463 | MathOperator mo = new MathOperator(); | |
464 | mo.addText("\u222B"); | |
465 | mo.setStretchy(true); | |
466 | if (p3 != null && p4 != null) { | |
467 | final MathUnderOver munderover = new MathUnderOver(); | |
468 | munderover.addMathElement(mo); | |
469 | munderover.addMathElement(elemOrQuestion(p3)); | |
470 | munderover.addMathElement(elemOrQuestion(p4)); | |
471 | me.addMathElement(munderover); | |
472 | } else if (p3 != null) { | |
473 | final MathUnder munder = new MathUnder(); | |
474 | munder.addMathElement(mo); | |
475 | munder.addMathElement(elemOrQuestion(p3)); | |
476 | me.addMathElement(munder); | |
477 | } else if (p4 != null) { | |
478 | final MathOver mover = new MathOver(); | |
479 | mover.addMathElement(mo); | |
480 | mover.addMathElement(elemOrQuestion(p4)); | |
481 | me.addMathElement(mover); | |
482 | } else | |
483 | 483 | me.addMathElement(mo); |
484 | final MathTable mtable = new MathTable(); | |
485 | for (final MathElement mel : vp) { | |
486 | final MathRow mrow = new MathRow(); | |
487 | final MathTableData mtd = new MathTableData(); | |
488 | mtd.setColumnAlign("left"); | |
489 | mtd.addMathElement(elemOrQuestion(mel)); | |
490 | mrow.addMathElement(mtd); | |
491 | mtable.addMathElement(mrow); | |
484 | final MathRow mrow = new MathRow(); | |
485 | mrow.addMathElement(elemOrQuestion(p1)); | |
486 | // <mo> ⁢ </mo> | |
487 | if (p2 != null) { | |
488 | mo = new MathOperator(); | |
489 | mo.addText("d"); // ⅆ | |
490 | mrow.addMathElement(mo); | |
491 | mrow.addMathElement(p2.versMathML()); | |
492 | } | |
493 | me.addMathElement(mrow); | |
494 | } else if ("prod".equals(nomfct) || "sum".equals(nomfct) || | |
495 | "produit".equals(nomfct) || "somme".equals(nomfct)) { | |
496 | me = new MathRow(); | |
497 | final MathUnderOver munderover = new MathUnderOver(); | |
498 | final MathOperator mo = new MathOperator(); | |
499 | if ("prod".equals(nomfct) || "produit".equals(nomfct)) | |
500 | mo.addText("\u220F"); | |
501 | else if ("sum".equals(nomfct) || "somme".equals(nomfct)) | |
502 | mo.addText("\u2211"); | |
503 | mo.setStretchy(true); | |
504 | munderover.addMathElement(mo); | |
505 | munderover.addMathElement(elemOrQuestion(p2)); | |
506 | munderover.addMathElement(elemOrQuestion(p3)); | |
507 | me.addMathElement(munderover); | |
508 | final MathRow mrow = new MathRow(); | |
509 | mrow.addMathElement(elemOrQuestion(p1)); | |
510 | me.addMathElement(mrow); | |
511 | } else if ("over".equals(nomfct) || "dessus".equals(nomfct)) { | |
512 | final MathOver mover = new MathOver(); | |
513 | mover.addMathElement(elemOrQuestion(p1)); | |
514 | mover.addMathElement(elemOrQuestion(p2)); | |
515 | me = mover; | |
516 | } else if ("subsup".equals(nomfct)) { | |
517 | final MathSubSup msubsup = new MathSubSup(); | |
518 | msubsup.addMathElement(elemOrQuestion(p1)); | |
519 | msubsup.addMathElement(elemOrQuestion(p2)); | |
520 | msubsup.addMathElement(elemOrQuestion(p3)); | |
521 | me = msubsup; | |
522 | } else if ("accent".equals(nomfct)) { | |
523 | final MathOver mover = new MathOver(); | |
524 | mover.setAccent(true); | |
525 | mover.addMathElement(elemOrQuestion(p1)); | |
526 | mover.addMathElement(elemOrQuestion(p2)); | |
527 | me = mover; | |
528 | } else if ("matrix".equals(nomfct) || "matrice".equals(nomfct)) { | |
529 | me = new MathRow(); | |
530 | MathOperator mo = new MathOperator(); | |
531 | mo.addText("("); | |
532 | me.addMathElement(mo); | |
533 | final MathTable mtable = new MathTable(); | |
534 | for (final JEQ mel : vp) | |
535 | mtable.addMathElement(elemOrQuestion(mel)); | |
536 | me.addMathElement(mtable); | |
537 | mo = new MathOperator(); | |
538 | mo.addText(")"); | |
539 | me.addMathElement(mo); | |
540 | } else if ("system".equals(nomfct) || "système".equals(nomfct)) { | |
541 | me = new MathRow(); | |
542 | final MathOperator mo = new MathOperator(); | |
543 | mo.addText("{"); | |
544 | me.addMathElement(mo); | |
545 | final MathTable mtable = new MathTable(); | |
546 | for (final JEQ mel : vp) { | |
547 | final MathRow mrow = new MathRow(); | |
548 | final MathTableData mtd = new MathTableData(); | |
549 | mtd.setColumnAlign("left"); | |
550 | mtd.addMathElement(elemOrQuestion(mel)); | |
551 | mrow.addMathElement(mtd); | |
552 | mtable.addMathElement(mrow); | |
553 | } | |
554 | me.addMathElement(mtable); | |
555 | } else if ("line".equals(nomfct) || "ligne".equals(nomfct)) { | |
556 | me = new MathTableRow(); | |
557 | for (final JEQ mel : vp) { | |
558 | final MathTableData mtd = new MathTableData(); | |
559 | mtd.addMathElement(elemOrQuestion(mel)); | |
560 | me.addMathElement(mtd); | |
561 | } | |
562 | } else if ("slash".equals(nomfct)) { | |
563 | me = new MathRow(); | |
564 | me.addMathElement(elemOrQuestion(p1)); | |
565 | final MathOperator mo = new MathOperator(); | |
566 | mo.addText("/"); // could be \u2215 | |
567 | me.addMathElement(mo); | |
568 | me.addMathElement(elemOrQuestion(p2)); | |
569 | } else if ("frac".equals(nomfct) || "fraction".equals(nomfct)) { | |
570 | final MathFrac mfrac = new MathFrac(); | |
571 | mfrac.addMathElement(elemOrQuestion(p1)); | |
572 | mfrac.addMathElement(elemOrQuestion(p2)); | |
573 | me = mfrac; | |
574 | } else if ("pscalaire".equals(nomfct) || "scalarp".equals(nomfct)) { | |
575 | final MathRow mrow = new MathRow(); | |
576 | mrow.addMathElement(elemOrQuestion(p1)); | |
577 | final MathOperator mo = new MathOperator(); | |
578 | mo.addText("."); | |
579 | mrow.addMathElement(mo); | |
580 | mrow.addMathElement(elemOrQuestion(p2)); | |
581 | return mrow; | |
582 | } else if ("dtemps".equals(nomfct) || "timed".equals(nomfct)) { | |
583 | final MathOver mover = new MathOver(); | |
584 | mover.setAccent(true); | |
585 | mover.addMathElement(elemOrQuestion(p1)); | |
586 | MathText mt = new MathText(); | |
587 | if (p2 instanceof JEQNombre) { | |
588 | try { | |
589 | final int n = Integer.parseInt(((JEQNombre)p2).valeur); | |
590 | String spts = ""; | |
591 | for (int i=0; i<n; i++) | |
592 | spts = spts + '.'; | |
593 | mt.addText(spts); | |
594 | } catch (final NumberFormatException ex) { | |
595 | mt.addText("?"); | |
492 | 596 | } |
493 | me.addMathElement(mtable); | |
494 | } else if ("line".equals(nomfct) || "ligne".equals(nomfct)) { | |
495 | me = new MathTableRow(); | |
496 | for (final MathElement mel : vp) { | |
497 | final MathTableData mtd = new MathTableData(); | |
498 | mtd.addMathElement(elemOrQuestion(mel)); | |
499 | me.addMathElement(mtd); | |
500 | } | |
501 | } else if ("slash".equals(nomfct)) { | |
502 | me = new MathRow(); | |
503 | me.addMathElement(elemOrQuestion(p1)); | |
504 | final MathOperator mo = new MathOperator(); | |
505 | mo.addText("/"); // could be \u2215 | |
506 | me.addMathElement(mo); | |
507 | me.addMathElement(elemOrQuestion(p2)); | |
508 | } else if ("frac".equals(nomfct) || "fraction".equals(nomfct)) { | |
509 | final MathFrac mfrac = new MathFrac(); | |
510 | mfrac.addMathElement(elemOrQuestion(p1)); | |
511 | mfrac.addMathElement(elemOrQuestion(p2)); | |
512 | me = mfrac; | |
513 | } else if ("pscalaire".equals(nomfct) || "scalarp".equals(nomfct)) { | |
514 | final MathRow mrow = new MathRow(); | |
515 | mrow.addMathElement(elemOrQuestion(p1)); | |
516 | final MathOperator mo = new MathOperator(); | |
517 | mo.addText("."); | |
518 | mrow.addMathElement(mo); | |
519 | mrow.addMathElement(elemOrQuestion(p2)); | |
520 | return mrow; | |
521 | } else if ("dtemps".equals(nomfct) || "timed".equals(nomfct)) { | |
522 | final MathOver mover = new MathOver(); | |
523 | mover.setAccent(true); | |
524 | mover.addMathElement(elemOrQuestion(p1)); | |
525 | if (p2 instanceof MathNumber) { | |
526 | try { | |
527 | final int n = Integer.parseInt(p2.getText()); | |
528 | p2 = new MathText(); | |
529 | String spts = ""; | |
530 | for (int i=0; i<n; i++) | |
531 | spts = spts + '.'; | |
532 | p2.addText(spts); | |
533 | } catch (final NumberFormatException ex) { | |
534 | p2 = null; | |
597 | } else | |
598 | mt.addText("?"); | |
599 | mover.addMathElement(mt); | |
600 | me = mover; | |
601 | } else if ("unité".equals(nomfct) || "unit".equals(nomfct)) { | |
602 | final MathRow mrow = new MathRow(); | |
603 | mrow.addMathElement(elemOrQuestion(p1)); | |
604 | final MathOperator mo = new MathOperator(); | |
605 | mo.addText(" "); | |
606 | mrow.addMathElement(mo); | |
607 | mrow.addMathElement(elemOrQuestion(p2)); | |
608 | return mrow; | |
609 | } else { | |
610 | me = new MathRow(); | |
611 | boolean par = true; | |
612 | if (nom instanceof JEQVariable) { | |
613 | MathText mt = new MathText(); | |
614 | for (final String[] element : symbols) | |
615 | if (element[0].equals(nomfct)) { | |
616 | nomfct = element[1]; | |
617 | break; | |
535 | 618 | } |
536 | } else | |
537 | p2 = null; | |
538 | mover.addMathElement(elemOrQuestion(p2)); | |
539 | me = mover; | |
540 | } else if ("unité".equals(nomfct) || "unit".equals(nomfct)) { | |
541 | final MathRow mrow = new MathRow(); | |
542 | mrow.addMathElement(elemOrQuestion(p1)); | |
543 | final MathOperator mo = new MathOperator(); | |
544 | mo.addText(" "); | |
545 | mrow.addMathElement(mo); | |
546 | mrow.addMathElement(ident2text(elemOrQuestion(p2))); // les unités ne doivent pas être en italique | |
547 | return mrow; | |
548 | } else { | |
549 | me = new MathRow(); | |
550 | boolean par = true; | |
551 | if (mfct == null) { | |
552 | mfct = new MathText(); | |
553 | for (final String[] element : symbols) | |
554 | if (element[0].equals(nomfct)) { | |
555 | nomfct = element[1]; | |
619 | mt.addText(nomfct); | |
620 | if (p2 == null && p1 instanceof JEQVariable) | |
621 | for (final String element : fctnopar) | |
622 | if (element.equals(nomfct)) { | |
623 | par = false; | |
556 | 624 | break; |
557 | 625 | } |
558 | mfct.addText(nomfct); | |
559 | if (p2 == null && p1 instanceof MathIdentifier) | |
560 | for (final String element : fctnopar) | |
561 | if (element.equals(nomfct)) { | |
562 | par = false; | |
563 | break; | |
564 | } | |
626 | me.addMathElement(mt); | |
627 | } else | |
628 | me.addMathElement(nom.versMathML()); | |
629 | if (par) { | |
630 | final MathOperator mo = new MathOperator(); | |
631 | mo.addText("("); // \u2061 = ⁡ serait mieux mais pas reconnu | |
632 | me.addMathElement(mo); | |
633 | } | |
634 | me.addMathElement(p1.versMathML()); | |
635 | for (int i=1; i<vp.size(); i++) { // ATTENTION, LA BOUCLE COMMENCE A 1 | |
636 | final MathOperator mo = new MathOperator(); | |
637 | mo.addText(";"); | |
638 | me.addMathElement(mo); | |
639 | me.addMathElement(vp.get(i).versMathML()); | |
640 | } | |
641 | if (par) { | |
642 | final MathOperator mo = new MathOperator(); | |
643 | mo.addText(")"); | |
644 | me.addMathElement(mo); | |
645 | } else { | |
646 | final MathText mtext = new MathText(); | |
647 | mtext.addText("\u00A0"); // nbsp, mspace serait mieux | |
648 | me.addMathElement(mtext); | |
649 | } | |
650 | } | |
651 | return me; | |
652 | } | |
653 | } | |
654 | ||
655 | class JEQOperation implements JEQ { | |
656 | char op; | |
657 | JEQ p1, p2; | |
658 | boolean unites; | |
659 | public JEQOperation(final char operateur, final JEQ p1, final JEQ p2) { | |
660 | op = operateur; | |
661 | this.p1 = p1; | |
662 | this.p2 = p2; | |
663 | unites = false; | |
664 | } | |
665 | public void setUnites() { | |
666 | unites = true; | |
667 | if (p1 != null) | |
668 | p1.setUnites(); | |
669 | if (p2 != null) | |
670 | p2.setUnites(); | |
671 | } | |
672 | public MathElement versMathML() { | |
673 | if (op == '/') { | |
674 | final MathFrac mfrac = new MathFrac(); | |
675 | mfrac.addMathElement(elemOrQuestion(p1)); | |
676 | mfrac.addMathElement(elemOrQuestion(p2)); | |
677 | return mfrac; | |
678 | } else if (op == '^') { | |
679 | final MathSup msup = new MathSup(); | |
680 | boolean par; | |
681 | if (p1 instanceof JEQFonction) { | |
682 | String nomfct = ((JEQFonction)p1).getNomFct(); | |
683 | if ("sqrt".equals(nomfct) || "racine".equals(nomfct)) | |
684 | par = false; | |
685 | else if ("abs".equals(nomfct)) | |
686 | par = false; | |
687 | else if ("matrice".equals(nomfct)) | |
688 | par = false; | |
689 | else if ("dtemps".equals(nomfct) || "timed".equals(nomfct)) | |
690 | par = false; | |
691 | else | |
692 | par = true; | |
693 | } else if (p1 instanceof JEQOperation) { | |
694 | char op = ((JEQOperation)p1).op; | |
695 | if (op == '_') | |
696 | par = false; | |
697 | else | |
698 | par = true; | |
699 | ||
700 | } else | |
701 | par = false; | |
702 | MathElement me1; | |
703 | if (par) | |
704 | me1 = ajPar(p1.versMathML()); | |
705 | else | |
706 | me1 = elemOrQuestion(p1); | |
707 | msup.addMathElement(me1); | |
708 | msup.addMathElement(elemOrQuestion(p2)); | |
709 | return msup; | |
710 | } else if (op == '_') { | |
711 | final MathSub msub = new MathSub(); | |
712 | msub.addMathElement(elemOrQuestion(p1)); | |
713 | msub.addMathElement(elemOrQuestion(p2)); | |
714 | return msub; | |
715 | } else if (op == '*') { | |
716 | final MathRow mrow = new MathRow(); | |
717 | MathElement me1 = elemOrQuestion(p1); | |
718 | if (p1 instanceof JEQOperation && "+-".indexOf(((JEQOperation)p1).op) != -1) | |
719 | me1 = ajPar(me1); | |
720 | mrow.addMathElement(me1); | |
721 | ||
722 | JEQ dernierDansP1 = p1; | |
723 | if (p1 != null) | |
724 | while (dernierDansP1 instanceof JEQOperation && ((JEQOperation)dernierDansP1).p2 != null) { | |
725 | dernierDansP1 = ((JEQOperation)dernierDansP1).p2; | |
565 | 726 | } |
566 | me.addMathElement(mfct); | |
567 | if (par) { | |
727 | final boolean p1nombre = dernierDansP1 instanceof JEQNombre; | |
728 | JEQ premierDansP2 = p2; | |
729 | if (p2 != null) | |
730 | while (premierDansP2 instanceof JEQOperation && ((JEQOperation)premierDansP2).p1 != null) { | |
731 | premierDansP2 = ((JEQOperation)premierDansP2).p1; | |
732 | } | |
733 | final boolean p2nombre = premierDansP2 instanceof JEQNombre; | |
734 | boolean pscalaire1 = false; | |
735 | if (p1 instanceof JEQFonction) { | |
736 | final String nomfct = ((JEQFonction)p1).getNomFct(); | |
737 | if ("pscalaire".equals(nomfct) || "scalarp".equals(nomfct)) | |
738 | pscalaire1 = true; | |
739 | } | |
740 | boolean pscalaire2 = false; | |
741 | if (p2 instanceof JEQFonction) { | |
742 | final String nomfct = ((JEQFonction)p2).getNomFct(); | |
743 | if ("pscalaire".equals(nomfct) || "scalarp".equals(nomfct)) | |
744 | pscalaire2 = true; | |
745 | } | |
746 | if ((p1nombre && p2nombre) || (pscalaire1 && pscalaire2)) { | |
747 | final MathOperator mo = new MathOperator(); | |
748 | mo.addText("×"); | |
749 | mrow.addMathElement(mo); | |
750 | } else { | |
751 | if (unites) { | |
568 | 752 | final MathOperator mo = new MathOperator(); |
569 | mo.addText("("); // \u2061 = ⁡ serait mieux mais pas reconnu | |
570 | me.addMathElement(mo); | |
753 | mo.addText("."); | |
754 | mrow.addMathElement(mo); | |
571 | 755 | } |
572 | me.addMathElement(p1); | |
573 | for (int i=1; i<vp.size(); i++) { // ATTENTION, LA BOUCLE COMMENCE A 1 | |
574 | final MathOperator mo = new MathOperator(); | |
575 | mo.addText(";"); | |
576 | me.addMathElement(mo); | |
577 | me.addMathElement(vp.get(i)); | |
578 | } | |
579 | if (par) { | |
580 | final MathOperator mo = new MathOperator(); | |
581 | mo.addText(")"); | |
582 | me.addMathElement(mo); | |
583 | } else { | |
584 | final MathText mtext = new MathText(); | |
585 | mtext.addText("\u00A0"); // nbsp, mspace serait mieux | |
586 | me.addMathElement(mtext); | |
587 | } | |
588 | } | |
589 | return me; | |
590 | } else if ("hat".equals(s) || "chapeau".equals(s)) { | |
756 | // else <mo> ⁢ </mo> | |
757 | } | |
758 | ||
759 | MathElement me2 = elemOrQuestion(p2); | |
760 | if (p2 instanceof JEQOperation && "+-".indexOf(((JEQOperation)p2).op) != -1) | |
761 | me2 = ajPar(me2); | |
762 | mrow.addMathElement(me2); | |
763 | return mrow; | |
764 | } else if (op == '-') { | |
765 | final MathRow mrow = new MathRow(); | |
766 | if (p1 != null) | |
767 | mrow.addMathElement(p1.versMathML()); | |
768 | final MathOperator mo = new MathOperator(); | |
769 | mo.addText("-"); | |
770 | mrow.addMathElement(mo); | |
771 | if (p2 != null) { | |
772 | MathElement me2 = p2.versMathML(); | |
773 | if (p2 instanceof JEQOperation && "+-".indexOf(((JEQOperation)p2).op) != -1) | |
774 | me2 = ajPar(me2); | |
775 | mrow.addMathElement(me2); | |
776 | } | |
777 | return mrow; | |
778 | } else { | |
779 | final MathRow mrow = new MathRow(); | |
780 | if (p1 != null) | |
781 | mrow.addMathElement(p1.versMathML()); | |
782 | final MathOperator mo = new MathOperator(); | |
783 | mo.addText(Character.toString(op)); | |
784 | if ("=\u2260\u2248\u2264\u2265\u226A\u226B".indexOf(op) != -1) { | |
785 | // espace autour des opérateurs d'égalité | |
786 | mo.setLspace(0.5); | |
787 | mo.setRspace(0.5); | |
788 | } | |
789 | mrow.addMathElement(mo); | |
790 | if (p2 != null) | |
791 | mrow.addMathElement(p2.versMathML()); | |
792 | return mrow; | |
793 | } | |
794 | } | |
795 | private MathElement ajPar(final MathElement me) { | |
796 | final MathRow mrow = new MathRow(); | |
797 | MathOperator mo = new MathOperator(); | |
798 | mo.addText("("); | |
799 | mrow.addMathElement(mo); | |
800 | mrow.addMathElement(me); | |
801 | mo = new MathOperator(); | |
802 | mo.addText(")"); | |
803 | mrow.addMathElement(mo); | |
804 | return mrow; | |
805 | } | |
806 | } | |
807 | ||
808 | class JEQNombre implements JEQ { | |
809 | String valeur; | |
810 | public JEQNombre(final String valeur) { | |
811 | this.valeur = valeur; | |
812 | } | |
813 | public void setUnites() { | |
814 | } | |
815 | public MathElement versMathML() { | |
816 | final MathNumber mn = new MathNumber(); | |
817 | mn.addText(valeur); | |
818 | return mn; | |
819 | } | |
820 | } | |
821 | ||
822 | class JEQVariable implements JEQ { | |
823 | String nom; | |
824 | boolean unites; | |
825 | public JEQVariable(final String nom) { | |
826 | this.nom = nom; | |
827 | unites = false; | |
828 | } | |
829 | public void setUnites() { | |
830 | unites = true; | |
831 | } | |
832 | public MathElement versMathML() { | |
833 | if ("hat".equals(nom) || "chapeau".equals(nom)) { | |
591 | 834 | final MathOperator mo = new MathOperator(); |
592 | 835 | mo.setStretchy(true); |
593 | 836 | mo.addText("^"); |
594 | 837 | return mo; |
595 | } else if ("bar".equals(s) || "barre".equals(s)) { | |
838 | } else if ("bar".equals(nom) || "barre".equals(nom)) { | |
596 | 839 | final MathOperator mo = new MathOperator(); |
597 | 840 | mo.setStretchy(true); |
598 | 841 | mo.addText("\u00AF"); |
599 | 842 | return mo; |
600 | 843 | } else { |
844 | String s = nom; | |
601 | 845 | for (final String[] element : symbols) |
602 | 846 | if (element[0].equals(s)) { |
603 | 847 | s = element[1]; |
605 | 849 | } |
606 | 850 | if (s.indexOf(',') != -1 || s.indexOf('.') != -1) |
607 | 851 | s = "?"; // les ',' et les '.' sont interdits dans les noms de variables |
608 | final MathIdentifier mi = new MathIdentifier(); | |
609 | mi.addText(s); | |
610 | return mi; | |
852 | MathElement me; | |
853 | if (unites) | |
854 | me = new MathText(); // les unités ne doivent pas être en italique | |
855 | else | |
856 | me = new MathIdentifier(); | |
857 | me.addText(s); | |
858 | return me; | |
611 | 859 | } |
612 | 860 | } |
613 | final char op = s.charAt(indop); | |
614 | if (ajparentheses && "+-".indexOf(op) != -1) { | |
615 | final MathRow mrow = new MathRow(); | |
616 | MathOperator mo = new MathOperator(); | |
617 | mo.addText("("); | |
618 | mrow.addMathElement(mo); | |
619 | mrow.addMathElement(parser(s, false)); | |
620 | mo = new MathOperator(); | |
621 | mo.addText(")"); | |
622 | mrow.addMathElement(mo); | |
623 | return mrow; | |
624 | } | |
625 | boolean par1 = false; | |
626 | boolean par2 = false; | |
627 | if (op == '-') | |
628 | par2 = true; | |
629 | if (op == '*') { | |
630 | par1 = true; | |
631 | par2 = true; | |
632 | } | |
633 | final String s1 = s.substring(0,indop).trim(); | |
634 | MathElement p1; | |
635 | if (s1.equals("")) | |
636 | p1 = null; | |
637 | else | |
638 | p1 = parser(s1, par1); | |
639 | final String s2 = s.substring(indop+1).trim(); | |
640 | MathElement p2; | |
641 | if (s2.equals("")) | |
642 | p2 = null; | |
643 | else | |
644 | p2 = parser(s2, par2); | |
645 | ||
646 | if (op == '/') { | |
647 | final MathFrac mfrac = new MathFrac(); | |
648 | mfrac.addMathElement(elemOrQuestion(p1)); | |
649 | mfrac.addMathElement(elemOrQuestion(p2)); | |
650 | return mfrac; | |
651 | } else if (op == '^') { | |
652 | final MathSup msup = new MathSup(); | |
653 | if (p1 instanceof MathFrac || p1 instanceof MathRow || p1 instanceof MathSup) { | |
654 | final MathRow mrow = new MathRow(); | |
655 | MathOperator mo = new MathOperator(); | |
656 | mo.addText("("); | |
657 | mrow.addMathElement(mo); | |
658 | mrow.addMathElement(p1); | |
659 | mo = new MathOperator(); | |
660 | mo.addText(")"); | |
661 | mrow.addMathElement(mo); | |
662 | p1 = mrow; | |
663 | } | |
664 | msup.addMathElement(elemOrQuestion(p1)); | |
665 | msup.addMathElement(elemOrQuestion(p2)); | |
666 | return msup; | |
667 | } else if (op == '_') { | |
668 | final MathSub msub = new MathSub(); | |
669 | msub.addMathElement(elemOrQuestion(p1)); | |
670 | msub.addMathElement(elemOrQuestion(p2)); | |
671 | return msub; | |
672 | } else if (op == '*') { | |
673 | final MathRow mrow = new MathRow(); | |
674 | mrow.addMathElement(elemOrQuestion(p1)); | |
675 | ||
676 | MathElement dernierDansP1 = p1; | |
677 | if (p1 != null) | |
678 | while (dernierDansP1.getMathElementCount() > 1) | |
679 | dernierDansP1 = dernierDansP1.getMathElement( | |
680 | dernierDansP1.getMathElementCount()-1); | |
681 | final boolean p1nombre = dernierDansP1 instanceof MathNumber; | |
682 | MathElement premierDansP2 = p2; | |
683 | if (p2 != null) | |
684 | while (premierDansP2.getMathElementCount() > 1) | |
685 | premierDansP2 = premierDansP2.getMathElement(0); | |
686 | final boolean p2nombre = premierDansP2 instanceof MathNumber; | |
687 | if (p1nombre && p2nombre) { | |
688 | final MathOperator mo = new MathOperator(); | |
689 | mo.addText("×"); | |
690 | mrow.addMathElement(mo); | |
691 | } // else <mo> ⁢ </mo> | |
692 | ||
693 | mrow.addMathElement(elemOrQuestion(p2)); | |
694 | return mrow; | |
695 | } else { | |
696 | final MathRow mrow = new MathRow(); | |
697 | if (p1 != null) | |
698 | mrow.addMathElement(p1); | |
699 | final MathOperator mo = new MathOperator(); | |
700 | mo.addText(Character.toString(op)); | |
701 | if ("=\u2260\u2248\u2264\u2265\u226A\u226B".indexOf(op) != -1) { | |
702 | // espace autour des opérateurs d'égalité | |
703 | mo.setLspace(0.5); | |
704 | mo.setRspace(0.5); | |
705 | } | |
706 | mrow.addMathElement(mo); | |
707 | if (p2 != null) | |
708 | mrow.addMathElement(p2); | |
709 | return mrow; | |
710 | } | |
711 | } | |
712 | ||
713 | private static MathElement elemOrQuestion(final MathElement me) { | |
714 | if (me != null) | |
715 | return me; | |
716 | final MathText mtext = new MathText(); | |
717 | mtext.addText("?"); | |
718 | return mtext; | |
719 | } | |
720 | ||
721 | private static MathElement ident2text(final MathElement me) { | |
722 | if (me instanceof MathIdentifier) { | |
723 | final MathText me2 = new MathText(); | |
724 | me2.addText(me.getText()); | |
725 | return(me2); | |
726 | } else { | |
727 | for (int i=0; i<me.getMathElementCount(); i++) | |
728 | me.setMathElementAt(ident2text(me.getMathElement(i)), i); | |
729 | return(me); | |
730 | } | |
731 | 861 | } |
732 | 862 | } |
46 | 46 | // (assuming MacOS version will not be compiled in other environments) |
47 | 47 | for (final String currentClassName : className) { |
48 | 48 | try { |
49 | final Class mjimpl = Class.forName(currentClassName); | |
49 | final Class<?> mjimpl = Class.forName(currentClassName); | |
50 | 50 | //final Class[] tc = { Jaxe.class }; |
51 | 51 | //Constructor cons = mjimpl.getConstructor(tc); |
52 | 52 | final Constructor cons = mjimpl.getConstructor((Class[])null); |
Binary diff not shown
Binary diff not shown
Binary diff not shown
Binary diff not shown
35 | 35 | <key>CFBundlePackageType</key> |
36 | 36 | <string>APPL</string> |
37 | 37 | <key>CFBundleShortVersionString</key> |
38 | <string>3.2</string> | |
38 | <string>3.3</string> | |
39 | 39 | <key>CFBundleSignature</key> |
40 | 40 | <string>????</string> |
41 | 41 | <key>CFBundleVersion</key> |
42 | <string>3.2</string> | |
42 | <string>3.3</string> | |
43 | 43 | <key>Java</key> |
44 | 44 | <dict> |
45 | 45 | <key>VMOptions</key> |
0 | 0 | <launch4jConfig> |
1 | 1 | <dontWrapJar>true</dontWrapJar> |
2 | <headerType>0</headerType> | |
2 | <headerType>gui</headerType> | |
3 | 3 | <jar>lib/Jaxe.jar</jar> |
4 | <outfile>Jaxe.exe</outfile> | |
4 | <outfile>/Users/damien/Java/Jaxe/launch4j/Jaxe.exe</outfile> | |
5 | 5 | <errTitle></errTitle> |
6 | <jarArgs></jarArgs> | |
6 | <cmdLine></cmdLine> | |
7 | 7 | <chdir>.</chdir> |
8 | <priority>normal</priority> | |
9 | <downloadUrl>http://java.com/download</downloadUrl> | |
10 | <supportUrl></supportUrl> | |
8 | 11 | <customProcName>false</customProcName> |
9 | 12 | <stayAlive>false</stayAlive> |
10 | <icon>Jaxe.ico</icon> | |
13 | <manifest></manifest> | |
14 | <icon>/Users/damien/Java/Jaxe/launch4j/Jaxe.ico</icon> | |
11 | 15 | <jre> |
12 | 16 | <path></path> |
13 | 17 | <minVersion>1.5.0</minVersion> |
14 | 18 | <maxVersion></maxVersion> |
15 | <initialHeapSize>0</initialHeapSize> | |
16 | <maxHeapSize>0</maxHeapSize> | |
17 | <args></args> | |
19 | <jdkPreference>preferJre</jdkPreference> | |
18 | 20 | </jre> |
19 | 21 | <versionInfo> |
20 | <fileVersion>3.2.0.0</fileVersion> | |
21 | <txtFileVersion>3.2</txtFileVersion> | |
22 | <fileVersion>3.3.0.0</fileVersion> | |
23 | <txtFileVersion>3.3</txtFileVersion> | |
22 | 24 | <fileDescription>Jaxe - Java XML Editor</fileDescription> |
23 | 25 | <copyright>GPL</copyright> |
24 | <productVersion>3.2.0.0</productVersion> | |
25 | <txtProductVersion>3.2</txtProductVersion> | |
26 | <productVersion>3.3.0.0</productVersion> | |
27 | <txtProductVersion>3.3</txtProductVersion> | |
26 | 28 | <productName>Jaxe</productName> |
27 | 29 | <companyName></companyName> |
28 | 30 | <internalName>Jaxe</internalName> |
Binary diff not shown
Binary diff not shown
Binary diff not shown
Binary diff not shown
Binary diff not shown
Binary diff not shown
Binary diff not shown
Binary diff not shown
Binary diff not shown
Binary diff not shown
Binary diff not shown
Binary diff not shown
Binary diff not shown
Binary diff not shown
Binary diff not shown
Binary diff not shown
Binary diff not shown
Binary diff not shown
Binary diff not shown
Binary diff not shown
Binary diff not shown
Binary diff not shown
Binary diff not shown
Binary diff not shown
Binary diff not shown
Binary diff not shown
Binary diff not shown
Binary diff not shown
Binary diff not shown
Binary diff not shown
Binary diff not shown
Binary diff not shown
Binary diff not shown
Binary diff not shown
Binary diff not shown
Binary diff not shown
Binary diff not shown
Binary diff not shown
Binary diff not shown
Binary diff not shown
Binary diff not shown
Binary diff not shown
Binary diff not shown
Binary diff not shown
Binary diff not shown
Binary diff not shown
Binary diff not shown
Binary diff not shown
Binary diff not shown
Binary diff not shown
Binary diff not shown
Binary diff not shown
Binary diff not shown
Binary diff not shown
Binary diff not shown
Binary diff not shown
Binary diff not shown
Binary diff not shown
Binary diff not shown
Binary diff not shown