<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<title><![CDATA[Форум компьютерной помощи &mdash; XML и XSL преобразования. Синтаксис XSL.]]></title>
		<link>http://itpmr.ru/viewtopic.php?id=819</link>
		<atom:link href="https://itpmr.ru/extern.php?action=feed&amp;tid=819&amp;type=rss" rel="self" type="application/rss+xml" />
		<description><![CDATA[Недавние сообщения в теме «XML и XSL преобразования. Синтаксис XSL.».]]></description>
		<lastBuildDate>Fri, 06 Dec 2013 14:26:16 +0000</lastBuildDate>
		<generator>PunBB</generator>
		<item>
			<title><![CDATA[Re: XML и XSL преобразования. Синтаксис XSL.]]></title>
			<link>http://itpmr.ru/viewtopic.php?pid=124048#p124048</link>
			<description><![CDATA[<p>Офигенный самоучитель XSL с примерами:<br />erum.ru/34.htm</p>]]></description>
			<author><![CDATA[null@example.com (admin)]]></author>
			<pubDate>Fri, 06 Dec 2013 14:26:16 +0000</pubDate>
			<guid>http://itpmr.ru/viewtopic.php?pid=124048#p124048</guid>
		</item>
		<item>
			<title><![CDATA[Re: XML и XSL преобразования. Синтаксис XSL.]]></title>
			<link>http://itpmr.ru/viewtopic.php?pid=124043#p124043</link>
			<description><![CDATA[<p>Онлайн сервис XSL Transformation:<br />xslt.online-toolz.com/tools/xslt-transformation.php</p>]]></description>
			<author><![CDATA[null@example.com (admin)]]></author>
			<pubDate>Wed, 04 Dec 2013 11:41:46 +0000</pubDate>
			<guid>http://itpmr.ru/viewtopic.php?pid=124043#p124043</guid>
		</item>
		<item>
			<title><![CDATA[Re: XML и XSL преобразования. Синтаксис XSL.]]></title>
			<link>http://itpmr.ru/viewtopic.php?pid=124039#p124039</link>
			<description><![CDATA[<p>&lt;xsl:copy-of select=&quot;XPATH&quot;/&gt; - копирует содержимое XPATH</p><p>XML:<br />&lt;?xml version=&quot;1.0&quot;?&gt;<br />&lt;?xml-stylesheet type=&quot;text/xsl&quot; ?&gt;<br />&lt;family&gt;<br />&nbsp; &lt;person&gt;<br />&nbsp; &nbsp; &lt;fio age=&quot;10&quot;&gt;<br />&nbsp; &nbsp; &nbsp; &lt;name&gt;Вася&lt;/name&gt;<br />&nbsp; &nbsp; &nbsp; &lt;otch&gt;Юрьевич&lt;/otch&gt;<br />&nbsp; &nbsp; &lt;/fio&gt;<br />&nbsp; &nbsp; &lt;family&gt;Пупкин&lt;/family&gt;<br />&nbsp; &lt;/person&gt;<br />&lt;/family&gt;</p><br /><p>XSL:<br />&lt;?xml version=&quot;1.0&quot;?&gt;<br />&lt;xsl:stylesheet version=&quot;1.0&quot;<br />&nbsp; &nbsp; &nbsp; xmlns:xsl=&quot;http://_.w3.org/1999/XSL/Transform&quot; &gt;<br />&lt;xsl:template match=&quot;family/person&quot;&gt;<br />&nbsp; &lt;p&gt;<br />&nbsp; &nbsp; &lt;xsl:copy-of select=&quot;fio&quot;/&gt;<br />&nbsp; &lt;/p&gt;<br />&lt;/xsl:template&gt;<br />&lt;/xsl:stylesheet&gt;</p><p>Выводит: <br /> &lt;p&gt;&lt;fio age=&quot;10&quot;&gt;<br />&nbsp; &nbsp; &nbsp; &lt;name&gt;Вася&lt;/name&gt;<br />&nbsp; &nbsp; &nbsp; &lt;otch&gt;Юрьевич&lt;/otch&gt;<br />&nbsp; &nbsp; &lt;/fio&gt;&lt;/p&gt;</p><br /><p>&lt;xsl:copy-of select=&quot;family/*&quot;/&gt;&nbsp; - выведет всё что внутри узла family.</p>]]></description>
			<author><![CDATA[null@example.com (admin)]]></author>
			<pubDate>Thu, 28 Nov 2013 13:11:42 +0000</pubDate>
			<guid>http://itpmr.ru/viewtopic.php?pid=124039#p124039</guid>
		</item>
		<item>
			<title><![CDATA[Re: XML и XSL преобразования. Синтаксис XSL.]]></title>
			<link>http://itpmr.ru/viewtopic.php?pid=124038#p124038</link>
			<description><![CDATA[<p>Попробуем написать для</p><p>XML:<br />&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;<br />&lt;document xmlns=&#039;http://_.lotus.com/dxl&#039; version=&#039;7.0&#039; maintenanceversion=&#039;3.0&#039; replicaid=&#039;C2257B36002D2217&#039; form=&#039;fmejved&#039;&gt;</p><p>&lt;noteinfo noteid=&#039;9ae&#039; unid=&#039;797F122934FF755BC2257C2F0033EE69&#039; sequence=&#039;1&#039;&gt;<br />&lt;created&gt;&lt;datetime&gt;20131126T112713,69+02&lt;/datetime&gt;&lt;/created&gt;<br />&lt;modified&gt;&lt;datetime&gt;20131126T112713,70+02&lt;/datetime&gt;&lt;/modified&gt;<br />&lt;revised&gt;&lt;datetime&gt;20131126T112713,69+02&lt;/datetime&gt;&lt;/revised&gt;<br />&lt;lastaccessed&gt;&lt;datetime&gt;20131126T112713,69+02&lt;/datetime&gt;&lt;/lastaccessed&gt;<br />&lt;addedtofile&gt;&lt;datetime&gt;20131126T112713,69+02&lt;/datetime&gt;&lt;/addedtofile&gt;&lt;/noteinfo&gt;<br />&lt;updatedby&gt;&lt;name&gt;CN=Бор Н Эфрс/O=inf&lt;/name&gt;&lt;/updatedby&gt;</p><p>&lt;item name=&#039;ОРГАНИЗАЦИЯ&#039;&gt;&lt;text&gt;ГССИиСМИ&lt;/text&gt;&lt;/item&gt;<br />&lt;item name=&#039;Sprav_PI&#039;&gt;&lt;text&gt;3200&lt;/text&gt;&lt;/item&gt;<br />&lt;item name=&#039;Sprav_Tel&#039;&gt;&lt;text&gt;8-55-35&lt;/text&gt;&lt;/item&gt;<br />&lt;item name=&#039;Sprav_Bank&#039;&gt;&lt;text&gt;2182000023101&lt;/text&gt;&lt;/item&gt;<br />&lt;item name=&#039;Sprav_email&#039;&gt;&lt;text&gt;minin@gmail.com&lt;/text&gt;&lt;/item&gt;<br />&lt;item name=&#039;ЗАГОЛОВОК&#039;&gt;&lt;text&gt;Теккст заголовка 11&lt;/text&gt;&lt;/item&gt;<br />&lt;item name=&#039;АДРЕСАТ&#039;&gt;&lt;text&gt;Председателю Правительства&nbsp; П.П. Степанову&lt;/text&gt;&lt;/item&gt;<br />&lt;item name=&#039;РЕГИСТРАЦИОННЫЙ_НОМЕР&#039;&gt;&lt;text&gt;0000000&lt;/text&gt;&lt;/item&gt;<br />&lt;item name=&#039;ДАТА_РЕГИСТРАЦИИ&#039;&gt;&lt;datetime&gt;20131113&lt;/datetime&gt;&lt;/item&gt;<br />&lt;/document&gt;</p><br /><br /><br /><p>XSL 1:<br />&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;<br />&lt;xsl:stylesheet version=&quot;1.0&quot; xmlns:xsl=&quot;http://_.w3.org/1999/XSL/Transform&quot;&gt;<br />&nbsp; &lt;xsl:output method=&quot;html&quot; /&gt;<br />&nbsp; <br />&lt;xsl:template match=&quot;item&quot;&gt;<br />&lt;html xmlns=&quot;http://_.w3.org/1999/xhtml&quot;&gt;<br />&lt;title&gt;<br />&lt;xsl:value-of select=&quot;@name&quot; /&gt;<br />&lt;/title&gt;</p><p>&lt;test1&gt;<br />&lt;xsl:value-of select=&quot;/text&quot;/&gt;<br />&lt;/test1&gt;</p><p> &lt;/html&gt;<br />&lt;/xsl:template&gt;</p><p>&lt;/xsl:stylesheet&gt;</p><br /><br /><p>XSL2:<br />&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;<br />&lt;xsl:stylesheet version=&quot;1.0&quot; xmlns:xsl=&quot;http://_.w3.org/1999/XSL/Transform&quot;&gt;<br />&nbsp; &lt;xsl:output method=&quot;html&quot; /&gt;<br />&nbsp; <br />&lt;xsl:template match=&quot;/&quot;&gt;<br />&lt;html xmlns=&quot;http://_.w3.org/1999/xhtml&quot;&gt;<br />&lt;title&gt;<br />&lt;xsl:value-of select=&quot;document/item/@name&quot;/&gt;<br />&lt;/title&gt;</p><p>&lt;test1&gt;<br />&lt;xsl:value-of select=&quot;document/item/text&quot;/&gt;<br />&lt;/test1&gt;</p><p> &lt;/html&gt;<br />&lt;/xsl:template&gt;<br />&lt;/xsl:stylesheet&gt;</p>]]></description>
			<author><![CDATA[null@example.com (admin)]]></author>
			<pubDate>Thu, 28 Nov 2013 12:12:02 +0000</pubDate>
			<guid>http://itpmr.ru/viewtopic.php?pid=124038#p124038</guid>
		</item>
		<item>
			<title><![CDATA[XML и XSL преобразования. Синтаксис XSL.]]></title>
			<link>http://itpmr.ru/viewtopic.php?pid=124037#p124037</link>
			<description><![CDATA[<p>Задача: преобразовать с помощью XSL лотусовый XML в собственный формат XML&nbsp; в рамках XHTML.</p><p>XML:<br />&lt;корень&gt;<br />&nbsp; &lt;узел1&gt;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;узел2&gt;Вася&lt;/узел2&gt;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;узел3&gt;Петя&lt;/узел3&gt;<br />&nbsp; &lt;/узел1&gt;<br />&lt;registry country=&quot;Россия&quot; city=&quot;Москва&quot; /&gt;<br />&lt;/корень&gt;</p><p>XSL:<br /> &lt;xsl:template match=&quot;/&quot;&gt;<br />....<br /> &lt;/xsl:template&gt;<br />Шаблон для корневого узла.</p><p>XPATH<br />Вместо &quot;/&quot; может быть:</p><br /><p>/корень/узел1/ - абсолютный путь к элементу узел1, содержащему узлы 2 и 3<br />/корень/узел1/узел2/ абсолютный путь к &quot;Вася&quot;<br />//узел1 -&nbsp; если не знаешь пути, то адресация по имени<br />registry/@country - обращение к атрибуту&nbsp; country, элемента&nbsp; registry</p><br /><p>&lt;xsl:value-of select=&quot;XPATH&quot;/&gt;&nbsp; -&nbsp; вывести содержимое узла, указанного в параметре select<br />select=&quot;.&quot; выборка текущего элемента.</p><p>&lt;xsl:sort select=&quot;поле1&quot;/&gt;&nbsp; -&nbsp; сортировка по полю &quot;поле1&quot;<br />&lt;xsl:for-each select=&quot;авторы&quot;&gt; - перебирает поля &quot;авторы&quot;<br />position() - функция возвращает порядковый номер элемента. Аналогично {@id} .</p><p>Подгрузка шаблона в другой шаблон:&nbsp; &lt;xsl:import href=&quot;имя.xsl&quot;/&gt;<br />Вызов шаблона: &lt;xsl:call-template name=&quot;имя элеменгта подгружаемого шаблона&quot; /&gt;</p>]]></description>
			<author><![CDATA[null@example.com (admin)]]></author>
			<pubDate>Thu, 28 Nov 2013 11:39:43 +0000</pubDate>
			<guid>http://itpmr.ru/viewtopic.php?pid=124037#p124037</guid>
		</item>
	</channel>
</rss>
