<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<title type="html"><![CDATA[Серый форум &mdash; html+xml в Fifefox]]></title>
	<link rel="self" href="http://forum.script-coding.com/extern.php?action=feed&amp;tid=8479&amp;type=atom" />
	<updated>2013-07-15T10:03:48Z</updated>
	<generator>PunBB</generator>
	<id>http://forum.script-coding.com/viewtopic.php?id=8479</id>
		<entry>
			<title type="html"><![CDATA[Re: html+xml в Fifefox]]></title>
			<link rel="alternate" href="http://forum.script-coding.com/viewtopic.php?pid=73784#p73784" />
			<content type="html"><![CDATA[<div class="quotebox"><cite>DnsIs пишет:</cite><blockquote><p>Есть некие данные, большей частью в xml и немного в txt. Хотел сконвертить все в один xml и иногда посматривать их. Хотя правильнее неверное xml+xsl, ага?</p></blockquote></div><p>Возможно. Мне нравятся xsl преобразования (по крайней мере несложные мне удается реализовать так, чтобы &quot;нравится&quot; преобладало над &quot;не нравится&quot;), но иногда я пользуюсь и простой текстовой обработкой вида:<br /></p><div class="codebox"><pre><code>
perl -pe &#039;s/&gt;&lt;/&gt;\n&lt;/g&#039; filename | grep &#039;&lt;tagname&#039;
</code></pre></div>]]></content>
			<author>
				<name><![CDATA[Rumata]]></name>
				<uri>http://forum.script-coding.com/profile.php?id=24846</uri>
			</author>
			<updated>2013-07-15T10:03:48Z</updated>
			<id>http://forum.script-coding.com/viewtopic.php?pid=73784#p73784</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: html+xml в Fifefox]]></title>
			<link rel="alternate" href="http://forum.script-coding.com/viewtopic.php?pid=73783#p73783" />
			<content type="html"><![CDATA[<p>Стыдно мне.</p><p>Кучу примеров перепробовал и забыл, что xml файл из другого источника.<br />Спасибо.</p><br /><div class="quotebox"><cite>Rumata пишет:</cite><blockquote><p>В чем смысл нестандартного решения? Чем оно лучше обычной обработки XML?</p></blockquote></div><p>А фиг его знает.<br />Есть некие данные, большей частью в xml и немного в txt. Хотел сконвертить все в один xml и иногда посматривать их. Хотя правильнее неверное xml+xsl, ага?</p>]]></content>
			<author>
				<name><![CDATA[DnsIs]]></name>
				<uri>http://forum.script-coding.com/profile.php?id=26282</uri>
			</author>
			<updated>2013-07-15T09:39:20Z</updated>
			<id>http://forum.script-coding.com/viewtopic.php?pid=73783#p73783</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: html+xml в Fifefox]]></title>
			<link rel="alternate" href="http://forum.script-coding.com/viewtopic.php?pid=73780#p73780" />
			<content type="html"><![CDATA[<p>Надо бы и код под себя править : )<br /></p><div class="codebox"><pre><code>
// своия структура документа, свои теги, свое пространство имен
function runDemo()
{
    var doc = document.getElementById(&quot;purchase-order&quot;).contentDocument;
    var names = doc.getElementsByTagNameNS(&quot;&quot;, &quot;name&quot;);
    var result = [];
    Array.forEach(names, function(v)
    {
        result.push(v.textContent);
    });
    document.getElementById(&quot;output-box&quot;).innerHTML = result.join(&#039;&lt;br /&gt;&#039;);
}
</code></pre></div><p>В чем смысл нестандартного решения? Чем оно лучше обычной обработки XML?</p>]]></content>
			<author>
				<name><![CDATA[Rumata]]></name>
				<uri>http://forum.script-coding.com/profile.php?id=24846</uri>
			</author>
			<updated>2013-07-15T09:11:06Z</updated>
			<id>http://forum.script-coding.com/viewtopic.php?pid=73780#p73780</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[html+xml в Fifefox]]></title>
			<link rel="alternate" href="http://forum.script-coding.com/viewtopic.php?pid=73778#p73778" />
			<content type="html"><![CDATA[<p>Доброго утра.</p><p>Прочел <a href="https://developer.mozilla.org/en-US/docs/Using_XML_Data_Islands_in_Mozilla">Using XML Data Islands in Mozilla | MDN</a>. Вытащил куски.</p><p><strong>equip.html</strong><br /></p><div class="codebox"><pre><code>&lt;!DOCTYPE html&gt;
&lt;html&gt;
&lt;head&gt;
&lt;title&gt;XML Data Block Demo&lt;/title&gt;
&lt;script&gt;
function runDemo() {
  var doc = document.getElementById(&quot;purchase-order&quot;).contentDocument;
  var lineItems = doc.getElementsByTagNameNS(&quot;http://example.mozilla.org/PurchaseOrderML&quot;, &quot;lineItem&quot;);
  var firstPrice = lineItems[0].getElementsByTagNameNS(&quot;http://example.mozilla.org/PurchaseOrderML&quot;, &quot;price&quot;)[0].textContent;
  document.getElementById(&quot;output-box&quot;).textContent = &quot;The purchase order contains &quot; + lineItems.length + &quot; line items. The price of the first line item is &quot; + firstPrice + &quot;.&quot;;
}
&lt;/script&gt;
&lt;/head&gt;
&lt;body onload=&quot;runDemo()&quot;;&gt;
    &lt;object id=&quot;purchase-order&quot; data=&quot;equip.xml&quot; type=&quot;text/xml&quot; style=&quot;display: none;&quot;&gt;&lt;/object&gt;
    &lt;div id=&quot;output-box&quot;&gt;Demo did not run&lt;/div&gt;
&lt;/body&gt;
&lt;/html&gt;</code></pre></div><p><strong>equip.xml</strong><br /></p><div class="codebox"><pre><code>&lt;?xml version=&quot;1.0&quot; encoding=&quot;windows-1251&quot;?&gt;
&lt;equipment&gt;
    &lt;details&gt;
        &lt;name&gt;Hard Disk&lt;/name&gt;
        &lt;rate&gt;2800&lt;/rate&gt;
        &lt;manufacturer&gt;SeaGate&lt;/manufacturer&gt;  
    &lt;/details&gt;

    &lt;details&gt;
        &lt;name&gt;Motherboard&lt;/name&gt;
        &lt;rate&gt;10000&lt;/rate&gt;
        &lt;manufacturer&gt;Intel&lt;/manufacturer&gt;  
    &lt;/details&gt;
    
    &lt;details&gt;
        &lt;name&gt;Monitor&lt;/name&gt;
        &lt;rate&gt;8000&lt;/rate&gt;
        &lt;manufacturer&gt;Samsung&lt;/manufacturer&gt;  
    &lt;/details&gt;
    
    &lt;details&gt;
        &lt;name&gt;Rajadurai&lt;/name&gt;
        &lt;rate&gt;Tuticorin&lt;/rate&gt;
        &lt;manufacturer&gt;Tamilnad&lt;/manufacturer&gt;  
    &lt;/details&gt;
&lt;/equipment&gt;</code></pre></div><p>Не подскажете, от чего не пашет?</p><br /><p>Спасибо.</p>]]></content>
			<author>
				<name><![CDATA[DnsIs]]></name>
				<uri>http://forum.script-coding.com/profile.php?id=26282</uri>
			</author>
			<updated>2013-07-15T08:46:52Z</updated>
			<id>http://forum.script-coding.com/viewtopic.php?pid=73778#p73778</id>
		</entry>
</feed>
